Achei esse script e gostaria que alguem arrumasse. Ele so abre e pega o loot do bicho morto no meu target, se uso uma magia como exori e mato todos bichos em minha volta ele n abre os corpos pra pegar o loot, mas se eu abrir ele pega. Script abaixo.
-- [TARGET LOOTER by #Rafal ] --
items = {'gold coin', 'worm'} -- loot to backpack
ground_items = {'mace','cheese'} -- throw to ground
bp = 'jewelled backpack' -- default normal brown
ropes_ladders = {1948, 386} -- id when cannot open
-- [ DON'T EDIT BELOW ] --
OPEN = nil
print('[Target Looter] by #Rafal')
while true do
SI = Creature.GetByID(Self.TargetID())
if Self.TargetID() ~= 0 then
pos = SI:Position()
if not table.isStrIn(ropes_ladders, getTileUseID(pos.x, pos.y, pos.z).id) then
SI_1 = SI
OPEN = true
end
end
if OPEN and not SI_1:isVisible() then
p = SI_1:Position()
OPEN = nil
if not table.isStrIn({1948, 386}, getTileUseID(p.x, p.y, p.z).id) then
Self.UseItemFromGround(p.x, p.y, p.z)
end
end
for i = 0, #Container.GetAll() do
cont = Container.New(i)
PUT = Container.New(bp)
for SPOT, item in cont:iItems() do
if (cont:isOpen() and PUT:EmptySlots() > (0) and table.isStrIn({"The", "Dead", "Slain", "Dissolved", "Remains", "Elemental"}, string.match(cont:Name(), "%a+"))) then
if (table.isStrIn(items, Item.GetName(item.id))) then
cont:MoveItemToContainer(SPOT, PUT:Index(), 0)
elseif (table.isStrIn(ground_items, Item.GetName(item.id))) then
pos = Self.Position()
cont:MoveItemToGround(SPOT, pos.x, pos.y, pos.z)
end
end
end
end
for i = 0, #PUT do
if PUT:isFull() and PUT:isOpen() then
for spot = PUT:ItemCount() - 1, 0, -1 do
if Item.GetName(PUT:GetItemData(spot).id) == bp then
PUT:UseItem(spot, true)
end
end
end
end
end