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


Joined: 06 Jul 2002
Posts: 6

PostPosted: Sat Jul 06, 2002 9:59 pm   

Help On Stat Autoroller please
 
Ok I posted this before, but it wasnt very clear. Ok I want a trigger to respon either yes or no to stats. If ALL the stats are over 20, say yes, if not say no. I might have it working, but as far as i can tell it might just keep looping through. So... look at it and point out any problems please.

Text from mud:

Strength : 21
Intelligence : 10
Wisdom : 17
Dexterity : 10
Constitution : 11

Do you wish keep these stats (y/n)?

My set up:
Ok first i assigned all the stats variables, they work, I tested them. the variables are all @str/int/wis/dex/con.

Next I assigned a trigger to catch the first line, strength.

Trigger
Pattern: Do you wish keep these stats ~(y/n~)~?
Command: #if (@str > 19) {intcheck} {n}

Then I made a series of alias checks, to check each stat based on the variables.

Alias
Name: intcheck
Value: #if (@int > 19) {wischeck}

Name: wischeck
Value: #if (@wis > 19) {dexcheck}

Name: dexcheck
Value: #if (@dex > 19) {concheck}

Name: concheck
Value: #if (@con > 19) {y} {n}

Sorry I didn't use the zmud commands for alias' and triggers. I dont usually use them and might have complicated explaining them. I hope you can understand this way, and can point out any problems, thanks.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sat Jul 06, 2002 10:52 pm   
 
The problem with they way you have it set up is that if either int, wis or dex is not above 19, then the script won't do anything. It is better if you put all of the checks inside the trigger, using the and operator:
Pattern: Do you wish keep these stats ~(y/n~)~?
Command: #IF ((@str > 19) and (@int > 19) and (@wis > 19) and (@dex > 19) and (@con > 19)) {y} {n}

Kjata
Reply with quote
MinT_T
Newbie


Joined: 06 Jul 2002
Posts: 6

PostPosted: Sat Jul 06, 2002 11:18 pm   
 
Thank you for your response, been working on this for awhile. It works now, but the only problem is it's late. It'll respond yes to the next stats, but when I look at the previous ones they are the ones i wanted. I tried to change the trigger to activate off of Strength, but it's still late. Any suggestions?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Jul 07, 2002 4:50 am   
 
The question:
Do you wish keep these stats (y/n)?
is usually a prompt type output (that just means it doesn't finish with an end-of-line character). Most triggers wait for an end-of-line before they fire (default condition). To use this question as your pattern, you need to change the options for that trigger to enable trigger on Prompt and disable trigger on End-of-Line. An alternate method is to trigger on an earlier line (such as the one that provides the Constitution stat).

LightBulb
Senior Member
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