Everyone who has never used our Bots before, can test each one for 2 days without any limitation.
The trial is given automatically when you login on the Bot, but in some cases it wouldn't work (security reasons).
If this happens, send me a private message and i will be checking the failed trials manually and adding it for those who didn't get it.
We are looking for resellers who may accept payment methods different from ours, including classictibia's cash, realesta's cash, mastercores' cash, etc. Interested? Click here at anytime.



Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FREE Check for Task Message
#1
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.
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
Reply

#2
LUA Script -> Cavebot/Action:#task?: 8: attempt to call global 'ischannel' (a nil value)


|Only Registered members can see download links. | Click here to buy subscription or here to register.


it will always choose the LeaveHunt label and not go start, any ideas? 
|Only Registered members can see download links. | Click here to buy subscription or here to register.
|Only Registered members can see download links. | Click here to buy subscription or here to register.alt="Big Grin" title="Big Grin" class="smilie smilie_4" />
Reply

#3
Hello.

I could not understand what some parts of your post like when you said that ran "ischannelselected('serverlog')" and received error about "activechannel".
However, the LUA Functions & Variables was outdated about those functions and i just updated it and the script.
ischannelopen(string channel) [boolean] Returns true the specified channel is open.
ischannelselected(string channel) [boolean] Returns true the specified channel is selected.
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016