Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. local StackablesBP = "fur backpack" -- Name of the backpack that should carry the stackables.
  2. local NonStackablesBP = "fur backpack" -- Name of the backpack that should carry the non stackables.
  3. local GoldBP = "moon backpack" -- Name of the backpack that should carry the gold coins. (only needed if LoodGold is true.)
  4.  
  5. local LootGold = true -- Do you want to loot gold coins?
  6. local NonStackValue = 1000 -- Loot items equal or above this value.
  7. local StackValue = 50 -- Loot stackables equal or above this value.
  8.  
  9. local BlackList = {"war hammer", "shovel", "dirt"}
  10. local WhiteList = {"small sapphire", "sea serpent scale", "glacier kilt", "crystalline armor", "glacier amulet", "demon amor"}
  11.  
  12. -- delay settings, lower delay = looting faster
  13. local Delay = 100
  14. ----------------------------------------------------------------------------------------------------------------------------------------------------------------
  15.  
  16.  
  17.  
  18. function Loot(container)
  19. for i = 0, #Container.GetAll() do
  20. local cont = Container.New(i)
  21. for Spot, item in cont:iItems() do
  22. if (cont:isOpen() and table.isStrIn({"The", "Dead", "Slain", "Dissolved", "Remains", "Elemental"}, string.match(cont:Name(), "%a+"))) then
  23. 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
  24. 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
  25. if not table.contains(BlackList, Item.GetName(item.id)) then
  26. if Container.New(container):EmptySlots()>0 then
  27. cont:MoveItemToContainer(Spot, Container.New(container):Index(), 0)
  28. wait(Delay + Self.Ping())
  29. else
  30. local contto = Container.New(container)
  31. for spot, bp in contto:iItems() do
  32. if bp.id == Item.GetID(container) then
  33. contto:UseItem(spot, true)
  34. wait(Delay + Self.Ping())
  35. end
  36. end
  37. end
  38. end
  39. end
  40. end
  41. end
  42. end
  43. end
  44. end
  45.  
  46. Module.New('Looter', function()
  47. Loot(StackablesBP)
  48. Loot(NonStackablesBP)
  49. if LootGold then Loot(GoldBP) end
  50. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement