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

Xenobot NPC


szulcyk2kkk

Rekomendowane odpowiedzi

Opublikowano

Witam.

Sciągnołem dzis sobie xenobota i przeczytałem poradnik jak zrobic skrypt 100% afk. Wszystko ladnie idzie oprocz jedenej rzeczy. Nie rozmawia mi z NPC.

Wie ktoś o co może chodzic? Załacze wam jeszcze moje .lua

 

 

--------------
--------------
----Scrypt--
------By:-
------Petos---
----------------    
 
--------- BP SETUP ----------
-- [bP 1] - głowny bp
-- [bP 2] - bp na itemki
-- [bP 3] - gold (bp mozesz sobie dowolnie ustawic w lootingu)
 
--------- DP SETUP ----------
-- [DP 1] - bp na lota
 
------ REFILL SETTINGS ------
local MinHealth = 20 --- Od ilu heal potów ma wracać z Hunta.
local MaxHealth = 65  --- Z iloma potami ma zaczynac hunt.
------- HUNT SETTINGS --------
local GoldBP = 8860 --- id bp do którego ma chować gp (mozesz ustawic poprostu w lootingu numer bp ;p)
local MinCap = 50-- ilość capa od której ma wracać do dp.
------- EXTRA SETTINGS -------
local HideEquipment = false --- 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.Cap() < MinCap) or (Self.ItemCount(266) <= MinHealth) or ((LogoutStamina) and (Self.Stamina() < 840)), "Leave", "Hunt")
 
elseif (labelName == "Potions") then
Walker.Stop()
if (Self.ItemCount(268) < MaxHealth) then
Self.SayToNpc({"hi", "flasks", "yes", "yes", "yes", "yes", "yes", "yes", "trade"}, 65)
wait(2000)
if (Self.ItemCount(268) < MaxHealth) then
BuyItems(268, MaxHealth)
wait(500)
end
wait(200, 500)
end
Walker.Start()
 
elseif (labelName == "CheckStuff") then
Walker.ConditionalGoto((Self.ItemCount(268) < MaxHealth), "Bank", "ToHunt")
 
elseif (labelName == "Bank") then
local withdrawHealths = math.max(MaxHealth - Self.ItemCount(268), 0)*50
local totalmoneyneeded = (withdrawHealths - Self.ItemCount(285)*5)
local MATHCEIL = (totalmoneyneeded)
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 == "Deposit") then
        Walker.Stop()
        Self.ReachDepot()
Self.DepositItems({3322, 1}, {7430, 1}, {3071, 1}, {5877, 2}, {5920, 2}, {3416, 1}, {11457, 1}, {5922, 2}, {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, {266, 0,(MaxHealth-Self.ItemCount(266))})
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

Zarchiwizowany

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

×
×
  • Dodaj nową pozycję...