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


Joined: 19 Feb 2004
Posts: 18
Location: USA

PostPosted: Thu Feb 19, 2004 1:30 pm   

Statroller for Shadowdale MUD
 
this is the output format of my mud:



Reroll!
STR : You are slightly favored in tug-o-war games.
DEX : You have good balance.
INT : You are a bit of a slow learner.
WIS : You sometimes learn from your mistakes.
CON : You never get sick and can run miles without tiring.
CHR : People enjoy your company.


Do these stats look satisfactory to you? [y/n]:

I want to make sure INT : is equal to "Your intelligence rivals the ancients!" and WIS : is equal to "Your wisdom equals the sum of many lifetimes!"

Any ideas?[?]
Reply with quote
Rorso
Wizard


Joined: 14 Oct 2000
Posts: 1368

PostPosted: Thu Feb 19, 2004 5:40 pm   
 
quote:
Originally posted by metroiceberg

this is the output format of my mud:



Reroll!
STR : You are slightly favored in tug-o-war games.
DEX : You have good balance.
INT : You are a bit of a slow learner.
WIS : You sometimes learn from your mistakes.
CON : You never get sick and can run miles without tiring.
CHR : People enjoy your company.


Do these stats look satisfactory to you? [y/n]:

I want to make sure INT : is equal to "Your intelligence rivals the ancients!" and WIS : is equal to "Your wisdom equals the sum of many lifetimes!"

Any ideas?[?]


This shouldn't be too hard. First you capture the data you are interested in and store it somewhere. Then depending on the data you reroll.

Usually it is a good idea to store set of triggers in their own folder, or class as zMUD like to call them.
Code:

<b>#CLASS</b> StatRoller
 <b>#trigger</b> {^INT : (*)} {stat.int={%1}}
 <b>#trigger</b> {^WIS : (*)} {stat.wis={%1}}
 <b>#trigger</b> {^Do these stats look satisfactory to you} {<b>#if</b> <u>(@stat.int</u>="Your intelligence rivals the ancients!" and <u>@stat.wis</u>="Your wisdom equals the sum of many lifetimes!") {y} {n}} "" {prompt}
<b>#CLASS</b> 0

I haven't actually tested this trigger Very Happy. This is the basic layout on how to make a stat roller though. We detect lines containing INT/WIS and store them in the variables int, and wis in the stat record. The last step is that we detect the question asking us if we want to reroll or not. We look in the data we stored and compared it to the data we want to have, and if we dont have the data we want we reroll.

Hopefully this will help you get started with your stat roller. Good luck.
Reply with quote
metroiceberg
Beginner


Joined: 19 Feb 2004
Posts: 18
Location: USA

PostPosted: Fri Feb 20, 2004 5:45 am   
 
quote:
This shouldn't be too hard. First you capture the data you are interested in and store it somewhere. Then depending on the data you reroll.

Usually it is a good idea to store set of triggers in their own folder, or class as zMUD like to call them.
Code:

<b>#CLASS</b> StatRoller
 <b>#trigger</b> {^INT : (*)} {stat.int={%1}}
 <b>#trigger</b> {^WIS : (*)} {stat.wis={%1}}
 <b>#trigger</b> {^Do these stats look satisfactory to you} {<b>#if</b> <u>(@stat.int</u>="Your intelligence rivals the ancients!" and <u>@stat.wis</u>="Your wisdom equals the sum of many lifetimes!") {y} {n}} "" {prompt}
<b>#CLASS</b> 0

I haven't actually tested this trigger Very Happy. This is the basic layout on how to make a stat roller though. We detect lines containing INT/WIS and store them in the variables int, and wis in the stat record. The last step is that we detect the question asking us if we want to reroll or not. We look in the data we stored and compared it to the data we want to have, and if we dont have the data we want we reroll.

Hopefully this will help you get started with your stat roller. Good luck.



Thanks! We'll give it a go, and see what happens...
Reply with quote
metroiceberg
Beginner


Joined: 19 Feb 2004
Posts: 18
Location: USA

PostPosted: Fri Feb 20, 2004 6:10 am   
 
Ok, I've tested it. When the arguements are both false, two "n"s are entered, instead of just one.
Reply with quote
metroiceberg
Beginner


Joined: 19 Feb 2004
Posts: 18
Location: USA

PostPosted: Fri Feb 20, 2004 6:03 pm   
 
quote:
Originally posted by Rorso

quote:
Originally posted by metroiceberg

this is the output format of my mud:



Reroll!
STR : You are slightly favored in tug-o-war games.
DEX : You have good balance.
INT : You are a bit of a slow learner.
WIS : You sometimes learn from your mistakes.
CON : You never get sick and can run miles without tiring.
CHR : People enjoy your company.


Do these stats look satisfactory to you? [y/n]:

I want to make sure INT : is equal to "Your intelligence rivals the ancients!" and WIS : is equal to "Your wisdom equals the sum of many lifetimes!"

Any ideas?[?]


This shouldn't be too hard. First you capture the data you are interested in and store it somewhere. Then depending on the data you reroll.

Usually it is a good idea to store set of triggers in their own folder, or class as zMUD like to call them.
Code:

<b>#CLASS</b> StatRoller
 <b>#trigger</b> {^INT : (*)} {stat.int={%1}}
 <b>#trigger</b> {^WIS : (*)} {stat.wis={%1}}
 <b>#trigger</b> {^Do these stats look satisfactory to you} {<b>#if</b> <u>(@stat.int</u>="Your intelligence rivals the ancients!" and <u>@stat.wis</u>="Your wisdom equals the sum of many lifetimes!") {y} {n}} "" {prompt}
<b>#CLASS</b> 0

I haven't actually tested this trigger Very Happy. This is the basic layout on how to make a stat roller though. We detect lines containing INT/WIS and store them in the variables int, and wis in the stat record. The last step is that we detect the question asking us if we want to reroll or not. We look in the data we stored and compared it to the data we want to have, and if we dont have the data we want we reroll.

Hopefully this will help you get started with your stat roller. Good luck.



Ok. Now that I have tried the script to this point, here is the problem I'm having now. The output is now showing:

STR : You are slightly favored in tug-o-war games.
DEX : You have good balance.
INT : You are a bit of a slow learner.
WIS : You sometimes learn from your mistakes.
CON : You never get sick and can run miles without tiring.
CHR : People enjoy your company.


Do these stats look satisfactory to you? [y/n]:n
n

So it looks like the script is giving the response for each condition being true, instead of the entire arguement being true...

Any fixes for this?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Feb 20, 2004 6:54 pm   
 
The trigger is giving two answers each time it fires because you have both the Newline and the Prompt options enabled. Disable the Newline option.
Reply with quote
metroiceberg
Beginner


Joined: 19 Feb 2004
Posts: 18
Location: USA

PostPosted: Fri Feb 20, 2004 7:09 pm   
 
Simple as that? *smacks head* DUH!

Thanks, LightBulb
Reply with quote
Bounces
Newbie


Joined: 09 Jul 2005
Posts: 5

PostPosted: Thu Nov 16, 2006 9:48 pm   
 
Okay...I play in the same mud...and am just learning about scripts and classes...so what is wrong with this script?

#CLASS {StatRoller}
#trigger {^STR : (*)}{stat.str={%1}}
#trigger {^CON : (*)}{stat.con={%1}}
#trigger {^DEX : (*)}{stat.dex={%1}}
#trigger {^INT : (*)}{stat.int={%1}}
#trigger {^WIS : (*)}{stat.wis={%1}}
#trigger {^CHR : (*)}{stat.chr={%1}}
#trigger {^Do these stats look satisfactory to you}{#if {@stat.str="Your strength is amazing!" and @stat.con="Illness is a foreign thing to you!" and @stat.dex="You could dodge sunlight!" and @stat.int="Your intelligence rivals the ancients!" and @stat.wis="Your wisdom equals the sum of many lifetimes!" and @stat.chr="You could become the next leader of your race!"} {y} {n} "" {prompt}
#CLASS 0

at the end of the last line it points to the double quote and says "command list expected"

What's that?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Nov 17, 2006 12:18 am   
 
You need to add another curly brace after {n} to match the one you opened before #if.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Bounces
Newbie


Joined: 09 Jul 2005
Posts: 5

PostPosted: Fri Nov 17, 2006 3:09 am   
 
Okay, I did that...but it's still saying the same thing.
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Fri Nov 17, 2006 8:51 am   
 
#if (@stat.str ... your race!") {y} {n}} "" {prompt}
_________________
Taz :)
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