Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local StackablesBP = "fur backpack" -- Name of the backpack that should carry the stackables.
- local NonStackablesBP = "fur backpack" -- Name of the backpack that should carry the non stackables.
- local GoldBP = "moon backpack" -- 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 = {"small sapphire", "sea serpent scale", "glacier kilt", "crystalline armor", "glacier amulet", "demon amor"}
- -- 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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement