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


Joined: 27 Oct 2001
Posts: 9
Location: USA

PostPosted: Thu Mar 14, 2002 2:35 am   

AutoRoller
 
I am trying to make an autoroller for PerilousRealms.com port 23.

Well I got it to partially work now however I can't figure out how to have it wait for all 5 entries to be tested and roll again if none of the values are useful or to have it stop if one or more of them are. Here is the mud stat roller output:


You can choose from any of the following sets of abilities:
1. Str: 12 Int: 11 Wis: 12 Dex: 15 Con: 11 Chr: 14 Lck: 12
2. Str: 13 Int: 12 Wis: 18 Dex: 8 Con: 6 Chr: 12 Lck: 6
3. Str: 13 Int: 16 Wis: 10 Dex: 12 Con: 11 Chr: 16 Lck: 11
4. Str: 14 Int: 16 Wis: 11 Dex: 13 Con: 13 Chr: 16 Lck: 14
5. Str: 12 Int: 16 Wis: 15 Dex: 15 Con: 10 Chr: 10 Lck: 11
Choice? [Enter=Roll again, H for help on classes, Q to quit]


Here is the pattern and value I used:

PATTERN:


*. Str~: (%d) Int~: (%d) Wis~: (%d) Dex~: (%d) Con~: (%d) Chr~: (%d) Lck~: (%d)


VALUE:


#MATH value %1+%2+%3+%4+%5+%6+%7
#SHOW %ansi( cyan)~(Value~:@value/Total~:@total~)
#IF (@value>=@total) {ALERT} {N}


I thought I might have to make a seperate trigger for each of the 5 choices of stats and somehow get it to wait till all of them are proven false but I been looking through the help and getting myself more confused than I was when I started. Could use some detailed advice.
Reply with quote
dracx
Beginner


Joined: 14 Oct 2000
Posts: 26
Location: USA

PostPosted: Thu Mar 14, 2002 2:39 am   
 
Try this pattern instead.

*~. Str~: (%d) Int~: (%d) Wis~: (%d) Dex~: (%d) Con~: (%d) Chr~: (%d) Lck~: (%d)

First problem, which I'm not sure is actually a problem so much as non-standard, is the %1, %2 etc... that's not a zmud thing, it's a throwback. Second problem is that you need to enclose a wildcard in paren. to pass it to your code.

%d = any digits

The help entry on patterns has some good stuff. Read it :)

Dracx
Reply with quote
Dizelesicap
Newbie


Joined: 27 Oct 2001
Posts: 9
Location: USA

PostPosted: Thu Mar 14, 2002 3:39 am   
 
I am trying to make an autoroller for PerilousRealms.com port 23.

Well I got it to partially work now however I can't figure out how to have it wait for all 5 entries to be tested and roll again if none of the values are useful or to have it stop if one or more of them are. Here is the mud stat roller output:


You can choose from any of the following sets of abilities:
1. Str: 12 Int: 11 Wis: 12 Dex: 15 Con: 11 Chr: 14 Lck: 12
2. Str: 13 Int: 12 Wis: 18 Dex: 8 Con: 6 Chr: 12 Lck: 6
3. Str: 13 Int: 16 Wis: 10 Dex: 12 Con: 11 Chr: 16 Lck: 11
4. Str: 14 Int: 16 Wis: 11 Dex: 13 Con: 13 Chr: 16 Lck: 14
5. Str: 12 Int: 16 Wis: 15 Dex: 15 Con: 10 Chr: 10 Lck: 11
Choice? [Enter=Roll again, H for help on classes, Q to quit]


Here is the pattern and value I used:

PATTERN:


*. Str~: (%d) Int~: (%d) Wis~: (%d) Dex~: (%d) Con~: (%d) Chr~: (%d) Lck~: (%d)


VALUE:


#MATH value %1+%2+%3+%4+%5+%6+%7
#SHOW %ansi( cyan)~(Value~:@value/Total~:@total~)
#IF (@value>=@total) {ALERT} {N}


I thought I might have to make a seperate trigger for each of the 5 choices of stats and somehow get it to wait till all of them are proven false but I been looking through the help and getting myself more confused than I was when I started. Could use some detailed advice.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Mar 14, 2002 4:23 am   
 
Hrm, I actually like this one. I am normally flat against autorollers, mainly because you will use it once per character.

Anyhow this one looks like fun to write. First let me say thank you for having all the info in your post.

