Advertisement
Guest User

Untitled

a guest
Mar 28th, 2020
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.17 KB | None | 0 0
  1. ---------------------------- ZMIENNE ---------------------------------
  2. ---- SUPPLE ----
  3. local manaPotionName = "Mana Potion"
  4. local manaPotionAmmount = 200
  5. local manaPotionLeaveAmmount = 100
  6. local manaPotionID = Item.GetID(manaPotionName)
  7.  
  8. local healthPotionName = "Supreme Health Potion"
  9. local healthPotionAmount = 50
  10. local healthPotionLeaveAmmount = 35
  11. local healthPotionID = Item.GetID(healthPotionName)
  12. ---- SUPPLE ----
  13.  
  14. ---- PLECAKI ----
  15. local rashidBP = "Grey Backpack"
  16. local suppliesBP = "Purple Backpack"
  17. local stackBP = "Camouflage Backpack"
  18. local greenBP = "Green Backpack"
  19. local blueBP = "Blue Backpack"
  20. ---- PLECAKI ----
  21.  
  22. ---- SORTOWANIE ----
  23. local Items = {manaPotionID, healthPotionID}
  24. local MainBP = "Backpack"
  25. local suppleBP = "Purple Backpack"
  26. ---- SORTOWANIE ----
  27.  
  28. --- PRYWATNE WIADOMOSCI ---
  29. local title = "Prywatne wiadomosci:"
  30. local showTitle = true
  31. local messageCount = 4
  32. local messageLength = 60
  33. local location =
  34. {
  35. x = 0,
  36. y = 250
  37. }
  38. local colors =
  39. {
  40. message = {95, 247, 247},
  41. title = {225, 225, 225},
  42. }
  43. local HUDData = {}
  44. --- PRYWATNE WIADOMOSCI ---
  45.  
  46. --- SOFTY ---
  47. local Mana = 5000000 -- Ilosc many od ktorej zalozyc softy
  48. --- SOFTY ---
  49.  
  50. dropVials = true
  51.  
  52. local Info = [[~~~~ROSHAMUUL - LOWER [EK], made by Sasyia~~~~
  53. Start Yalahar Depot +1]]
  54. print(Info)
  55.  
  56. ---------------------------- ZMIENNE ---------------------------------
  57.  
  58. registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
  59.  
  60. function onWalkerSelectLabel(labelName)
  61.  
  62. ---------------------------- MISC ------------------------------
  63.  
  64.  
  65. if (labelName == "Start") then
  66. Walker.ConditionalGoto((Self.Position().z == 9), "BeginHunt", "ReachDepot")
  67.  
  68. elseif (labelName == "Checker") then
  69. Walker.ConditionalGoto((Self.ItemCount(healthPotionID) <= healthPotionLeaveAmmount) or (Self.ItemCount(manaPotionID) <= manaPotionLeaveAmmount), "Leave", "BeginHunt")
  70.  
  71. elseif (labelName == "Checker1") then
  72. Walker.ConditionalGoto((Self.ItemCount(healthPotionID) <= healthPotionLeaveAmmount) or (Self.ItemCount(manaPotionID) <= manaPotionLeaveAmmount), "Leave", "Continue1")
  73.  
  74. elseif (labelName == "Checker2") then
  75. Walker.ConditionalGoto((Self.ItemCount(healthPotionID) <= healthPotionLeaveAmmount) or (Self.ItemCount(manaPotionID) <= manaPotionLeaveAmmount), "Leave", "Continue2")
  76.  
  77. elseif (labelName == "Checker3") then
  78. Walker.ConditionalGoto((Self.ItemCount(healthPotionID) <= healthPotionLeaveAmmount) or (Self.ItemCount(manaPotionID) <= manaPotionLeaveAmmount), "Leave", "Continue3")
  79.  
  80. elseif (labelName == "DepositItems") then
  81. Self.ReachDepot()
  82. Self.DepositItems()
  83.  
  84. elseif (labelName == "ResetBps") then
  85. Walker.Stop()
  86. Self.CloseContainers()
  87. Self.OpenMainBackpack(true):OpenChildren({suppliesBP, true}, {stackBP,true}, {greenBP, true}, {blueBP,true}, {rashidBP,true})
  88. Container.GetFirst():Minimize()
  89. Walker.Start()
  90.  
  91. elseif (labelName == "YalaShipDoors") then
  92. Walker.Stop()
  93. Self.UseDoor(32817, 31275, 6, close)
  94. Walker.Start()
  95.  
  96. elseif (labelName == "SellVials") then
  97. setBotEnabled(false)
  98. Self.SayToNpc({"Hi", "Trade"}, 65)
  99. wait(1000,2000)
  100. local ITEMS_TO_SELL = {285}
  101. for _, ITEM in ipairs(ITEMS_TO_SELL) do
  102. Self.ShopSellAllItems(ITEM)
  103. wait(300, 500)
  104. end
  105. setBotEnabled(true)
  106. Self.SayToNpc("bye", 65)
  107.  
  108. elseif (labelName == "Jewels") then
  109. setBotEnabled(false)
  110. Self.SayToNpc({"Hi", "Trade"}, 65)
  111. wait(1000,2000)
  112. local ITEMS_TO_SELL = {"Blue Crystal Shard","Blue Crystal Splinter","Brown Crystal Splinter","Cyan Crystal Fragment",
  113. "Gold Ingot","Green Crystal Fragment","Green Crystal Shard","Green Crystal Splinter",
  114. "Red Crystal Fragment","Small Sapphire","Violet Crystal Shard"}
  115. for _, ITEM in ipairs(ITEMS_TO_SELL) do
  116. Self.ShopSellAllItems(ITEM)
  117. wait(300, 500)
  118. end
  119. setBotEnabled(true)
  120. Self.SayToNpc("bye", 65)
  121.  
  122. ---------------------------- MISC ------------------------------
  123.  
  124. ---------------------------- NPCS ------------------------------
  125.  
  126. elseif (labelName == "Supplies") then
  127. Walker.Stop()
  128. if (Self.ItemCount(manaPotionID) < manaPotionAmmount) or (Self.ItemCount(healthPotionID) <= healthPotionLeaveAmmount) then
  129. Self.SayToNpc({"hi", "flasks"}, 100)
  130. while (Self.ItemCount(FlaskID) >= 1) or (Self.ItemCount(FlaskIDA) >= 1) or (Self.ItemCount(FlaskIDB) >= 1) do
  131. Self.SayToNpc("yes", 100)
  132. end
  133. wait(2000)
  134. Self.SayToNpc("Trade", 100)
  135. wait(2000)
  136. while (Self.ItemCount(manaPotionID) < manaPotionAmmount) do
  137. Self.ShopBuyItemsUpTo(manaPotionID, manaPotionAmmount)
  138. wait(500,800)
  139. end
  140. while (Self.ItemCount(healthPotionID) < healthPotionAmount) do
  141. Self.ShopBuyItemsUpTo(healthPotionID, healthPotionAmount)
  142. wait(500,800)
  143. end
  144. end
  145. Walker.Start()
  146.  
  147. ---------------------------- NPCS ------------------------------
  148.  
  149. elseif (labelName == "DropJewels") then
  150. Walker.Stop()
  151. Self.DropItems(33244,32474,6,"Small Emerald","Small Ruby","Small Diamond","Small Amethyst","Black Pearl","White Pearl",
  152. "Blue Crystal Shard","Blue Crystal Splinter","Brown Crystal Splinter","Cyan Crystal Fragment",
  153. "Giant Shimmering Pearl","Gold Ingot","Green Crystal Fragment","Green Crystal Shard","Green Crystal Splinter",
  154. "Opal","Red Crystal Fragment","Small Enchanted Amethyst","Small Enchanted Emerald","Small Enchanted Ruby","Small Enchanted Sapphire",
  155. "Small Sapphire","Small Topaz","Tiger Eye","Violet Crystal Shard", 1)
  156. Walker.Start()
  157.  
  158. --------------------------- TRAVELS ----------------------------
  159.  
  160. elseif (labelName == "Rosha") then
  161. if(Self.Position().x == 33494 and Self.Position().y == 32567 and Self.Position().z == 7) then
  162. sleep(2000)
  163. Self.SayToNpc({"hi","roshamuul","yes"}, 100)
  164. if (Self.Position().x == 32310 and Self.Position().y == 32210 and Self.Position().z == 6) then
  165. Walker.Start()
  166. end
  167. end
  168.  
  169. elseif (labelName == "Thais") then
  170. if(Self.Position().x == 32309 and Self.Position().y == 32207 and Self.Position().z == 6) then
  171. sleep(2000)
  172. Self.SayToNpc({"hi","thais","yes"}, 100)
  173. if (Self.Position().x == 33494 and Self.Position().y == 32567 and Self.Position().z == 7) then
  174. Walker.Start()
  175. end
  176. end
  177.  
  178. elseif (labelName == "Yala") then
  179. if(Self.Position().x == 32309 and Self.Position().y == 32207 and Self.Position().z == 6) then
  180. sleep(2000)
  181. Self.SayToNpc({"Hi","yalahar","yes"}, 1000)
  182. if (Self.Position().x == 32816 and Self.Position().y == 31272 and Self.Position().z == 6) then
  183. Walker.Start()
  184. end
  185. end
  186. --------------------------- TRAVELS ----------------------------
  187.  
  188. elseif(labelName == "CheckRosha") then
  189. if (Self.Position().x == 32309 and Self.Position().y == 32208 and Self.Position().z == 6) then
  190. gotoLabel("Thais")
  191. end
  192.  
  193. elseif(labelName == "CheckYala") then
  194. if (Self.Position().x == 32309 and Self.Position().y == 32208 and Self.Position().z == 6) then
  195. gotoLabel("Yala")
  196. end
  197.  
  198. elseif(labelName == "CheckThais") then
  199. if (Self.Position().x == 33495 and Self.Position().y == 32566 and Self.Position().z == 7) then
  200. gotoLabel("Rosha")
  201. end
  202. end
  203. end
  204.  
  205. ------------------------- DEPOSITER ----------------------------
  206.  
  207. Self.ReachDepot = function (tries)
  208. local tries = tries or 3
  209. Walker.Stop()
  210. local DepotIDs = {3497, 3498, 3499, 3500}
  211. local DepotPos = {}
  212. for i = 1, #DepotIDs do
  213. local dps = Map.GetUseItems(DepotIDs[i])
  214. for j = 1, #dps do
  215. table.insert(DepotPos, dps[j])
  216. end
  217. end
  218. local function gotoDepot()
  219. local pos = Self.Position()
  220. print("Depots found: " .. tostring(#DepotPos))
  221. for i = 1, #DepotPos do
  222. location = DepotPos[i]
  223. Self.UseItemFromGround(location.x, location.y, location.z)
  224. wait(1000, 2000)
  225. if Self.DistanceFromPosition(pos.x, pos.y, pos.z) >= 1 then
  226. wait(5000, 6000)
  227. if Self.DistanceFromPosition(location.x, location.y, location.z) == 1 then
  228. Walker.Start()
  229. return true
  230. end
  231. else
  232. print("Something is blocking the path. Trying next depot.")
  233. end
  234. end
  235. return false
  236. end
  237.  
  238. repeat
  239. reachedDP = gotoDepot()
  240. if reachedDP then
  241. return true
  242. end
  243. tries = tries - 1
  244. sleep(100)
  245. print("Attempt to reach depot was unsuccessfull. " .. tries .. " tries left.")
  246. until tries <= 0
  247. return false
  248. end
  249.  
  250. Map.GetUseItems = function (id)
  251. if type(id) == "string" then
  252. id = Item.GetID(id)
  253. end
  254. local pos = Self.Position()
  255. local store = {}
  256. for x = -7, 7 do
  257. for y = -5, 5 do
  258. if Map.GetTopUseItem(pos.x + x, pos.y + y, pos.z).id == id then
  259. itemPos = {x = pos.x + x, y = pos.y + y, z = pos.z}
  260. table.insert(store, itemPos)
  261. end
  262. end
  263. end
  264. return store
  265. end
  266. ------------------------- DEPOSITER ----------------------------
  267.  
  268. ---------------------- WYWALANIE SMIECI -------------------------
  269. Module.New('itemdrop', function(mod)
  270. mainBP = Container.New(0)
  271. local DROP_ITEMS = {"empty potion flask"}
  272. local pos = Self.Position()
  273. if mainBP:isOpen() then
  274. for spot, item in mainBP:iItems() do
  275. if table.find(DROP_ITEMS, Item.GetName(item.id)) then
  276. mainBP:MoveItemToGround(spot, pos.x, pos.y, pos.z)
  277. end
  278. end
  279. end
  280. end)
  281.  
  282. ----------------------- WYWALANIE SMIECI ------------------------
  283.  
  284. --------------------- SORTOWANIE SUPPLI --------------------
  285.  
  286. Module.New("Sort Supplies", function()
  287. local bp1 = Container(MainBP)
  288. for spot, item in bp1:iItems() do
  289. if (table.contains(Items, item.id)) then
  290. bp1:MoveItemToContainer(spot, Container.New(suppleBP):Index())
  291. break
  292. end
  293. end
  294. end)
  295.  
  296. --------------------- SORTOWANIE SUPPLI --------------------
  297.  
  298. --------------------- PRYWATNE WIADOMOSCI --------------------
  299.  
  300. if (showTitle == true) then
  301. local HUDTitle = HUD.CreateTextDisplay(location.x, location.y, title, unpack(colors.title))
  302. location.y = location.y + 20
  303. end
  304.  
  305. for index = 1, messageCount do
  306. local data = {}
  307. data.message = ""
  308. data.label = HUD.CreateTextDisplay(
  309. location.x,
  310. location.y + ((index - 1) * 12),
  311. data.message,
  312. unpack(colors.message)
  313. )
  314. HUDData[index] = data
  315. end
  316.  
  317. PrivateMessageProxy.OnReceive("pmProxy", function (proxy, speaker, level, text)
  318. local message = speaker .. " [" .. level .. "]: " .. text
  319. if (string.len(message) > messageLength) then
  320. message = string.sub(message, 0, messageLength - 3) .. "..."
  321. end
  322. for index = 1, messageCount-1 do
  323. HUDData[index].message = HUDData[index+1].message
  324. HUDData[index].label:SetText(HUDData[index].message)
  325. end
  326. HUDData[messageCount].message = message
  327. HUDData[messageCount].label:SetText(message)
  328. end)
  329.  
  330. --------------------- PRYWATNE WIADOMOSCI --------------------
  331.  
  332. --------------------- ZAKLADANIE SOFTOW --------------------
  333.  
  334. Module.New("SoftSwitcher", function(Softs)
  335. if (Self.Feet().id ~= 3549) and (Self.ItemCount(6529) >= 1) and (Self.Mana() <= Mana) and (Self.isInPz() == false) then
  336. Self.Equip(6529, "feet")
  337. end
  338. Softs:Delay(200 * math.random(3,15))
  339. end)
  340.  
  341. --------------------- ZAKLADANIE SOFTOW --------------------
  342.  
  343. ----------------------- LOOTER OFF -------------------------
  344.  
  345. Module.New('LooterOnOff', function()
  346. local _lootCap = 120
  347. if (Self.Cap() <= _lootCap) then
  348. Looter.Stop()
  349. else
  350. Looter.Start()
  351. end
  352. end)
  353.  
  354. ----------------------- LOOTER OFF -------------------------
  355.  
  356. Module.New('DropVials', function()
  357. if dropVials and Self.Cap() < 300 then
  358. pos = Self.Position()
  359. Self.DropFlasks(pos.x, pos.y, pos.z)
  360. end
  361. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement