Check for Task Message
This script will select Server Log channel and check for a specific message then select Default channel back. It's useful on Cavebot to check for task messages.
You should not use on Persistents, unless you use a with decent interval, because this script will select the Server Log to check for messages.
keywords: check message, check for a message, check task message, check task msg
This script will select Server Log channel and check for a specific message then select Default channel back. It's useful on Cavebot to check for task messages.
You should not use on Persistents, unless you use a with decent interval, because this script will select the Server Log to check for messages.
local PieceOfMessage = 'You have already killed 200 larvas'
if LAST_COUNT_MSG == nil then
LAST_COUNT_MSG = 0
end
if ischannelopen('Server Log') then
if ischannelselected('Server Log') == false then
selectchannel('Server Log')
wait(400, 800)
end
local count = 0
local msgs = getmessages()
for _, msg in ipairs(msgs) do
if string.find(msg.content, PieceOfMessage) ~= nil then
count = count + 1
end
end
if count > 0 and count > LAST_COUNT_MSG then
gotolabel('LeaveHunt')
end
end
if ischannelselected('Default') == false then
selectchannel('Default')
wait(400, 800)
end
keywords: check message, check for a message, check task message, check task msg