Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.43 KB | None | 0 0
  1. ---True/False---
  2. WyvernTower = false ---Set this to 'true' if you can want to hunt Wyverns on the way (80+ Recommended)
  3. Warlords = false ---Set this to 'true' if you can want to hunt Warlords -1 (90+ Recommended)
  4. QuestFloor = false ---Set this to 'true' if you can want to hunt at the Quest Floor (3Warlords+Dragon+3OrcLeaders)(120+ Recommended)
  5. WarlordTower = false ---Set this to 'true' if you can want to hunt at the Warlords at the tower (Warlords+Berserkers+Leaders)(100+ Recommended)
  6.  
  7. ---Backpacks---
  8. MinimizeBPs = true ---Set to 'true' if you want to minimize your backpacks
  9. MinimizeMain = true ---Set to 'true' if you want to minimize your main backpack
  10. LootBP = 2867 ---ID of loot items BP
  11. StackableBP = 2871 ---ID of stackables BP
  12. GoldBP = 8860 ---ID of gold BP
  13. SupplyBP = 2865 ---ID of backpack where your supplies will go
  14.  
  15. ---Potions--
  16. maxMana = 150 ---Mana potions you want to take to hunt
  17. leaveMana = 60 ---Mana potions you want to leave the spawn at
  18. manaId = 268 ---Mana potions ID
  19. manaPrice = 50 ---Mana potions price
  20. maxHealth = 50 ---Health Potion's you want to take to hunt
  21. leaveHealth = 40 ---Health Potion's you want to leave spawn at
  22. HealthId = 'Great Health Potion' ---Health Potion ID
  23. HealthPrice = 190 ---Health Potion price
  24.  
  25. ---Supply BP-- ( What will be moved inside your supply backpack)
  26. SHPID = Item.GetID("Mana potion") ---Name of what's going to go inside that backpack
  27. GHPID = Item.GetID("Great health potion") ---Name of what's going to go inside that backpack
  28. ---Other--
  29. MinCap = 200 ---Set the cap you want your character to leave spawn at
  30.  
  31. -----------------------------------------------------------------------------------------------------------------------
  32. registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
  33.  
  34. function onWalkerSelectLabel(LabelName)
  35. if (LabelName == "Deposit") then
  36. setWalkerEnabled(false)
  37. print("Depositing Items...")
  38. sleep(math.random(500, 1000))
  39. Self.ReachDepot()
  40. wait(500, 600)
  41. Self.DepositItems( -- Backpack 1 Inside Depot <item ID="7395" action="2"/>
  42. {7395, 0},
  43. {5907, 0},
  44. {3063, 0},
  45. {3391, 0},
  46. {3369, 0},
  47. {7397, 0},
  48. {7394, 0},
  49. {7400, 0},
  50. {818, 0},
  51. {3322, 0},
  52. {5875, 0},
  53. {3072, 0},
  54. {3071, 0},
  55. {7408, 0},
  56. {3091, 0}
  57. )
  58. Self.DepositItems( -- Backpack 2 Inside Depot
  59. {5896, 1},
  60. {5897, 1},
  61. {5902, 1},
  62. {10196, 1},
  63. {10196, 1},
  64. {3091, 1},
  65. {11477, 1},
  66. {11480, 1},
  67. {11478, 1},
  68. {11452, 1},
  69. {10318, 1},
  70. {11479, 1},
  71. {18996, 1},
  72. {18993, 1},
  73. {18997, 1},
  74. {11453, 1},
  75. {3301, 1},
  76. {3313, 1},
  77. {3316, 1},
  78. {3049, 1},
  79. {3254, 1},
  80. {3265, 1}
  81.  
  82. )
  83. if Self.Stamina()/60 > 15 then
  84. setWalkerEnabled(true)
  85. else
  86. print("Low Stamina")
  87. end
  88.  
  89. elseif LabelName == ("CheckDp") then
  90. print("Checking Supplies...")
  91. if ((Self.ItemCount(HealthId) < leaveHealth)) or ((Self.ItemCount(manaId) < leaveMana)) or (Self.Cap() < MinCap) then
  92. gotoLabel("StartDp")
  93. else
  94. print("EnoughSupplies..")
  95. gotoLabel("GoHunt")
  96. end
  97.  
  98. elseif LabelName == ("CheckWyvern") then
  99. Walker.Stop()
  100. if (WyvernTower) == false then
  101. gotoLabel("AfterWyvern")
  102. Walker.Start()
  103. else
  104. print("Hunting Wyvern Tower")
  105. Walker.Start()
  106. end
  107.  
  108. elseif LabelName == ("CheckWarlord") then
  109. Walker.Stop()
  110. if (Warlords) == false then
  111. gotoLabel("AfterWarlord")
  112. Walker.Start()
  113. else
  114. print("Hunting Warlords")
  115. Walker.Start()
  116. end
  117.  
  118. elseif LabelName == ("CheckDown") then
  119. Walker.Stop()
  120. if (QuestFloor) == false then
  121. gotoLabel("AfterDown")
  122. Walker.Start()
  123. else
  124. print("Hunting Quest Floor")
  125. Walker.Start()
  126. end
  127.  
  128. elseif LabelName == ("CheckWarlordUp") then
  129. Walker.Stop()
  130. if (WarlordTower) == false then
  131. gotoLabel("AfterUp")
  132. Walker.Start()
  133. else
  134. print("Hunting WarlordTower")
  135. Walker.Start()
  136. end
  137.  
  138. elseif (LabelName == "CheckHunt") then
  139. print("Checking Supplies...")
  140. if ((Self.ItemCount(HealthId) < leaveHealth)) or ((Self.ItemCount(manaId) < leaveMana)) or (Self.Cap() < MinCap) or (Self.ItemCount(6530) >= 1) then
  141. gotoLabel("Refill")
  142. else
  143. print("Enough Supplies to Hunt")
  144. gotoLabel("StartHunt")
  145. end
  146.  
  147. elseif (LabelName == "Bank") then
  148. setWalkerEnabled(false)
  149. print("Withdrawing Money...")
  150. delayWalker(5000)
  151. Self.SayToNpc({"Hi","Deposit all", "Yes"}, 65)
  152. sleep(math.random(800, 1500))
  153. Self.WithdrawMoney((manaPrice*(maxMana-Self.ItemCount(manaId))))
  154. sleep(math.random(800, 1500))
  155. Self.SayToNpc("yes")
  156. sleep(math.random(800, 1500))
  157. Self.WithdrawMoney((HealthPrice*(maxHealth-Self.ItemCount(HealthId))))
  158. sleep(math.random(800, 1500))
  159. Self.SayToNpc("yes")
  160. setWalkerEnabled(true)
  161.  
  162. elseif (LabelName == "SellItems") then
  163. setWalkerEnabled(false)
  164. Self.SayToNpc({"Hi", "Trade"}, 65)
  165. wait(900, 1200)
  166. Self.ShopSellItemsDownTo(3269, 0)
  167. wait(900, 1200)
  168. setWalkerEnabled(true)
  169.  
  170. elseif (LabelName == "BpReset") then
  171. setWalkerEnabled(false)
  172. print("Reseting Backpacks...")
  173. Client.HideEquipment()
  174. wait(900)
  175. Self.CloseContainers()
  176. wait(900,2000)
  177. Self.OpenMainBackpack(MinimizeMain):OpenChildren({LootBP,MinimizeBPs},{StackableBP,MinimizeBPs},{GoldBP,MinimizeBPs},{SupplyBP,MinimizeBPs})
  178. setWalkerEnabled(true)
  179.  
  180. elseif LabelName == ("Pots") then
  181. setWalkerEnabled(false)
  182. print("Buying Supplies...")
  183. Self.SayToNpc({"hi", "vial", "yes", "vial", "yes", "vial", "yes", "trade"}, 65)
  184. wait(1000)
  185. Self.SayToNpc({"vials", "yes", "yes", "yes"}, 65)
  186. wait(1000)
  187. if (Self.ItemCount(manaId) < maxMana) then
  188. Self.ShopBuyItemsUpTo(manaId, maxMana)
  189. wait(800)
  190. end
  191. if (Self.ItemCount(HealthId) < maxHealth) then
  192. Self.ShopBuyItemsUpTo(HealthId, maxHealth)
  193. wait(800)
  194. end
  195. setWalkerEnabled(true)
  196. end
  197. end
  198.  
  199. Module.New("MoveManas", function(module)
  200.  
  201. if (Self.ItemCount(ManaPotID) >= 1) or (Self.ItemCount(HealthID) >=1) or (Self.ItemCount(SHPID) >=1) or (Self.ItemCount(GHPID) >=1) then
  202. local MainBp = Container.GetFirst()
  203. local DestinationBp = Container.GetByName(SupplyBP)
  204. for spot = 0, MainBp:ItemCount() do
  205. local item = MainBp:GetItemData(spot)
  206. if (item.id == ManaPotID) or (item.id == SDID) or (item.id == SHPID) or (item.id == GHPID) then
  207. MainBp:MoveItemToContainer(spot, DestinationBp:Index(), 0)
  208. module:Delay(500)
  209. break
  210. end
  211. module:Delay(200)
  212. end
  213. end
  214. end)
  215.  
  216. Self.ReachDepot = function(ATTEMPTS)
  217. --Forgee Library
  218.  
  219. local ATTEMPTS = ATTEMPTS or 5
  220. local DP_IDS = {3497, 3498, 3499, 3500}
  221. local DP_POSITIONS = {}
  222.  
  223. Walker.Stop()
  224. local function reachDP()
  225. for i = 1, #DP_IDS do
  226. for POS_X = -7, 7, 1 do
  227. for POS_Y = -5, 5, 1 do
  228. if (Map.GetTopUseItem(Self.Position().x + POS_X, Self.Position().y + POS_Y, Self.Position().z).id == DP_IDS[i]) then
  229. DP_POSITION = {x = Self.Position().x + POS_X, y = Self.Position().y + POS_Y, z = Self.Position().z}
  230. table.insert(DP_POSITIONS, DP_POSITION)
  231. end
  232. end
  233. end
  234. end
  235. print("XenoBot has found "..#DP_POSITIONS.." depots around you.")
  236. wait(2000)
  237. for i = 1, #DP_POSITIONS do
  238. local LAST_POSITION = Self.Position()
  239. local BLOCKED = 0
  240. local COORDINATES = DP_POSITIONS[i]
  241. for j = CREATURES_LOW, CREATURES_HIGH do
  242. local CREATURE = Creature.GetFromIndex(j)
  243. if (CREATURE:isPlayer() and CREATURE:ID() ~= Self.ID() and CREATURE:isOnScreen()) then
  244. if (Map.GetTopUseItem(COORDINATES.x, COORDINATES.y, COORDINATES.z).id == DP_IDS[1]) then
  245. --SOUTH
  246. if ((CREATURE:Position().x == COORDINATES.x and CREATURE:Position().y == COORDINATES.y-1) or (CREATURE:Position().x == COORDINATES.x and CREATURE:Position().y == COORDINATES.y-2) or (Map.IsTileWalkable(COORDINATES.x, COORDINATES.y-1, COORDINATES.z) == false) or (Map.IsTileWalkable(COORDINATES.x, COORDINATES.y-2, COORDINATES.z) == false)) then
  247. BLOCKED = BLOCKED+1
  248. end
  249. end
  250. if (Map.GetTopUseItem(COORDINATES.x, COORDINATES.y, COORDINATES.z).id == DP_IDS[2]) then
  251. --WEST
  252. if ((CREATURE:Position().x == COORDINATES.x+1 and CREATURE:Position().y == COORDINATES.y) or (CREATURE:Position().x == COORDINATES.x+2 and CREATURE:Position().y == COORDINATES.y) or (Map.IsTileWalkable(COORDINATES.x+1, COORDINATES.y, COORDINATES.z) == false) or (Map.IsTileWalkable(COORDINATES.x+2, COORDINATES.y, COORDINATES.z) == false)) then
  253. BLOCKED = BLOCKED+1
  254. end
  255. end
  256. if (Map.GetTopUseItem(COORDINATES.x, COORDINATES.y, COORDINATES.z).id == DP_IDS[3]) then
  257. --NORTH
  258. if ((CREATURE:Position().x == COORDINATES.x and CREATURE:Position().y == COORDINATES.y+1) or (CREATURE:Position().x == COORDINATES.x and CREATURE:Position().y == COORDINATES.y+2) or (Map.IsTileWalkable(COORDINATES.x, COORDINATES.y+1, COORDINATES.z) == false) or (Map.IsTileWalkable(COORDINATES.x, COORDINATES.y+2, COORDINATES.z) == false)) then
  259. BLOCKED = BLOCKED+1
  260. end
  261. end
  262. if (Map.GetTopUseItem(COORDINATES.x, COORDINATES.y, COORDINATES.z).id == DP_IDS[4]) then
  263. --EAST
  264. if ((CREATURE:Position().x == COORDINATES.x-1 and CREATURE:Position().y == COORDINATES.y) or (CREATURE:Position().x == COORDINATES.x-2 and CREATURE:Position().y == COORDINATES.y) or (Map.IsTileWalkable(COORDINATES.x-1, COORDINATES.y, COORDINATES.z) == false) or (Map.IsTileWalkable(COORDINATES.x-2, COORDINATES.y, COORDINATES.z) == false)) then
  265. BLOCKED = BLOCKED+1
  266. end
  267. end
  268. end
  269. end
  270. if (BLOCKED == 0) then
  271. print("XenoBot is now trying to reach a free depot.")
  272. Self.UseItemFromGround(COORDINATES.x, COORDINATES.y, COORDINATES.z)
  273. wait(2000, 4000)
  274. if (Self.DistanceFromPosition(LAST_POSITION.x, LAST_POSITION.y, LAST_POSITION.z) >= 1) then
  275. wait(5000, 10000)
  276. if (Self.DistanceFromPosition(COORDINATES.x, COORDINATES.y, COORDINATES.z) == 1) then
  277. print("XenoBot has successfully reached a free depot and will now proceed with following actions.")
  278. wait(2000)
  279. return true
  280. end
  281. end
  282. end
  283. end
  284. return false
  285. end
  286.  
  287. while (ATTEMPTS > 0) do
  288. if (reachDP()) then
  289. return true
  290. end
  291. ATTEMPTS = ATTEMPTS-1
  292. wait(100)
  293. end
  294. return false
  295. end
  296.  
  297. function Self.ShopSellItemsDownTo(item, count)
  298. wait(300, 1700)
  299. Self.ShopSellItem(item, Self.ShopGetItemSaleCount(item))
  300. wait(900, 1200)
  301. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement