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 - szykbie pytanie


ppqz

Rekomendowane odpowiedzi

Opublikowano

Witam, w zasadzie to mam kilka pytań:

1. Czy jest skrypt na niszczenie korytek? (prosił bym o link lub o podanie go)

2. Jak ustawić w skrypcie, aby bot korzystał z dowolnego BP? - tj przy resecie BP otwiera tylko te BP, które ma napisane a innych nie (skrypt niżej)

A chodzi o to, że korzystam z jednego skryptu i każda ma inne BP i ciągle muszę zmieniać w lua nazwy tych BP co jest denerwujące

3. Ciągle mam problem ze sprzedawaniem itemów tj, nwm jak poprawnie napisać to w lua, ma ktoś jakiegoś gotowca, którego z łatwością przerobię ?

4. Dlaczego bot nie zawsze otwiera wszstkie BP? np na początku otworzy, idzie do DP, patrzę jest na huncie i nie ma wszystkich otwartch a jak zaznaczę w walkerze ResetBP to normalnie wszystkie otwiera

oto .lua co do tych BP:

------ REFILL SETTINGS ------
local LeaveMana = 50 --- How many mana potions until you leave the hunt?
local BuyMana = 300 --- How many mana potions you begin the hunt with?
 
local LeaveHealth = 10 --- How many health potions until you leave the hunt?
local BuyHealth = 30 --- How many health potions you begin the hunt with?
 
local AmmoName = "Spear" --- What ammunition are you using?
local LeaveAmmo = 10 --- How much ammunition until you leave hunt?
local BuyAmmo = 50 --- How much ammunition do you begin the hunt with?
local AmmoCost = 10 --- What is the cost of your selected ammunition?
 
local LeaveCap = 200 --- Leaves spawn when character reaches this cap.
local HideEquipment = true --- Do you want to minimize your equipment?
local LogoutStamina = true --- Do you want to logout at 16 hours? (Inside the depot)
 
-- Item ID's, if you don't want to use SHP and SMP, change these:
 
local ManaName = "Mana Potion" 
local ManaCost = 50
local HealthName = "Great Health Potion" 
local HealthCost = 190
 
-- Backpack Configuration:
 
local LootBP = "Beach Backpack"
local GoldBP = "Backpack"
 
-- Spawn Options
 
local HuntMiddle = false
 
-- Here I'm gonna get the item ids, leave this as it is.
 
local ManaID = Item.GetID(ManaName)
local HealthID = Item.GetID(HealthName)
local AmmoID = Item.GetID(AmmoName)
 
-- These are the flask IDs, not worth changing since it will sell all flasks regardless of type.
local FlaskID = 283
local FlaskIDA = 284
local FlaskIDB = 285
 
-- local GoldBP = 5801 --- Item ID of your gold backpack.
 
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
 
function onWalkerSelectLabel(labelName)
if (labelName == "Checker") then
-- Check Supplies, Hunt or Leave
Walker.ConditionalGoto((Self.ItemCount(ManaID) <= LeaveMana) or (Self.Cap() < LeaveCap) or (Self.ItemCount(HealthID) <= LeaveHealth), "Leave", "BeginHunt")
 
elseif (labelName == "Start") then
Walker.ConditionalGoto((Self.Position().z == 11), "BeginHunt", "ReachDepot")
 
elseif (labelName == "DepositGold") then
-- Deposit Gold, check balance.
Walker.Stop()
Self.SayToNpc({"hi", "deposit all", "yes"}, 100)
 
local withdrawManas = math.max(BuyMana - Self.ItemCount(ManaID), 0)*ManaCost
local withdrawHealths = math.max(BuyHealth - Self.ItemCount(HealthID), 0)*HealthCost
local withdrawAmmo = math.max(BuyAmmo - Self.ItemCount(AmmoID), 0)*AmmoCost
local total = math.abs(withdrawManas + withdrawHealths + withdrawAmmo)
 
if total >= 1 then
Self.SayToNpc({"withdraw " .. total, "yes", "balance"}, 100)
end
Walker.Start()
 
elseif (labelName == "DepositItems") then
-- Deposit Items
Walker.Stop()
Self.ReachDepot(5)
Self.DepositItems({5882, 1}, {3028, 1}, {3029, 1}, {5948, 1}, {11457, 1}, {5920, 1}, {5877, 1}, {3061, 1})
Self.DepositItems({3386, 0}, {3392, 0}, {7402, 0}, {7399, 0}, {3428, 0}, {3416, 0}, {3280, 0}, {3071, 0}, {7430, 0}, {3322, 0})
Walker.Start()
 
elseif (labelName == "BuyManas") then
-- Buy Mana Potions
Walker.Stop()
if (Self.ItemCount(ManaID) < BuyMana) or (Self.ItemCount(HealthID) < BuyHealth) then
print("Buying manas or healths")
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(ManaID) < BuyMana) do
Self.ShopBuyItemsUpTo(ManaID, BuyMana)
wait(500,800)
end
if (Self.ItemCount(HealthID) < BuyHealth) then
Self.ShopBuyItemsUpTo(HealthID, BuyHealth)
wait(500)
end
wait(200, 500)
end
Walker.Start()
 
elseif (labelName == "CheckGoneUp") then
-- Check we're on floor 3
Walker.ConditionalGoto((Self.Position().z == 7), "OpenSouth", "Leave")
 
elseif (labelName == "CheckGoneDown") then
-- Check we're on floor 7
Walker.ConditionalGoto((Self.Position().z == 11), "AmDown", "EnterResp")
 
elseif (labelName == "BuySpears") then
--------------------------------- TODO -------------------------
Walker.Stop()
Self.SayToNpc({"hi", "trade"}, 100)
-- Buy spears, make sure Self.ItemCount returns items in hands.
while (Self.ItemCount(AmmoID) < BuyAmmo) do
Self.ShopBuyItemsUpTo(AmmoID, BuyAmmo)
wait(500,800)
end
Walker.Start()
 
elseif (labelName == "ResetBps") then
-- Reset Backpacks
Walker.Stop()
Self.CloseContainers()
Self.OpenMainBackpack(true):OpenChildren({LootBP, true}, {GoldBP, true})
Container.GetFirst():Minimize()
Walker.Start()
 
elseif (labelName == "OpenNorth") then
Walker.Stop()
Self.UseItemFromGround(Self.Position().x, Self.Position().y - 1, Self.Position().z) 
Walker.Start()
 
elseif (labelName == "OpenSouth") then
Walker.Stop()
Self.UseItemFromGround(Self.Position().x, Self.Position().y + 1, Self.Position().z) 
Walker.Start()
 
elseif (labelName == "MiddleSpawn") then
Walker.Stop()
Walker.ConditionalGoto(HuntMiddle, "MiddleGo", "MiddleDone")
Walker.Start()
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
Opublikowano
local _BackpackAmount  = 5
 
function OpenBackpacks(amount)
    Self.CloseContainers()
    Self.OpenMainBackpack(true)
    wait(500 + Self.Ping())
    if #Container.GetAll() == 1 then
        for slot, item in Container.GetFirst():iItems() do
            if Item.isContainer(item.id) then
                Container.GetFirst():UseItem(slot, false)
                wait(500 + Self.Ping())
                Container.GetLast():Minimize()
                wait(100 + Self.Ping())
            end
            if #Container.GetAll() == amount then break end
        end
    end
    if #Container.GetAll() ~= amount then
        print('Backpack reset not complete, recursing.')
        OpenBackpacks(amount)
    end
end

warunek:

if #Container.GetAll() < _BackpackAmount then
OpenBackpacks(_BackpackAmount)
wait(500 + Self.Ping())
end

