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


Joined: 27 Jul 2004
Posts: 5

PostPosted: Tue Jul 27, 2004 4:44 am   

#IF command
 
ok how do you use multiple variables in an #IF command? i play Achaea and im trying to setup some triggers so that it will input a command into zmud IF various variables are either the value of 1 or 0.
eg right now i have:


#if (@ACP/bal = 1 AND @ACP/eq = 1 AND @NonACP/Ratting/rats > 0 AND @NonACP/Balance/legs = 1 AND @NonACP/Balance/rightarm = 1 AND @NonACP/Balance/leftarm = 1) (cmod rat)

but obviously it doesnt work and it decides to 'cmob rat' anyway. Please help if you know what im on about and how to help.
Reply with quote
SCORNME
Novice


Joined: 25 Jul 2004
Posts: 48
Location: aka Falan

PostPosted: Tue Jul 27, 2004 5:04 am   Re: #IF command
 
@ACP/bal
@ACP/eq
@NonACP/Ratting/rats
@NonACP/Balance/legs
@NonACP/Balance/rightarm
@NonACP/Balance/leftarm

Isn't / a division operator?
Have you tried renaming the variables to NOT include the / operator?
Reply with quote
funkychicken
Newbie


Joined: 27 Jul 2004
Posts: 5

PostPosted: Tue Jul 27, 2004 5:12 am   
 
with my other settings doing @something/somethingelse/yetanotherthing/variable would target the @variable variable in the folders something/somethingelse/yetanotherthing settings folder. Otherwise if you have a trigger setup to change the value of a variable it will just do it in the root, ie not change the variable in the designated folder

what im trying to say is that:

@ACP/bal is not the name of the variable: @bal is, but its in the ACP folder
Reply with quote
SCORNME
Novice


Joined: 25 Jul 2004
Posts: 48
Location: aka Falan

PostPosted: Tue Jul 27, 2004 6:09 am   
 
OK. But for expressions doesn't the default operator have precedence? I.E. your #IF command is reading the / as an operator and not a class. Also, since you're not changing the variable, do you need to specify the class in an #IF?


Just trying to learn. Thanks for your patience with my questions. Smile
Reply with quote
funkychicken
Newbie


Joined: 27 Jul 2004
Posts: 5

PostPosted: Tue Jul 27, 2004 6:21 am   
 
ok yeah i see where your coming from, but i think that there needs to be a space before and after the / to be an operator.

Just my thoughts. Trying to learn too :D
Reply with quote
SCORNME
Novice


Joined: 25 Jul 2004
Posts: 48
Location: aka Falan

PostPosted: Tue Jul 27, 2004 7:40 am   
 
Oh, duh. Multiple values for a duplicate variable. Looking through the Help files, I think your classes were backwards. Will this work?

#if {(@bal/ACP)=1 AND (@eq/ACP)=1 AND (@rats/Ratting/NonACP)>0 AND (@legs/Balance/NonACP)=1 AND (@rightarm/Balance/NonACP)=1 AND (@leftarm/Balance/NonACP)=1} {cmod rat}


I'm at work with no access to zMUD otherwise I'd test it.
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Tue Jul 27, 2004 8:23 am   
 
No, he had the classes around the right way. When using the logical operators, such as AND IF OR, you must encase each expression to be tested by a set of parentheses:

#if ((@ACP/bal = 1) AND (@ACP/eq = 1) AND (@NonACP/Ratting/rats > 0) AND (@NonACP/Balance/legs = 1) AND (@NonACP/Balance/rightarm = 1) AND (@NonACP/Balance/leftarm = 1)) {cmod rat}
Reply with quote
funkychicken
Newbie


Joined: 27 Jul 2004
Posts: 5

PostPosted: Tue Jul 27, 2004 9:08 am   
 
Danlo wrote:
#if ((@ACP/bal = 1) AND (@ACP/eq = 1) AND (@NonACP/Ratting/rats > 0) AND (@NonACP/Balance/legs = 1) AND (@NonACP/Balance/rightarm = 1) AND (@NonACP/Balance/leftarm = 1)) {cmod rat}



eh, funny that. Thats exactly what i tried the first time and i swear it didnt work. Ill give it another go!
Reply with quote
SCORNME
Novice


Joined: 25 Jul 2004
Posts: 48
Location: aka Falan

PostPosted: Tue Jul 27, 2004 9:16 am   
 
Danlo wrote:
No, he had the classes around the right way. When using the logical operators, such as AND IF OR, you must encase each expression to be tested by a set of parentheses.


So it was about the (), good to know. Now, why do the Help file examples show the classes the other way (root -> class -> subclass)?

#ALIAS ./class2/ex {example2}
#SHOW @./test
class2/ex
Reply with quote
funkychicken
Newbie


Joined: 27 Jul 2004
Posts: 5

PostPosted: Tue Jul 27, 2004 10:43 am   
 
SCORNME wrote:
Danlo wrote:
No, he had the classes around the right way. When using the logical operators, such as AND IF OR, you must encase each expression to be tested by a set of parentheses.


So it was about the (), good to know. Now, why do the Help file examples show the classes the other way (root -> class -> subclass)?

#ALIAS ./class2/ex {example2}
#SHOW @./test
class2/ex


It is like that:

@NonACP/Balance/rightarm

Root: NonACP
Class: Balance
Subclass: @rightarm

Is that what you mean?
Reply with quote
SCORNME
Novice


Joined: 25 Jul 2004
Posts: 48
Location: aka Falan

PostPosted: Tue Jul 27, 2004 12:12 pm   
 
funkychicken wrote:
It is like that:

@NonACP/Balance/rightarm

Root: NonACP
Class: Balance
Subclass: @rightarm

Is that what you mean?


I read Subclass @rightarm and was thinking the exact opposite of Subclass @NonACP. Yet another reason why I shouldn't try to use reason at 4 am! Mental spoonerism.
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