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


Joined: 19 Jun 2001
Posts: 30
Location: USA

PostPosted: Mon Jun 24, 2002 6:11 pm   

Autoroller
 
This is what the roll screen looks like in the character creation process:

-=-*-=- Your rolls -=-*-=-
Roll number: 1 = 13
Roll number: 2 = 14
Roll number: 3 = 9
Roll number: 4 = 14
Roll number: 5 = 13
Roll number: 6 = 14
-=-*-=-=-=-=**=-=-=-=-*-=-
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 want something where it will automatically reroll unless some specific numbers come up. For example, maybe I want at least 1 18, 2 17's, 2 stats no less than 12 and the last 1 doesn't matter. Unless these requirements are met, it will reroll. Is this doable?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Jun 24, 2002 9:57 pm   
 
Sure is. Here is a trigger to handle this:
#TRIGGER {-=-~*-=- Your rolls -=-~*-=-$Roll number: 1 = (%d)$Roll number: 2 = (%d)$Roll number: 3 = (%d)$Roll number: 4 = (%d)$Roll number: 5 = (%d)$Roll number: 6 = (%d)} {#VAR valid 0;#VAR numbers {%1|%2|%3|%4|%5|%6};#VAR command "#SAY The stats you want have been rolled!";#IF (%ismember("18", @numbers)) {#DELNITEM numbers %ismember("18", @numbers)} {#VAR command "reroll"};#IF (%ismember("17", @numbers)) {#DELNITEM numbers %ismember("17", @numbers)} {#VAR command "reroll"};#IF (%ismember("17", @numbers)) {#DELNITEM numbers %ismember("17", @numbers)} {#VAR command "reroll"};#FORALL @numbers {#IF (%i > 11) {#ADD valid 1}};#IF (@valid < 2) {#VAR command "reroll"};#EXEC {@command}}

Kjata
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Mon Jun 24, 2002 10:23 pm   
 
#TRIGGER {~-~=~-~*~-~=~- Your rolls} {#VAR V_Rolled ""}
#TRIGGER {^Roll number: %d ~= (%d)} {#ADDITEM V_Rolled %1}

#VAR V_MinStats "18|17|17|12|12|1"
#VAR V_Stat {} {}


#TRIGGER {Remember that this command will remove your old stats!} {
#VAR V_reroll 0
#VAR V_RolledOrder @V_Rolled
#LOOP 6 {
#IF {%max( %replace( @V_Rolled, "|", ",")) >= %item( @V_MinStats, %i)} {
#VAR V_Stat %additem( %max( %replace( @V_Rolled, "|", ",")), @V_Stat)
#VAR V_Rolled %delitem( %max( %replace( @V_Rolled, "|", ",")), @V_Rolled)
} {
#VAR V_reroll 1
}
}
#IF (@V_Reroll) {reroll} {#ECHO Assign away V_RolledOrder has the stats in order}
}


I wrote up something similar to Kjata's solution. I check for >= versus
pure = is that matter. I wont garbage can this message just for that reason.

Ton Diening
Providing untested answers that tend to be
more complicated than others.
Reply with quote
ballegator
Novice


Joined: 19 Jun 2001
Posts: 30
Location: USA

PostPosted: Mon Jun 24, 2002 10:47 pm   
 
Thanks to both of you. Well done.
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