Open next container
#54
This will open the next backpack if only contains 1 item and iscontainer. Second script will open the next backpack if full.
nextBackpack = macro(100,"Open next container",function()
local containerId = 2854
for i, container in pairs(getContainers()) do
containerItem = container:getContainerItem()
if containerItem and containerItem:getId() == containerId then
if container:getItemsCount() == 1 then
item = container:getItem(0)
if item and item:isContainer() then
g_game.open(item, container)
delay(200)
end
end
end
end
end)
- remove | + add
nextBackpackFull = macro(100,"Open next container Full",function()
local containerId = 2867
for _, container in pairs(getContainers()) do
containerItem = container:getContainerItem()
if containerItem and containerItem:getId() == containerId then
if container:getCapacity() == #container:getItems() then
for _, item in ipairs(container:getItems()) do
if item:getId() == containerId then
g_game.open(item, container)
delay(200)
break
end
end
end
end
end
end)
- remove | + add
12 Sep 2021