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
Alert if certain words in default channel
#1
local ITEMS = { 'dragon scale mail', 'royal helmet', 'tower shield', 'dragon slayer'}

local messages = getnewmessages('Default') -- Get new messages from Default channel. If your server uses Server Log then change it.

for _, msg in ipairs(messages) do
    if msg.type == 22 and string.find(msg.content, 'Loot of ') ~= nil then
        local text_lower = msg.content:lower()
        for __, item in ipairs(ITEMS) do
            if string.find(text_lower, item:lower()) ~= nil then
                playsound('default')
                flashclient()
                return
            end
        end 
    end
end


I tried this code but it doesn't work. Any ideas?
Reply

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

I used this 1



local PieceOfMessage = 'dragon shield'


if LAST_COUNT_MSG == nil then
    LAST_COUNT_MSG = 0
end

if ischannelopen('Default') then
    if ischannelselected('Default') == false then
        selectchannel('Default')
        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
        playsound('default')
        flashclient()
    end
end


if ischannelselected('Default') == false then
    selectchannel('Default')
    wait(400, 800)
end
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016