-
Ballerlocke
- Posts: 12
- Joined: Sat Jul 23, 2011 7:22 pm
#1
Post
by Ballerlocke » Sat Jul 13, 2013 1:02 pm
hi all i want to wirte a script and in the onload i want to make a if between three varibels start pionts the first and second he reads but no time the third won
Code: Select all
player:update();
local zoneid = RoMScript("GetZoneID()")
if ( zoneid == 401 ) then
__WPL:setWaypointIndex(__WPL:findWaypointTag("Gildenstart"));
printf ("Gildenstart.");
elseif ( zoneid == 2001 or 2002 or 2 ) then
__WPL:setWaypointIndex(__WPL:findWaypointTag("Varanasstart"));
printf ("Varanas.");
elseif ( zoneid == 6 ) then
__WPL:setWaypointIndex(__WPL:findWaypointTag("Obsidanstart"));
printf ("Osidan.");
else
printf ("CANT FIND START.");
end
thanks for help
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#2
Post
by rock5 » Sat Jul 13, 2013 2:55 pm
It's because this is wrong
Code: Select all
elseif ( zoneid == 2001 or 2002 or 2 ) then
That's the same as writing
Code: Select all
elseif ( zoneid == 2001) or ( 2002) or ( 2 ) then
Any value that is not false or nil is considered true so (2002) and (2) will both always be true so it never passes that line.
What you meant was
Code: Select all
elseif ( zoneid == 2001 or zoneid == 2002 or zoneid == 2 ) then
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:
- “They say hard work never hurt anybody, but I figure, why take the chance.”
Who is online
Users browsing this forum: No registered users and 1 guest