Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------------
- --------Ediinsz WorkShop™--------
- ----Scripts By EdsonJunior-------
- ---------Divirta-se!-------------
- ---------------------------------
- ----------- BP SETUP ------------
- local GoldBP = "Brocade Backpack" --- Your gold backpack (use same colors inside)
- local LootBP = "Bag" --- Your loot backpack
- local StackBP = "Blue backpack" --- Your stack backpack
- ------ REFILL SETUP ------
- local MinMana = 10 --- How many mana potions until you leave the hunt.
- local MaxMana = 50 --- How many mana potions you begin the hunt with.
- local IDMana = 268 --- ID Mana Potion
- local CostMana = 50 --- Price Mana Potion
- local MinHealth = 0 --- How many health potions until you leave the hunt.
- local MaxHealth = 0 --- How many health potions you begin the hunt with.
- local IDHealth = 236 --- ID Health potion
- local CostHealth = 100 --- Price Health Potion
- local MinSd = 100
- local MaxSd = 3000
- local IDSd = Item.GetID("sudden death rune")
- ------- EXTRA SETTINGS ------
- local MinCap = 100 --- Leaves spawn when character reaches this cap.
- --------------------------------------------------------------------
- --------------------------------------------------------------------
- --------------------------------------------------------------------
- --------------------------------------------------------------------
- --------------------------------------------------------------------
- Targeting.Start()
- Looter.Start()
- registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
- print([[ !! VIDEO AULA !!
- -- XENOBOT 100% --
- \\ by EdsonJunior // ]])
- wait(5000)
- function onWalkerSelectLabel(labelName)
- -- Checar na hunt
- if (labelName == "Check") then
- Walker.ConditionalGoto((Self.Cap() <= MinCap) or
- (Self.ItemCount(IDMana) < MinMana) or
- (Self.ItemCount(IDHealth) < MinHealth) or
- (Self.ItemCount(IDSd) < MinSd), "City", "Hunt")
- -- Depositar e Retirar grana
- elseif (labelName == "Banco") then
- print([[Depositando e retirando para refillar]])
- local withdrawManas = math.max(MaxMana - Self.ItemCount(IDMana), 0)*CostMana
- local withdrawHealths = math.max(MaxHealth - Self.ItemCount(IDHealth), 0)*CostHealth
- local totalmoneyneeded = (withdrawManas + withdrawHealths)
- local MATHCEIL = (math.ceil((totalmoneyneeded)))
- Walker.Stop()
- Self.SayToNpc({"hi", "deposit all", "yes"}, 65)
- if (totalmoneyneeded > 0) then
- Self.SayToNpc({"withdraw " .. MATHCEIL, "yes"}, 65)
- end
- wait(2000)
- Walker.Start()
- -- Depositar no DP e Checar stamina
- elseif (labelName == "Depositer") then
- Walker.Stop()
- wait(1900,2400)
- Self.ReachDepot()
- Self.DepositItems({10308, 0}, {9668, 0})
- wait(2000)
- Self.DepositItems({3049, 1}, {8072, 1}, {3428, 1})
- wait(2000)
- if (Self.Stamina() <= 960) then
- Walker.Stop()
- print([[Stamina baixa, parando bot...]])
- else
- Walker.Start()
- print([[Stamina normal, continuando hunt...]])
- end
- -- Comprar Supplies
- elseif (labelName == "Shop") then
- Walker.Stop()
- print([[Comprando...]])
- if (Self.ItemCount(IDMana) < MaxMana) or (Self.ItemCount(IDHealth) < MaxHealth) then
- Self.SayToNpc({"hi", "flasks", "yes", "yes", "yes", "yes", "yes", "yes", "trade"}, 65)
- wait(2000)
- if (Self.ItemCount(IDMana) < MaxMana) then
- BuyItems(IDMana, MaxMana)
- wait(500)
- end
- if (Self.ItemCount(IDHealth) < MaxHealth) then
- BuyItems(IDHealth, MaxHealth)
- wait(500)
- end
- if (Self.ItemCount(IDSd) < MaxSd) then
- BuyItems(IDSd, MaxSd)
- wait(500)
- end
- wait(200, 500)
- end
- Walker.Start()
- -- Resetar Backpack (Colocar sempre depois do bank)
- elseif (labelName == "Backpacks") then
- Walker.Stop()
- print([[Resetando Backpacks...]])
- wait(1000,2000)
- Self.CloseContainers()
- wait(2000,3000)
- Self.OpenMainBackpack(true):OpenChildren({Item.GetID(GoldBP), true}, {Item.GetID(LootBP), true})
- wait(2000,3000)
- Walker.Start()
- 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
Advertisement