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


Joined: 13 Mar 2004
Posts: 1
Location: USA

PostPosted: Sat Mar 13, 2004 8:47 pm   

Stat Roller for a CircleMUD.
 
Okay, this is what I've gotten so far:
#TRIGGER {New stats: Str *, Int *, Wis *, Dex *, Con *, Cha *} {#IF (%1<=18 %2<=13 %3<=13 %4<=18 %5<=18) {buy reroll}}

My problem is that while it does roll, it doesn't stop when it has the desired stats. Any help anyone could offer would be appreciated, and I apologize in advance if this one has already been done and I just didn't look hard enough.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Mar 13, 2004 9:56 pm   
 
You didn't put parentheses anywhere in your pattern, so you don't have any values for %1-%5.
Your IF condition isn't structured properly. It should have an operator between each item (probably OR).

#TR {New stats: Str (*), Int (*), Wis (*), Dex (*), Con (*), Cha (*)} {#IF ((%1 <= 18) OR (%2 <= 13) OR (%3 <= 13) OR (%4 <= 18) OR (%5 <= 18)) {buy reroll}}
Reply with quote
Motient
Beginner


Joined: 14 Mar 2004
Posts: 18
Location: USA

PostPosted: Sun Mar 14, 2004 6:23 am   
 
I tried that improved script but it won't reroll and I have 5.55 it stops on these stats:
New stats: Str 16/0, Int 9, Wis 11, Dex 16, Con 15, Cha 7

Any ideas why?
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Sun Mar 14, 2004 2:55 pm   
 
Try this:

#TRIGGER {New stats:%sStr%s(%d)/%d,%sInt%s(%d),%sWis%s(%d),%sDex%s(%d),%sCon%s(%d),%sCha%s(%d)} {#IF ((%1<18) OR (%2<13) OR (%3<13) OR (%4<18) OR (%5<18)) {buy reroll}}
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Mar 14, 2004 8:04 pm   
 
Two reasons.
1. Your strength isn't a single number, it's two of them, but you only had one wildcard in your trigger and since that's all the information I had to work with I only used one in mine.
2. Most questions from the MUD are prompts, meaning that they don't end with a newline. If this is the case, you'll need to change the trigger's options from Trigger on Newline to Trigger on Prompt.
Reply with quote
Motient
Beginner


Joined: 14 Mar 2004
Posts: 18
Location: USA

PostPosted: Sun Mar 14, 2004 11:14 pm   
 
2 issues when I was looking at this

#TRIGGER {New stats:%sStr%s(%d)/%d,%sInt%s(%d),%sWis%s(%d),%sDex%s(%d),%sCon%s(%d),%sCha%s(%d)} {#IF ((%1<18) OR (%2<13) OR (%3<13) OR (%4<18) OR (%5<18)) {buy reroll}}

wouldn't the ors need to be and if you wanted to be above those numbers also when I tried both directions (or) or (and) it wouldn't do the buy reroll. Should I put that on the line below it or what should I try?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Mar 15, 2004 12:28 am   
 
Just noticed that you (Motient) didn't ask the original question. Since your MUD's character roller doesn't appear to be the same as Valen's, you should probably use the Search link to find something which is a closer match to your MUD's output or start a new topic.

This thread is intended to help Valen, and it probably will only confuse him if we go off on a tangent to an autoroller for somewhere else. Just as this one, which was written for a MUD other than yours, has confused you.
Reply with quote
Motient
Beginner


Joined: 14 Mar 2004
Posts: 18
Location: USA

PostPosted: Mon Mar 15, 2004 4:54 am   
 
We are from the same MUD Valen is my friend, Valen was making the script for me. Since I was drawing a blank on it. Eternal Darkness is the name of the mud it is a modified Circle/Diku MUD
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Mar 15, 2004 5:38 am   
 
Very well.
"(W)ouldn't the ors need to be and if you wanted to be above those numbers(?)"
Yes. However Valen's initial trigger tested for BELOW those numbers and so have all the variations derived from it. If you decide to change it to ABOVE, then you'll also need to change the logical operator.

"(W)hen I tried both directions (or) or (and) it wouldn't do the buy reroll...what should I try?"
I already answered this.
"2. Most questions from the MUD are prompts, meaning that they don't end with a newline. If this is the case, you'll need to change the trigger's options from Trigger on Newline to Trigger on Prompt."

It doesn't appear that you need to use %s. %s is used in situations where the number of spaces between items may change. From your example, that doesn't appear to be the case at all. However, it's possible that there might be an extra space when you receive a one-digit number. If that is the case, leave the %s before each number, but take out all the rest of them and replace with the correct number of spaces. This will improve readability and make it easier to understand your trigger pattern when you come back to it several months later and wonder what it does.
#TR {New stats: Str (%d)/%d, Int (%d), Wis (%d), Dex (%d), Con (%d), Cha (%d)} {#IF ((%1 <= 18) OR (%2 <= 13) OR (%3 <= 13) OR (%4 <= 18) OR (%5 <= 18)) {buy reroll}} {} {prompt|nocr}

NOTES:
1. I didn't put () around the second %d in Str: (%d)/%d. This is intentional.
2. The IF condition only checks 5 items: Str, Int, Wis, Dex, and Con. Cha is not checked. This is as per Valen's original trigger. If you want to add a check for Cha, it's %6.
3. Str, Dex, and Con must all be greater than 18 for a roll to be accepted. This seems unrealistic to me, but again it's what Valen put in the original trigger.
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Mon Mar 15, 2004 5:45 am   
 
I included the %s's in case Motient's trigger wasn't firing due to spacing issues, which as the rest of the trigger looked to be alright could only assume was making it not fire.
Reply with quote
Motient
Beginner


Joined: 14 Mar 2004
Posts: 18
Location: USA

PostPosted: Mon Mar 15, 2004 8:12 am   
 
Danlo
Your script works perfect thanks
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