Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --------------
- --------------
- ----Scrypt--
- ------By:-
- ------Petos---
- ----------------
- --------- BP SETUP ----------
- --BP SETUP--
- local MainBp = "Golden Backpack" ----- Main Backpack
- local GoldBp = "Pirate Backpack" ---- Backpack to put gold in
- local LootBp = "Backpack" ------ Backpack to put loot in
- local StackBp = "Backpack" ------ Backpack to put stack in
- local HideEquipment = false -------- Set this true if you want to hide equipment (recommended for low resolutions)
- --------- DP SETUP ----------
- -- [DP 1] - bp na lota
- ------ REFILL SETTINGS ------
- local MinHealth = 25 --- Od ilu heal potów ma wracać z Hunta.
- local MaxHealth = 100 --- Z iloma potami ma zaczynac hunt.
- local MinMana = 45 --- Od ilu heal potów ma wracać z Hunta.
- local MaxMana = 270 --- Z iloma potami ma zaczynac hunt.
- ------- HUNT SETTINGS --------
- local GoldBP = 5949 --- id bp do którego ma chować gp (mozesz ustawic poprostu w lootingu numer bp ;p)
- local MinCap = 5-- ilość capa od której ma wracać do dp.
- ------- EXTRA SETTINGS -------
- local HideEquipment = true --- czy bot ma minimalizować eq.
- local LogoutStamina = true --- czy bot ma pójść do dp i sie wylogować jak bedzie miał 16 staminy.
- --------------------------------------------------------------------
- --------------------------------------------------------------------
- --------------------------------------------------------------------
- --------------------------------------------------------------------
- --------------------------------------------------------------------
- Targeting.Start()
- Looter.Start()
- registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
- print([[
- Scrypt
- By:
- Petos]])
- wait(5000)
- function onWalkerSelectLabel(labelName)
- if (labelName == "Checker") then
- Walker.ConditionalGoto((Self.ItemCount(266) <= MinHealth) or (Self.ItemCount(268) <= MinMana) or ((LogoutStamina) and (Self.Stamina() < 840)), "Leave", "Hunt")
- elseif (labelName == "Checker1") then
- Walker.ConditionalGoto((Self.ItemCount(266) <= MinHealth) or (Self.ItemCount(268) <= MinMana) or ((LogoutStamina) and (Self.Stamina() < 840)), "Leave", "Dalej")
- elseif (labelName == "Potions") then
- Walker.Stop()
- if (Self.ItemCount(268) < MaxMana) or (Self.ItemCount(266) < MaxHealth) then
- Self.SayToNpc({"hi", "flasks", "yes", "yes", "yes", "yes", "yes", "yes", "trade"}, 65)
- wait(2000)
- if (Self.ItemCount(268) < MaxMana) or (Self.ItemCount(266) < MaxHealth) then
- BuyItems(268, MaxMana)
- wait(500)
- BuyItems(266, MaxHealth)
- wait(500)
- end
- wait(200, 500)
- end
- Walker.Start()
- elseif (labelName == "CheckStuff") then
- Walker.ConditionalGoto((Self.ItemCount(268) < MaxMana) or (Self.ItemCount(266) < MaxHealth) , "Bank", "ToHunt")
- elseif (labelName == "Bank") then
- Walker.Stop()
- delayWalker(5000)
- Self.Say("hi")
- sleep(math.random(700, 1400))
- Self.WithdrawMoney((50*(MaxMana-Self.ItemCount(268))))
- sleep(math.random(800, 1500))
- Self.SayToNpc("yes")
- sleep(math.random(800, 1500))
- Self.WithdrawMoney((45*(MaxHealth-Self.ItemCount(266))))
- sleep(math.random(800, 1500))
- Self.SayToNpc("yes")
- Walker.Start()
- end
- end
- elseif label == "gotoMistrock" then
- wait(900, 1200)
- setWalkerEnabled(false)
- Self.SayToNpc({"hi","mistrock", "yes"}, 65)
- wait(900, 1200)
- setWalkerEnabled(true)
- elseif label == "gotoYalahar" then
- wait(900, 1200)
- setWalkerEnabled(false)
- Self.SayToNpc({"hi","yalahar", "yes"}, 65)
- wait(900, 1200)
- setWalkerEnabled(true)
- elseif (labelName == "Deposit") then
- Walker.Stop()
- Self.ReachDepot()
- Self.DepositItems({9657, 1}, {11480, 1}, {5878, 1}, {11472, 1}, {3358, 1}, {3056, 1}, {3430, 1}, {3054, 1}, {3299, 1}, {3410, 1}, {3354, 1}, {3286, 1}, {9689, 1}, {11479, 1}, {3376, 1}, {3264, 1}, {3378, 1}, {11453, 1}, {3426, 1}, {3273, 1}, {3336, 1}, {3274, 1}, {3412, 1}, {3268, 1}, {3355, 1}, {3277, 1}, {3552, 1}, {3577, 1})
- wait(1000)
- Self.WithdrawItems(1, {268, 0,(MaxMana-Self.ItemCount(268))})
- if (LogoutStamina) and (Self.Stamina() < 960) then
- Walker.Stop()
- else
- Walker.Start()
- end
- elseif (labelName == "ResetBPs") then
- setWalkerEnabled(false)
- Self.CloseContainers()
- Self.OpenMainBackpack(true):OpenChildren({GoldBp, true}, {LootBp, true})
- setWalkerEnabled(true)
- end
- end
- ----------------------- Functions ----------------------
- function BuyItems(item, count) -- item = item id, count = how many you want to buy up to
- wait(900, 1200)
- if (Self.ItemCount(item) < count) then
- Self.ShopBuyItem(item, (count-Self.ItemCount(item)))
- wait(200, 500)
- end
- end
- Self.ReachDepot = function (tries)
- local tries = tries or 3
- Walker.Stop()
- local DepotIDs = {3497, 3498, 3499, 3500}
- local DepotPos = {}
- for i = 1, #DepotIDs do
- local dps = Map.GetUseItems(DepotIDs[i])
- for j = 1, #dps do
- table.insert(DepotPos, dps[j])
- end
- end
- local function gotoDepot()
- local pos = Self.Position()
- print("Depots found: " .. tostring(#DepotPos))
- for i = 1, #DepotPos do
- location = DepotPos[i]
- Self.UseItemFromGround(location.x, location.y, location.z)
- wait(1000, 2000)
- if Self.DistanceFromPosition(pos.x, pos.y, pos.z) >= 1 then
- wait(5000, 6000)
- if Self.DistanceFromPosition(location.x, location.y, location.z) == 1 then
- Walker.Start()
- return true
- end
- else
- print("Something is blocking the path. Trying next depot.")
- end
- end
- return false
- end
- repeat
- reachedDP = gotoDepot()
- if reachedDP then
- return true
- end
- tries = tries - 1
- sleep(100)
- print("Attempt to reach depot was unsuccessfull. " .. tries .. " tries left.")
- until tries <= 0
- return false
- end
- Map.GetUseItems = function (id)
- if type(id) == "string" then
- id = Item.GetID(id)
- end
- local pos = Self.Position()
- local store = {}
- for x = -7, 7 do
- for y = -5, 5 do
- if Map.GetTopUseItem(pos.x + x, pos.y + y, pos.z).id == id then
- itemPos = {x = pos.x + x, y = pos.y + y, z = pos.z}
- table.insert(store, itemPos)
- end
- end
- end
- return store
- end
Advertisement
Add Comment
Please, Sign In to add comment