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
shadowsurfer
Novice


Joined: 17 Dec 2004
Posts: 34

PostPosted: Sun Dec 31, 2006 3:23 am   

Stat Rolling/Character Creation
 
I'm looking for a script that will read a set of stats for character creation and, if they don't match a predetermined setup, will clear the screen and reroll until that setup is reached. The stat screen when rolled looks something like this:

-=-*-=- Your rolls -=-*-=-
Roll number: 1 = 8
Roll number: 2 = 12
Roll number: 3 = 15
Roll number: 4 = 14
Roll number: 5 = 14
Roll number: 6 = 15
-=-*-=-=-=-=**=-=-=-=-*-=-

A sample of a predetermined setup (because i'm not sure exactly what I want yet) would be that if the total of the roll is = or > 85 then nothing happens and I can assign the rolls. But if the total of the roll is <85 it issues the command REROLL and another set is rolled.

Can someone help me with this? I would be greatful.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sun Dec 31, 2006 11:09 am   
 
#var Rolls ""
#var RollTotal ""
#trig {Roll number: (%d) = (%d)} {#addkey Rolls %1 %2;#if (%1=6) {#loopdb @Rolls {#math RollTotal @RollTotal+%val};#if (@RollTotal >= 85) {#echo Total is over 85, done.} {#var Rolls "";#var RollTotal "";reroll}}

Think that should work.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
shadowsurfer
Novice


Joined: 17 Dec 2004
Posts: 34

PostPosted: Mon Jan 01, 2007 2:01 pm   
 
It didn't. Maybe I left some things out, not sure. Here is the screen you get when you first log in:

-> -=-*-=- Your rolls -=-*-=-
Roll number: 1 = 10
Roll number: 2 = 12
Roll number: 3 = 8
Roll number: 4 = 9
Roll number: 5 = 10
Roll number: 6 = 9
-=-*-=-=-=-=**=-=-=-=-*-=-
Now you can <assign> a roll number to a stat.
For instance 'assign 2 strength' will assign roll #2 to strength.
You can type <show> at any point to list your rolls.
You can also type <stats> to show your current stats.
Note that you can just type <quick> to quickly associate them.
Note that you can <reroll> if you are not satisfied
with your stats.
Remember that this command will remove your old stats!
Type <done> when you are finished with your stats.

I just want the script to total the numbers and if they are below a certain total, REROLL will be initiated. Hopefully this explains better. THanks.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Mon Jan 01, 2007 6:23 pm   
 
Code:
#TRIGGER "roller" {-=-~*-=- Your rolls -=-~*-=-} {}
#COND {Roll number: 1 = (%d)} {} {within|param=1}
#COND {Roll number: 2 = (%d)} {} {within|param=1}
#COND {Roll number: 3 = (%d)} {} {within|param=1}
#COND {Roll number: 4 = (%d)} {} {within|param=1}
#COND {Roll number: 5 = (%d)} {} {within|param=1}
#COND {Roll number: 6 = (%d)} {
#IF (%eval(%t1+%t2+%t3+%t4+%t5+%1)>=85) {#BEEP} {reroll}
} {within|param=1}
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
shadowsurfer
Novice


Joined: 17 Dec 2004
Posts: 34

PostPosted: Mon Jan 01, 2007 7:13 pm   
 
It still doesn't work. Just so everyone understands, when I type reroll, this is what I get:

Quote:

-=-*-=- Your rolls -=-*-=-
Roll number: 1 = 11
Roll number: 2 = 15
Roll number: 3 = 7
Roll number: 4 = 12
Roll number: 5 = 13
Roll number: 6 = 13
-=-*-=-=-=-=**=-=-=-=-*-=-
Now you can <assign> a roll number to a stat.
For instance 'assign 2 strength' will assign roll #2 to strength.
You can type <show> at any point to list your rolls.
You can also type <stats> to show your current stats.
Note that you can just type <quick> to quickly associate them.
Note that you can <reroll> if you are not satisfied
with your stats.
Remember that this command will remove your old stats!

Type <done> when you are finished with your stats.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4689
Location: Pensacola, FL, USA

PostPosted: Mon Jan 01, 2007 10:09 pm   
 
#TR {Roll number: (%d) = (%d)} {#IF (%1=1) {total=%2} {#ADD total %2};#IF (%1=6) {#IF (@total<65) {reroll}}}
_________________
Discord: Shalimarwildcat
Reply with quote
shadowsurfer
Novice


Joined: 17 Dec 2004
Posts: 34

PostPosted: Mon Jan 01, 2007 11:32 pm   
 
This one, too, didn't work. Not sure what i'm doing wrong, if anything. I'm putting what you guys write into the command and then going about my business. But it is not triggering a reroll if it is less than the specified number. If anyone is interested, the mud is ShadowGate (209.161.2.50:6969).
Reply with quote
Ceres
Wanderer


Joined: 25 May 2006
Posts: 88

PostPosted: Tue Jan 02, 2007 12:18 am   
 
I logged on to your Mud and came up with this using Shalimar's logic and adjusting the trigger pattern:
Code:
#TR {Roll number:%s(%d)%s=%s(%d)} {#IF (%1=1) {total=%2} {#ADD total %2};#IF (%1=6) {#IF (@total<85) {reroll}}}

Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Tue Jan 02, 2007 1:23 pm   
 
Shadowsurfer, based on Ceres trigger i'll take a guess that there are multiple spaces between the ='s.
This is an instance where you need to use the code tags in the forum because multiple spaces on here only show as one space.
That was the reason why there were some many "incorrect'" scripts. they were based on your text.

Code:
-=-*-=- Your rolls -=-*-=-
Roll number: 1 =                            8
Roll number: 2 = 12
Roll number: 3 = 15
Roll number: 4 = 14
Roll number: 5 = 14
Roll number: 6 = 15
-=-*-=-=-=-=**=-=-=-=-*-=-


-=-*-=- Your rolls -=-*-=-
Roll number: 1 = 8 <--I put the same amount of spaces as the above one. See the diff?
Roll number: 2 = 12
Roll number: 3 = 15
Roll number: 4 = 14
Roll number: 5 = 14
Roll number: 6 = 15
-=-*-=-=-=-=**=-=-=-=-*-=-
_________________
http://www.Aardwolf.com
Reply with quote
shadowsurfer
Novice


Joined: 17 Dec 2004
Posts: 34

PostPosted: Thu Jan 04, 2007 5:08 pm   
 
Yep, you were both right. Ceres' trigger works excellent! Thank you everyone for helping me with this.
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