Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------- ZMIENNE ---------------------------------
- ---- SUPPLE ----
- local manaPotionName = "Mana Potion"
- local manaPotionAmount = 2500
- local manaPotionLeaveAmount = 450
- local manaPotionID = Item.GetID(manaPotionName)
- ---- SUPPLE ----
- local supremeHealthPotionName = "Supreme Health Potion"
- local supremeHealthPotionAmount = 800
- local supremeHealthPotionLeaveAmount = 80
- local supremeHealthPotionID = Item.GetID(supremeHealthPotionName)
- ---- SUPPLE ----
- local leaveCap = 300
- ---- SUPPLE ----
- local mainBP = "Backpack"
- local lootBP = "Camouflage Backpack"
- local stackBP = "Beach Backpack"
- local suppliesBP = "Zaoan chess box"
- local supremeBP = "Brocade Backpack"
- ---- PLECAKI ----
- ---- SORTOWANIE ----
- local MainBP = mainBP
- local potions = {manaPotionID}
- ---- SORTOWANIE ----
- dropVials = true
- antySuppleStuck = true
- local info = [[Prison by Sky
- Start: -> W PIZDZIE XD <-]]
- print(info)
- Targeting.Start()
- Looter.Start()
- ---------------------------- ZMIENNE ---------------------------------
- registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
- function onWalkerSelectLabel(labelName)
- ---------------------------- MISC ------------------------------
- if (labelName == "Start") then
- Walker.ConditionalGoto((Self.Position().z == 9), "BeginHunt", "ReachDepot")
- elseif (labelName == "Checker") then
- Walker.ConditionalGoto((Self.ItemCount(healthPotionID) <= healthPotionLeaveAmount) or (Self.ItemCount(manaPotionID) <= manaPotionLeaveAmount or
- (Self.ItemCount(supremeHealthPotionID) <= supremeHealthPotionLeaveAmount) or (Self.Cap() < leaveCap)), "Leave", "BeginHunt")
- elseif (labelName == "MiddleChecker") then
- Walker.ConditionalGoto((Self.ItemCount(healthPotionID) <= healthPotionLeaveAmount) or (Self.ItemCount(manaPotionID) <= manaPotionLeaveAmount or
- (Self.ItemCount(supremeHealthPotionID) <= supremeHealthPotionLeaveAmount) or (Self.Cap() < leaveCap)), "Leave", "MiddleRespawn")
- elseif (labelName == "PotCheck") then
- Walker.ConditionalGoto((Self.ItemCount(healthPotionID) <= healthPotionLeaveAmount) or (Self.ItemCount(manaPotionID) <= manaPotionLeaveAmount or
- (Self.ItemCount(supremeHealthPotionID) <= supremeHealthPotionLeaveAmount) or (Self.Cap() < leaveCap)), "Exp", "Supplies")
- elseif (labelName == "DepositItems") then
- Self.ReachDepot()
- Self.DepositItems()
- elseif (labelName == "ResetBps") then
- Walker.Stop()
- Self.CloseContainers()
- Self.OpenMainBackpack(true):OpenChildren({suppliesBP, true}, {stackBP,true}, {lootBP,true}, {supremeBP,true})
- Container.GetFirst():Minimize()
- Walker.Start()
- ---------------------------- MISC ------------------------------
- ---------------------------- NPCS ------------------------------
- elseif (labelName == "Supplies") then
- while (Self.ItemCount(manaPotionID) < manaPotionAmount) or (Self.ItemCount(healthPotionID) <= healthPotionAmount) or (Self.ItemCount(supremeHealthPotionID) <= supremeHealthPotionAmount) do
- Walker.Stop()
- if (Self.ItemCount(manaPotionID) < manaPotionAmount) or (Self.ItemCount(healthPotionID) <= healthPotionAmount) or (Self.ItemCount(supremeHealthPotionID) <= supremeHealthPotionAmount) then
- Self.SayToNpc({"hi", "flasks"}, 100)
- while (Self.ItemCount(FlaskID) >= 1) or (Self.ItemCount(FlaskIDA) >= 1) or (Self.ItemCount(FlaskIDB) >= 1) do
- Self.SayToNpc("yes", 100)
- end
- wait(2000)
- Self.SayToNpc("Trade", 100)
- wait(2000)
- while (Self.ItemCount(manaPotionID) < manaPotionAmount) do
- Self.ShopBuyItemsUpTo(manaPotionID, manaPotionAmount)
- wait(500,800)
- end
- end
- while (Self.ItemCount(healthPotionID) < healthPotionAmount) do
- Self.ShopBuyItemsUpTo(healthPotionID, healthPotionAmount)
- wait(500,800)
- end
- while (Self.ItemCount(supremeHealthPotionID) < supremeHealthPotionAmount) do
- Self.ShopBuyItemsUpTo(supremeHealthPotionID, supremeHealthPotionAmount)
- wait(500,800)
- end
- end
- Walker.Start()
- elseif (labelName == "SellJewels") then
- setBotEnabled(false)
- Self.SayToNpc({"Hi", "Trade"}, 65)
- wait(1000,2000)
- local ITEMS_TO_SELL = {"Small Emerald","Small Ruby","Small Diamond","Small Amethyst","Black Pearl","White Pearl",
- "Blue Crystal Shard","Blue Crystal Splinter","Brown Crystal Splinter","Cyan Crystal Fragment",
- "Giant Shimmering Pearl","Gold Ingot","Green Crystal Fragment","Green Crystal Shard","Green Crystal Splinter",
- "Opal","Red Crystal Fragment","Small Enchanted Amethyst","Small Enchanted Emerald","Small Enchanted Ruby","Small Enchanted Sapphire",
- "Small Sapphire","Small Topaz","Tiger Eye","Violet Crystal Shard"}
- for _, ITEM in ipairs(ITEMS_TO_SELL) do
- Self.ShopSellAllItems(ITEM)
- wait(300, 500)
- end
- setBotEnabled(true)
- Self.SayToNpc("bye", 65)
- end
- ------------------------- DEPOSITER ----------------------------
- 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
- ------------------------- DEPOSITER ----------------------------
- --------------------- SORTOWANIE SUPPLI --------------------
- --POTIONS
- Module.New("SortPotions", function()
- local bp1 = Container(MainBP)
- for spot, item in bp1:iItems() do
- if (table.contains(potions, item.id)) then
- bp1:MoveItemToContainer(spot, Container.New(suppliesBP):Index())
- break
- end
- end
- end)
- --------------------- SORTOWANIE SUPPLI --------------------
- ----------------------- LOOTER OFF -------------------------
- Module.New('LooterOnOff', function()
- local _lootCap = 80
- if (Self.Cap() <= _lootCap) then
- Looter.Stop()
- else
- Looter.Start()
- end
- end)
- ----------------------- LOOTER OFF -------------------------
- ----------------------- DROP VIALS -----------------------
- Module.New('DropVials', function()
- if dropVials and Self.Cap() < 600 then
- pos = Self.Position()
- Self.DropFlasks(pos.x, pos.y, pos.z)
- end
- end)
- end
- ----------------------- DROP VIALS -----------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement