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

kubaskov1

Rekomendowane odpowiedzi

Opublikowano

Siema, próbuje zrobić skrypt na to by, gdy ma już otwarte depo wyciąga potki z 4 depoboxa do mainBP, ale wyskakuje mi taki błąd:

15:33 XenoScript Error:
           Script: withdrawitems.lua
           Line #: 12
           Chunk: ...Users?*******?DOCUME?1?XenoBot?Scripts??WITHDR?1.LUA
           Error: attempt to index global 'self' (a nil value)
This is an error with user-input and should not be reported as a bug with XenoBot.
Wie ktoś jak to poprawić?
Będę wdzięczny
 
a oto Skrypt .lua
 
Withdraw = {name = "Mana Potions", amount =  30, from = 3, to = 0, enabled = true}


local AmmoID = Item.GetID(Withdraw.name)


------------------------------------
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
   


function onWalkerSelectLabel(labelName)
if (labelName == "WP") then
Walker.Stop()
Withdraw_Potions(withdraw)
Walker.Start()
end


function Withdraw_Potions(withdraw)
local counting = ((Withdraw.amount - Self.ItemCount(AmmoID)))
wait(900, 1000)
    Self.WithdrawItems(Withdraw.from, {AmmoID, Withdraw.to, counting})
    wait(500, 800)
end
end
Opublikowano

Mam jeszcze 1 pytanko, znalazłem w google taki skrypt:

 

local AmmoUse = "Assassin Star"


local AmmoMax = 200


local AmmoBp = "Purple Backpack"


----------------------






registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")


function onWalkerSelectLabel(labelName)


if (labelName == "WP") then


Self.ItemCount(Item.GetID(AmmoUse) < AmmoMax)


AmmoToWithdraw = (AmmoMax - Self.ItemCount(AmmoUse))


Self.WithdrawItems(3, {Item.GetID(AmmoUse), AmmoBp, AmmoToWithdraw})


end
end

skrypt się włącza ale gdy dojdzie do labelu wyskakuj error:

23:40 XenoScript Error:
           Script: Withdraw.lua
           Line #: 3961
           Chunk: ...ubaMen\Desktop\Xenobot\Versions\..?Data?XB0025?1.LUA
           Error: attempt to compare number with string
This is an error with user-input and should not be reported as a bug with XenoBot.

Wie ktoś dlaczego jest line 3961? chodziarz w skrypcie jest 24 line.

Opublikowano

 

Mam jeszcze 1 pytanko, znalazłem w google taki skrypt:

 

local AmmoUse = "Assassin Star"


local AmmoMax = 200


local AmmoBp = "Purple Backpack"


----------------------






registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")


function onWalkerSelectLabel(labelName)


if (labelName == "WP") then


Self.ItemCount(Item.GetID(AmmoUse) < AmmoMax)


AmmoToWithdraw = (AmmoMax - Self.ItemCount(AmmoUse))


Self.WithdrawItems(3, {Item.GetID(AmmoUse), AmmoBp, AmmoToWithdraw})


end
end

skrypt się włącza ale gdy dojdzie do labelu wyskakuj error:

23:40 XenoScript Error:
           Script: Withdraw.lua
           Line #: 3961
           Chunk: ...ubaMen\Desktop\Xenobot\Versions\..?Data?XB0025?1.LUA
           Error: attempt to compare number with string
This is an error with user-input and should not be reported as a bug with XenoBot.

Wie ktoś dlaczego jest line 3961? chodziarz w skrypcie jest 24 line.

 

spróbuj tego

local AmmoUse = "assassin star"
local AmmoMax = 200
local AmmoBp = "bag"


----------------------
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "WP") then
Self.ItemCount(Item.GetID(AmmoUse) < AmmoMax)
AmmoToWithdraw = (AmmoMax - Self.ItemCount(AmmoUse))
Self.WithdrawItems(2, {Item.GetID(AmmoUse), AmmoBp, AmmoToWithdraw})
	end
end

przed dodaniem labela dodaj w kolejności od góry w Walkerze :

1) Reach Depot

2) Add Script -> Self.OpenDepot()

3) Label o nazwie: WP

 

co do skryptu w 1 poście :

Withdraw = {name = "Mana Potions", amount =  30, from = 3, to = 0, enabled = true}


local AmmoID = Item.GetID(Withdraw.name)


------------------------------------
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
   


function onWalkerSelectLabel(labelName)
if (labelName == "WP") then
Walker.Stop()
Withdraw_Potions(withdraw)
Walker.Start()
end
end

function Withdraw_Potions(withdraw)
local counting = ((Withdraw.amount - Self.ItemCount(AmmoID)))
wait(900, 1000)
    Self.WithdrawItems(Withdraw.from, {AmmoID, Withdraw.to, counting})
    wait(500, 800)
end
end

Pozdrawiam Wszystkich :)

Zarchiwizowany

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

×
×
  • Dodaj nową pozycję...