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
Takashi
Beginner


Joined: 19 Feb 2004
Posts: 14
Location: USA

PostPosted: Sat Feb 21, 2004 8:11 am   

Stat roller?
 
Well.. If someone could help me out that would be great. I want to roll stats automatically for a MUD i play called Myrradel (myrradel.com 4000) See, its REALLY hard to get good stats. The max for a stat is 18, and its a 1 out of 524 chance to get an 18. You can imagine how many hours i have spent rolling. I want to make a script as simple as it can be. The following is what the MUD looks like while rolling stats:


Choose one of the following sets of character stats:
<---S E T---> 1 2 3 4 5
Intelligence: 15 15 11 11 13
Wisdom......: 11 11 12 14 14
Strength....: 10 9 14 12 8
Dexterity...: 9 10 11 13 13
Constitution: 15 14 9 11 15
Select a set of statistics <1-5> or hit <ENTER> to reroll:


Thats the basics of it, I'm sure whoever reads this can figure out whats going on. If someone could help me write this script, or write part of it and let me alter it for all the stats. What i want to do, is have 2 options.
Option 1) choose what stats i want like Int 14, wisdom 14, 18 strength ,18 dexterity, 18 constitution.
Option 2) Set a total for the roller to come up with. So something where i could enter 84, and it would add the stats up vertically and stop if one came up to a total of 84 or more.

I know thats a LOT of work, but if someone can point me in the right direction, i would appreciate it.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Feb 21, 2004 5:56 pm   
 
The right direction would be the Search link. Autorollers have been done for almost every method.

For this case, it's a simple matter of using variables to record the 5 sets, then deciding if any of them are acceptable. Option 1, as you requested, is individual stats and Option 2 (or any other value) is total stats. It's not a difficult or complex script, just a long and tedious one to type out.

#VAR Option 1
#VAR Int 14
#VAR Wis 14
#VAR Str 18
#VAR Dex 18
#VAR Con 18
#VAR Total 84
#TR {^Choose one of the following sets of character stats:} {
#VAR set1 ""
#VAR set2 ""
#VAR set3 ""
#VAR set4 ""
#VAR set5 ""
#VAR Choice 0
}
#COND {Intelligence* (%d) * (%d) * (%d) * (%d) * (%d)} {
#ADDK set1 Int %1
#ADDK set2 Int %2
#ADDK set3 Int %3
#ADDK set4 Int %4
#ADDK set5 Int %5
}
#COND {Wisdom* (%d) * (%d) * (%d) * (%d) * (%d)} {
#ADDK set1 Wis %1
#ADDK set2 Wis %2
#ADDK set3 Wis %3
#ADDK set4 Wis %4
#ADDK set5 Wis %5
}
#COND {Strength* (%d) * (%d) * (%d) * (%d) * (%d)} {
#ADDK set1 Str %1
#ADDK set2 Str %2
#ADDK set3 Str %3
#ADDK set4 Str %4
#ADDK set5 Str %5
}
#COND {Dexterity* (%d) * (%d) * (%d) * (%d) * (%d)} {
#ADDK set1 Dex %1
#ADDK set2 Dex %2
#ADDK set3 Dex %3
#ADDK set4 Dex %4
#ADDK set5 Dex %5
}
#COND {Constitution* (%d) * (%d) * (%d) * (%d) * (%d)} {
#ADDK set1 Con %1
#ADDK set2 Con %2
#ADDK set3 Con %3
#ADDK set4 Con %4
#ADDK set5 Con %5
#IF (@Option = 1) {
#IF ((@Set1.Int >= @Int) AND (@Set1.Wis >= @Wis) AND (@Set1.Str >= @Str) AND (@Set1.Dex >= @Dex) AND (@Set1.Con >= @Con)) {
#VAR Choice 1
}
#IF ((@Set2.Int >= @Int) AND (@Set2.Wis >= @Wis) AND (@Set2.Str >= @Str) AND (@Set2.Dex >= @Dex) AND (@Set2.Con >= @Con)) {
#VAR Choice 2
}
#IF ((@Set3.Int >= @Int) AND (@Set3.Wis >= @Wis) AND (@Set3.Str >= @Str) AND (@Set3.Dex >= @Dex) AND (@Set3.Con >= @Con)) {
#VAR Choice 3
}
#IF ((@Set4.Int >= @Int) AND (@Set4.Wis >= @Wis) AND (@Set4.Str >= @Str) AND (@Set4.Dex >= @Dex) AND (@Set4.Con >= @Con)) {
#VAR Choice 4
}
#IF ((@Set5.Int >= @Int) AND (@Set5.Wis >= @Wis) AND (@Set5.Str >= @Str) AND (@Set5.Dex >= @Dex) AND (@Set5.Con >= @Con)) {
#VAR Choice 5
}} {
#IF ((@Set1.Int + @Set1.Wis + @Set1.Str + @Set1.Dex + @Set1.Con) >= @Total) {
#VAR Choice 1
}
#IF ((@Set2.Int + @Set2.Wis + @Set2.Str + @Set2.Dex + @Set2.Con) >= @Total) {
#VAR Choice 2
}
#IF ((@Set3.Int + @Set3.Wis + @Set3.Str + @Set3.Dex + @Set3.Con) >= @Total) {
#VAR Choice 3
}
#IF ((@Set4.Int + @Set4.Wis + @Set4.Str + @Set4.Dex + @Set4.Con) >= @Total) {
#VAR Choice 4
}
#IF ((@Set5.Int + @Set5.Wis + @Set5.Str + @Set5.Dex + @Set5.Con) >= @Total) {
#VAR Choice 5
}}
#IF (@Choice > 0) {
@Choice
} {
#ALA +1 {
#CR
}}}

EDIT: Added an alarm
Reply with quote
Takashi
Beginner


Joined: 19 Feb 2004
Posts: 14
Location: USA

PostPosted: Sun Feb 22, 2004 3:49 am   
 
Hrm.. Um, i can't get it to work right. It will roll through maybe 2 sets, but thats it. Does it stop if it gets /one/ stat match? Because all the conditions need to be true for it to stop. Like 18 con, 16 wis, etc. Not if it just lands 16 wisdom. Either that or i'm not using it right, any suggestions?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Feb 22, 2004 5:28 am   
 
No, as written it doesn't stop unless ALL five stats in one set are at or above the desired minimum set in the variables before the trigger for option one. It doesn't stop for option two unless the total of ALL five stats in one set is at or above the desired total in the Total variable.

I probably should have included instructions for use. A lot of people don't realize that settings can be created from the main window, so they try to find somewhere to put the script in the Settings Editor. Since it wasn't written for entry in the Settings Editor they almost always get it wrong.

Start by deleting any triggers you already made with this script. Use your mouse to highlight the entire script, then right-click and Copy it all to the clipboard. In zMUD, right-click in the command line in the main window (NOT the settings editor) and Paste. Press ENTER. It's ready to go.
Reply with quote
Takashi
Beginner


Joined: 19 Feb 2004
Posts: 14
Location: USA

PostPosted: Sun Feb 22, 2004 5:30 am   
 
Sorry to say, I still can't get it to work. It still refuses to go through more than 2 rolls, and not a single condition is being met. Any clues? If you want to test it yourself the adress is as follows: Myrradel.com Port:4000 You don't have to do anything but enter the name to get to the stat rolling part of it.
I would really appreciate it
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Feb 22, 2004 6:31 am   
 
You're right. I added an alarm to slow down the response a little, and that seems to have fixed it.
Reply with quote
Takashi
Beginner


Joined: 19 Feb 2004
Posts: 14
Location: USA

PostPosted: Sun Feb 22, 2004 6:36 am   
 
I've no clue how to make an alarm, and i don't know where to put it :) could you please tell me?
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sun Feb 22, 2004 7:25 am   
 
IF you would post more of what happens we would know the problem. after loggin in I found that
Choose one of the following sets of character stats: Does not start on a new line for new rolls because of th ^ in the trigger

so Edit the trigger and remove the ^ from the pattern

If you can't figure out how to do that read the helpfiles
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sun Feb 22, 2004 7:32 am   
 
or What lightbuld did *reminds self to refresh window more often*
Reply with quote
Takashi
Beginner


Joined: 19 Feb 2004
Posts: 14
Location: USA

PostPosted: Sun Feb 22, 2004 7:57 am   
 
That still doesn't answer my question of where to put the alarm.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sun Feb 22, 2004 8:17 am   
 
Delete your settings and copy/past the code Lightbulb posted
Reply with quote
Takashi
Beginner


Joined: 19 Feb 2004
Posts: 14
Location: USA

PostPosted: Sun Feb 22, 2004 8:44 am   
 
Ahh i didn't see it was edited. Much thanks Lightbulb, you have helped /ALOT/. If you ever think of playing there, I'll hook yah up with a good character. Thanks again
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