Your browser does not support JavaScript or its disabled!
Please turn it on, or be aware that some features on this website will not work correctly.
1K
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.
File: openbp_empty.lua | 548b | 15 lines.
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)
File: openbp_full.lua | 646b | 17 lines.
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)

12 Sep 2021
Ads