Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ CONFIG ]]--
- mainBP = "backpack of holding"
- lootBP = "zaoan chess box"
- goldBP = "red backpack"
- manaID = 268 -- Mana Potion ID, Leave as is.
- manaCost = 50 -- Cost of the Mana Potion
- minManas = 150 -- Less than this amount, Bot will go refill.
- maxManas = 400 -- Amount of Mana Potions to buy up to at Shop.
- healthID = 239 -- Mana Potion ID, Leave as is.
- healthCost = 190 -- Cost of the Mana Potion
- minHealths = 10 -- Less than this amount, Bot will go refill.
- maxHealths = 22 -- Amount of Mana Potions to buy up to at Shop.
- minCap = 300 ---- if less then script will exit spawn
- dropEmpties = false
- useTp = false
- print("#Yolo #Swag")
- registerEventListener(WALKER_SELECTLABEL, "onLabel")
- function onLabel(label)
- if label == "Bp Reset" then
- setWalkerEnabled(false)
- Self.CloseContainers() wait(500,750)
- wait(500, 900)
- while Self.OpenMainBackpack():OpenChildren(lootBP, goldBP) do
- wait(500,750)
- end
- if #Container.GetIndexes() < 3 then
- gotoLabel("Start")
- end
- setWalkerEnabled(true)
- elseif label == "Bank" then
- if not(Self.Position().x == 33014 and Self.Position().y == 31492 and Self.Position().z == 10) then
- gotoLabel("beforeBank")
- end
- setWalkerEnabled(false)
- Self.SayToNpc({'hi','deposit all','yes','withdraw ' .. ((maxManas-Self.ItemCount(manaID)) * manaCost)+((maxHealths-Self.ItemCount(healthID)) * healthCost),'yes','balance'},65)
- setWalkerEnabled(true)
- elseif label == "Shop" then
- setWalkerEnabled(false)
- Self.SayToNpc({'hi','flasks','yes'},65)
- while Self.ItemCount(284) > 0 or Self.ItemCount(285) > 0 do
- Self.SayToNpc('yes')
- wait(200, 500)
- end
- Self.SayToNpc({'hi','trade'},70)
- wait(200, 500)
- if Self.ItemCount(manaID) < maxManas then
- Self.ShopBuyItem (manaID, maxManas - Self.ItemCount(manaID))
- wait(700,1000)
- end
- if Self.ItemCount(healthID) < maxHealths then
- Self.ShopBuyItem(healthID, maxHealths - Self.ItemCount(healthID))
- wait(500, 900)
- end
- setWalkerEnabled(true)
- elseif label == "Bp Reset2" then
- setWalkerEnabled(false)
- Self.CloseContainers() wait(500,750)
- wait(500, 900)
- while Self.OpenMainBackpack():OpenChildren(lootBP, goldBP) do
- wait(500,750)
- end
- if #Container.GetIndexes() < 3 then
- gotoLabel("beforePots")
- end
- setWalkerEnabled(true)
- elseif label == "useLever" then
- if not(Self.Position().x == 33061 and Self.Position().y == 31527 and Self.Position().z == 10) then
- gotoLabel("goHunt")
- end
- setBotEnabled(false)
- for i = 1,2 do
- Self.UseLever(33062, 31527, 10)
- wait(1000, 1500)
- end
- setBotEnabled(true)
- elseif label == "checkTp" then
- if not(Self.Position().x == 32995 and Self.Position().y == 31553 and Self.Position().z == 4) then
- gotoLabel("useLever")
- end
- if useTp == false then
- gotoLabel("contWalk")
- end
- elseif label == "useLever2" then
- if not(Self.Position().x == 32991 and Self.Position().y == 31539 and Self.Position().z == 4) then
- gotoLabel("contTp")
- end
- setBotEnabled(false)
- for i = 1, 2 do
- Self.UseLever(32992, 31539, 4)
- wait(1000, 1500)
- end
- setBotEnabled(true)
- elseif label == "afterExani" then
- if not(Self.Position().x == 33008 and Self.Position().y == 31554 and Self.Position().z == 4) then
- gotoLabel("contWalk")
- end
- elseif label == "afterExani2" then
- if not(Self.Position().x == 33027 and Self.Position().y == 31549 and Self.Position().z == 6) then
- gotoLabel("beforeExani")
- end
- elseif label == "Check" then
- if (Self.Cap() > minCap and Self.ItemCount(manaID) > minManas and Self.ItemCount(healthID) > minHealths) then
- gotoLabel("Spawn")
- end
- if (Self.Position().z == 7 and Self.Cap() > minCap and Self.ItemCount(manaID) > minManas and Self.ItemCount(healthID) > minHealths) then
- gotoLabel("beforeHunt")
- end
- elseif label == "afterExani3" then
- if not(Self.Position().x == 33026 and Self.Position().y == 31549 and Self.Position().z == 5) then
- gotoLabel("beforeExani2")
- end
- elseif label == "useLever3" then
- if not(Self.Position().x == 32993 and Self.Position().y == 31547 and Self.Position().z == 4) then
- gotoLabel("contWalk3")
- end
- setBotEnabled(false)
- for i = 1, 2 do
- Self.UseLever(32994, 31547, 4)
- wait(1000, 1500)
- end
- setBotEnabled(true)
- elseif label == "Bank2" then
- if not(Self.Position().x == 33013 and Self.Position().y == 31492 and Self.Position().z == 10) then
- gotoLabel("beforeBank3")
- end
- setWalkerEnabled(false)
- Self.SayToNpc({'hi','deposit all','yes','balance'},65)
- setWalkerEnabled(true)
- elseif label == "Depot" then
- setWalkerEnabled(false)
- Self.ReachDepot()
- Self.DepositItems({3032, 0}, {10328, 0}, {10279, 0}, {3556, 1}, {281, 0}, {282, 0})
- wait(850,1250)
- end
- end
- Module.New('vial-dropper', function()
- if dropEmpties == true and Self.Cap() < minCap then
- wait(150,300)
- Self.DropFlasks(Self.Position().x, Self.Position().y, Self.Position().z)
- end
- 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
- Self.ReachDepot = function (tries)
- local tries = tries or 3
- setWalkerEnabled(false)
- 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
- setWalkerEnabled(true)
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement