Log in

View Full Version : Looter



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)

leux10
06-11-2016, 06:21 PM
Thanks! Havent got time to try it yet, but is it SUPERFAST? :D

yompa93
06-12-2016, 06:01 PM
Thanks! Havent got time to try it yet, but is it SUPERFAST? :D

It's fast, but you should use some delay for your own safety i believe.

leux10
06-13-2016, 03:35 PM
After some testing i Confirm, its fast! Great work.

But, is it possible to have like a BP for nonstackable where i choose with Iteams i want exaclty and the same for Stackable?

For e.g

Bp stackable = Yellow BP and loot these items: "scarab coin", "small emerald" etc.
BP not stackable = Purple BP and loot these items: "terra hood", "scarab shield" etc.

I dont want it to loot some stackables that i dont care about, and instead of blacklist cant i just choose exactly too loot whatever i want? :D

yompa93
06-17-2016, 11:11 PM
After some testing i Confirm, its fast! Great work.

But, is it possible to have like a BP for nonstackable where i choose with Iteams i want exaclty and the same for Stackable?

For e.g

Bp stackable = Yellow BP and loot these items: "scarab coin", "small emerald" etc.
BP not stackable = Purple BP and loot these items: "terra hood", "scarab shield" etc.

I dont want it to loot some stackables that i dont care about, and instead of blacklist cant i just choose exactly too loot whatever i want? :D

use the whitelist to do that, the script will check if the item is stackable or not and choose the correct backpack.

Vazeroo
08-17-2016, 03:38 PM
Can someone add auto open creeps?

DarkstaR
08-17-2016, 05:03 PM
http://forums.xenobot.net/showthread.php?43519