Log in

View Full Version : Making the bot go to depot without having to wait for a check



Zashalio
12-31-2012, 11:37 PM
So I've been making scripts for my knight and currently using a label "Check" every so often to make sure my capacity and mana potions aren't low...

But now I want to bot my paladin and I'm sure he'l run out of spears pretty fast as he's only level 50....
I was wondering if anyone could give me a way to make the check automatic so he doesn't have to wait for a label with that name...

I'm not good at explaining this stuff... But if you understand what I mean please help :)

This is an example of what a script for my knight would look like and If you could tell me what I need to change id be grateful (:

--Cap
CapToRefill = 70 -- Below this amount bot will refill
--Mana
ManasToRefill = 30 -- below this amount bot will refill
ManaPotsID = 268 -- ID of manapotion you wish to buy
ManaPotsPrice = 50 -- Price of the mana potion you wish to buy
ManasToBuy = 150 -- Amount of mana potions you wish to buy


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

registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)

if (labelName == "CheckStatus") then
setBotEnabled(false)
local mana = Self.ItemCount(ManaPotsID)
local cap = Self.Cap()
if(mana <= ManasToRefill or cap <= CapToRefill) then
setBotEnabled(true)
gotoLabel('LeaveSpawn')
else
setBotEnabled(true)
end
elseif (labelName == "DepositCash") then
setBotEnabled(false)
delayWalker(10000)
Self.SayToNpc('hi')
wait(1000,2000)
Self.SayToNpc('deposit all')
wait(1000,2000)
Self.SayToNpc('yes')
wait(1000,2000)
local GoldToManas = ((ManasToBuy-Self.ItemCount(ManaPotsID))*ManaPotsPrice)
Self.SayToNpc("withdraw " .. GoldToManas)
wait(1000,2000)
Self.SayToNpc('yes')
wait(1000,2000)
Self.SayToNpc('balance')
wait(1000,2000)
setBotEnabled(true)
elseif (labelName == "DepositItems") then
setBotEnabled(false)
Self.DepositItems({9053, 1}, {9054, 1}, {9668, 1}, {10308, 0}, {3428, 1}, {8072, 1})
setBotEnabled(true)
elseif (labelName == "MecToSpawn") then
setBotEnabled(false)
Self.UseItemFromGround(32743, 31164, 5)
wait(1000,2000)
setBotEnabled(true)
elseif (labelName == "MecToYala") then
setBotEnabled(false)
Self.UseItemFromGround(32743, 31161, 5)
wait(1000,2000)
setBotEnabled(true)
elseif (labelName == "BuyManas") then
setBotEnabled(false)
Self.SayToNpc({"Hi", "Trade"}, 65)
wait(1000,2000)
Self.ShopBuyItem(ManaPotsID,(ManasToBuy-Self.ItemCount(ManaPotsID)))
wait(1000,2000)
setBotEnabled(true)
elseif (labelName == "KeepHunting") then
setBotEnabled(true)
gotoLabel("StartHunting")
end
end