Advertisement
Guest User

Untitled

a guest
Jan 17th, 2020
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.01 KB | None | 0 0
  1. ---------------------------- ZMIENNE ---------------------------------
  2. ---- SUPPLE ----
  3. local manaPotionName = "Mana Potion"
  4. local manaPotionAmount = 2500
  5. local manaPotionLeaveAmount = 450
  6. local manaPotionID = Item.GetID(manaPotionName)
  7.  
  8. ---- SUPPLE ----
  9.  
  10. local supremeHealthPotionName = "Supreme Health Potion"
  11. local supremeHealthPotionAmount = 800
  12. local supremeHealthPotionLeaveAmount = 80
  13. local supremeHealthPotionID = Item.GetID(supremeHealthPotionName)
  14. ---- SUPPLE ----
  15.  
  16. local leaveCap = 300
  17. ---- SUPPLE ----
  18.  
  19. local mainBP = "Backpack"
  20. local lootBP = "Camouflage Backpack"
  21. local stackBP = "Beach Backpack"
  22. local suppliesBP = "Zaoan chess box"
  23. local supremeBP = "Brocade Backpack"
  24. ---- PLECAKI ----
  25.  
  26. ---- SORTOWANIE ----
  27. local MainBP = mainBP
  28. local potions = {manaPotionID}
  29. ---- SORTOWANIE ----
  30.  
  31. dropVials = true
  32. antySuppleStuck = true
  33.  
  34. local info = [[Prison by Sky
  35. Start: -> W PIZDZIE XD <-]]
  36. print(info)
  37.  
  38. Targeting.Start()
  39. Looter.Start()
  40.  
  41. ---------------------------- ZMIENNE ---------------------------------
  42.  
  43.  
  44. registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
  45.  
  46. function onWalkerSelectLabel(labelName)
  47.  
  48. ---------------------------- MISC ------------------------------
  49.  
  50.  
  51. if (labelName == "Start") then
  52. Walker.ConditionalGoto((Self.Position().z == 9), "BeginHunt", "ReachDepot")
  53.  
  54. elseif (labelName == "Checker") then
  55. Walker.ConditionalGoto((Self.ItemCount(healthPotionID) <= healthPotionLeaveAmount) or (Self.ItemCount(manaPotionID) <= manaPotionLeaveAmount or
  56. (Self.ItemCount(supremeHealthPotionID) <= supremeHealthPotionLeaveAmount) or (Self.Cap() < leaveCap)), "Leave", "BeginHunt")
  57.  
  58. elseif (labelName == "MiddleChecker") then
  59. Walker.ConditionalGoto((Self.ItemCount(healthPotionID) <= healthPotionLeaveAmount) or (Self.ItemCount(manaPotionID) <= manaPotionLeaveAmount or
  60. (Self.ItemCount(supremeHealthPotionID) <= supremeHealthPotionLeaveAmount) or (Self.Cap() < leaveCap)), "Leave", "MiddleRespawn")
  61.  
  62. elseif (labelName == "PotCheck") then
  63. Walker.ConditionalGoto((Self.ItemCount(healthPotionID) <= healthPotionLeaveAmount) or (Self.ItemCount(manaPotionID) <= manaPotionLeaveAmount or
  64. (Self.ItemCount(supremeHealthPotionID) <= supremeHealthPotionLeaveAmount) or (Self.Cap() < leaveCap)), "Exp", "Supplies")
  65.  
  66. elseif (labelName == "DepositItems") then
  67. Self.ReachDepot()
  68. Self.DepositItems()
  69.  
  70. elseif (labelName == "ResetBps") then
  71. Walker.Stop()
  72. Self.CloseContainers()
  73. Self.OpenMainBackpack(true):OpenChildren({suppliesBP, true}, {stackBP,true}, {lootBP,true}, {supremeBP,true})
  74. Container.GetFirst():Minimize()
  75. Walker.Start()
  76.  
  77. ---------------------------- MISC ------------------------------
  78.  
  79.  
  80.  
  81. ---------------------------- NPCS ------------------------------
  82.  
  83. elseif (labelName == "Supplies") then
  84. while (Self.ItemCount(manaPotionID) < manaPotionAmount) or (Self.ItemCount(healthPotionID) <= healthPotionAmount) or (Self.ItemCount(supremeHealthPotionID) <= supremeHealthPotionAmount) do
  85. Walker.Stop()
  86. if (Self.ItemCount(manaPotionID) < manaPotionAmount) or (Self.ItemCount(healthPotionID) <= healthPotionAmount) or (Self.ItemCount(supremeHealthPotionID) <= supremeHealthPotionAmount) then
  87. Self.SayToNpc({"hi", "flasks"}, 100)
  88. while (Self.ItemCount(FlaskID) >= 1) or (Self.ItemCount(FlaskIDA) >= 1) or (Self.ItemCount(FlaskIDB) >= 1) do
  89. Self.SayToNpc("yes", 100)
  90. end
  91. wait(2000)
  92. Self.SayToNpc("Trade", 100)
  93. wait(2000)
  94. while (Self.ItemCount(manaPotionID) < manaPotionAmount) do
  95. Self.ShopBuyItemsUpTo(manaPotionID, manaPotionAmount)
  96. wait(500,800)
  97. end
  98. end
  99. while (Self.ItemCount(healthPotionID) < healthPotionAmount) do
  100. Self.ShopBuyItemsUpTo(healthPotionID, healthPotionAmount)
  101. wait(500,800)
  102. end
  103. while (Self.ItemCount(supremeHealthPotionID) < supremeHealthPotionAmount) do
  104. Self.ShopBuyItemsUpTo(supremeHealthPotionID, supremeHealthPotionAmount)
  105. wait(500,800)
  106. end
  107. end
  108. Walker.Start()
  109.  
  110. elseif (labelName == "SellJewels") then
  111. setBotEnabled(false)
  112. Self.SayToNpc({"Hi", "Trade"}, 65)
  113. wait(1000,2000)
  114. local ITEMS_TO_SELL = {"Small Emerald","Small Ruby","Small Diamond","Small Amethyst","Black Pearl","White Pearl",
  115. "Blue Crystal Shard","Blue Crystal Splinter","Brown Crystal Splinter","Cyan Crystal Fragment",
  116. "Giant Shimmering Pearl","Gold Ingot","Green Crystal Fragment","Green Crystal Shard","Green Crystal Splinter",
  117. "Opal","Red Crystal Fragment","Small Enchanted Amethyst","Small Enchanted Emerald","Small Enchanted Ruby","Small Enchanted Sapphire",
  118. "Small Sapphire","Small Topaz","Tiger Eye","Violet Crystal Shard"}
  119. for _, ITEM in ipairs(ITEMS_TO_SELL) do
  120. Self.ShopSellAllItems(ITEM)
  121. wait(300, 500)
  122. end
  123. setBotEnabled(true)
  124. Self.SayToNpc("bye", 65)
  125. end
  126.  
  127. ------------------------- DEPOSITER ----------------------------
  128. Self.ReachDepot = function (tries)
  129. local tries = tries or 3
  130. Walker.Stop()
  131. local DepotIDs = {3497, 3498, 3499, 3500}
  132. local DepotPos = {}
  133. for i = 1, #DepotIDs do
  134. local dps = Map.GetUseItems(DepotIDs[i])
  135. for j = 1, #dps do
  136. table.insert(DepotPos, dps[j])
  137. end
  138. end
  139. local function gotoDepot()
  140. local pos = Self.Position()
  141. print("Depots found: " .. tostring(#DepotPos))
  142. for i = 1, #DepotPos do
  143. location = DepotPos[i]
  144. Self.UseItemFromGround(location.x, location.y, location.z)
  145. wait(1000, 2000)
  146. if Self.DistanceFromPosition(pos.x, pos.y, pos.z) >= 1 then
  147. wait(5000, 6000)
  148. if Self.DistanceFromPosition(location.x, location.y, location.z) == 1 then
  149. Walker.Start()
  150. return true
  151. end
  152. else
  153. print("Something is blocking the path. Trying next depot.")
  154. end
  155. end
  156. return false
  157. end
  158.  
  159. repeat
  160. reachedDP = gotoDepot()
  161. if reachedDP then
  162. return true
  163. end
  164. tries = tries - 1
  165. sleep(100)
  166. print("Attempt to reach depot was unsuccessfull. " .. tries .. " tries left.")
  167. until tries <= 0
  168.  
  169. return false
  170. end
  171.  
  172. Map.GetUseItems = function (id)
  173. if type(id) == "string" then
  174. id = Item.GetID(id)
  175. end
  176. local pos = Self.Position()
  177. local store = {}
  178. for x = -7, 7 do
  179. for y = -5, 5 do
  180. if Map.GetTopUseItem(pos.x + x, pos.y + y, pos.z).id == id then
  181. itemPos = {x = pos.x + x, y = pos.y + y, z = pos.z}
  182. table.insert(store, itemPos)
  183. end
  184. end
  185. end
  186. return store
  187. end
  188. ------------------------- DEPOSITER ----------------------------
  189.  
  190. --------------------- SORTOWANIE SUPPLI --------------------
  191.  
  192. --POTIONS
  193. Module.New("SortPotions", function()
  194. local bp1 = Container(MainBP)
  195. for spot, item in bp1:iItems() do
  196. if (table.contains(potions, item.id)) then
  197. bp1:MoveItemToContainer(spot, Container.New(suppliesBP):Index())
  198. break
  199. end
  200. end
  201. end)
  202.  
  203. --------------------- SORTOWANIE SUPPLI --------------------
  204. ----------------------- LOOTER OFF -------------------------
  205.  
  206. Module.New('LooterOnOff', function()
  207. local _lootCap = 80
  208. if (Self.Cap() <= _lootCap) then
  209. Looter.Stop()
  210. else
  211. Looter.Start()
  212. end
  213. end)
  214.  
  215. ----------------------- LOOTER OFF -------------------------
  216.  
  217. ----------------------- DROP VIALS -----------------------
  218.  
  219. Module.New('DropVials', function()
  220. if dropVials and Self.Cap() < 600 then
  221. pos = Self.Position()
  222. Self.DropFlasks(pos.x, pos.y, pos.z)
  223. end
  224. end)
  225.  
  226. end
  227. ----------------------- DROP VIALS -----------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement