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
Woot20
Newbie


Joined: 23 Sep 2005
Posts: 8

PostPosted: Wed Oct 12, 2005 9:00 pm   

#if Statements
 
I know how to make an #if statement to check if a variable is true or false and then issue a command.

Is there a way to check if 2 conditions are met? I want to check and make sure both HP and SP are met before the command is issued. Thanks!
Reply with quote
Aleron
Wanderer


Joined: 01 Aug 2005
Posts: 76

PostPosted: Wed Oct 12, 2005 9:07 pm   
 
I'm actually not sure if you can do something like this or not:

#IF ((@HP > @AcceptableHP) && (@SP > @AcceptableSP)) {do something}

Regardless, you can always do the following:

#IF (@HP > @AcceptableHP) {#IF (@SP > @AcceptableSP) {do something}}
Reply with quote
OmegaDeus
Apprentice


Joined: 14 Sep 2005
Posts: 121

PostPosted: Wed Oct 12, 2005 9:30 pm   
 
You can do the first one. I'm not sure on this next bit of information though, but I believe that you only need one & there.
_________________


Look at me I've got zSKILLS
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Thu Oct 13, 2005 3:47 am   
 
You can also use
Code:
 #IF ((@HP > @AcceptableHP) AND (@SP > @AcceptableSP)) {do something}

_________________
Asati di tempari!
Reply with quote
Woot20
Newbie


Joined: 23 Sep 2005
Posts: 8

PostPosted: Sat Oct 15, 2005 2:25 am   thanks
 
not sure why I didn't just test two if statements in the same box.. oh well i filled up some space here Razz
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