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 INPUTS ARE {CONTAINER INDEX,ID,ID,ID}, ETC
- -- REMEMBER 0 IS FIRST CONTAINER INDEX
- local itemList = { {0,3031,3035}, {1, 123, 321}}
- --[[ 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 table.fastfind(value, table)
- local data = table
- for i = 1, #data do
- if value == data[i] then
- return value
- end
- end
- return false
- end
- function getSpot(index)
- local cont = Container(index)
- for i = 0, cont:ItemCount()-1 do
- local itemid = cont:GetItemData(i)
- if not Item.isContainer(itemid) then
- spot = i
- return spot
- end
- end
- return 0
- end
- function DoIt()
- local ID = Self.TargetID()
- if ID and ID~=0 then
- Target = Creature(ID)
- local pos
- while Target:isAlive() do
- pos = Target:Position()
- end
- if pos then
- Walker.Stop()
- Targeting.Stop()
- local tries = 4
- local bps = getOpenBackpacks()
- while bps == getOpenBackpacks() and tries > 0 do
- wait(700,1000)
- Self.UseItemFromGround(pos.x, pos.y ,pos.z)
- wait(300,500)
- tries = tries-1
- end
- wait(500,700)
- if bps < getOpenBackpacks() then
- local corp = Container.GetLast()
- for i = corp:ItemCount()-1, 0, -1 do
- local item = corp:GetItemData(i)
- for j = 1, #itemList do
- local tbl = itemList[j]
- local index = tbl[1]
- local to = Container(index)
- local continue = true
- if table.fastfind(item.id, tbl) then
- if to:isFull() then
- if Item.isContainer(to:GetItemData(to:ItemCount()-1)) then
- to:UseItem(to:ItemCount()-1, true)
- wait(450,700)
- else
- continue = false
- end
- end
- if continue then
- corp:MoveItemToContainer(i, index, getSpot(index), item.count)
- wait(550,800)
- end
- end
- end
- end
- end
- end
- Targeting.Start()
- Walker.Start()
- end
- end
- Module.New("looter", function(mod)
- DoIt()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement