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


Joined: 06 Jul 2002
Posts: 6

PostPosted: Sat Jul 06, 2002 8:50 pm   

Noob: IF and stat roller
 
Ok, I'm new to this version of zmud, so if statements and the new trigger features are confusing. But to keep it simple, I want a stat roller.
Mud:

Strength : 7
Intelligence : 18
Wisdom : 3
Dexterity : 15
Constitution : 13

Do you wish keep these stats (y/n)?

Now, after viewing the other posts about stat rollers, and trying to read up on how to work with this, this is what I have so far:

#TR {Strenght%s: (%d)$Intelligence%s: (%d)$Wisdom%s: (%d)$Dexterity%s: (%d)$Constitution%s: (%d)$%s$Do you wish keep these stats ~(y/n~)~?} {#VAR str {%1}; #VAR int {%2};#VAR wis {%3};#VAR dex {%4};#VAR con {%5}}

Now I want to send "no" to the mud if the values are less than 20, and yes ONLY when the values are all 20 or over. Help?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Jul 06, 2002 11:46 pm   
 
I dislike multiline triggers, but anyhow...
It would be easier to meet your requirements by using a number of zMud's list functions. %sort comes right to mind. Since that is an ascii based sorting function and not a math based I will add a few little things to overcome that.

#TR {Strenght%s: (%d)} {#VAR Stats {%replace(%format("&3.0f",%1)," ","0")}}
#TR {Intelligence%s: (%d)} {#ADDITEM Stats {%replace(%format("&3.0f",%1)," ","0")}}
#TR {Wisdom%s: (%d)} {#ADDITEM Stats {%replace(%format("&3.0f",%1)," ","0")}}
#TR {Dexterity%s: (%d)} {#ADDITEM Stats {%replace(%format("&3.0f",%1)," ","0")}}
#TR {Constitution%s: (%d)} {#ADDITEM Stats {%replace(%format("&3.0f",%1)," ","0")}}
#TR {Do you wish keep these stats ~(y/n~)~?} {#IF (%item(%sort(@Stats),1)>19) {y} {n}} {prompt|no_cr}
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Jul 07, 2002 4:36 am   
 
The trigger you have is fine except that it will probably need to be a prompt trigger. If you drop the question line, you can use a regular (end-of-line) trigger.

#TR {Strength%s: (%d)$Intelligence%s: (%d)$Wisdom%s: (%d)$Dexterity%s: (%d)$Constitution%s: (%d)} {#VAR str {%1}; #VAR int {%2};#VAR wis {%3};#VAR dex {%4};#VAR con {%5};#IF ((%1 > 19) AND (%2 > 19) AND (%3 > 19) AND (%4 > 19) AND (%5 > 19)) {y} {n}}


LightBulb
Senior Member
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