Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.97 KB | None | 0 0
  1. -- Mana Potions --
  2.  
  3. local ManasToLeave = 100
  4. local WantedManas = 299
  5. local ManaPotID = 238
  6. local ManaCost = 50
  7. local UsingSoftboots = false
  8.  
  9. -- Health Potions --
  10.  
  11. local SuddenToLeave = 150
  12. local WantedSudden = 900
  13. local SuddenID = 3155
  14. local SuddenCost = 110
  15.  
  16. local AvaToLeave = 50
  17. local WantedAva = 150
  18. local AvaID = 3161
  19. local AvaCost = 45
  20. -- Other Options --
  21.  
  22.  
  23. local backpacks = {'golden backpack', 'buggy backpack', 'crown backpack'}
  24.  
  25.  
  26.  
  27. local MainBP = 2854
  28. local ItemBP = 2871
  29. local GoldBP = 14249
  30. local StackBP = 9605
  31. local SuppliesBP = 2872
  32. local RingBP = 3253
  33. local MinCap = 10
  34. local HideEquipment = true
  35.  
  36. -- Seller --
  37.  
  38. local itemID = 3028
  39. local item2ID = 3032
  40. local item3ID = 3033
  41. local item4ID = 3381
  42. local item5ID = 3382
  43. local item6ID = 3280
  44.  
  45. local item7ID = 3419
  46. local item8ID = 3381
  47. local item9ID = 3063
  48. local item10ID = 2958
  49.  
  50.  
  51. -- Floor Settings --
  52. local MaxAs = 19
  53. local SecondFloor = true
  54.  
  55. local sWE = setWalkerEnabled
  56. local swe = setWalkerEnabled
  57. Targeting.Start()
  58. Looter.Start()
  59.  
  60. --------------------------------------------------------------------
  61. --------------------------------------------------------------------
  62. --------------------------------------------------------------------
  63. --------------------------------------------------------------------
  64. --------------------------------------------------------------------
  65.  
  66.  
  67.  
  68. local info = [[]]
  69. wait(5000)
  70.  
  71. print([[
  72. --<By Sholhzeyz :D>--]])
  73. wait(3000)
  74.  
  75. -----------------------------------------------------------------------------------------------------------------------------------------
  76. function onWalkerSelectLabel(labelName)
  77. if (labelName == "Checker") then
  78. -- Check Supplies, Hunt or Leave
  79. Walker.ConditionalGoto((Self.ItemCount(ManaPotID) <= ManasToLeave) or (Self.ItemCount(SuddenID) <= SuddenToLeave) or (Self.ItemCount(AvaID) <= AvaToLeave), "Leave", "StartHunt")
  80.  
  81. elseif (labelName == "Venore") then
  82. setWalkerEnabled(false)
  83. delayWalker(5000)
  84. Self.Say("hi")
  85. sleep(math.random(700, 1400))
  86. Self.SayToNpc("venore") -- Tutaj wpisz wyspe na ktora sie udajesz.
  87. sleep(math.random(300, 1000))
  88. Self.SayToNpc("yes")
  89. setWalkerEnabled(true)
  90.  
  91. elseif (labelName == "Seller") then
  92. setWalkerEnabled(false)
  93. delayWalker(10000)
  94. Self.SayToNpc("hi")
  95. sleep(math.random(800, 1700))
  96. Self.SayToNpc("trade")
  97.  
  98. sleep(math.random(1000, 1500))
  99. Self.ShopSellItem(item5ID, Self.ShopGetItemSaleCount(item5ID))
  100. sleep(math.random(1000, 1500))
  101. Self.ShopSellItem(item6ID, Self.ShopGetItemSaleCount(item6ID))
  102. sleep(math.random(1000, 1500))
  103.  
  104. Self.ShopSellItem(item7ID, Self.ShopGetItemSaleCount(item7ID))
  105. sleep(math.random(1000, 1500))
  106. Self.ShopSellItem(item8ID, Self.ShopGetItemSaleCount(item8ID))
  107.  
  108. sleep(math.random(1000, 1500))
  109. Self.ShopSellItem(item9ID, Self.ShopGetItemSaleCount(item9ID))
  110.  
  111. sleep(math.random(1000, 1500))
  112. Self.ShopSellItem(item10ID, Self.ShopGetItemSaleCount(item10ID))
  113.  
  114. sleep(math.random(1000, 1500))
  115. setWalkerEnabled(true)
  116. elseif (labelName == "Seller Bank") then
  117. setWalkerEnabled(false)
  118. delayWalker(10000)
  119. Self.SayToNpc("hi")
  120. sleep(math.random(800, 1700))
  121. Self.SayToNpc("trade")
  122. sleep(math.random(1000, 1500))
  123. Self.ShopSellItem(itemID, Self.ShopGetItemSaleCount(itemID))
  124. sleep(math.random(1000, 1500))
  125. Self.ShopSellItem(item2ID, Self.ShopGetItemSaleCount(item2ID))
  126. sleep(math.random(1000, 1500))
  127.  
  128.  
  129. Self.ShopSellItem(item3ID, Self.ShopGetItemSaleCount(item3ID))
  130. sleep(math.random(1000, 1500))
  131. Self.ShopSellItem(item4ID, Self.ShopGetItemSaleCount(item4ID))
  132. sleep(math.random(1000, 1500))
  133.  
  134. setWalkerEnabled(true)
  135.  
  136. function SellItems(item)
  137. wait(300, 1700)
  138. Self.ShopSellItem(item, Self.ShopGetItemSaleCount(item))
  139. wait(900, 1200)
  140. end
  141.  
  142. elseif (labelName == "Asylum") then
  143. setWalkerEnabled(false)
  144. delayWalker(5000)
  145. Self.Say("hi")
  146. sleep(math.random(700, 1400))
  147. Self.SayToNpc("Asylum")
  148. sleep(math.random(300, 1000))
  149. Self.SayToNpc("yes")
  150. setWalkerEnabled(true)
  151.  
  152. elseif (labelName == "Edron") then
  153. setWalkerEnabled(false)
  154. delayWalker(5000)
  155. Self.Say("hi")
  156. sleep(math.random(700, 1400))
  157. Self.SayToNpc("Edron")
  158. sleep(math.random(300, 1000))
  159. Self.SayToNpc("yes")
  160. setWalkerEnabled(true)
  161.  
  162. elseif (labelName == "Oxidia") then
  163. setWalkerEnabled(false)
  164. delayWalker(5000)
  165. Self.Say("hi")
  166. sleep(math.random(700, 1400))
  167. Self.SayToNpc("Oxidia")
  168. sleep(math.random(300, 1000))
  169. Self.SayToNpc("yes")
  170. setWalkerEnabled(true)
  171.  
  172. elseif (labelName == "Deposit") then
  173. setWalkerEnabled(false)
  174. Self.ReachDepot()
  175. Self.DepositItems({237, 1}, {3032, 1}, {3027, 1}, {3026, 1}, {9057, 1})
  176. Self.DepositItems({3419, 0}, {3048, 0}, {3381, 0}, {2995, 0}, {3382, 0}, {3280, 0}, {3079, 0}, {3324, 0}, {7456, 0}, {8073, 0}, {3098, 0}, {3567, 0}, {3055, 0}, {820, 0}, {12304, 0})
  177. wait(1500,1900)
  178.  
  179. elseif (labelName == "Money") then
  180. setWalkerEnabled(false)
  181. delayWalker(5000)
  182. Self.Say("hi")
  183. sleep(math.random(700, 1400))
  184. Self.SayToNpc("deposit all")
  185. sleep(math.random(300, 1000))
  186. Self.SayToNpc("yes")
  187. setWalkerEnabled(true)
  188.  
  189. elseif (labelName == "Out") then
  190. swe(false)
  191. wait(500, 800)
  192. withdraw = 0
  193. withdraw = math.abs(withdraw + ((WantedManas - Self.ItemCount(ManaPotID)) * ManaCost))
  194. withdraw = math.abs(withdraw + ((WantedSudden - Self.ItemCount(SuddenID)) * SuddenCost))
  195. withdraw = math.abs(withdraw + ((WantedAva - Self.ItemCount(AvaID)) * AvaID))
  196. withdraw = withdraw + 2000
  197. Self.SayToNpc({'hi', 'withdraw ', tostring(withdraw) , 'yes'})
  198. wait(500, 800)
  199. swe(true)
  200.  
  201. wait(500, 800)
  202. buyPotions(ManaPotID, WantedManas)
  203. wait(500,800)
  204. buyPotions(AvaID, WantedAva)
  205. wait(500, 800)
  206.  
  207. elseif (labelName == "btaa") then
  208. swe(false)
  209. wait(500, 800)
  210. buyPotions(ManaPotID, WantedManas)
  211. wait(500, 800)
  212. buyPotions(UhpId, WantedUhp)
  213. wait(500, 800)
  214. swe(true)
  215. elseif (labelName == "Buy Ammo") then
  216. setWalkerEnabled(false)
  217. buyPotions(AmmoID, WantedAmmo)
  218. setWalkerEnabled(true)
  219.  
  220. elseif (labelName == "FullCheck") then
  221. if (Self.ItemCount(ManaPotID) < WantedManas) or (Self.Cap() < MinCap) or (Self.ItemCount(SuddenID) < WantedSudden) or (Self.ItemCount(AvaID) < WantedAva) then
  222. gotoLabel("Resupply")
  223. else
  224. gotoLabel("SkipSupplies")
  225. end
  226.  
  227. elseif (labelName == "on") then
  228. setTargetingEnabled(true)
  229. wait(1500)
  230. elseif (labelName == "off") then
  231. setTargetingEnabled(false)
  232. wait(100)
  233. elseif (labelName == "StopLoot") then
  234. setLooterEnabled(false)
  235. wait(500)
  236. elseif (labelName == "startLoot") then
  237. setLooterEnabled(true)
  238. wait(500)
  239. elseif (labelName == "yemeen") then
  240. setWalkerEnabled(false)
  241. delayWalker(500)
  242. Self.Step(EAST)
  243. wait(500)
  244. setWalkerEnabled(true)
  245.  
  246. elseif (labelName == "shemal") then
  247. setWalkerEnabled(false)
  248. delayWalker(500)
  249. Self.Step(WEST)
  250. wait(500)
  251. setWalkerEnabled(true)
  252.  
  253. elseif (labelName == "fo2") then
  254. setWalkerEnabled(false)
  255. delayWalker(500)
  256. Self.Step(NORTH)
  257. wait(500)
  258. setWalkerEnabled(true)
  259.  
  260. elseif (labelName == "ta7t") then
  261. setWalkerEnabled(false)
  262. delayWalker(500)
  263. Self.Step(SOUTH)
  264. wait(500)
  265. setWalkerEnabled(true)
  266.  
  267. elseif (labelName == "CheckSofts") then
  268. print("Checking Softs")
  269. delayWalker(3000)
  270. if (UsingSoftboots == true) and (Self.ItemCount(6530) >= 1) then
  271. gotoLabel("GoSofts")
  272. else
  273. gotoLabel("SkipSofts")
  274. end
  275.  
  276. elseif (labelName == "WithdrawSofts") then
  277. print("Withdrawing Soft Boots Money")
  278. Walker.Stop()
  279. Self.WithdrawMoney(11000)
  280. Walker.Start()
  281.  
  282. elseif (labelName == "RepairSofts") then
  283. Walker.Stop()
  284. Self.SayToNpc({"hi", "soft boots", "yes"}, 65)
  285. Walker.Start()
  286.  
  287. elseif (labelName == "tempo") then
  288. Self.Say("utito tempo")
  289. wait(100)
  290. elseif (labelName == "Ring") then
  291. setWalkerEnabled(false)
  292. Self.ReachDepot()
  293. if (Self.ItemCount(3098) < MaxAs) then
  294. repeat
  295. Self.WithdrawItems(2, {3098, 5, (MaxAs-Self.ItemCount(3098, 2))})
  296. wait(1500,1900)
  297. until (Self.ItemCount(3098) == MaxAs)
  298. end
  299.  
  300. elseif (labelName == "LeviUpW") then
  301. Walker.Stop()
  302. wait(500, 1000)
  303. Self.Turn(WEST)
  304. wait(500, 1000)
  305. Self.Say("Exani hur up")
  306. wait(2000, 2500)
  307. Walker.Start()
  308.  
  309. elseif (labelName == "LeviDownS") then
  310. Walker.Stop()
  311. wait(500, 1000)
  312. Self.Turn(SOUTH)
  313. wait(500, 1000)
  314. Self.Say("Exani hur down")
  315. wait(2000, 2500)
  316. Walker.Start()
  317.  
  318. elseif (labelName == "LeviDownE") then
  319. Walker.Stop()
  320. wait(500, 1000)
  321. Self.Turn(EAST)
  322. wait(500, 1000)
  323. Self.Say("Exani hur down")
  324. wait(2000, 2500)
  325. Walker.Start()
  326.  
  327. elseif (labelName == "LeviUpN") then
  328. Walker.Stop()
  329. wait(500, 1000)
  330. Self.Turn(NORTH)
  331. wait(500, 1000)
  332. Self.Say("Exani hur up")
  333. wait(2000, 2500)
  334. Walker.Start()
  335.  
  336. elseif (labelName == "DoorS") then
  337. setWalkerEnabled(false)
  338. wait(200)
  339. Self.OpenDoor(Self.Position().x, Self.Position().y + 1, Self.Position().z)
  340. wait(200)
  341. Self.OpenDoor(Self.Position().x, Self.Position().y + 1, Self.Position().z)
  342. setWalkerEnabled(true)
  343.  
  344. elseif (labelName == "DoorN") then
  345. setWalkerEnabled(false)
  346. wait(200)
  347. Self.OpenDoor(Self.Position().x, Self.Position().y - 1, Self.Position().z)
  348. wait(200)
  349. Self.OpenDoor(Self.Position().x, Self.Position().y - 1, Self.Position().z)
  350. setWalkerEnabled(true)
  351.  
  352. elseif (labelName == "DoorE") then
  353. setWalkerEnabled(false)
  354. wait(200)
  355. Self.OpenDoor(Self.Position().x + 1, Self.Position().y, Self.Position().z)
  356. wait(200)
  357. Self.OpenDoor(Self.Position().x + 1, Self.Position().y, Self.Position().z)
  358. setWalkerEnabled(true)
  359.  
  360. elseif (labelName == "DoorW") then
  361. setWalkerEnabled(false)
  362. wait(200)
  363. Self.OpenDoor(Self.Position().x - 1, Self.Position().y, Self.Position().z)
  364. wait(200)
  365. Self.OpenDoor(Self.Position().x - 1, Self.Position().y, Self.Position().z)
  366. setWalkerEnabled(true)
  367.  
  368. elseif (labelName == "OpenE") then
  369. Walker.Stop()
  370. Self.UseItemFromGround(Self.Position().x + 1, Self.Position().y, Self.Position().z)
  371. Walker.Start()
  372.  
  373. elseif (labelName == "OpenW") then
  374. Walker.Stop()
  375. Self.UseItemFromGround(Self.Position().x - 1, Self.Position().y, Self.Position().z)
  376. Walker.Start()
  377.  
  378. elseif (labelName == "OpenN") then
  379. Walker.Stop()
  380. Self.UseItemFromGround(Self.Position().x, Self.Position().y - 1, Self.Position().z)
  381. Walker.Start()
  382.  
  383. elseif (labelName == "OpenS") then
  384. Walker.Stop()
  385. Self.UseItemFromGround(Self.Position().x, Self.Position().y + 1, Self.Position().z)
  386. Walker.Start()
  387.  
  388.  
  389.  
  390. elseif (labelName == "Bp") then
  391. -- Reset Backpacks
  392. bpReseter()
  393. end
  394. end
  395.  
  396.  
  397. ----------------------- Functions ----------------------
  398.  
  399. function BuyItems(item, count) -- item = item id, count = how many you want to buy up to
  400. wait(900, 1200)
  401. if (Self.ItemCount(item) < count) then
  402. Self.ShopBuyItem(item, (count-Self.ItemCount(item)))
  403. wait(200, 500)
  404. end
  405. end
  406.  
  407. Self.ReachDepot = function (tries)
  408. local tries = tries or 3
  409. Walker.Stop()
  410. local DepotIDs = {3497, 3499, 3500}
  411. local DepotPos = {}
  412. for i = 1, #DepotIDs do
  413. local dps = Map.GetUseItems(DepotIDs[i])
  414. for j = 1, #dps do
  415. table.insert(DepotPos, dps[j])
  416. end
  417. end
  418.  
  419. local function gotoDepot()
  420. local pos = Self.Position()
  421. print("Ilosc znalezionych Depo: " .. tostring(#DepotPos))
  422. for i = 1, #DepotPos do
  423. location = DepotPos[i]
  424. Self.UseItemFromGround(location.x, location.y, location.z)
  425. wait(1000, 2000)
  426. if Self.DistanceFromPosition(pos.x, pos.y, pos.z) >= 1 then
  427. wait(5000, 6000)
  428. if Self.DistanceFromPosition(location.x, location.y, location.z) == 1 then
  429. Walker.Start()
  430. return true
  431. end
  432. else
  433. print("")
  434. end
  435. end
  436. return false
  437. end
  438.  
  439. repeat
  440. reachedDP = gotoDepot()
  441. if reachedDP then
  442. return true
  443. end
  444. tries = tries - 1
  445. sleep(100)
  446. print("")
  447. until tries <= 0
  448.  
  449. return false
  450. end
  451.  
  452. Map.GetUseItems = function (id)
  453. if type(id) == "string" then
  454. id = Item.GetID(id)
  455. end
  456. local pos = Self.Position()
  457. local store = {}
  458. for x = -7, 7 do
  459. for y = -5, 5 do
  460. if Map.GetTopUseItem(pos.x + x, pos.y + y, pos.z).id == id then
  461. itemPos = {x = pos.x + x, y = pos.y + y, z = pos.z}
  462. table.insert(store, itemPos)
  463. end
  464. end
  465. end
  466. return store
  467. end
  468.  
  469.  
  470.  
  471.  
  472. buyPotions = function(itemid, count) -- buying itemid upto count.
  473. sWE(false)
  474. print('Attempting to buy ' .. count .. ' ' .. Item.GetName(itemid) .. ' s.')
  475. if Self.ItemCount(itemid) < count then
  476. print('Buying ' .. count - Self.ItemCount(itemid) .. ' ' .. Item.GetName(itemid) .. '.')
  477. Self.SayToNpc({'hi', 'flasks', 'yes', 'yes', 'trade'})
  478. wait()
  479. repeat
  480. Self.ShopBuyItemsUpTo(itemid, count)
  481. until Self.ItemCount(itemid) >= count
  482. if Self.ItemCount(itemid >= count) then
  483. print('Buying successfull.')
  484. else
  485. print('Something went wrong.')
  486. errorLog('Something is wrong with potionsBuyer')
  487. end
  488. Self.SayToNpc('Bye')
  489. end
  490. sWE(true)
  491. end
  492.  
  493. bpReseter = function()
  494. swe(false)
  495. if #backpacks > 0 then
  496. repeat
  497. Self.CloseContainers()
  498. Self.OpenMainBackpack(true)
  499. for i = 1, #backpacks do
  500. Container(0):OpenChildren(backpacks[i])
  501. end
  502. until #Container.GetAll() == (#backpacks + 1)
  503. if #Container.GetAll() == (#backpacks + 1) then
  504. print('Reseting successful.')
  505. else
  506. print('Something went wrong.')
  507. end
  508. else
  509. print('Change config file. Array: backpacks is empty.')
  510. end
  511.  
  512. swe(true)
  513. end
  514.  
  515. registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement