Log in

View Full Version : Go to label if low supply



brenimlele
12-14-2016, 08:47 PM
Hello friends,

im have this script

if (labelName == "Check") then
Walker.ConditionalGoto((Self.Cap() <= MinCap) or
(Self.ItemCount(IDMana) < MinMana) or
(Self.ItemCount(IDava) < Minava) or
(Self.ItemCount(IDSD) < MinSD), "City", "Hunt")

but this need stay on specific waypoint to "Check"

I need a script to go label "City" if low cap or low supply independent waypoint i am

thanks!!!

yompa93
12-15-2016, 08:18 AM
check returns true if you dont have enough suppllies, so you can use it like this:

if check() then
walker.goto("City")
end



function check()
if(Self.Cap() <= MinCap) or (Self.ItemCount(IDMana) < MinMana) or (Self.ItemCount(IDava) < Minava) or (Self.ItemCount(IDSD) < MinSD then
return true
end
end

brenimlele
12-16-2016, 05:27 AM
Hi man, i dont understand how to use this script

look is like this



local MinCap = 100
local MinMana = 100
local IDMana = 268
local Minava = 100
local IDava = 3161
local MinSD = 50
local IDSD = 3155

if check() then
walker.goto("City")
end

function check()
if(Self.Cap() <= MinCap) or (Self.ItemCount(IDMana) < MinMana) or (Self.ItemCount(IDava) < Minava) or (Self.ItemCount(IDSD) < MinSD then
return true
end
end

yompa93
12-16-2016, 09:15 AM
local MinCap = 100
local MinMana = 100
local IDMana = 268
local Minava = 100
local IDava = 3161
local MinSD = 50
local IDSD = 3155

function check()
if(Self.Cap() <= MinCap) or (Self.ItemCount(IDMana) < MinMana) or (Self.ItemCount(IDava) < Minava) or (Self.ItemCount(IDSD) < MinSD) then
return true
end
end

registerEventListener(WALKER_SELECTLABEL, "onLabel")

function onLabel(label)
if(label == "Check") then -- checks the supplies on label Check
if check() then
Walker.Goto("City") -- goes to label City if you're getting low on supplies
end
end
end


I missed a bracket, now it should work. my bad