Log in

View Full Version : Wondering why my labels won't work



Paladyn
05-20-2016, 05:11 PM
I´m having this problem that my script accepts into the bot with no errors. But when I´m having Labels in my walker it won't do what I have told the bot in the script:

registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")

function onWalkerSelectLabel(labelName)

if (labelName == "Manas") then
delayWalker(3000)
Self.Say("Hi")
sleep(math.random(700, 1400))
Self.SayToNpc("Trade")
sleep(math.random(700, 1400))
Self.ShopSellAllItems("empty potion flask")
sleep(math.random(700, 1400))
Self.ShopBuyItemsUpTo("mana potion", 40)
end


if (labelName == "Withdraw") then
delayWalker(3000)
Self.Say("Hi")
sleep(math.random(700, 1400))
Self.SayToNpc("deposit all")
sleep(math.random(700, 1400))
Self.SayToNpc("withdraw 2400")
sleep(math.random(700, 1400))
Self.SayToNpc("Yes")

also this seems to not work correctly:
if (labelName == "Check") then
delayWalker(3000)
if (Self.Cap(20) < MinCap) or ((Self.ItemCount(268) < 5)) or ((Self.ItemCount(7378) <5)) (LeaveUponGoldAmount == true) and ((Self.ItemCount(GoldID) >= 3000)) then
gotoLabel("Gobank")
else
gotoLabel("Start")
end


So here it will just walk to the bank for withdraw and do nothing just moving on to the next thing to do on walker.

yompa93
05-21-2016, 07:58 AM
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "Manas") then
setWalkerEnabled(false)
Self.SayToNpc({"hi", "Trade"}, 35)
wait(300+Self.Ping())
Self.ShopSellFlasks()
wait(300+Self.Ping())
Self.ShopBuyItemsUpTo(268, 40)
setWalkerEnabled(true)
elseif (labelName == "Withdraw") then
setWalkerEnabled(false)
Self.SayToNpc({"hi", "deposit all", "yes", "withdraw 2400", "yes"}, 35)
setWalkerEnabled(true)
elseif (labelName == "Check") then
delayWalker(3000)
if (Self.Cap(20) < MinCap) or ((Self.ItemCount(268) < 5)) or ((Self.ItemCount(7378) <5)) (LeaveUponGoldAmount == true) and ((Self.ItemCount(GoldID) >= 3000)) then
Walker.Goto("Gobank")
else
Walker.Goto("Start")
end
end
end

Trykon
05-21-2016, 09:53 AM
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")

function onWalkerSelectLabel(labelName)

if (labelName == "Manas") then
Walker.Stop()
Self.Say("Hi")
sleep(math.random(700, 1400))
Self.SayToNpc("Trade")
sleep(math.random(700, 1400))
Self.ShopSellAllItems("empty potion flask")
sleep(math.random(700, 1400))
Self.ShopBuyItemsUpTo("mana potion", 40)
sleep(math.random(700, 1400))
Walker.Start()



elseif (labelName == "Withdraw") then
Walker.Stop()
Self.Say("Hi")
sleep(math.random(700, 1400))
Self.SayToNpc("deposit all")
sleep(math.random(700, 1400))
Self.SayToNpc("withdraw 2400")
sleep(math.random(700, 1400))
Self.SayToNpc("Yes")
sleep(math.random(700, 1400))
Walker.Start()

elseif (labelName == "Check") then
delayWalker(3000)
if ((((Self.Cap(20) < MinCap) or (Self.ItemCount(268) < 5)) or (Self.ItemCount(7378) <5)) or ((LeaveUponGoldAmount == true) and (Self.ItemCount(GoldID) >= 3000))) then
gotoLabel("Gobank")
else
gotoLabel("Start")
end
end

should work
i have changed brackets order in check so this is working with general logical standards and replaced delay with stopping the walker, also it is good to have sleep time after last phrase said to npc