Guest User

Untitled

a guest
May 8th, 2018
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.21 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", "Buckle", "Helmet of the lost", "Pair of iron fists"},
  10.  
  11. Esrik = {"Spiked Iron Ball", "Broken Halberd", "Broken Slicer", "High Guard Shoulderplates", "Bone Shoulderplate", "Zaogun Shoulderplates", "Warmaster's Wristguards", "Cursed Shoulder Spikes", "Broken Draken Mail", "Draken Wristbands", "Twin Hooks", "Zaoan Halberd", "Wailing Widow's Necklace", "Zaoan Shoes", "Drachaku", "Drakinata", "Zaoan Armor", "Zaoan Legs", "Sai", "Twiceslicer", "Zaoan Sword", "Guardian Boots", "Draken Boots", "Zaoan Helmet", "Elite Draken Mail"},
  12.  
  13. Lailene = {"Ethno Coat", "Spirit Cloak", "Focus Cape", "Batwing Hat", "Jade Hat", "Zaoan Robe", "Spellweaver's Robe"},
  14.  
  15. Alexander = {"Mind Stone", "Crystal Ball", "Spellbook of Enlightenment", "Spellbook of Warding", "Spellbook of Mind Control", "Spellbook of Lost Souls"},
  16.  
  17. Fiona = {"Glob of Mercury", "Glob of Acid Slime", "Glob of Tar", "Bola", "Carrion Worm Fang", "Red Hair Dye", "Cheese Cutter", "Elven Scouting Glass", "Miraculum", "Demonic Skeletal Hand", "Mad Froth", "Elven Astral Observer", " Gauze Bandage", "Small Flask of Eyedrops", "Spooky Blue Eye", "Dragon's Tail", "Bloody Dwarven Beard", "Geomancer's Staff", "Stone Wing", "Wimp Tooth Chain", "Lost Bracers", "Bone Fetish", "Elder Bonelord Tentacle", "Basalt Figurine", "Holy Ash", "Skull Shatterer", "Dragon Priest's Wandtip", "Basalt Fetish", "Bony Tail", "Brimstone Shell", "Broken Throwing Axe", "Lost Husher's Staff", "Weaver's Wandtip", "Wyvern Talisman", "Frosty Heart", "Lost Basher's Spike", "Spellsinger's Seal", "Deeptags", "Key to the Drowned Library", "Blood Tincture in a Vial", "Fiery Heart", "Brimstone Fangs", "Giant Eye", "Wyrm Scale", "Scythe Leg", "Hellspawn Tail", "Hideous Chunk", "Sea Serpent Scale", "Humongous Chunk", "Draken Sulphur", "Blazing Bone", "Mystical Hourglass", "Demon Horn", "Luminous Orb", "Vexclaw Talon", "Some Grimeleech Wings", "Pair of Hellflayer Horns"},
  18.  
  19. Telas = {"Coal", "Sulphurous Stone", "Broken Gladiator Shield", "Ancient Stone", "Gear Crystal", "Battle Stone", "Metal Spike", "Vein of Ore", "Pulverized Ore", "Crystalline Spikes", "War Crystal", "Gear Wheel", "Piece of Hell Steel", "Shiny Stone", "Crystal Pedestal", "Piece of Hellfire Armor", "Magma Clump", "Stone Nose", "Flintstone", "Crystal of Balance", "Crystal of Focus", "Crystal of Power", "Piece of Draconian Steel"},
  20.  
  21. Malunga = {"Pig Foot", "Poison Spider Shell", "Spider Fangs", "Cobra Tongue", "Damselfly Wing", "Swampling Moss", "Fir Cone", "Damselfly Eye", "Scorpion Tail", "Pile of Grave Earth", "Centipede Leg", "Hatched Rorc Egg", "Pelvis Bone", "Rotten Piece of Cloth", "Piece of Swampling Wood", "Dowser", "Horoscope", "Piece of Scarab Shell", "Mutated Flesh", "Poisonous Slime", "Half-Digested Piece of Meat", "Venison", "Ghoul Snack", "Tooth File", "Small Pitchfork", "Deepling Scales", "Tarantula Egg", "Half-Eaten Brain", "Incantation Notes", "Lancet", "Deepling Breaktime Snack", "Thorn", "Widow's Mandibles", "Haunted Piece of Wood", "Rorc Egg", "Swarmer Antenna", "Mutated Rat Tail", "Compound Eye", "Eye of a Deepling", "Vampire's Cape Chain", "Slime Mould", "Deepling Warts", "Bonecarving Knife", "Waspoid Wing", "Boggy Dreads", "Undead Heart", "Crawler Head Plating", "Pieces of Magic Chalk", "Tail of Corruption", "Petrified Scream", "Necromantic Robe", "Lizard Essence", "Waspoid Claw", "Spitter Nose", "Hair of a Banshee", "Deepling Ridge", "Essence of a Bad Dream", "Eye of Corruption", "Piece of Dead Brain", "Deepling Claw", "Spidris Mandible", "Hellhound Slobber", "Gland", "Strand of Medusa Hair", "Yielocks", "Yielowax", "Eye of a Weeper", "Scale of Corruption", "Ghastly Dragon Head", "Cliff Strider Claw", "Winged Tail", "Demonic Finger", "Tentacle Piece"},
  22.  
  23. Irmana = {"Piece of Crocodile Leather", "Badger Fur", "Wool", "Winter Wolf Fur", "Downy Feather", "Shaggy Tail", "Warwolf Fur", "Bunch Of Troll Hair", "Silky Fur", "Earflap", "Striped Fur", "Skunk Tail", "Lion's Mane", "Rope Belt", "Gloom Wolf Fur", "Geomancer's Robe", "Ghostly Tissue", "Purple Robe", "Tattered Piece of Robe", "Dirty Turban", "Safety Pin", "Thick Fur", "Frost Giant Pelt", "Jewelled Belt", "Necromantic Robe", "Black Wool", "Werewolf Fur", "Snake Skin", "Noble Turban"},
  24.  
  25. Tothdral = {"Flask of Embalming Fluid", "Elvish Talisman", "Dark Rosary", "Witch Broom", "Book of Prayers", "Cultish Robe", "Book of Necromantic Rituals", "Black Hood", "Strange Symbol", "Cultish Mask", "Unholy Bone", "Cultish Symbol", "Broken Key Ring"}
  26.  
  27. }
  28.  
  29.  
  30.  
  31. BackpacksToSortTo =
  32.  
  33. {
  34.  
  35. BlueDjinn = "Blue Backpack",
  36.  
  37. GreenDjinn = "Green Backpack",
  38.  
  39. Rashid = "Orange Backpack",
  40.  
  41. Esrik = "Purple Backpack",
  42.  
  43. Lailene = "Beach Backpack",
  44.  
  45. Alexander = "Camouflage Backpack",
  46.  
  47. Fiona = "Fur Backpack",
  48.  
  49. Telas = "Golden Backpack",
  50.  
  51. Malunga = "Grey Backpack",
  52.  
  53. Irmana = "Red Backpack",
  54.  
  55. Tothdral = "Pirate Backpack",
  56.  
  57. Others = "Yellow Backpack",
  58.  
  59. Main = "Brocade Backpack"
  60.  
  61. }
  62.  
  63.  
  64.  
  65. function itemMoveHelper(contFrom, fromSpot, contTo)
  66.  
  67.  
  68.  
  69. print("Moving from %s spot %d to %s", contFrom:Name(), fromSpot, contTo:Name())
  70.  
  71. if (contTo:ItemCount() == contTo:ItemCapacity()) then --opens the next container
  72.  
  73. local openAt = contTo:ItemCount() - 1
  74.  
  75. if (Item.isContainer(contTo:GetItemData(openAt).id)) then
  76.  
  77. contTo:UseItem(openAt, true)
  78.  
  79. wait(1500)
  80.  
  81. else
  82.  
  83. print("No more room for items in %s. Please fix the problem and restart the script.", contTo:Name())
  84.  
  85. wait(99999999)
  86.  
  87. end
  88.  
  89. end
  90.  
  91.  
  92.  
  93. contFrom:MoveItemToContainer(fromSpot, contTo:Index(), contTo:ItemCapacity() - 1)
  94.  
  95. end
  96.  
  97.  
  98.  
  99. function itemFound(nameTable, itemId)
  100.  
  101. local itemName = string.upper(Item.GetName(itemId))
  102.  
  103. for _, name in pairs(nameTable) do
  104.  
  105. if (itemName == string.upper(name)) then
  106.  
  107. return true
  108.  
  109. end
  110.  
  111. end
  112.  
  113.  
  114.  
  115. return false
  116.  
  117. end
  118.  
  119.  
  120.  
  121. local error = false
  122.  
  123. local backpacks = {}
  124.  
  125. for merchant, bpName in pairs(BackpacksToSortTo) do
  126.  
  127. backpacks[merchant] = Container.GetByName(bpName)
  128.  
  129. if (not backpacks[merchant]:isOpen()) then
  130.  
  131. error = true
  132.  
  133. print("You must open a %s as your %s backpack. Please fix the problem and restart the script.", bpName, merchant)
  134.  
  135. break
  136.  
  137. end
  138.  
  139. end
  140.  
  141.  
  142.  
  143. if (not error) then
  144.  
  145. repeat
  146.  
  147.  
  148.  
  149. while (backpacks["Main"]:ItemCount() > 0) do
  150.  
  151. local item = backpacks["Main"]:GetItemData(0)
  152.  
  153.  
  154.  
  155. if (Item.isContainer(item.id) and backpacks["Main"]:ItemCount() == 1) then --open next backpack of loot
  156.  
  157. backpacks["Main"]:UseItem(backpacks["Main"]:ItemCount()-1, true)
  158.  
  159. wait(1000)
  160.  
  161. break
  162.  
  163. else --move it the loot
  164.  
  165. local foundBp = backpacks["Others"]
  166.  
  167. for merchant, _ in pairs(MerchantsAndItems) do
  168.  
  169. if (itemFound(MerchantsAndItems[merchant], item.id)) then
  170.  
  171. foundBp = backpacks[merchant]
  172.  
  173. break
  174.  
  175. end
  176.  
  177. end
  178.  
  179.  
  180.  
  181. itemMoveHelper(backpacks["Main"], 0, foundBp)
  182.  
  183. wait(500, 900)
  184.  
  185. end
  186.  
  187. end
  188.  
  189. until (backpacks["Main"]:ItemCount() == 0)
  190.  
  191. end
Advertisement
Add Comment
Please, Sign In to add comment