Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.55 KB | None | 0 0
  1. ---------------------------------
  2. --------Ediinsz WorkShop™--------
  3. ----Scripts By EdsonJunior-------
  4. ---------Divirta-se!-------------
  5. ---------------------------------
  6.  
  7. ----------- BP SETUP ------------
  8. local GoldBP = "Brocade Backpack" --- Your gold backpack (use same colors inside)
  9. local LootBP = "Bag" --- Your loot backpack
  10. local StackBP = "Blue backpack" --- Your stack backpack
  11.  
  12.  
  13. ------ REFILL SETUP ------
  14. local MinMana = 10 --- How many mana potions until you leave the hunt.
  15. local MaxMana = 50 --- How many mana potions you begin the hunt with.
  16. local IDMana = 268 --- ID Mana Potion
  17. local CostMana = 50 --- Price Mana Potion
  18.  
  19. local MinHealth = 0 --- How many health potions until you leave the hunt.
  20. local MaxHealth = 0 --- How many health potions you begin the hunt with.
  21. local IDHealth = 236 --- ID Health potion
  22. local CostHealth = 100 --- Price Health Potion
  23.  
  24. local MinSd = 100
  25. local MaxSd = 3000
  26. local IDSd = Item.GetID("sudden death rune")
  27.  
  28. ------- EXTRA SETTINGS ------
  29. local MinCap = 100 --- Leaves spawn when character reaches this cap.
  30.  
  31.  
  32.  
  33. --------------------------------------------------------------------
  34. --------------------------------------------------------------------
  35. --------------------------------------------------------------------
  36. --------------------------------------------------------------------
  37. --------------------------------------------------------------------
  38.  
  39. Targeting.Start()
  40. Looter.Start()
  41.  
  42. registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
  43.  
  44. print([[ !! VIDEO AULA !!
  45. -- XENOBOT 100% --
  46. \\ by EdsonJunior // ]])
  47. wait(5000)
  48.  
  49. function onWalkerSelectLabel(labelName)
  50.  
  51. -- Checar na hunt
  52. if (labelName == "Check") then
  53. Walker.ConditionalGoto((Self.Cap() <= MinCap) or
  54. (Self.ItemCount(IDMana) < MinMana) or
  55. (Self.ItemCount(IDHealth) < MinHealth) or
  56. (Self.ItemCount(IDSd) < MinSd), "City", "Hunt")
  57.  
  58. -- Depositar e Retirar grana
  59. elseif (labelName == "Banco") then
  60. print([[Depositando e retirando para refillar]])
  61. local withdrawManas = math.max(MaxMana - Self.ItemCount(IDMana), 0)*CostMana
  62. local withdrawHealths = math.max(MaxHealth - Self.ItemCount(IDHealth), 0)*CostHealth
  63. local totalmoneyneeded = (withdrawManas + withdrawHealths)
  64. local MATHCEIL = (math.ceil((totalmoneyneeded)))
  65. Walker.Stop()
  66. Self.SayToNpc({"hi", "deposit all", "yes"}, 65)
  67. if (totalmoneyneeded > 0) then
  68. Self.SayToNpc({"withdraw " .. MATHCEIL, "yes"}, 65)
  69. end
  70. wait(2000)
  71. Walker.Start()
  72.  
  73. -- Depositar no DP e Checar stamina
  74. elseif (labelName == "Depositer") then
  75. Walker.Stop()
  76. wait(1900,2400)
  77. Self.ReachDepot()
  78. Self.DepositItems({10308, 0}, {9668, 0})
  79. wait(2000)
  80. Self.DepositItems({3049, 1}, {8072, 1}, {3428, 1})
  81. wait(2000)
  82.  
  83. if (Self.Stamina() <= 960) then
  84. Walker.Stop()
  85. print([[Stamina baixa, parando bot...]])
  86.  
  87. else
  88. Walker.Start()
  89. print([[Stamina normal, continuando hunt...]])
  90. end
  91.  
  92. -- Comprar Supplies
  93. elseif (labelName == "Shop") then
  94. Walker.Stop()
  95. print([[Comprando...]])
  96. if (Self.ItemCount(IDMana) < MaxMana) or (Self.ItemCount(IDHealth) < MaxHealth) then
  97. Self.SayToNpc({"hi", "flasks", "yes", "yes", "yes", "yes", "yes", "yes", "trade"}, 65)
  98. wait(2000)
  99. if (Self.ItemCount(IDMana) < MaxMana) then
  100. BuyItems(IDMana, MaxMana)
  101. wait(500)
  102. end
  103. if (Self.ItemCount(IDHealth) < MaxHealth) then
  104. BuyItems(IDHealth, MaxHealth)
  105. wait(500)
  106. end
  107. if (Self.ItemCount(IDSd) < MaxSd) then
  108. BuyItems(IDSd, MaxSd)
  109. wait(500)
  110. end
  111. wait(200, 500)
  112. end
  113. Walker.Start()
  114.  
  115. -- Resetar Backpack (Colocar sempre depois do bank)
  116. elseif (labelName == "Backpacks") then
  117. Walker.Stop()
  118. print([[Resetando Backpacks...]])
  119. wait(1000,2000)
  120. Self.CloseContainers()
  121. wait(2000,3000)
  122. Self.OpenMainBackpack(true):OpenChildren({Item.GetID(GoldBP), true}, {Item.GetID(LootBP), true})
  123. wait(2000,3000)
  124. Walker.Start()
  125.  
  126.  
  127. end
  128. end
  129.  
  130. ----------------------- Functions ----------------------
  131. function BuyItems(item, count) -- item = item id, count = how many you want to buy up to
  132. wait(900, 1200)
  133. if (Self.ItemCount(item) < count) then
  134. Self.ShopBuyItem(item, (count-Self.ItemCount(item)))
  135. wait(200, 500)
  136. end
  137. end
  138.  
  139. Self.ReachDepot = function (tries)
  140. local tries = tries or 3
  141. Walker.Stop()
  142. local DepotIDs = {3497, 3498, 3499, 3500}
  143. local DepotPos = {}
  144. for i = 1, #DepotIDs do
  145. local dps = Map.GetUseItems(DepotIDs[i])
  146. for j = 1, #dps do
  147. table.insert(DepotPos, dps[j])
  148. end
  149. end
  150. local function gotoDepot()
  151. local pos = Self.Position()
  152. print("Depots found: " .. tostring(#DepotPos))
  153. for i = 1, #DepotPos do
  154. location = DepotPos[i]
  155. Self.UseItemFromGround(location.x, location.y, location.z)
  156. wait(1000, 2000)
  157. if Self.DistanceFromPosition(pos.x, pos.y, pos.z) >= 1 then
  158. wait(5000, 6000)
  159. if Self.DistanceFromPosition(location.x, location.y, location.z) == 1 then
  160. Walker.Start()
  161. return true
  162. end
  163. else
  164. print("Something is blocking the path. Trying next depot.")
  165. end
  166. end
  167. return false
  168. end
  169.  
  170. repeat
  171. reachedDP = gotoDepot()
  172. if reachedDP then
  173. return true
  174. end
  175. tries = tries - 1
  176. sleep(100)
  177. print("Attempt to reach depot was unsuccessfull. " .. tries .. " tries left.")
  178. until tries <= 0
  179.  
  180. return false
  181. end
  182.  
  183. Map.GetUseItems = function (id)
  184. if type(id) == "string" then
  185. id = Item.GetID(id)
  186. end
  187. local pos = Self.Position()
  188. local store = {}
  189. for x = -7, 7 do
  190. for y = -5, 5 do
  191. if Map.GetTopUseItem(pos.x + x, pos.y + y, pos.z).id == id then
  192. itemPos = {x = pos.x + x, y = pos.y + y, z = pos.z}
  193. table.insert(store, itemPos)
  194. end
  195. end
  196. end
  197. return store
  198. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement