Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.35 KB | None | 0 0
  1.  
  2. --------------------
  3. ----- Setup By -----
  4. ----- jimmyebeat ------
  5. ---- Version 2.0 ---
  6. --------------------
  7. --- Last Update ----
  8. --- 21.02.2020 ------
  9. --------------------
  10.  
  11. --- Backpacks ---
  12. local MainBP = "Minotaur Backpack"
  13. local RingBP = "Grey Backpack"
  14. local SuppliesBP = "Orange Backpack"
  15. local LootBag = "Loot Bag"
  16. --- Ava ---
  17. local MaxHp = 1000
  18. local MinHp = 250
  19. local HpID = 3161
  20. local HpCost = 45
  21.  
  22. --- Mana Potions ---
  23. local MaxMp = 800
  24. local MinMp = 250
  25. local MpID = 'ultimate mana potion'
  26. local MpCost = 100
  27.  
  28. --- SD ---
  29. local MaxRunes = 50
  30. local MinRunes = 10
  31. local RunesID = 3155
  32. local RunesCost = 108
  33.  
  34. --- Cap ---
  35. local MinCap = 1
  36.  
  37. --- Deposit ---
  38. local RareDP = 0
  39. local StackDP = 0
  40.  
  41. --- Another Options ---
  42. local UseSoftsBoots = true
  43. local BootsID = 813
  44. local AutoResetBp = true
  45. local HideEquipment = false
  46. local StaminaLogout = true
  47. local CloseTibiaAfterFrag = true
  48.  
  49. --- Hunting Settings ---
  50. local RestoreMana = false
  51. local DropGold = false
  52. local DropVials = false
  53.  
  54. ----------------------------
  55. --- END OF CONFIGURATION ---
  56. ----------------------------
  57. ----------------------------
  58. --- IF U DONT KNOW HOW TO --
  59. --- DO NOT EDIT BELOW -----
  60. ----------------------------
  61. ----------------------------
  62. Targeting.Start()
  63.  
  64.  
  65. registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
  66. print([[Oramond Raid Ava]])
  67.  
  68. function onWalkerSelectLabel(labelName)
  69. if (labelName == "Checker") then
  70. if (Self.ItemCount(MpID) <= MinMp) or (Self.ItemCount(HpID) <= MinHp) then
  71. gotoLabel("Leave")
  72. else
  73. gotoLabel("StartHunt")
  74. end
  75.  
  76. elseif (labelName == "Bp") then
  77. Bp_Reset()
  78. if (HideEquipment) then
  79. Client.HideEquipment()
  80. end
  81.  
  82. elseif (labelName == "FullCheck") then
  83. if (Self.ItemCount(MpID) <= MaxMp - 50) or (Self.ItemCount(HpID) <= MaxHp - 10) or (Self.ItemCount(RunesID) <= MaxRunes - 10) then
  84. Walker.Goto("Resupply")
  85. else
  86. Walker.Goto("SkipSupplies")
  87. end
  88.  
  89. elseif (labelName == "CheckStamina") then
  90. setWalkerEnabled(false)
  91. if (Self.Stamina() < 900) and (StaminaLogout == true) then
  92. print([[Low stamina, Closing Tibia]])
  93. os.exit()
  94. else
  95. setWalkerEnabled(true)
  96. print([[Enough stamina, continue hunt..]])
  97. end
  98.  
  99.  
  100. elseif (labelName == "WithdrawSofts") then
  101. print("Withdrawing Soft Boots Money")
  102. Walker.Stop()
  103. Self.WithdrawMoney(25000)
  104. Walker.Start()
  105.  
  106. elseif (labelName == "RepairSofts") then
  107. Walker.Stop()
  108. Self.SayToNpc({"hi", "soft boots", "yes"}, 65)
  109. Walker.Start()
  110.  
  111. elseif (labelName == "CheckSofts") then
  112. delayWalker(500)
  113. if (UseSoftsBoots == true) and (Self.ItemCount(6530) >= 1) then
  114. gotoLabel("GoSofts")
  115. else
  116. gotoLabel("SkipSofts")
  117. end
  118.  
  119. elseif (labelName == "Potions") then
  120. setWalkerEnabled(false)
  121. Self.SayToNpc("Hi")
  122. wait(200)
  123. Self.SayToNpc("trade")
  124. wait(500)
  125. Self.ShopBuyItem(MpID, (MaxMp-Self.ItemCount(MpID)))
  126. wait(500)
  127. setWalkerEnabled(true)
  128.  
  129. elseif (labelName == "Runes") then
  130. setWalkerEnabled(false)
  131. Self.SayToNpc("Hi")
  132. wait(200)
  133. Self.SayToNpc("trade")
  134. wait(500)
  135. Self.ShopBuyItem(HpID, (MaxHp-Self.ItemCount(HpID)))
  136. wait(500)
  137. setWalkerEnabled(true)
  138.  
  139.  
  140.  
  141. elseif (labelName == "Sell1") then
  142. setWalkerEnabled(false)
  143. delayWalker(500)
  144. Self.SayToNpc("hi")
  145. sleep(math.random(800, 1700))
  146. Self.SayToNpc("trade")
  147. sleep(math.random(2000, 2400))
  148. Self.ShopSellItem(21170, Self.ShopGetItemSaleCount(21170))
  149. Self.ShopSellItem(21172, Self.ShopGetItemSaleCount(21172))
  150. Self.ShopSellItem(21178, Self.ShopGetItemSaleCount(21178))
  151. Self.ShopSellItem(21168, Self.ShopGetItemSaleCount(21168))
  152. Self.ShopSellItem(21183, Self.ShopGetItemSaleCount(21183))
  153. Self.ShopSellItem(21165, Self.ShopGetItemSaleCount(21165))
  154. Self.ShopSellItem(21179, Self.ShopGetItemSaleCount(21179))
  155. Self.ShopSellItem(21180, Self.ShopGetItemSaleCount(21180))
  156. Self.ShopSellItem(21164, Self.ShopGetItemSaleCount(21164))
  157. Self.ShopSellItem(21167, Self.ShopGetItemSaleCount(21167))
  158. Self.ShopSellItem(21171, Self.ShopGetItemSaleCount(21171))
  159. Self.ShopSellItem(21169, Self.ShopGetItemSaleCount(21169))
  160. sleep(math.random(2000, 2400))
  161. setWalkerEnabled(true)
  162.  
  163. elseif (labelName == "Sell2") then
  164. setWalkerEnabled(false)
  165. delayWalker(500)
  166. Self.SayToNpc("hi")
  167. sleep(math.random(800, 1700))
  168. Self.SayToNpc("trade")
  169. sleep(math.random(2000, 2400))
  170. Self.ShopSellItem(21196, Self.ShopGetItemSaleCount(21196))
  171. Self.ShopSellItem(21197, Self.ShopGetItemSaleCount(21197))
  172. Self.ShopSellItem(21193, Self.ShopGetItemSaleCount(21193))
  173. sleep(math.random(2000, 2400))
  174. setWalkerEnabled(true)
  175.  
  176.  
  177. elseif (labelName == "Sell3") then
  178. setWalkerEnabled(false)
  179. delayWalker(500)
  180. Self.SayToNpc("hi")
  181. sleep(math.random(800, 1700))
  182. Self.SayToNpc("trade")
  183. sleep(math.random(2000, 2400))
  184. Self.ShopSellItem(9057, Self.ShopGetItemSaleCount(9057))
  185. Self.ShopSellItem(3032, Self.ShopGetItemSaleCount(3032))
  186. Self.ShopSellItem(3030, Self.ShopGetItemSaleCount(3030))
  187. Self.ShopSellItem(3028, Self.ShopGetItemSaleCount(3028))
  188. Self.ShopSellItem(3033, Self.ShopGetItemSaleCount(3033))
  189. Self.ShopSellItem(16124, Self.ShopGetItemSaleCount(16124))
  190. Self.ShopSellItem(16120, Self.ShopGetItemSaleCount(16120))
  191. sleep(math.random(2000, 2400))
  192. setWalkerEnabled(true)
  193.  
  194.  
  195. end
  196. end
  197.  
  198.  
  199.  
  200. ----------------------- Functions ----------------------
  201. local Bps = {}
  202.  
  203. if MainBP then
  204. table.insert(Bps,MainBP)
  205. end
  206. if RingBP then
  207. table.insert(Bps,RingBP)
  208. end
  209. if SuppliesBP then
  210. table.insert(Bps,SuppliesBP)
  211. end
  212.  
  213. if LootBag then
  214. table.insert(Bps,LootBag)
  215. end
  216.  
  217. function UseGround(x, y, z)
  218. wait(200)
  219. Self.UseItemFromGround(x, y, z)
  220. wait(500)
  221. end
  222.  
  223. function Door(x, y, z)
  224. wait(200)
  225. Self.OpenDoor(x, y, z)
  226. wait(250)
  227. end
  228.  
  229. function Lever(direction)
  230. pos = Self.Position()
  231. if direction == "east" then
  232. UseGround(pos.x+1, pos.y, pos.z)
  233. elseif direction == "south" then
  234. UseGround(pos.x, pos.y+1, pos.z)
  235. elseif direction == "west" then
  236. UseGround(pos.x-1, pos.y, pos.z)
  237. elseif direction == "north" then
  238. UseGround(pos.x, pos.y-1, pos.z)
  239. end
  240. end
  241.  
  242. function Door(x, y, z)
  243. wait(200)
  244. Self.OpenDoor(x, y, z)
  245. wait(250)
  246. end
  247.  
  248. function CheckPosition(x, y, z, FalseLabel)
  249. pos = Self.Position()
  250. if pos.x == x and pos.y == y and pos.z == z then
  251. else
  252. print("Repeat")
  253. Walker.Goto(FalseLabel)
  254. end
  255. end
  256.  
  257.  
  258. function Bp_Reset()
  259. Walker.Stop()
  260. local tries = 3
  261. local n = #Bps
  262. Self.CloseContainers()
  263. local allgoodie = false
  264. wait(600,800)
  265. Self.OpenMainBackpack()
  266. wait(600,800)
  267. local main = Container(0)
  268. main:Minimize()
  269. wait(600,1000)
  270.  
  271. while tries > 0 and (not allgoodie) do
  272. for i = 1, n do
  273. main:OpenChildren(Bps[i])
  274. wait(600,800)
  275. local cont = Container(Bps[i])
  276. cont:Minimize()
  277. if cont:ID() ~= Item.GetID(Bps[i]) then
  278. print("Could not find "..Bps[i]..', trying again. Tries left : '..tries)
  279. allgoodie = false
  280. break
  281. else allgoodie = true
  282. end
  283. end
  284. tries = tries-1
  285. end
  286.  
  287. if allgoodie then Walker.Start()
  288. else print('Could not find all backpacks, stoping walker...')
  289. end
  290. end
  291.  
  292. function ManaPercent()
  293. return math.ceil((Self.Mana()/Self.MaxMana()*100))
  294. end
  295.  
  296. Module.New("Mana Restore", function(module)
  297. if (ManaPercent() < 85) and (#Self.GetTargets(8) == 0) and (Self.ItemCount(MpID) > 0) and RestoreMana then
  298. setWalkerEnabled(false)
  299. while (ManaPercent() < 85) and (#Self.GetTargets(8) == 0) and (Self.ItemCount(MpID) > 0) do
  300. Self.UseItemWithMe(MpID)
  301. wait(500,700)
  302. end
  303. setWalkerEnabled(true)
  304. end
  305. module:Delay(500)
  306. end,RestoreMana)
  307. Module.New("DropGold", function(module)
  308. if DropGold and (Self.Cap() <= MinCap + 50) then
  309. delayWalker(500)
  310. Self.DropItem(Self.Position().x, Self.Position().y, Self.Position().z, 3031, 100)
  311. end
  312. module:Delay(3000)
  313. end)
  314. Module.New("Drop vials", function(module)
  315. if (DropVials) and Self.Cap() < MinCap + 60 then
  316. Self.DropFlasks(Self.Position().x, Self.Position().y, Self.Position().z)
  317. end
  318. module:Delay(10000, 15000)
  319. end)
  320. Module.New("Sort Supplies", function(module)
  321. local bp1 = Container(MainBP)
  322. for i = bp1:ItemCount() -1, 0, -1 do
  323. local id = bp1:GetItemData(i).id
  324. if id == MpID or id == HpID or id == RunesID then
  325. bp1:MoveItemToContainer(i, Container(SuppliesBP):Index())
  326. wait(600,800)
  327. end
  328. end
  329. module:Delay(800)
  330. end)
  331.  
  332. function BuyItems(item, count)
  333. wait(900, 1200)
  334. if (Self.ItemCount(item) < count) then
  335. Self.ShopBuyItem(item, (count-Self.ItemCount(item)))
  336. wait(200, 500)
  337. end
  338. end
  339.  
  340. function SellItems(item) -- item = item ID
  341. wait(300, 1700)
  342. Self.ShopSellItem(item, Self.ShopGetItemSaleCount(item))
  343. wait(900, 1200)
  344. end
  345.  
  346. Self.ReachDepot = function (tries)
  347. local tries = tries or 3
  348. Walker.Stop()
  349. local DepotIDs = {3497, 3499, 3500}
  350. local DepotPos = {}
  351. for i = 1, #DepotIDs do
  352. local dps = Map.GetUseItems(DepotIDs[i])
  353. for j = 1, #dps do
  354. table.insert(DepotPos, dps[j])
  355. end
  356. end
  357.  
  358. local function gotoDepot()
  359. local pos = Self.Position()
  360. print("Ilosc znalezionych Depo: " .. tostring(#DepotPos))
  361. for i = 1, #DepotPos do
  362. location = DepotPos[i]
  363. Self.UseItemFromGround(location.x, location.y, location.z)
  364. wait(1000, 2000)
  365. if Self.DistanceFromPosition(pos.x, pos.y, pos.z) >= 1 then
  366. wait(5000, 6000)
  367. if Self.DistanceFromPosition(location.x, location.y, location.z) == 1 then
  368. Walker.Start()
  369. return true
  370. end
  371. else
  372. print("")
  373. end
  374. end
  375. return false
  376. end
  377.  
  378. repeat
  379. reachedDP = gotoDepot()
  380. if reachedDP then
  381. return true
  382. end
  383. tries = tries - 1
  384. sleep(100)
  385. print("")
  386. until tries <= 0
  387.  
  388. return false
  389. end
  390.  
  391. if(RestoreMana) then
  392. Module.Start('Mana Restore')
  393. end
  394.  
  395. Map.GetUseItems = function (id)
  396. if type(id) == "string" then
  397. id = Item.GetID(id)
  398. end
  399. local pos = Self.Position()
  400. local store = {}
  401. for x = -7, 7 do
  402. for y = -5, 5 do
  403. if Map.GetTopUseItem(pos.x + x, pos.y + y, pos.z).id == id then
  404. itemPos = {x = pos.x + x, y = pos.y + y, z = pos.z}
  405. table.insert(store, itemPos)
  406. end
  407. end
  408. end
  409. return store
  410. end
  411.  
  412. Module.New("Backpacks", function(module)
  413. if #Container.GetAll() < 3 and (AutoResetBp) then
  414. Cavebot.Stop()
  415. Bp_Reset()
  416. Cavebot.Start()
  417. end
  418. module:Delay(5000)
  419. end)
  420.  
  421. local function getSpot(to)
  422. local cont = Container(to)
  423. for i=0, cont:ItemCount()-1 do
  424. if (not Item.isContainer(cont:GetItemData(i).id)) then
  425. local slot = i
  426. return slot
  427. end
  428. end
  429. return 0
  430. end
  431.  
  432. GenericTextMessageProxy.New("Unjusted"):OnReceive(function (proxy, message)
  433. local frag = string.match(message, "Warning! The murder of (.+) was not justified.")
  434. if frag and (CloseTibiaAfterFrag == true) then
  435. os.exit()
  436. end
  437. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement