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


Joined: 29 Jun 2012
Posts: 2

PostPosted: Fri Jun 29, 2012 11:51 pm   

Need help on an auto roller..
 
The mud roller looks like this and the Str has 2 stats as you can see..I want 18/100 instead of 18/29 or 17/0 etc..

Str: [17/0] Int: [10] Wis: [13] Dex: [16] Con: [14] Cha: [10]

Do you wish to keep these abilities? [Y/N]
Reply with quote
panc4k3z
Newbie


Joined: 29 Jun 2012
Posts: 2

PostPosted: Sun Jul 01, 2012 3:35 am   
 
Is this right guys? This doesn't work for me. What did I do wrong in code please..here it is
#TRIGGER {Str: ~[(%d)~/(%d)~] Int: ~[(%d)~] Wis: ~[(%d)~] Dex: ~[(%d)~] Con: ~[(%d)~] Cha: ~[(%d)~] {IF (%1<18)or(%2<100)or(%3<13)or(%4<13)or(%5<18)or(%6<18)or(%7<1) {N} {Y}}
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Jul 01, 2012 6:09 pm   
 
Spacingisimportantinzscriptcode,justlikeitisinwritingnotes.Whileitperhapsmightwork,theparsermightgetconfusedandevaluatestuffinunexpectedways.

Beyond that, you are missing a # in front of IF and a master set of () around your entire if condition.
_________________
EDIT: I didn't like my old signature
Reply with quote
myddrun
Wanderer


Joined: 31 Mar 2005
Posts: 58

PostPosted: Thu Jul 12, 2012 11:58 am   
 
Personally I would break it down in a class and have a trigger for each stat.

Trigger: Str : ~[%d~]
Commands:
stat1=%1
#if (@stat1 > 19) {#CO yellow}
Class: roll

etc

Then trigger off "Do you wish to keep these abilities? [Y/N]" with an if statement.

#if (@stat1 < 20 or @stat2 < 19 or @stat3 < 17) {#CR
ECHO Rerolling... @stat1, @stat2, @stat3} {#ECHO How about this roll? @stat1 @stat2 @stat3}

This link is to a really old one for a mud that stop using stat rolling. It will need to be tinkered with to suit your output though.

http://www.angelfire.com/art/epicar/zmud_rearrange.htm

As for the 18/00, you just need a 4th trigger for the percentile and an extra condition to suit
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Tue Jul 24, 2012 2:22 pm   
 
#TRIGGER {Str: ~[(%d)~/(%d)~] Int: ~[(%d)~] Wis: ~[(%d)~] Dex: ~[(%d)~] Con: ~[(%d)~] Cha: ~[(%d)~]} {#IF ((%1 < 18) OR (%2 < 100) OR (%3 < 13) OR (%4 < 13) OR (%5 < 18) OR (%6 < 18) OR (%7 < 1)) {N} {#SHOW {Str: %1/%2 Int: %3 Wis: %4 Dex: %5 Con: %6 Cha: %7, press Y to accept!}}}

#SHOW {Str: [17/0] Int: [10] Wis: [13] Dex: [16] Con: [14] Cha: [10]}
Yields:
N


#SHOW {Str: [18/100] Int: [13] Wis: [13] Dex: [18] Con: [18] Cha: [5]}
Yields:
Str: 18/100 Int: 13 Wis: 13 Dex: 18 Con: 18 Cha: 5, press Y to accept


I wouldn't autoaccept... might screw up or something (littl chance, but still)

So this trig when it eventually hits the right stats will show you and ask for Y to confirm.
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