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 container content
#1
Lightbulb 
I want a persistent where I can define a backpack like "green backpack". And then a list of safe items like "sword", "axe", "mace".

Script will check if backpack contains any item not in safe list, if there is, play sound.

Is that possible?
Reply

#2
Hello.

Yeah, it's possible.
I recommend you to use item id instead of names, because Bot may not know all item names.
local BACKPACK = 'green backpack'
local SAFE_ITEMS = { 'sword' } -- Items allowed on backpack..

if connected() then
    local container = getcontainer(BACKPACK)
    if container ~= nil and container.open and container.usedslots > 0 then
        table.id(SAFE_ITEMS)
        for _, item in ipairs(container.items) do
            if table.find(SAFE_ITEMS, item.id) == nil then
                playsound('default')
                flashclient()
                print(item.id .. '(' .. item.name .. ') found in your backpack')
            end
        end
    end
end
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016