Advertisement
Guest User

Untitled

a guest
Feb 26th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.63 KB | None | 0 0
  1. MerchantsAndItems =
  2.  
  3. {
  4.  
  5. BlueDjinn = {"Magic Light Wand", "Orb", "Wand of Cosmic Energy", "Wand of Decay", "Wand of Draconia", "Wand of Dragonbreath", "Wand of Inferno", "Wand of Starstorm", "Wand of Voodoo", "Wand of Vortex", "Angelic Axe", "Blue Robe", "Bonelord Shield", "Boots of Haste", "Broadsword", "Butcher's Axe", "Crown Armor", "Crown Helmet", "Crown Legs", "Crown Shield", "Crusader Helmet", "Dragon Lance", "Dragon Shield", "Earth Spike Sword", "Earth War Hammer", "Energy Spike Sword", "Energy War Hammer", "Fiery Spike Sword", "Fiery War Hammer", "Fire Axe", "Fire Sword", "Glorious Axe", "Guardian Shield", "Ice Rapier", "Icy Spike Sword", "Icy War Hammer", "Noble Armor", "Obsidian Lance", "Queen's Sceptre", "Royal Helmet", "Shadow Sceptre", "Spike Sword", "Thaian Sword", "War Hammer"},
  6.  
  7. GreenDjinn = {"Ancient Shield", "Black Shield", "Bonebreaker", "Dark Armor", "Dark Helmet", "Dragon Hammer", "Dreaded Cleaver", "Earth Knight Axe", "Energy Knight Axe", "Fiery Knight Axe", "Giant Sword", "Haunted Blade", "Icy Knight Axe", "Knight Armor", "Knight Axe", "Knight Legs", "Mystic Turban", "Onyx Flail", "Poison Dagger", "Scimitar", "Serpent Sword", "Skull Staff", "Strange Helmet", "Titan Axe", "Tower Shield", "Vampire Shield", "Warrior Helmet", "Hailstorm Rod", "Moonlight Rod", "Mysterious Fetish", "Necrotic Rod", "Northwind Rod", "Snakebite Rod", "Springsprout Rod", "Strange Talisman", "Terra Rod", "Underworld Rod"},
  8.  
  9. Rashid = {"Abyss Hammer", "Amber Staff", "Ancient Amulet", "Assassin Dagger", "Bandana", "Beastslayer Axe", "Beetle Necklace", "Berserker", "Blacksteel Sword", "Blessed Sceptre", "Bone Shield", "Bonelord Helmet", "Brutetamer's Staff", "Castle Shield", "Chaos Mace", "Coconut Shoes", "Composite Hornbow", "Cranial Basher", "Crocodile Boots", "Crystal Mace", "Crystal Necklace", "Crystal Ring", "Crystal Sword", "Crystalline Armor", "Daramanian Mace", "Daramanian Waraxe", "Dark Shield", "Death Ring", "Demon Shield", "Demonbone Amulet", "Demonrage Sword", "Devil Helmet", "Diamond Sceptre", "Doll", "Dragon Scale Mail", "Dragon Slayer", "Dragonbone Staff", "Dreaded Cleaver", "Earth Cranial Basher", "Earth Dragon Slayer", "Earth Heroic Axe", "Earth Mystic Blade", "Earth Relic Sword", "Earth War Axe", "Elvish Bow", "Emerald Bangle", "Energy Cranial Basher", "Energy Dragon Slayer", "Energy Heroic Axe", "Energy Mystic Blade", "Energy Relic Sword", "Energy War Axe", "Epee", "Fiery Cranial Basher", "Fiery Dragon Slayer", "Fiery Heroic Axe", "Fiery Mystic Blade", "Fiery Relic Sword", "Fiery War Axe", "Flower Dress", "Flower Wreath", "Fur Boots", "Furry Club", "Glacier Amulet", "Glacier Kilt", "Glacier Mask", "Glacier Robe", "Glacier Shoes", "Gold Ring", "Golden Armor", "Golden Legs", "Guardian Halberd", "Hammer of Wrath", "Heavy Mace", "Heavy Machete", "Heavy Trident", "Heroic Axe", "Hibiscus Dress", "Icy Cranial Basher", "Icy Dragon Slayer", "Icy Heroic Axe", "Icy Mystic Blade", "Icy Relic Sword", "Icy War Axe", "Jade Hammer", "Krimhorn Helmet", "Leaf Legs", "Leopard Armor", "Leviathan's Amulet", "Light Shovel", "Lightning Boots", "Lightning Headband", "Lightning Legs", "Lightning Pendant", "Lightning Robe", "Lunar Staff", "Magic Plate Armor", "Magma Amulet", "Magma Boots", "Magma Coat", "Magma Legs", "Magma Monocle", "Mammoth Fur Cape", "Mammoth Fur Shorts", "Mammoth Whopper", "Mastermind Shield", "Medusa Shield", "Mercenary Sword", "Mystic Blade", "Naginata", "Nightmare Blade", "Noble Axe", "Norse Shield", "Orcish Maul", "Paladin Armor", "Pirate Boots", "Pirate Hat", "Pirate Knee Breeches", "Pirate Shirt", "Pirate Voodoo Doll", "Platinum Amulet", "Ragnir Helmet", "Relic Sword", "Ring of the Sky", "Ruby Necklace", "Ruthless Axe", "Sacred Tree Amulet", "Sapphire Hammer", "Scarab Amulet", "Scarab Shield", "Shockwave Amulet", "Silver Brooch", "Silver Dagger", "Skull Helmet", "Skullcracker Armor", "Spiked Squelcher", "Steel Boots", "Swamplair Armor", "Taurus Mace", "Terra Amulet", "Terra Boots", "Terra Hood", "Terra Legs", "Terra Mantle", "The Justice Seeker", "Tortoise Shield", "Vile Axe", "Voodoo Doll", "War Axe", "War Horn", "Witch Hat", "Wyvern Fang"},
  10.  
  11. }
  12.  
  13.  
  14.  
  15. BackpacksToSortTo =
  16.  
  17. {
  18.  
  19. BlueDjinn = "Blue Backpack",
  20.  
  21. GreenDjinn = "Blue Backpack",
  22.  
  23. Rashid = "Blue Backpack",
  24.  
  25. Others = "Blue Backpack",
  26.  
  27. Main = "Depot Box I"
  28.  
  29. }
  30.  
  31.  
  32.  
  33. function itemMoveHelper(contFrom, fromSpot, contTo)
  34.  
  35.  
  36.  
  37. print("Moving from %s spot %d to %s", contFrom:Name(), fromSpot, contTo:Name())
  38.  
  39. if (contTo:ItemCount() == contTo:ItemCapacity()) then --opens the next container
  40.  
  41. local openAt = contTo:ItemCount() - 1
  42.  
  43. if (Item.isContainer(contTo:GetItemData(openAt).id)) then
  44.  
  45. contTo:UseItem(openAt, true)
  46.  
  47. wait(1500)
  48.  
  49. else
  50.  
  51. print("No more room for items in %s. Please fix the problem and restart the script.", contTo:Name())
  52.  
  53. wait(99999999)
  54.  
  55. end
  56.  
  57. end
  58.  
  59.  
  60.  
  61. contFrom:MoveItemToContainer(fromSpot, contTo:Index(), contTo:ItemCapacity() - 1)
  62.  
  63. end
  64.  
  65.  
  66.  
  67. function itemFound(nameTable, itemId)
  68.  
  69. local itemName = string.upper(Item.GetName(itemId))
  70.  
  71. for _, name in pairs(nameTable) do
  72.  
  73. if (itemName == string.upper(name)) then
  74.  
  75. return true
  76.  
  77. end
  78.  
  79. end
  80.  
  81.  
  82.  
  83. return false
  84.  
  85. end
  86.  
  87.  
  88.  
  89. local error = false
  90.  
  91. local backpacks = {}
  92.  
  93. for merchant, bpName in pairs(BackpacksToSortTo) do
  94.  
  95. backpacks[merchant] = Container.GetByName(bpName)
  96.  
  97. if (not backpacks[merchant]:isOpen()) then
  98.  
  99. error = true
  100.  
  101. print("You must open a %s as your %s backpack. Please fix the problem and restart the script.", bpName, merchant)
  102.  
  103. break
  104.  
  105. end
  106.  
  107. end
  108.  
  109.  
  110.  
  111. if (not error) then
  112.  
  113. repeat
  114.  
  115.  
  116.  
  117. while (backpacks["Main"]:ItemCount() > 0) do
  118.  
  119. local item = backpacks["Main"]:GetItemData(0)
  120.  
  121.  
  122.  
  123. if (Item.isContainer(item.id) and backpacks["Main"]:ItemCount() == 1) then --open next backpack of loot
  124.  
  125. backpacks["Main"]:UseItem(backpacks["Main"]:ItemCount()-1, true)
  126.  
  127. wait(1000)
  128.  
  129. break
  130.  
  131. else --move it the loot
  132.  
  133. local foundBp = backpacks["Others"]
  134.  
  135. for merchant, _ in pairs(MerchantsAndItems) do
  136.  
  137. if (itemFound(MerchantsAndItems[merchant], item.id)) then
  138.  
  139. foundBp = backpacks[merchant]
  140.  
  141. break
  142.  
  143. end
  144.  
  145. end
  146.  
  147.  
  148.  
  149. itemMoveHelper(backpacks["Main"], 0, foundBp)
  150.  
  151. wait(500, 900)
  152.  
  153. end
  154.  
  155. end
  156.  
  157. until (backpacks["Main"]:ItemCount() == 0)
  158.  
  159. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement