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


Joined: 27 Jul 2001
Posts: 17

PostPosted: Sun Dec 29, 2002 1:33 am   

Auto Roller
 
Ok this may seem like a rather confusing thing I am completely lost as to where to start with this auto roller I need to have it check that the total value of all stats but app and trains is more then 490 and that cha is less the 40 and all other stats are less then 90. the mud output is like this.

Str:44 Qui:87 Dex:83 Int:99 Wis:86 Con:41 Cha:36 App:66 Trains:0
Accept these values (Y/N) ?

any help would be nice
Reply with quote
iljhar
GURU


Joined: 10 Oct 2000
Posts: 1116
Location: USA

PostPosted: Sun Dec 29, 2002 4:55 am   
 
how about this:

#trigger {Str:(%d) Qui:(%d) Dex:(%d) Int:(%d) Wis:(%d) Con:(%d) Cha:(%d) App:%d Trains:%d$Accept these values ~(Y~/N~) ?} {#var Good 1;#if ((%1+%2+%3+%4+%5+%6+%7)<=490) {#var Good 0};#if (%1>=90) {#var Good 0};#if (%2>=90) {#var Good 0};#if (%3>=90) {#var Good 0};#if (%4>=90) {#var Good 0};#if (%5>=90) {#var Good 0};#if (%6>=90) {#var Good 0};#if (%7>=40) {#var Good 0};#if (@Good=1) {y} {n}}

A bit clumsy, but it should work.

Iljhar
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Dec 29, 2002 6:34 am   
 
Since iljhar included the question in the trigger phrase, this will probably need to be a "prompt" trigger. To make it a "prompt" trigger, go to the Options tab in the editor, and click the checkbox next to Trigger on: Prompt. It would be a good idea to uncheck Trigger on: Newline.

This can also be done at the command line using the "nocr" and "prompt" options.
#trigger {Str:(%d) Qui:(%d) Dex:(%d) Int:(%d) Wis:(%d) Con:(%d) Cha:(%d) App:%d Trains:%d$Accept these values ~(Y~/N~) ?} {#var Good 1;#if ((%1+%2+%3+%4+%5+%6+%7)<=490) {#var Good 0};#if (%1>=90) {#var Good 0};#if (%2>=90) {#var Good 0};#if (%3>=90) {#var Good 0};#if (%4>=90) {#var Good 0};#if (%5>=90) {#var Good 0};#if (%6>=90) {#var Good 0};#if (%7>=40) {#var Good 0};#if (@Good=1) {y} {n}} {} {nocr|prompt}

Another method is to use a single-line pattern using the default "Trigger on" options. This will trigger when it receives the newline before the question. Since App and Trains aren't used, I left them out of the pattern also.
#TR {Str:(%d) Qui:(%d) Dex:(%d) Int:(%d) Wis:(%d) Con:(%d) Cha:(%d)} {#IF (((%1 + %2 + %3 + %4 + %5 + %6 + %7) > 490) AND (%1 < 90) AND (%2 < 90) AND (%3 < 90) AND (%4 < 90) AND (%5 < 90) AND (%6 < 90) AND (%7 < 40)) {yes} {no}}

LightBulb
Senior Member
Reply with quote
Noboyuki
Beginner


Joined: 27 Jul 2001
Posts: 17

PostPosted: Tue Dec 31, 2002 3:16 am   
 
It works Great Thanks now my next Question is there a way to show the output of all the numbers o I can see what the total value is
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Dec 31, 2002 7:37 pm   
 
Sure. Use #MATH or %eval to add them all up, and #SAY, #SHOW, or #ECHO to display the total.

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