yompa93
05-30-2016, 07:40 PM
You have to open the corpses yourself. Here you go!
local StackablesBP = "zaoan chess box" -- Name of the backpack that should carry the stackables.
local NonStackablesBP = "zaoan chess box" -- Name of the backpack that should carry the non stackables.
local GoldBP = "zaoan chess box" -- Name of the backpack that should carry the gold coins. (only needed if LoodGold is true.)
local LootGold = true -- Do you want to loot gold coins?
local NonStackValue = 1000 -- Loot items equal or above this value.
local StackValue = 50 -- Loot stackables equal or above this value.
local BlackList = {"war hammer", "shovel", "dirt"}
local WhiteList = {"maxilla maximus", "reins", "leather whip", "tin key", "great mana potion", "great health potion", "ultimate health potion"}
-- delay settings, lower delay = looting faster
local Delay = 100
----------------------------------------------------------------------------------------------------------------------------------------------------------------
function Loot(container)
for i = 0, #Container.GetAll() do
local cont = Container.New(i)
for Spot, item in cont:iItems() do
if (cont:isOpen() and table.isStrIn({"The", "Dead", "Slain", "Dissolved", "Remains", "Elemental"}, string.match(cont:Name(), "%a+"))) then
if Item.GetValue(item.id) >= NonStackValue and not Item.isStackable(item.id) or Item.GetValue(item.id) >= StackValue and Item.isStackable(item.id) or item.id == 3035 or item.id == 3031 or table.contains(WhiteList, Item.GetName(item.id)) then
if Item.isStackable(item.id) and container == StackablesBP and item.id ~= 3031 or (not Item.isStackable(item.id) and container == NonStackablesBP) or item.id == 3031 and container == GoldBP then
if not table.contains(BlackList, Item.GetName(item.id)) then
if Container.New(container):EmptySlots()>0 then
cont:MoveItemToContainer(Spot, Container.New(container):Index(), 0)
wait(Delay + Self.Ping())
else
local contto = Container.New(container)
for spot, bp in contto:iItems() do
if bp.id == Item.GetID(container) then
contto:UseItem(spot, true)
wait(Delay + Self.Ping())
end
end
end
end
end
end
end
end
end
end
Module.New('Looter', function()
Loot(StackablesBP)
Loot(NonStackablesBP)
if LootGold then Loot(GoldBP) end
end)
local StackablesBP = "zaoan chess box" -- Name of the backpack that should carry the stackables.
local NonStackablesBP = "zaoan chess box" -- Name of the backpack that should carry the non stackables.
local GoldBP = "zaoan chess box" -- Name of the backpack that should carry the gold coins. (only needed if LoodGold is true.)
local LootGold = true -- Do you want to loot gold coins?
local NonStackValue = 1000 -- Loot items equal or above this value.
local StackValue = 50 -- Loot stackables equal or above this value.
local BlackList = {"war hammer", "shovel", "dirt"}
local WhiteList = {"maxilla maximus", "reins", "leather whip", "tin key", "great mana potion", "great health potion", "ultimate health potion"}
-- delay settings, lower delay = looting faster
local Delay = 100
----------------------------------------------------------------------------------------------------------------------------------------------------------------
function Loot(container)
for i = 0, #Container.GetAll() do
local cont = Container.New(i)
for Spot, item in cont:iItems() do
if (cont:isOpen() and table.isStrIn({"The", "Dead", "Slain", "Dissolved", "Remains", "Elemental"}, string.match(cont:Name(), "%a+"))) then
if Item.GetValue(item.id) >= NonStackValue and not Item.isStackable(item.id) or Item.GetValue(item.id) >= StackValue and Item.isStackable(item.id) or item.id == 3035 or item.id == 3031 or table.contains(WhiteList, Item.GetName(item.id)) then
if Item.isStackable(item.id) and container == StackablesBP and item.id ~= 3031 or (not Item.isStackable(item.id) and container == NonStackablesBP) or item.id == 3031 and container == GoldBP then
if not table.contains(BlackList, Item.GetName(item.id)) then
if Container.New(container):EmptySlots()>0 then
cont:MoveItemToContainer(Spot, Container.New(container):Index(), 0)
wait(Delay + Self.Ping())
else
local contto = Container.New(container)
for spot, bp in contto:iItems() do
if bp.id == Item.GetID(container) then
contto:UseItem(spot, true)
wait(Delay + Self.Ping())
end
end
end
end
end
end
end
end
end
end
Module.New('Looter', function()
Loot(StackablesBP)
Loot(NonStackablesBP)
if LootGold then Loot(GoldBP) end
end)