- To rozwiąże problem z 'wpisywaniem" plecaków, otwiera po prostu daną ilosc. domyslnie 5.

Opublikowano
------ REFILL SETTINGS ------
local LeaveMana = 50 --- How many mana potions until you leave the hunt?
local BuyMana = 300 --- How many mana potions you begin the hunt with?
 
local LeaveHealth = 10 --- How many health potions until you leave the hunt?
local BuyHealth = 30 --- How many health potions you begin the hunt with?
 
local AmmoName = "Spear" --- What ammunition are you using?
local LeaveAmmo = 10 --- How much ammunition until you leave hunt?
local BuyAmmo = 50 --- How much ammunition do you begin the hunt with?
local AmmoCost = 10 --- What is the cost of your selected ammunition?
 
local LeaveCap = 200 --- Leaves spawn when character reaches this cap.
local HideEquipment = true --- Do you want to minimize your equipment?
local LogoutStamina = true --- Do you want to logout at 16 hours? (Inside the depot)
 
-- Item ID's, if you don't want to use SHP and SMP, change these:
 
local ManaName = "Mana Potion" 
local ManaCost = 50
local HealthName = "Great Health Potion" 
local HealthCost = 190
 
-- Backpack Configuration:
 
local _BackpackAmount = 5
local LootBP = "Beach Backpack"
local GoldBP = "Backpack"
 
-- Spawn Options
 
local HuntMiddle = false
 
-- Here I'm gonna get the item ids, leave this as it is.
 
local ManaID = Item.GetID(ManaName)
local HealthID = Item.GetID(HealthName)
local AmmoID = Item.GetID(AmmoName)
 
-- These are the flask IDs, not worth changing since it will sell all flasks regardless of type.
local FlaskID = 283
local FlaskIDA = 284
local FlaskIDB = 285
 
-- local GoldBP = 5801 --- Item ID of your gold backpack.
 
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
 
function onWalkerSelectLabel(labelName)
if (labelName == "Checker") then
-- Check Supplies, Hunt or Leave
Walker.ConditionalGoto((Self.ItemCount(ManaID) <= LeaveMana) or (Self.Cap() < LeaveCap) or (Self.ItemCount(HealthID) <= LeaveHealth), "Leave", "BeginHunt")
 
elseif (labelName == "Start") then
Walker.ConditionalGoto((Self.Position().z == 11), "BeginHunt", "ReachDepot")
 
elseif (labelName == "DepositGold") then
-- Deposit Gold, check balance.
Walker.Stop()
Self.SayToNpc({"hi", "deposit all", "yes"}, 100)
 
local withdrawManas = math.max(BuyMana - Self.ItemCount(ManaID), 0)*ManaCost
local withdrawHealths = math.max(BuyHealth - Self.ItemCount(HealthID), 0)*HealthCost
local withdrawAmmo = math.max(BuyAmmo - Self.ItemCount(AmmoID), 0)*AmmoCost
local total = math.abs(withdrawManas + withdrawHealths + withdrawAmmo)
 
if total >= 1 then
Self.SayToNpc({"withdraw " .. total, "yes", "balance"}, 100)
end
Walker.Start()
 
elseif (labelName == "DepositItems") then
-- Deposit Items
Walker.Stop()
Self.ReachDepot(5)
Self.DepositItems({5882, 1}, {3028, 1}, {3029, 1}, {5948, 1}, {11457, 1}, {5920, 1}, {5877, 1}, {3061, 1})
Self.DepositItems({3386, 0}, {3392, 0}, {7402, 0}, {7399, 0}, {3428, 0}, {3416, 0}, {3280, 0}, {3071, 0}, {7430, 0}, {3322, 0})
Walker.Start()
 
