Guest User

Untitled

a guest
May 19th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.22 KB | None | 0 0
  1. --------------
  2. --------------
  3. ----Scrypt--
  4. ------By:-
  5. ------Petos---
  6. ----------------
  7.  
  8. --------- BP SETUP ----------
  9. --BP SETUP--
  10. local MainBp = "Golden Backpack" ----- Main Backpack
  11. local GoldBp = "Pirate Backpack" ---- Backpack to put gold in
  12. local LootBp = "Backpack" ------ Backpack to put loot in
  13. local StackBp = "Backpack" ------ Backpack to put stack in
  14. local HideEquipment = false -------- Set this true if you want to hide equipment (recommended for low resolutions)
  15.  
  16. --------- DP SETUP ----------
  17. -- [DP 1] - bp na lota
  18.  
  19. ------ REFILL SETTINGS ------
  20. local MinHealth = 25 --- Od ilu heal potów ma wracać z Hunta.
  21. local MaxHealth = 100 --- Z iloma potami ma zaczynac hunt.
  22. local MinMana = 45 --- Od ilu heal potów ma wracać z Hunta.
  23. local MaxMana = 270 --- Z iloma potami ma zaczynac hunt.
  24. ------- HUNT SETTINGS --------
  25. local GoldBP = 5949 --- id bp do którego ma chować gp (mozesz ustawic poprostu w lootingu numer bp ;p)
  26. local MinCap = 5-- ilość capa od której ma wracać do dp.
  27. ------- EXTRA SETTINGS -------
  28. local HideEquipment = true --- czy bot ma minimalizować eq.
  29. local LogoutStamina = true --- czy bot ma pójść do dp i sie wylogować jak bedzie miał 16 staminy.
  30.  
  31. --------------------------------------------------------------------
  32. --------------------------------------------------------------------
  33. --------------------------------------------------------------------
  34. --------------------------------------------------------------------
  35. --------------------------------------------------------------------
  36.  
  37. Targeting.Start()
  38. Looter.Start()
  39.  
  40. registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
  41.  
  42. print([[
  43. Scrypt
  44. By:
  45. Petos]])
  46. wait(5000)
  47.  
  48. function onWalkerSelectLabel(labelName)
  49. if (labelName == "Checker") then
  50. Walker.ConditionalGoto((Self.ItemCount(266) <= MinHealth) or (Self.ItemCount(268) <= MinMana) or ((LogoutStamina) and (Self.Stamina() < 840)), "Leave", "Hunt")
  51. elseif (labelName == "Checker1") then
  52. Walker.ConditionalGoto((Self.ItemCount(266) <= MinHealth) or (Self.ItemCount(268) <= MinMana) or ((LogoutStamina) and (Self.Stamina() < 840)), "Leave", "Dalej")
  53.  
  54. elseif (labelName == "Potions") then
  55. Walker.Stop()
  56. if (Self.ItemCount(268) < MaxMana) or (Self.ItemCount(266) < MaxHealth) then
  57. Self.SayToNpc({"hi", "flasks", "yes", "yes", "yes", "yes", "yes", "yes", "trade"}, 65)
  58. wait(2000)
  59. if (Self.ItemCount(268) < MaxMana) or (Self.ItemCount(266) < MaxHealth) then
  60. BuyItems(268, MaxMana)
  61. wait(500)
  62. BuyItems(266, MaxHealth)
  63. wait(500)
  64.  
  65. end
  66. wait(200, 500)
  67. end
  68. Walker.Start()
  69.  
  70. elseif (labelName == "CheckStuff") then
  71. Walker.ConditionalGoto((Self.ItemCount(268) < MaxMana) or (Self.ItemCount(266) < MaxHealth) , "Bank", "ToHunt")
  72.  
  73.  
  74. elseif (labelName == "Bank") then
  75.  
  76. Walker.Stop()
  77.  
  78. delayWalker(5000)
  79.  
  80. Self.Say("hi")
  81.  
  82. sleep(math.random(700, 1400))
  83.  
  84. Self.WithdrawMoney((50*(MaxMana-Self.ItemCount(268))))
  85.  
  86. sleep(math.random(800, 1500))
  87.  
  88. Self.SayToNpc("yes")
  89.  
  90. sleep(math.random(800, 1500))
  91.  
  92. Self.WithdrawMoney((45*(MaxHealth-Self.ItemCount(266))))
  93.  
  94. sleep(math.random(800, 1500))
  95.  
  96. Self.SayToNpc("yes")
  97.  
  98. Walker.Start()
  99.  
  100. end
  101. end
  102.  
  103.  
  104. elseif label == "gotoMistrock" then
  105. wait(900, 1200)
  106. setWalkerEnabled(false)
  107. Self.SayToNpc({"hi","mistrock", "yes"}, 65)
  108. wait(900, 1200)
  109. setWalkerEnabled(true)
  110.  
  111. elseif label == "gotoYalahar" then
  112. wait(900, 1200)
  113. setWalkerEnabled(false)
  114. Self.SayToNpc({"hi","yalahar", "yes"}, 65)
  115. wait(900, 1200)
  116. setWalkerEnabled(true)
  117.  
  118. elseif (labelName == "Deposit") then
  119. Walker.Stop()
  120. Self.ReachDepot()
  121. Self.DepositItems({9657, 1}, {11480, 1}, {5878, 1}, {11472, 1}, {3358, 1}, {3056, 1}, {3430, 1}, {3054, 1}, {3299, 1}, {3410, 1}, {3354, 1}, {3286, 1}, {9689, 1}, {11479, 1}, {3376, 1}, {3264, 1}, {3378, 1}, {11453, 1}, {3426, 1}, {3273, 1}, {3336, 1}, {3274, 1}, {3412, 1}, {3268, 1}, {3355, 1}, {3277, 1}, {3552, 1}, {3577, 1})
  122. wait(1000)
  123. Self.WithdrawItems(1, {268, 0,(MaxMana-Self.ItemCount(268))})
  124. if (LogoutStamina) and (Self.Stamina() < 960) then
  125. Walker.Stop()
  126. else
  127. Walker.Start()
  128. end
  129.  
  130. elseif (labelName == "ResetBPs") then
  131. setWalkerEnabled(false)
  132. Self.CloseContainers()
  133. Self.OpenMainBackpack(true):OpenChildren({GoldBp, true}, {LootBp, true})
  134. setWalkerEnabled(true)
  135. end
  136. end
  137.  
  138. ----------------------- Functions ----------------------
  139. function BuyItems(item, count) -- item = item id, count = how many you want to buy up to
  140. wait(900, 1200)
  141. if (Self.ItemCount(item) < count) then
  142. Self.ShopBuyItem(item, (count-Self.ItemCount(item)))
  143. wait(200, 500)
  144. end
  145. end
  146.  
  147. Self.ReachDepot = function (tries)
  148. local tries = tries or 3
  149. Walker.Stop()
  150. local DepotIDs = {3497, 3498, 3499, 3500}
  151. local DepotPos = {}
  152. for i = 1, #DepotIDs do
  153. local dps = Map.GetUseItems(DepotIDs[i])
  154. for j = 1, #dps do
  155. table.insert(DepotPos, dps[j])
  156. end
  157. end
  158. local function gotoDepot()
  159. local pos = Self.Position()
  160. print("Depots found: " .. tostring(#DepotPos))
  161. for i = 1, #DepotPos do
  162. location = DepotPos[i]
  163. Self.UseItemFromGround(location.x, location.y, location.z)
  164. wait(1000, 2000)
  165. if Self.DistanceFromPosition(pos.x, pos.y, pos.z) >= 1 then
  166. wait(5000, 6000)
  167. if Self.DistanceFromPosition(location.x, location.y, location.z) == 1 then
  168. Walker.Start()
  169. return true
  170. end
  171. else
  172. print("Something is blocking the path. Trying next depot.")
  173. end
  174. end
  175. return false
  176. end
  177.  
  178. repeat
  179. reachedDP = gotoDepot()
  180. if reachedDP then
  181. return true
  182. end
  183. tries = tries - 1
  184. sleep(100)
  185. print("Attempt to reach depot was unsuccessfull. " .. tries .. " tries left.")
  186. until tries <= 0
  187.  
  188. return false
  189. end
  190.  
  191. Map.GetUseItems = function (id)
  192. if type(id) == "string" then
  193. id = Item.GetID(id)
  194. end
  195. local pos = Self.Position()
  196. local store = {}
  197. for x = -7, 7 do
  198. for y = -5, 5 do
  199. if Map.GetTopUseItem(pos.x + x, pos.y + y, pos.z).id == id then
  200. itemPos = {x = pos.x + x, y = pos.y + y, z = pos.z}
  201. table.insert(store, itemPos)
  202. end
  203. end
  204. end
  205. return store
  206. end
Advertisement
Add Comment
Please, Sign In to add comment