Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

[Problem] Xenobot


ZebekBochenek

Rekomendowane odpowiedzi

Opublikowano

Pobrałem dziś skrypt na yalahar , a konkretnie magicany . Jednak mam z nim mały problem . Gdy jest w banku , to chyba błędnie coś wylicza , bo mimo 200 mana potionow i 30 health potionow , bot wyplaca 3k , po czym idzie do sklepu i nic nie kupuje.

---------------------------------
-------Yalahar Magicians---------
----By Xiaospike & Joshwa534-----
-------Scripted by Kopper--------
------------Enjoy!!!-------------
---------------------------------
--------- BP SETUP ----------
-- [bP 1] - Main/Stackables
-- [bP 2] - Rares
-- [bP 3] - Gold
--------- DP SETUP ----------
-- [DP 1] - Everything :D
------ REFILL SETTINGS ------
local MinHealth = 10 --- How many health potions until you leave the hunt.
local MaxHealth = 30 --- How many health potions you begin the hunt with.
local MinMana = 50 --- How many mana potions until you leave the hunt.
local MaxMana = 200 --- How many mana potions you begin the hunt with.
------- HUNT SETTINGS --------
local GoldBP = 2871 --- Item ID of your gold backpack. (Default is brocade backpack)
local MinCap = 100 --- Leaves spawn when character reaches this cap.
local Hardcore = true --- Do you want to kill the pirestess?
------- EXTRA SETTINGS -------
local HideEquipment = true --- Do you want to minimize your equipment?
local LogoutStamina = true --- Do you want to logout at 16 hours? (Inside the depot)
--------------------------------------------------------------------
--------------------------------------------------------------------
--------------------------------------------------------------------
--------------------------------------------------------------------
--------------------------------------------------------------------
Targeting.Start()
Looter.Start()
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
print([[
Yalahar Magicians by Xiaospike & Joshwa534
Scripted by Kopper]])
wait(5000)
function onWalkerSelectLabel(labelName)
if (labelName == "Checker") then
Walker.ConditionalGoto((Self.Cap() < MinCap) or (Self.ItemCount(236) <= MinHealth) or (Self.ItemCount(268) <= MinMana) or ((LogoutStamina) and (Self.Stamina() < 840)), "Leave", "Hunt")
elseif (labelName == "Potions") then
Walker.Stop()
if (Self.ItemCount(268) < MaxMana) or (Self.ItemCount(236) < MaxHealth) then
Self.SayToNpc({"hi", "flasks", "yes", "yes", "yes", "yes", "yes", "yes", "trade"}, 65)
wait(2000)
if (Self.ItemCount(268) < MaxMana) then
BuyItems(268, MaxMana)
wait(500)
BuyItems(268, MaxMana)
wait(500)
end
if (Self.ItemCount(236) < MaxHealth) then
BuyItems(236, MaxHealth)
wait(500)
end
wait(200, 500)
end
Walker.Start()
elseif (labelName == "CheckStuff") then
Walker.ConditionalGoto((Self.ItemCount(236) < MaxHealth) or (Self.ItemCount(268) < MaxMana), "Resupply", "ToHunt")
elseif (labelName == "Bank") then
local withdrawManas = math.max(MaxMana - Self.ItemCount(268), 0)*50
local withdrawHealths = math.max(MaxHealth - Self.ItemCount(266), 0)*100
local totalmoneyneeded = (withdrawHealths + withdrawManas)
local MATHCEIL = (math.ceil((totalmoneyneeded/1000)))*1000
Walker.Stop()
Self.SayToNpc({"hi", "deposit all", "yes"}, 65)
if (totalmoneyneeded > 0) then
Self.SayToNpc({"withdraw " .. MATHCEIL, "yes", "balance"}, 65)
end
wait(2000)
Walker.Start()
elseif (labelName == "CheckHardcore") then
Walker.ConditionalGoto((Hardcore) and ((Self.Cap() > MinCap) and (Self.ItemCount(266) > MinHealth)), "Hardcore", "NoHardcore")
elseif (labelName == "Deposit") then
Walker.Stop()
Self.ReachDepot()
Self.DepositItems({12308,0},{7440,0},{3067,0},{3069,0},{3072,0},{3034,0},{3075,0},{9645,0},{3311,0},{9639,0},{3061,0},{237,0},{10303,0},{266,0},{2995,0},{678,0})
if (LogoutStamina) and (Self.Stamina() < 960) then
Walker.Stop()
else
Walker.Start()
end
elseif (labelName == "ResetBP") then
Walker.Stop()
Container.Close(GoldBP)
wait(1000)
Container.GetFirst():OpenChildren(GoldBP)
wait(1000)
Container.GetByName(GoldBP):Minimize()
if (HideEquipment) then
Client.HideEquipment()
wait(1000)
end
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)
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
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

 

 

Proszę o wskazanie błędu i w miarę możliwości poprawienie go , dziękuje .

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...