Advertisement
Guest User

SKRYPTXENOAFK

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