local lootList = {
[1] = {3031}
}
local target, pos;
LootMessageProxy.OnReceive('looting', function(p, m)
if (pos) then
--Cavebot.Stop()
Self.BrowseField(pos.x, pos.y, pos.z)
wait(300, 500)
local cont = Container.GetLast()
for spot, item in cont:iItems() do
if (Item.isCorpse(item.id)) then
cont:UseItem(spot, true)
wait(300, 500)
cont = Container.GetLast()
local offset = 0
for i = 0, cont:ItemCount() - 1 do
local itm = cont:GetItemData(i - offset)
for bp, items in pairs(lootList) do
if table.contains(items, itm.id) then
cont:MoveItemToContainer(i - offset, Container(bp), 0)
wait(300, 500)
offset = offset - 1
break
end
end
end
break
end
end
--Cavebot.Start()
end
end)
Module.New('postracking', function()
if Self.TargetID() > 0 then
target = Creature(Self.TargetID())
if (target:isAlive() and target:isOnScreen()) then
pos = target:Position()
return
end
end
target = nil
end)