Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ ADD ITEMS TO LOOT LIST BELOW, BE SURE TO SEPARATE EACH ITEM WITH A COMMA ]]--
- --[[ VALID INPUT IS ID OR {ID, CONTAINER} ]]--
- local itemList = {
- 3031,
- {3577, 0}
- }
- --[[ DO NOT EDIT BELOW ]]--
- function getOpenBackpacks()
- local count = 0
- local bp = Container:GetFirst()
- while bp:isOpen() do
- count = count + 1
- bp = bp:GetNext()
- end
- return count
- end
- function watchTarget()
- local Target = Creature.GetByID(Self.TargetID())
- local pos = {}
- if Target:isAlive() then
- while Target:isAlive() do
- pos = Target:Position()
- sleep(50)
- end
- return pos
- end
- end
- function openCorpse(position, bpcount)
- setBotEnabled(false)
- local tries = 0
- repeat
- Self.UseItemFromGround(position.x, position.y, position.z)
- wait(700, 1100)
- local Corpse = Container.GetFromIndex(bpcount)
- wait(700, 1100)
- until Corpse:isOpen() or tries == 5
- end
- function lootItems(items, bpcount)
- local Corpse = Container.GetFromIndex(bpcount - 1)
- for x = 1, #items do
- for y = 0, Corpse:ItemCount() do
- local item = Corpse:GetItemData(y)
- if type(items[x]) == "table" then
- if item.id == items[x][1] then
- Corpse:MoveItemToContainer(y, items[x][2], 0)
- wait(500, 1000)
- lootItems(items, bpcount)
- end
- else
- if item.id == items[x] then
- Corpse:MoveItemToContainer(y, 0, 0)
- wait(500, 1000)
- lootItems(items, bpcount)
- end
- end
- end
- end
- setTargetingEnabled(true)
- setWalkerEnabled(true)
- end
- while true do
- local position = watchTarget()
- if position ~= nil then
- openCorpse(position, getOpenBackpacks())
- lootItems(itemList, getOpenBackpacks())
- end
- sleep(50)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement