Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.79 KB | None | 0 0
  1. -- Mana Potions --
  2.  
  3. local ManasToLeave = 100 -- Z iloma manasami wracać
  4. local WantedManas = 500 -- Ile Manasow kupić
  5. local ManaPotID = 238 -- Mana Potion ID
  6. local ManaCost = 120 -- Mana Potion koszt
  7.  
  8. -- Ava --
  9.  
  10. local AmmoToLeave = 500 -- Z iloma ava wracać
  11. local WantedAmmo = 1500 -- Ile avakupić
  12. local AmmoID = 3161 -- ava ID
  13. local AmmoCost = 45 -- ava koszt
  14.  
  15. -- Health Potions --
  16.  
  17. local HealthToLeave = 100 -- Z iloma sdwracać
  18. local WantedHealth = 200 -- Ile sd Kupić
  19. local HealthPotID = 3155 -- sd ID
  20. local HealthCost = 108 -- Koszt sd
  21.  
  22. -- Other Options --
  23.  
  24. local MainBP = "Blue Backpack" -- ID plecaka glownego (holding)
  25. local PotsBP = "jewelled backpack" -- ID plecaka na kase (brocade)
  26. local SsaBP = "Pirate Backpack" -- ID plecaka glownego (holding)
  27. local RingiBP = "Beach Backpack" -- ID plecaka glownego (holding)
  28. local MinCap = 150 -- Od ilu Capa wracać
  29. local HideEquipment = true -- Zminimalizować EQ
  30.  
  31. -- Floor Settings --
  32.  
  33. local SecondFloor = true -- Tego nie zmieniajcie
  34.  
  35.  
  36. Targeting.Start()
  37. Looter.Start()
  38.  
  39. --------------------------------------------------------------------
  40. --------------------------------------------------------------------
  41. --------------------------------------------------------------------
  42. --------------------------------------------------------------------
  43. --------------------------------------------------------------------
  44.  
  45. registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
  46.  
  47. local info = [[]]
  48. wait(500)
  49.  
  50. print([[
  51. Targeting,Wtp na expa, teleport crystale, i Healing]])
  52. wait(1000)
  53.  
  54. -----------------------------------------------------------------------------------------------------------------------------------------
  55. function onWalkerSelectLabel(labelName)
  56.  
  57. if (labelName == "Checker") then
  58. if (Self.ItemCount(ManaPotID) <= ManasToLeave) or (Self.Cap() < MinCap) or (Self.ItemCount(HealthPotID) <= HealthToLeave) or (Self.ItemCount(AmmoID) <= AmmoToLeave) then
  59. gotoLabel("Leave")
  60. wait(200)
  61. Self.PrivateMessage("Zdupydomordy", "wypierdalaj do depo")
  62. wait(200)
  63. Self.PrivateMessage("Syrop", "wypierdalaj do depo")
  64. wait(200)
  65. else
  66. gotoLabel("StartHunt")
  67. end
  68.  
  69. elseif (labelName == "TravelGo") then
  70. setWalkerEnabled(false)
  71. delayWalker(5000)
  72. Self.Say("hi")
  73. sleep(math.random(700, 1400))
  74. Self.SayToNpc("wyspa na ktora chcesz plynanc") -- Tutaj wpisz wyspe na ktora sie udajesz.
  75. sleep(math.random(300, 1000))
  76. Self.SayToNpc("yes")
  77. setWalkerEnabled(true)
  78.  
  79. elseif (labelName == "TravelBack") then
  80. setWalkerEnabled(false)
  81. delayWalker(5000)
  82. Self.Say("hi")
  83. sleep(math.random(700, 1400))
  84. Self.SayToNpc("Wyspa powrotna") -- Tutaj wpisz wyspe powrotna
  85. sleep(math.random(300, 1000))
  86. Self.SayToNpc("yes")
  87. setWalkerEnabled(true)
  88.  
  89. elseif (labelName == "Deposit") then
  90. setWalkerEnabled(false)
  91. Self.ReachDepot()
  92. Self.DepositItems({3554, 0}, {7456, 0}, {821, 0}, {826, 0}, {7404, 0}, {7402, 0}, {827, 0}, {3320, 0}, {3019, 0}, {3324, 0}, {3051, 0}, {7402, 0}, {3428, 0}, {3416, 0}, {7404, 0}, {3364, 0}, {7399, 0}, {9056, 0}, {3364, 0}, {7368, 0}, {5741, 0}, {7427, 0}, {7419, 0}, {7412, 0}, {3567, 0}, {3098, 0}, {7388, 0}, {7418, 0}, {3324, 0}, {10438, 0}, {3360, 0}, {3392, 0}, {8057, 0}, {3342, 0}, {8061, 0}, {7386, 0}, {7407, 0}, {7416, 0}, {7421, 0}, {823, 0}, {6553, 0}, {6499, 0}, {5914, 0}, {9058, 0}, {7368, 0}) -- Tutaj dodajesz ID itemkow ktore ma odkładać do Depo a po przecinku backpack w kolejności od lewej strony 0 oznacza miejsce pierwsze a 1 miejsce 2, 2 to miejsce trzecie i tak dalej
  93. wait(1500,1900)
  94.  
  95. elseif (labelName == "Cash") then
  96. setWalkerEnabled(false)
  97. delayWalker(5000)
  98. Self.Say("hi")
  99. sleep(math.random(700, 1400))
  100. Self.SayToNpc("deposit all")
  101. sleep(math.random(300, 1000))
  102. Self.SayToNpc("yes")
  103. setWalkerEnabled(true)
  104.  
  105. elseif (labelName == "Withdraw") then
  106. setWalkerEnabled(false)
  107. delayWalker(5000)
  108. Self.SayToNpc("hi")
  109. sleep(math.random(700, 1400))
  110. Self.WithdrawMoney((ManaCost*(WantedManas-Self.ItemCount(ManaPotID))))
  111. sleep(math.random(700, 1400))
  112. Self.WithdrawMoney((HealthCost*(WantedHealth-Self.ItemCount(HealthPotID))))
  113. sleep(math.random(700, 1400))
  114. Self.WithdrawMoney((AmmoCost*(WantedAmmo-Self.ItemCount(AmmoID))))
  115. sleep(math.random(700, 1400))
  116. Self.WithdrawMoney(100)
  117. sleep(math.random(700, 1400))
  118. Self.SayToNpc("yes")
  119. setWalkerEnabled(true)
  120.  
  121. elseif (labelName == "Potions") then
  122. setWalkerEnabled(false)
  123. delayWalker(10000)
  124. Self.SayToNpc("hi")
  125. sleep(math.random(800, 1700))
  126. Self.SayToNpc("trade")
  127. sleep(math.random(2000, 2400))
  128. Self.ShopBuyItem(ManaPotID, (WantedManas-Self.ItemCount(ManaPotID)))
  129. sleep(math.random(2000, 2400))
  130. Self.ShopBuyItem(HealthPotID, (WantedHealth-Self.ItemCount(HealthPotID)))
  131. sleep(math.random(2000, 2400))
  132. Self.ShopBuyItem(AmmoID, (WantedAmmo-Self.ItemCount(AmmoID)))
  133. sleep(math.random(800, 1700))
  134. setWalkerEnabled(true)
  135.  
  136. elseif (labelName == "Ammo") then
  137. setWalkerEnabled(false)
  138. delayWalker(10000)
  139. Self.SayToNpc("hi")
  140. sleep(math.random(800, 1700))
  141. Self.SayToNpc("trade")
  142. sleep(math.random(2000, 2400))
  143. Self.ShopBuyItem(AmmoID, (WantedAmmo-Self.ItemCount(AmmoID)))
  144. sleep(math.random(2000, 2400))
  145. setWalkerEnabled(true)
  146.  
  147. elseif (labelName == "Sell") then
  148. setWalkerEnabled(false)
  149. delayWalker(10000)
  150. Self.SayToNpc("hi")
  151. sleep(math.random(800, 1700))
  152. Self.SayToNpc("trade")
  153. sleep(math.random(2000, 2400))
  154. Self.ShopSellItem(21165, Self.ShopGetItemSaleCount(21165))
  155. Self.ShopSellItem(21164, Self.ShopGetItemSaleCount(21164))
  156. Self.ShopSellItem(21167, Self.ShopGetItemSaleCount(21167))
  157. sleep(math.random(2000, 2400))
  158. setWalkerEnabled(true)
  159.  
  160. elseif (labelName == "FullCheck") then
  161. if (Self.ItemCount(ManaPotID) < WantedManas) or (Self.Cap() < MinCap) then
  162. gotoLabel("PreDeposit")
  163. else
  164. gotoLabel("LetsHunt")
  165. end
  166.  
  167. elseif (labelName == "ResetBp") then
  168. Walker.Stop()
  169.  
  170. Self.CloseContainers()
  171. Self.OpenMainBackpack(true):OpenChildren({MainBP, true}, {PotsBP, true}, {SsaBP, true}, {RingiBP, true})
  172. wait(200)
  173. if (HideEquipment) then
  174. Client.HideEquipment()
  175. wait(1000)
  176. end
  177. Walker.Start()
  178. end
  179. end
  180.  
  181.  
  182. ----------------------- Functions ----------------------
  183.  
  184. AmmoType = "avalanche rune"
  185. SuppliesContainer = "jewelled backpack"
  186. --[[ DO NOT EDIT ANYTHING BELOW THIS LINE ]]--
  187. AmmoTypeID = Item.GetID(AmmoType)
  188. Module('StackAmmo', function(mod)
  189. if (#Container.GetAll() >= 1) then
  190. if (Container(0):CountItemsOfID(AmmoTypeID) >=1) then
  191. for spot = Container(0):ItemCount()-1, 0, -1 do
  192. local item = Container(0):GetItemData(spot)
  193. if (item.id == AmmoTypeID) then
  194. Container(0):MoveItemToContainer(spot, Container.GetByName(SuppliesContainer):Index(), 0)
  195. break
  196. end
  197. end
  198. end
  199. end
  200. mod:Delay(1)
  201. end)
  202. Ammo1Type = "sudden death rune"
  203. SuppliesContainer = "jewelled backpack"
  204. --[[ DO NOT EDIT ANYTHING BELOW THIS LINE ]]--
  205. Ammo1TypeID = Item.GetID(Ammo1Type)
  206. Module('StackAmmo', function(mod)
  207. if (#Container.GetAll() >= 1) then
  208. if (Container(0):CountItemsOfID(Ammo1TypeID) >=1) then
  209. for spot = Container(0):ItemCount()-1, 0, -1 do
  210. local item = Container(0):GetItemData(spot)
  211. if (item.id == Ammo1TypeID) then
  212. Container(0):MoveItemToContainer(spot, Container.GetByName(SuppliesContainer):Index(), 0)
  213. break
  214. end
  215. end
  216. end
  217. end
  218. mod:Delay(1)
  219. end)
  220.  
  221. function SellItems(item) -- item = item ID
  222. wait(300, 1700)
  223. Self.ShopSellAllItem(item, Self.ShopGetItemSaleCount(item))
  224. wait(900, 1200)
  225. end
  226.  
  227. function BuyItems(item, count) -- item = item id, count = how many you want to buy up to
  228. wait(900, 1200)
  229. if (Self.ItemCount(item) < count) then
  230. Self.ShopBuyItem(item, (count-Self.ItemCount(item)))
  231. wait(200, 500)
  232. end
  233. end
  234.  
  235. Self.ReachDepot = function (tries)
  236. local tries = tries or 3
  237. Walker.Stop()
  238. local DepotIDs = {3497, 3498, 3499, 3500}
  239. local DepotPos = {}
  240. for i = 1, #DepotIDs do
  241. local dps = Map.GetUseItems(DepotIDs[i])
  242. for j = 1, #dps do
  243. table.insert(DepotPos, dps[j])
  244. end
  245. end
  246.  
  247. local function gotoDepot()
  248. local pos = Self.Position()
  249. print("Ilosc znalezionych Depo: " .. tostring(#DepotPos))
  250. for i = 1, #DepotPos do
  251. location = DepotPos[i]
  252. Self.UseItemFromGround(location.x, location.y, location.z)
  253. wait(1000, 2000)
  254. if Self.DistanceFromPosition(pos.x, pos.y, pos.z) >= 1 then
  255. wait(5000, 6000)
  256. if Self.DistanceFromPosition(location.x, location.y, location.z) == 1 then
  257. Walker.Start()
  258. return true
  259. end
  260. else
  261. print("To depo jest zajete, szukam dalej.")
  262. end
  263. end
  264. return false
  265. end
  266.  
  267. repeat
  268. reachedDP = gotoDepot()
  269. if reachedDP then
  270. return true
  271. end
  272. tries = tries - 1
  273. sleep(100)
  274. print("Nie udalo sie dotrzec do depo... " .. tries .. " szukam dalej.")
  275. until tries <= 0
  276.  
  277. return false
  278. end
  279.  
  280. Map.GetUseItems = function (id)
  281. if type(id) == "string" then
  282. id = Item.GetID(id)
  283. end
  284. local pos = Self.Position()
  285. local store = {}
  286. for x = -7, 7 do
  287. for y = -5, 5 do
  288. if Map.GetTopUseItem(pos.x + x, pos.y + y, pos.z).id == id then
  289. itemPos = {x = pos.x + x, y = pos.y + y, z = pos.z}
  290. table.insert(store, itemPos)
  291. end
  292. end
  293. end
  294. return store
  295. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement