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


Joined: 12 Feb 2004
Posts: 2

PostPosted: Thu Feb 12, 2004 3:56 am   

Stat roller / Autoroller
 
Greetings!

Trying to design an autoroller based on this output, where Luc = (x), the other 5 stats individually >= (y) and the sum of all stats >= {z}.

Attempted to simplify where Luc = (x) and the sum of all stats >= (y), but even that isn't working.



1) Str:10 Int: 9 Wis:10 Dex: 8 Con: 9 Luc: 9
2) Str:10 Int:10 Wis: 6 Dex: 9 Con: 7 Luc:11
3) Str: 9 Int:10 Wis: 8 Dex: 7 Con: 8 Luc:10
4) Str: 7 Int:10 Wis: 7 Dex: 9 Con:11 Luc:11
5) Str: 9 Int: 8 Wis:11 Dex: 9 Con:10 Luc: 6
1-5 chooses / Return rerolls:



Spent all day on this one, tried many structures to no avail. Any help at all would be hugely appreciated.

Cheers
TB
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Feb 12, 2004 5:47 am   
 
Are you sure you want Luc = x, not Luc >= x?
In your examples, two-digit numbers come immediately after the colon but one-digit numbers have a space in front of them. Since there aren't any good wildcards which match both spaces and digits, I used the fixed-width pattern.
I put the response after the fifth line instead of waiting for the MUD to ask. This will work on most MUDs.
You will need to add some extra spaces to make the pattern match the MUD output. There should be two spaces after each number, but the forum will only display one.
#VAR {x} {9}
#VAR {y} {8}
#VAR {z} {54}
#TR {1~) Str:(&2) Int:(&2) Wis:(&2) Dex:(&2) Con:(&2) Luc:(&2)} {#VAR answer 0;#IF ((%1 >= @y) AND (%2 >= @y) AND (%3 >= @y) AND (%4 >= @y) AND (%5 >= @y) AND (%6 = @x) AND ((%1 + %2 + %3 + %4 + %5 + %6) >= @z)) {#VAR answer 1}}
#COND {2~) Str:(&2) Int:(&2) Wis:(&2) Dex:(&2) Con:(&2) Luc:(&2)} {#IF ((%1 >= @y) AND (%2 >= @y) AND (%3 >= @y) AND (%4 >= @y) AND (%5 >= @y) AND (%6 = @x) AND ((%1 + %2 + %3 + %4 + %5 + %6) >= @z)) {#VAR answer 2}}
#COND {3~) Str:(&2) Int:(&2) Wis:(&2) Dex:(&2) Con:(&2) Luc:(&2)} {#IF ((%1 >= @y) AND (%2 >= @y) AND (%3 >= @y) AND (%4 >= @y) AND (%5 >= @y) AND (%6 = @x) AND ((%1 + %2 + %3 + %4 + %5 + %6) >= @z)) {#VAR answer 3}}
#COND {4~) Str:(&2) Int:(&2) Wis:(&2) Dex:(&2) Con:(&2) Luc:(&2)} {#IF ((%1 >= @y) AND (%2 >= @y) AND (%3 >= @y) AND (%4 >= @y) AND (%5 >= @y) AND (%6 = @x) AND ((%1 + %2 + %3 + %4 + %5 + %6) >= @z)) {#VAR answer 4}}
#COND {5~) Str:(&2) Int:(&2) Wis:(&2) Dex:(&2) Con:(&2) Luc:(&2)} {#IF ((%1 >= @y) AND (%2 >= @y) AND (%3 >= @y) AND (%4 >= @y) AND (%5 >= @y) AND (%6 = @x) AND ((%1 + %2 + %3 + %4 + %5 + %6) >= @z)) {#VAR answer 5};#IF (@answer > 0) {@answer} {#CR}}
Reply with quote
the_bookie
Newbie


Joined: 12 Feb 2004
Posts: 2

PostPosted: Mon Feb 16, 2004 6:02 am   
 
Greetings Lightbulb

Flawless code. Flexible too.. What can I say, this alone was worth the ZMUD registration. Thanks for the help!

Cheers
TB
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