Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
jachyra
Newbie


Joined: 01 Feb 2002
Posts: 7
Location: USA

PostPosted: Thu Jun 06, 2002 10:24 pm   

Problems with #IF command on Zmud6.16
 
I have been having problem with the #IF and %if commands on Zmud scripting. I keep getting syntax errors whether I enter code as an alias or in a trigger. The following code should work but does not:

#IF (@brewmode="specific") {autobrew} {potionchange}


Since the @brewmode varaiable stores a string of either tank or specific it should test and choose one of the two possibilities yet it chooses neither because it thinks the argument to be evaluated is the false response. Anyone have any clues as to what is wrong or why this is occuring?



Why do you taunt me with your darkness?
Your evil is stinking up our streets!
The END is near, the end if NEAR!
Reply with quote
dacheeba
Adept


Joined: 29 Oct 2001
Posts: 250

PostPosted: Thu Jun 06, 2002 10:41 pm   
 
hmm, well i just copy and pasted your if statement and got no syntax error, so maybe something else in the script that you havent show us is messing it up. Other than that, the only problem I can think of is maybe your variable @brewmode isnt storing the strings correctly. Like maybe instead if storing 'specific' its storing 'specific ' or ' specific'? Check and make sure your variable doesnt have any extra spaces in it, or some other typo.
Reply with quote
jachyra
Newbie


Joined: 01 Feb 2002
Posts: 7
Location: USA

PostPosted: Thu Jun 06, 2002 11:23 pm   
 
I found a fix for what I just placed for that #IF statement.
 #IF ("%1"="specific") {

#SAY AUTOBREW
autobrew
} {
#SAY POTIONCHANGE
potionchange @autopot
}

Since I passed the test string through the %1 argument of the alias call, it works. For some reason when I do text #IF statements like the following:
#IF (@VARNAME="blazeward") {#var autopot {demonskin}} 

Zmud seems to think that
{#var autopot {demonskin}} 
is the false part instead of the true because if I change the = to a != it will run the commands. If I insert brackets before or after the commands it still won't allow me to make a true command list. This is kinda weird. Infact I have some scripts that are the same as the working ones with no different options selected on the same character that don't work. Any idea why?

FIX: For some reason if I use
 #IF (%1="dragonskin") {

#SAY AUTOBREW
autobrew
} {}


it will work, but only if I remove the "" around %1 even though it works in the other one.



Why do you taunt me with your darkness?
Your evil is stinking up our streets!
The END is near, the end if NEAR!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net