elseif (labelName == "BuyManas") then
-- Buy Mana Potions
Walker.Stop()
if (Self.ItemCount(ManaID) < BuyMana) or (Self.ItemCount(HealthID) < BuyHealth) then
print("Buying manas or healths")
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(ManaID) < BuyMana) do
Self.ShopBuyItemsUpTo(ManaID, BuyMana)
wait(500,800)
end
if (Self.ItemCount(HealthID) < BuyHealth) then
Self.ShopBuyItemsUpTo(HealthID, BuyHealth)
wait(500)
end
wait(200, 500)
end
Walker.Start()
 
elseif (labelName == "CheckGoneUp") then
-- Check we're on floor 3
Walker.ConditionalGoto((Self.Position().z == 7), "OpenSouth", "Leave")
 
elseif (labelName == "CheckGoneDown") then
-- Check we're on floor 7
Walker.ConditionalGoto((Self.Position().z == 11), "AmDown", "EnterResp")
 
elseif (labelName == "BuySpears") then
--------------------------------- TODO -------------------------
Walker.Stop()
Self.SayToNpc({"hi", "trade"}, 100)
-- Buy spears, make sure Self.ItemCount returns items in hands.
while (Self.ItemCount(AmmoID) < BuyAmmo) do
Self.ShopBuyItemsUpTo(AmmoID, BuyAmmo)
wait(500,800)
end
Walker.Start()
 
elseif (labelName == "ResetBps") then
-- Reset Backpacks
if #Container.GetAll() < _BackpackAmount then
OpenBackpacks(_BackpackAmount)
wait(500 + Self.Ping())
end
 
elseif (labelName == "OpenNorth") then
Walker.Stop()
Self.UseItemFromGround(Self.Position().x, Self.Position().y - 1, Self.Position().z) 
Walker.Start()
 
elseif (labelName == "OpenSouth") then
Walker.Stop()
Self.UseItemFromGround(Self.Position().x, Self.Position().y + 1, Self.Position().z) 
Walker.Start()
 
elseif (labelName == "MiddleSpawn") then
Walker.Stop()
Walker.ConditionalGoto(HuntMiddle, "MiddleGo", "MiddleDone")
Walker.Start()
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
 
function OpenBackpacks(amount)
    Self.CloseContainers()
    Self.OpenMainBackpack(true)
    wait(500 + Self.Ping())
    if #Container.GetAll() == 1 then
        for slot, item in Container.GetFirst():iItems() do
            if Item.isContainer(item.id) then
                Container.GetFirst():UseItem(slot, false)
                wait(500 + Self.Ping())
                Container.GetLast():Minimize()
                wait(100 + Self.Ping())
            end
            if #Container.GetAll() == amount then break end
        end
    end
    if #Container.GetAll() ~= amount then
        print('Backpack reset not complete, recursing.')
        OpenBackpacks(amount)
    end
end

 

Ilosc plecaczków edytujesz tutaj.

-- Backpack Configuration:
 
local _BackpackAmount  = 5

ps. jutro postaram się rozkminić jakis wygodny sposób na sprzedawanie itemków.

Opublikowano

jak z tym sellerem ? przydałby się i to bardzo :D

da się jakoś zrobić, aby od razu po włączeniu skryptu załączało Targetting i Looter??

dobrze, by było aby załączało też Walkera, otwierało BP a następnie szukało WPT w którym się znajduje i kontynuowało bocenie

Opublikowano
Targeting.Start()
Looter.Start()
Walker.Start()

Co do "sellera", sprawdz czy po ID będzie działało

local _Loot = { 666, 666, 666 }

w Label:

Self.SayToNpc({'hi', 'trade'}, 105)
wait(500,600)
for _, loot in ipairs(_Loot) do
Self.ShopSellAllItems(loot)
wait(1000)
end
Opublikowano

sellera sprawdzę w między czasie, wszystko spoko teraz staje na reach depot

Jak zrobić, aby z reach depot szedł do BeginHunt, jeśli nie widzi tego depo ?

Zarchiwizowany

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

×
×
  • Dodaj nową pozycję...