Abrir Bag
Abrir todas as bags
Autor:
openBackpacks = function()
containers = getContainers()
if #containers < 1 and containers[0] == nil then
bpItem = getBack()
if bpItem ~= nil then
g_game.open(bpItem)
end
end
schedule(1000, function()
local nextContainers = {}
containers = getContainers()
for i, container in pairs(g_game.getContainers()) do
for i, item in ipairs(container:getItems()) do
if item:isContainer() then
table.insert(nextContainers, item)
end
local purse =
g_game.getLocalPlayer():getInventoryItem(InventorySlotPurse)
end
if #nextContainers == 0 then return end
local delay = 1
for i = 1, #nextContainers do
schedule(delay, function()
g_game.open(nextContainers[i], nil)
schedule(delay, function()
end)
end)
schedule(delay, function()
end)
delay = delay + 500
end
end
end)
end
-- this loads the function straighta way
openBackpacks()
-- this adds a button to your bot, so you can press it
UI.Button("Abrir Todas as Bags", function()
openBackpacks()
end)