#CLASS AutoRoller
#VAR StrRating {13|2|1}
#VAR IntRating {16|2|4}
#VAR WisRating {10|1|2}
#VAR DexRating {12|2|1}
#VAR ConRating {14|3|2}
#VAR ChrRating {12|1|1}
#VAR LckRating {13|1|3}
#VAR LineRatings {0|0|0|0|0}
#VAR Rating {0}
#TR {^(%d). Str: (%d) Int: (%d) Wis: (%d) Dex: (%d) Con: (%d) Chr: (%d) Lck: (%d)} {Rating=%eval((%2>=%item(@StrRating,1)));Rating=%eval(@Rating&(%3>=%item(@IntRating,1)));Rating=%eval(@Rating&(%4>=%item(@WisRating,1)));Rating=%eval(@Rating&(%5>=%item(@DexRating,1)));Rating=%eval(@Rating&(%6>=%item(@ConRating,1)));Rating=%eval(@Rating&(%7>=%item(@ChrRating,1)));Rating=%eval(@Rating&(%8>=%item(@LckRating,1)));#IF (@Rating) {Rating=0;#ADD Rating %eval((%2*%item(@StrRating,2))+((%2-%item(@StrRating,1))*%item(@StrRating,3)));#ADD Rating %eval((%3*%item(@IntRating,2))+((%3-%item(@IntRating,1))*%item(@IntRating,3)));#ADD Rating %eval((%4*%item(@WisRating,2))+((%4-%item(@WisRating,1))*%item(@WisRating,3)));#ADD Rating %eval((%5*%item(@DexRating,2))+((%5-%item(@DexRating,1))*%item(@DexRating,3)));#ADD Rating %eval((%6*%item(@ConRating,2))+((%6-%item(@ConRating,1))*%item(@ConRating,3)));#ADD Rating %eval((%7*%item(@ChrRating,2))+((%7-%item(@ChrRating,1))*%item(@ChrRating,3)));#ADD Rating %eval((%8*%item(@LckRating,2))+((%8-%item(@LckRating,1))*%item(@LckRating,3)));LineRatings=%replaceitem(@Rating,%1,@LineRatings);#SUB {%trigger Rated:@Rating}} {LineRatings=%replaceitem("0",%1,@LineRatings);#SUB {%trigger Failed Minimums!}}}
#TR {^Choice~? ~[Enter=Roll again, H for help on classes, Q to quit~]} {#SUB {%trigger Highest:%ismember(@LineRatings,%max(%replace(@LineRatings,"|",","))) --~>}
"" {nocr|prompt}
#CLASS 0

Ok it doesn't actually make the selection for you but does a very nice rating system. The values in the variables StrRating and such are in the format "minimum|base rating|bonus rating". Adjust those to get any value you want.

As an exercise for you, once you get the rating adjeusted and make sure I have no bugs, have it hit the enter or select the line.

Editted:to fix prompt trigger, and add class 0
Reply with quote
Dizelesicap
Newbie


Joined: 27 Oct 2001
Posts: 9
Location: USA

PostPosted: Fri Mar 15, 2002 4:24 am   
 
That looks like it should work... Heh, truth be told, that all looked confusing for a bit till I pasted it into zMud then everything made sense... still new to this thing I guess. Anyway I have a few questions.

I got the syntax error:


{#SUB
^ syntax error


with the trigger:


^Choice~? ~[Enter=Roll again, H for help on classes, Q to quit~]


and I never saw any failed message. Here is the full text script as it is in my Autoroller class:


#CLASS {AutoRoller}
#VAR StrRating {13|2|1}
#VAR IntRating {16|2|4}
#VAR WisRating {10|1|2}
#VAR DexRating {12|2|1}
#VAR ConRating {14|3|2}
#VAR ChrRating {12|1|1}
#VAR LckRating {13|1|3}
#VAR LineRatings {0|0|0|0|0}
#VAR Rating {0}
#TRIGGER {^(%d). Str: (%d) Int: (%d) Wis: (%d) Dex: (%d) Con: (%d) Chr: (%d) Lck: (%d)} {Rating=%eval((%2>=%item(@StrRating,1)));Rating=%eval(@Rating&(%3>=%item(@IntRating,1)));Rating=%eval(@Rating&(%4>=%item(@WisRating,1)));Rating=%eval(@Rating&(%5>=%item(@DexRating,1)));Rating=%eval(@Rating&(%6>=%item(@ConRating,1)));Rating=%eval(@Rating&(%7>=%item(@ChrRating,1)));Rating=%eval(@Rating&(%8>=%item(@LckRating,1)));#IF (@Rating) {Rating=0;#ADD Rating %eval((%2*%item(@StrRating,2))+((%2-%item(@StrRating,1))*%item(@StrRating,3)));#ADD Rating %eval((%3*%item(@IntRating,2))+((%3-%item(@IntRating,1))*%item(@IntRating,3)));#ADD Rating %eval((%4*%item(@WisRating,2))+((%4-%item(@WisRating,1))*%item(@WisRating,3)));#ADD Rating %eval((%5*%item(@DexRating,2))+((%5-%item(@DexRating,1))*%item(@DexRating,3)));#ADD Rating %eval((%6*%item(@ConRating,2))+((%6-%item(@ConRating,1))*%item(@ConRating,3)));#ADD Rating %eval((%7*%item(@ChrRating,2))+((%7-%item(@ChrRating,1))*%item(@ChrRating,3)));#ADD Rating %eval((%8*%item(@LckRating,2))+((%8-%item(@LckRating,1))*%item(@LckRating,3)));LineRatings=%replaceitem(@Rating,%1,@LineRatings);#SUB {%trigger Rated:@Rating}} {LineRatings=%replaceitem("0",%1,@LineRatings);#SUB {%trigger Failed Minimums!}}}
#TRIGGER {^Choice~? ~[Enter=Roll again, H for help on classes, Q to quit~]} {{#SUB}
#CLASS 0



I was not sure where I could tweak it because I am not that versed in the code but I'm working on it perhaps you could see it faster and better than myself. Thankyou very much by the way in case I forgot my manners.
Reply with quote
Dizelesicap
Newbie


Joined: 27 Oct 2001
Posts: 9
Location: USA

PostPosted: Fri Mar 15, 2002 4:50 am   
 
I tested it anyway and this is what it outputted with both commands and triggers echoing.
Also these are the minimum values I would want because I am not to certain how the bonus works:

Minimum Values:

Str: 17
Int: 17
Wis: 15
Dex: 17
Con: 17
Chr: 15
Lck: 15


Actual Mud Output with all echoes on:

You can choose from any of the following sets of abilities:
1. Str: 14 Int: 10 Wis: 12 Dex: 13 Con: 6 Chr: 16 Lck: 10
2. Str: 13 Int: 8 Wis: 9 Dex: 11 Con: 12 Chr: 13 Lck: 14
3. Str: 12 Int: 9 Wis: 13 Dex: 17 Con: 10 Chr: 12 Lck: 12
4. Str: 12 Int: 15 Wis: 7 Dex: 17 Con: 11 Chr: 11 Lck: 12
5. Str: 13 Int: 13 Wis: 12 Dex: 10 Con: 16 Chr: 15 Lck: 12
Choice? [Enter=Roll again, H for help on classes, Q to quit]

[^Choice~? ~[Enter=Roll again, H for help on classes, Q to quit~]-> {#SUB]
{#SUB
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Mar 15, 2002 5:38 am   
 
Sorry the trigger must have gotten cut off in the paste.
#TR {Choice~? ~[Enter=Roll again, H for help on classes, Q to quit~]} {Rating=%ismember(%max(%replace(@LineRatings,"|",",")));#SUB {%trigger Highest:@Rating};#IF (@Rating>1000) {#SEND @Rating} {#ALARM{+3} {#SEND %null}}}

Also it appears the main trigger that captures the number is not firing. Remove the ^ from the beginning of that to correct that problem.

I added some actual response to the prompt trigger, you will see "@Rating>1000" once you play with the minimums and get them set how you like then change that to "@Rating" or "@Rating>=a number you think is good and doable". Also that has a delay before it sends enter so you have some time to read what it is rating different things as if you want to tweak the numbers. I highly recommend that since your mud appears to work off an 18 max and your minimums practically require that the autoroller would reject every roll for an hour or 10 without the delay, that is just rough probabilities.

Your minimum value set was put together in pasteable format here:
#CLASS AutoRoller
#VAR StrRating {17|1|0}
#VAR IntRating {17|1|0}
#VAR WisRating {15|1|0}
#VAR DexRating {17|1|0}
#VAR ConRating {17|1|0}
#VAR ChrRating {15|1|0}
#VAR LckRating {15|1|0}
#CLASS 0

See how they have {your minimum|1|0}. The rating system I set up first checks that they meet or exceed the minimum. Then multiplies the value for the roll by the second number, in this case 1. Finally it multiplies how much the rolled value is above the minimum by the third number. Adding all that together is what makes the rating value for the whole roll. That is more for allowing minimums like:
Str: 14
Int: 17
Wis: 12
Dex: 16
Con: 15
Chr: 11
Lck: 13
But still trying to get the best possible overall. So the different multipliers are there so that you can say having all minimum except Con at 16 is better then having all minimum and Chr at 18. Play with it a bit.
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