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


Joined: 03 May 2002
Posts: 14
Location: USA

PostPosted: Sat May 04, 2002 9:07 pm   

cheap and cheesy autoroller
 
hey there..

how do I make a script that can do this:

I'm playing on a mud that you get random rolls for abilities when creating a new character... for example, if you want a 20 str.. they're very rare in certain instances and you'd potentially have the manually roll around 150 times to achieve it.

How do I make a script that stops on a roll of a given value?

This is what the screen looks like:

---------------------------------------------

Name: Gren
Race: Minotaur
Class: Monk

Ability Scores:
Str: 16/0 Int: 11 Wis: 15 Dex: 11 Con: 15 Cha: 8

Do you wish to keep this character (Y/N)?

---------------------------------------------

if I want the script to enter the value 'n' unless it sees a str value of 20, how do I do that?

Thanks!
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Sat May 04, 2002 10:05 pm   
 
If the mud will allow you to type something
when the stats show up perhaps something
as simple as the following will work.

#TRIGGER {^Str: (%d)} {#IF (%1 != 20) {n} {y}}



TonDiening
Beta Upgrading to 6.26
Reply with quote
Gren
Beginner


Joined: 03 May 2002
Posts: 14
Location: USA

PostPosted: Sat May 04, 2002 10:34 pm   
 

what would the pattern be?

oh.. and if the str is 20, I want it to answer 'y' and if not, answer 'n'

thanks
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Sat May 04, 2002 11:21 pm   
 
This can be entered into your command line:

#TRIGGER {^Str: (%d)} {#IF (%1 != 20) {n} {y}}

It can be entered into the settings editor as:
Trigger:^Str: (%d)
Value:#IF (%1 != 20) {n} {y}

Hopefully this will work for you. If the
strength is not 20 it sends n and if it is
it will send y.

// solution B //
If you mud doesn't like the n being sent
that fast then we can send the y/n when we
get the prompt message:

Variable: V_str
Default Value: 0
Value: 0

Trigger:^Str: (%d)
Value:#VAR V_Str %1

Trigger:Do you wish to keep this character (Y/N)?
Value:#IF (@V_Str != 20) {n} {y}
Options: [X] prompt [ ] newline



TonDiening
Beta Upgrading to 6.26
Reply with quote
Gren
Beginner


Joined: 03 May 2002
Posts: 14
Location: USA

PostPosted: Sun May 05, 2002 2:02 am   
 

thanks much, TonDiening

it worked!

just curious.. if I was willing to settle for one of 2 results.. say I wanted 19 OR 20.. how would I say that in the syntax?

and.. if I wanted the value of more than one att to be met.. like a str of 20 and a dex of 19.. how would I do that? ;)

Thanks much btw!
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Sun May 05, 2002 5:25 am   
 
Capture more and change the #IF statement.

Trigger:^Str: (%d)~/(%d) Int: (%d) Wis: (%d) Dex: (%d) Con: (%d) Cha: (%d)
Value:
#VAR V_Str %1
#VAR V_Str_mod %2
#VAR V_Int %3
#VAR V_Wis %4
#VAR V_Dex %5
#VAR V_Con %6
#VAR V_Cha %7

Trigger:Do you wish to keep this character (Y/N)?
Value:#IF #IF ((@V_Str >= 20) AND @V_Dex >= 19))
{y} {n}
Options: [X] prompt [ ] newline


TonDiening
Beta Upgrading to 6.26
Reply with quote
Gren
Beginner


Joined: 03 May 2002
Posts: 14
Location: USA

PostPosted: Sun May 05, 2002 7:41 pm   
 

sorry for 100 questions.. what if I was willing to accept the results of one of _two_ str rolls?

like if I were to edit the trigegr so not only does it accept a roll of 20... but ALSO of 19 as well..

sorry if you just answered that.. I was a little lost trying to understand your last post.. variables throw me ;)

Thanks again, TonDiening
Reply with quote
Gandorf
Novice


Joined: 28 Oct 2000
Posts: 38
Location: Sweden

PostPosted: Sun May 05, 2002 7:51 pm   
 
Just change in the #IF statment from 20 to 19 and it would work like a dream

Gandorf
Reply with quote
Gren
Beginner


Joined: 03 May 2002
Posts: 14
Location: USA

PostPosted: Sun May 05, 2002 8:36 pm   
 

well.. I'm comfortable with accepting EITHER a 19 or a 20.. so if I could change the trigger to say something like:

#IF (%1 != 19 or 20) {n} {y}

that would be cool..

I doubt that's the correct syntax tho..
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun May 05, 2002 9:24 pm   
 
You can change it to #IF ((%1 != 19) and (%1 != 20)). It's doing things the hard way, but you can do it.

Most people just want to be sure their stats are a minimum value and don't care how high they go, so instead of specifying particular numbers they just specify the minimum with a greater than (>) or greater than or equal to (>=) expression.

LightBulb
Vague questions get vague answers
Reply with quote
Gren
Beginner


Joined: 03 May 2002
Posts: 14
Location: USA

PostPosted: Mon May 06, 2002 3:07 am   
 

Thanks guys.. you were a huge help.. seriously.. rolled a pretty good set thanks to you all!
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