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
If Message, flash client
#1
Hi,
im trying to write a scrip to check the default chat screen and if a certain message comes on, flash client. 

This way i can have looting off for max exp but manually loot items if the loot message pops up. The bots built in system doesnt work, the bot tries to loot all corpses. 

Currently i have the below, but it flashes regardless

Thanks
if getmessages('gold coins', 'Bone') then
flashclient()
wait(2000)
end
Reply

#2
Hello.

Looter is working fine. If you select "Loot corpses with listed items" then it will only loot bodies that dropped listed items, the item name on message must match looter item name.

If Looter is opening all bodies, it usually means two possibilities:
1. You are killing multiple creatures at once and it cannot know which one dropped the item.
2. It cannot find the loot msg on Default or Server log channels.

Notice there's no built in for playing sound when loot drops, but i will add on next release: "Loot announced".

Your script will never works but it getmessages() wasn't developed to accept those parameters.

I think this script works
local ITEMS = { 'gold coin', 'mace', 'bone' }

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
Reply

#3
Getting this error

17:18:26 - Core:Lua:ExecuteScript
|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" />oString:Loot Check: 8: 'in' expected near 'ipairs'
Reply

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

#5
now this error
sorry

12:12:52 - Core:Lua:ExecuteScript
|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" />oString:Loot Check: 6: bad argument #2 to 'find' (string expected, got no value)
Reply

#6
Try again
Reply

#7
still getting this
12:37:54 - Core:Lua:ExecuteScript
|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" />oString
|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="Tongue" title="Tongue" class="smilie smilie_5" />ersistent01: 6: bad argument #2 to 'find' (string expected, got no value)
Reply

#8
Holy s...
I can’t test it now, but changed it. Try again.
Reply

#9
no error any more, but no flashing or noise when looting gold coin or gold coins
Reply

#10
Hello.

Where does the loot messages shows up? (Channel)

If it’s default then kill a monster and run this code on console and paste results here.
print(getnewmessages('Default'))
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016