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


Joined: 12 May 2004
Posts: 2

PostPosted: Wed May 12, 2004 10:01 am   

Stat roller for v7.05
 
I'm looking for someone to make me a stat rolling trigger(s)
for zmud v7.05 that will do either...

A: look at each stat and reroll the given set of scores if they're all not 14 or higher

OR

B: add up the sum of all the stats and reroll them if their total is less than 110


I ship off to basic training in 12 days so i need this fairly soon... as for the output of the mud when making a character .. its as follows:

Character stats
------------------------------

You may now roll for your character's stats.
You may roll as often as you like.


Strength: 12 (Average)
Dexterity: 10 (Average)
Constitution: 13 (Fit)
Intelligence: 14 (Smart)
Wisdom: 9 (Average)
Charisma: 8 (Average)
Luck: 16 (Very lucky)

Keep? (Y/N)

ok .. hope that helps .. thanks.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Wed May 12, 2004 2:42 pm   
 
#Class {StatRoller}
#TR {Strength: (%d)} {Roll.Str=%1}
#TR {Dexterity: (%d)} {Roll.Dex=%1}
#TR Constitution: (%d)} {Roll.Con=%1
#TR {Intelligence: (%d)} {Roll.Int=%1}
#TR {Wisdom: (%d)} {Roll.Wis=%1}
#TR {Charisma: (%d)} {Roll.Chat=%1}
#TR {Luck: (%d)} {Roll.Lck=%1}
#TR {^Keep? ~(Y/N~)} {total=0:#PRIO {#loopdb @roll {#add total %val}}:#IF ((@roll.str>13 AND @roll.dex>13 AND @roll.con>13 AND @roll.int>13 AND @roll.wis>13 AND @roll.cha>13 and @Roll.lck>13) OR (@total>109)) {#YES "keep?" {Y} {N}} {N}} "" {prompt|nocr}
#CLASS 0
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed May 12, 2004 5:04 pm   
 
You don't need a loop, or even a variable.

#CLASS {StatRoller2}
#TR {Strength: (%d)} {}
#COND {Dexterity: (%d)} {}
#COND {Constitution: (%d)} {}
#COND {Intelligence: (%d)} {}
#COND {Wisdom: (%d)} {}
#COND {Charisma: (%d)} {}
#COND {Luck: (%d)} {}
#COND {} {#IF ((%t1 > 13) AND (%t2 > 13) AND (%t3 > 13) AND (%t4 > 13) AND (%t5 > 13) AND (%t6 > 13) AND (%t7 > 13) AND ((%t1 + %t2 + %t3 + %t4 + %t5 + %t6 + %t7) > 109)) {Y} {N}}
#CLASS 0

Be sure to delete or disable autorollers once you've finished rolling your character.

These are a couple of methods, there are many others possible. They all follow the same basic plan: check that each stat is in the desired range and that the total is in the desired range, then answer accordingly.

EDIT: Corrected script to include {} for blank commands parameter in #CONDITION


Last edited by LightBulb on Thu Sep 23, 2004 3:37 pm; edited 4 times in total
Reply with quote
domnslave2003
Newbie


Joined: 12 May 2004
Posts: 2

PostPosted: Wed May 12, 2004 7:05 pm   
 
Thanks lightbulb,.. that works great with a exception.
It only rolls between 3-5 times before stopping and me having to choose yes or no, then it starts rolling. Is this because the roller you wrote up adds up the total to 110 or did you write up one that would look at each stat and if they all weren't over 13 it would reroll?
If at all possible, could you write up on that checks each one to be 13 or higher? I think the one above yours does that... but it wouldn't activate.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed May 12, 2004 10:45 pm   
 
It already checks that each stat is 14 or higher.
It also checks that the total of all stats is 110 or higher.
That should be obvious, the IF condition isn't hard to read.

If it's stopping every 3-5 rolls, it's because it's faster than your MUD will allow. The solution is to add a delay. Replace the script with the one below.

#CLASS {StatRoller2}
#TR {Strength: (%d)} {}
#COND {Dexterity: (%d)} {}
#COND {Constitution: (%d)} {}
#COND {Intelligence: (%d)} {}
#COND {Wisdom: (%d)} {}
#COND {Charisma: (%d)} {}
#COND {Luck: (%d)} {}
#COND {} {#IF ((%t1 > 13) AND (%t2 > 13) AND (%t3 > 13) AND (%t4 > 13) AND (%t5 > 13) AND (%t6 > 13) AND (%t7 > 13) AND ((%t1 + %t2 + %t3 + %t4 + %t5 + %t6 + %t7) > 109)) {Y} {N}} {Wait|Param=500}
#CLASS 0

Increase the param if you need a longer delay (1000 = 1 second).

EDIT: Corrected script to include {} for blank commands parameter in #CONDITION


Last edited by LightBulb on Thu Sep 23, 2004 3:36 pm; edited 2 times in total
Reply with quote
jolopez
Novice


Joined: 31 May 2003
Posts: 49

PostPosted: Thu May 13, 2004 7:58 am   
 
i will not do a wait. it is suppose to be better an alarm command no? so in the Y o N case put #alarm +1000 {Y} o #alarm +1000 {N} the number is in seconds
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Thu May 13, 2004 4:44 pm   
 
http://www.zuggsoft.com/zmud/timers.htm

A Wait PARAM in a #COND trigger is COMPLETLY differant then the #WAIT command and is the suggested way to do it.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu May 13, 2004 7:25 pm   
 
quote:
From the the Support Library article, Advanced zMUD Triggers
The #WAIT command had side effects and could pause the reception of text from the MUD or other trigger processing. The new Wait trigger state does not have these side effects.

There's no problem using the Wait trigger state. However, alarms will also work as long as you adjust the time-period correctly (seconds instead of milliseconds). You don't want 1000-second alarms (about 16min 40sec)
#IF (conditions} {#ALARM +1 Y} {#ALARM +1 N}
Reply with quote
Speed
Newbie


Joined: 17 Sep 2004
Posts: 3

PostPosted: Thu Sep 23, 2004 2:17 pm   
 
Hey, I'm trying to get a stat rolling thing going on as well. The game is Tele-Arena. I copied the previously posted script and made a class for it...

#CLASS {StatRoller}
#TR {Intellect: (%d)}
#COND {Knowledge: (%d)}
#COND {Physique: (%d)}
#COND {Stamina: (%d)}
#COND {Agility: (%d)}
#COND {Charisma: (%d)}
#COND {} {#IF ((%t1 > 10) AND (%t2 > 10) AND (%t3 > 10) AND (%t4 > 10) AND (%t5 > 10) ) {Y} {N}} {Wait|Param=500}
#CLASS 0

Pretty Basic, eh?

Whenever I save, zMud automatically reduces it to this:

#CLASS {StatRoller}
#TRIGGER {Intellect: %d} {}
#COND {} {#IF ((%t1 > 10) AND (%t2 > 10) AND (%t3 > 10) AND (%t4 > 10) AND (%t5 > 10) ) {Y} {N}} {wait|param=500}
#CLASS 0

It killed all of the conditions but the last one and saved that. I put {}s after all of the conditions, and now they save, but I still cannot get the trigger to fire. I am getting so damned aggrivated. I've programmed muds in C/C++ for the better part of five freaking years, and I can't get a simple trigger to work in this program.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Sep 23, 2004 3:18 pm   
 
That's interesting. I hadn't realized that #CONDITION, unlike #TRIGGER, requires a commands parameter so that a blank commands parameter must be explicitly entered.

Did you intentionally ignore Charisma (%t6)?

I can't find anything wrong with the trigger or conditions, so I would guess that the patterns don't always match. This is usually caused by having the wrong number of spaces, especially in patterns where the number of spaces varies to maintain column alignment. Use %s to match those spaces.

#CLASS {StatRoller}
#TR {Intellect: %s (%d)} {}
#COND {Knowledge: %s (%d)} {}
#COND {Physique: %s (%d)} {}
#COND {Stamina: %s (%d)} {}
#COND {Agility: %s (%d)} {}
#COND {Charisma: %s (%d)} {}
#COND {} {#IF ((%t1 > 10) AND (%t2 > 10) AND (%t3 > 10) AND (%t4 > 10) AND (%t5 > 10) ) {Y} {N}} {Wait|Param=500}
#CLASS 0
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
Reply with quote
Speed
Newbie


Joined: 17 Sep 2004
Posts: 3

PostPosted: Thu Sep 23, 2004 4:19 pm   
 
OMG that was so annoying. Thanks for your help. I did the %s thing and it worked. Every flippin time I tried to space things out, zMud would automatically take out my spaces. God I hate the formatting in this program, nothing I type into that editor should change after I click save. Nothing. Ever. For any reason. :) I got it goin though, thanks!
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Sep 23, 2004 7:02 pm   
 
The forum doesn't display extra spaces, but it does retain them -- they can be seen by using the 'quote' button (Reply with quote).

I seldom use the settings editor, but you can stop it from stripping spaces by disabling these options on the Options Menu: Check syntax while typing, Command Help while typing, Pretty Print, and Convert to one line commands. Yes, that's all the options. Pretty Print seems to be the main culprit, you might be able to leave the others on if you want. You can also force the settings editor to accept multiple spaces by enclosing them in double-quotes.
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
Reply with quote
Rorso
Wizard


Joined: 14 Oct 2000
Posts: 1368

PostPosted: Thu Sep 23, 2004 7:52 pm   
 
LightBulb wrote:
The forum doesn't display extra spaces, but it does retain them -- they can be seen by using the 'quote' button (Reply with quote).

I seldom use the settings editor, but you can stop it from stripping spaces by disabling these options on the Options Menu: Check syntax while typing, Command Help while typing, Pretty Print, and Convert to one line commands. Yes, that's all the options. Pretty Print seems to be the main culprit, you might be able to leave the others on if you want. You can also force the settings editor to accept multiple spaces by enclosing them in double-quotes.

This is a sign of a bug. I really doubt Zugg wants the settings editor to remove spaces from patterns.

Edit: The likely reason the pretty printer removes extra white spaces is to clarify the interpretation of the script. Like a command is has a set of arguments separated by one or more spaces. The pretty printer believes that it is prettier to use one space instead of many. If you need multiple spaces you would need to use "" quotes. Removing extra whitespace this way doesn't affect the meaning of the script.

However as it is now it does change the meaning of the script when it removes whitespace from trigger patterns. So it must be a bug :).
Reply with quote
John Zimmer
Newbie


Joined: 25 Sep 2004
Posts: 1

PostPosted: Sat Sep 25, 2004 7:29 am   
 
I was trying to figure out how to do an autoroller as well. I did one that work, on a good day a few years ago. I hope someone here can start me off to deal with this format:

Choose one of the following set:
1) Str:17 Int:13 Wis:12 Dex:15 Con:11 Luc:15
2) Str:11 Int: 9 Wis: 9 Dex: 5 Con:12 Luc:12
3) Str:15 Int: 7 Wis:12 Dex:14 Con:11 Luc:12
4) Str: 9 Int:14 Wis:10 Dex:13 Con: 8 Luc:13
5) Str:12 Int:13 Wis: 8 Dex: 9 Con:13 Luc:13
Choose [1-5 set, Return roll again,q- quit]:

It would be fairly simple if it were just one line, but I get lost when it is 5 to consider. Any thoughts?
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sat Sep 25, 2004 11:49 am   
 
#CLASS AutoRoll
#TR {^Chose one of the following set:} {#VAR StatMatch ""}
#TR "stats" {^(%d)~) Str:(&2) Int:(&2) Wis:(&2) Dex:(&2) Con:(&2) Luc:(&2)} {
#IF ((%2>=X) AND (%3>=X) AND (%4>=X) AND (%5>=X) AND (%6>=X) AND (%7>=X)) {
#CW High,Blue
#VAR StatMatch %1
}
}
#TR {Choose: ~[1-5 set, Return roll again, q- quit} {
#IF (!%null( @StatMatch)) {
#BEEP
#EXEC @StatMatch
} {#CR}
}
#CLASS 0

Used Pretty Print

Change X to whatever Number you want.
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