Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --If backpack is empty, this will open next backpack of same type
- local mainBp = 8860 --Brocade BP use ID
- --For every container open, get information on open containers
- for i, container in pairs(getContainers()) do
- --Get the IDs of every open container
- containerItemId = container:getContainerItem():getId()
- --If the containerItemID is equal to one of the open containers then
- if containerItemId == mainBp then
- --If the amount of items in the container is equal to 1 then
- if container:getItemsCount() == 1 then
- --Search every item ID in the container
- for _, item in ipairs(container:getItems()) do
- --If one of the items in the container is equal to your backpack id, then
- if item:isContainer() then
- --Open up the backpack
- g_game.open(item, container)
- end
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment