Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- macro(300, "Loot reward bag", function()
- local rewardChestId = 19250
- local rewardBagId = 19202
- local mainBp = 23721 --Change this to whatever bag you want and all loot bag need to be same id,
- --also use my open next backpack when full macro in conjunction with this one
- -------------------DONT EDIT BELOW THIS LINE-------------------
- --Search for items in loot table above, move them to backpack
- local currentCap = freecap()
- --If > 120 cap
- if currentCap > 120 then
- -- Search for all open containers
- for i, container in pairs(getContainers()) do
- containerItemId = container:getContainerItem():getId()
- --If you find the reward bag
- if containerItemId == rewardBagId then
- --For every item in reward bag
- for j, item in ipairs(container:getItems()) do
- local foundItem = item
- --Search for containers again
- for i, depotcontainer in pairs(getContainers()) do
- containerItemId = depotcontainer:getContainerItem():getId()
- --If you find your mainBp then
- if containerItemId == mainBp then
- --Get all the items in your mainBp to find slot positions
- for l, depotbox in ipairs(depotcontainer:getItems()) do
- --print("moving item " .. foundItem:getId())
- --print("before move " .. container:getItemsCount())
- g_game.move(foundItem, depotcontainer:getSlotPosition(19), foundItem:getCount())
- if container:getItemsCount() == 1 then
- --g_game.openParent(container)
- modules.client_entergame.CharacterList.doLogin()
- end
- return
- end
- end
- end
- end
- end
- end
- end
- end)
Add Comment
Please, Sign In to add comment