Your browser does not support JavaScript or its disabled!
Please turn it on, or be aware that some features on this website will not work correctly.
503
GotoLabel onTextMessage #87
This will read a message and goto a label if kills = 0
399b | 12 lines.
local gotoKills = 0
onTextMessage(function(mode,text)
  local data = regexMatch(text, "([a-z A-Z-]*) defeated. You gained \\+([0-9]*) prey experience. ([0-9]*) kills remaining.")[1]
  if #data ~= 0 then
    local monsterName = data[2]
    local exp = tonumber(data[3])
    local kills = tonumber(data[4])
    if kills == gotoKills then
      CaveBot.gotoLabel("Cave")
    end
  end
end)

26 Mar 2022
Ads