|
Bounces Newbie
Joined: 09 Jul 2005 Posts: 5
|
Posted: Sat Jul 09, 2005 8:07 pm
Help with a set of Autoroller triggers |
I looked through the first couple of pages of these forums and noticed you guys help people with triggers...but did not see a set of code that solves my problem...
The mud I play randomly generates stats and then associates a text statement with those stats which it shows to you. I logged a random capture of 1058 rolls so that I could make sure I got all of the statements. I have filtered out the duplicates and here are the results...
STR : You are as feeble as a newborn kitten!
STR : You are a weakling.
STR : People don't often ask you to lift heavy objects.
STR : You have an average strength.
STR : You are slightly favored in tug-o-war games.
STR : You have a well-defined, muscular physique.
STR : Your strength is amazing!
CON : It's a miracle you survived your own birth!
CON : You are sickly and frail, and tire very easily.
CON : You tire easily.
CON : You are in good health.
CON : You rarely get sick, and you heal quickly.
CON : You never get sick and can run miles without tiring.
CON : Illness is a foreign thing to you!
DEX : Pottery and porcelain shops never allow you in!
DEX : You have a tendency to trip and stumble. A lot.
DEX : You are slightly clumsy and uncoordinated.
DEX : You have good balance.
DEX : You are nimble and flexible.
DEX : You are very nimble and have a natural talent for acrobatics.
DEX : You could dodge sunlight!
INT : Doorknobs frequently outsmart you!
INT : You're a few cards short of a full deck.
INT : You are a bit of a slow learner.
INT : You have an average intelligence.
INT : You figure things out a little faster than most.
INT : You are a brilliant and inventive thinker.
INT : Your intelligence rivals the ancients!
WIS : You rush in where fools fear to tread!
WIS : You believe anything anyone tells you.
WIS : You sometimes learn from your mistakes.
WIS : You usually make sound decisions.
WIS : You have excellent judgment.
WIS : You have outstanding judgment--you are wise beyond your years.
WIS : Your wisdom equals the sum of many lifetimes!
CHR : No one likes you, not even your mother!
CHR : You are a social outcast.
CHR : You have an annoying personality.
CHR : People enjoy your company.
CHR : You are popular.
CHR : You are very popular and seem to have a silver tongue.
CHR : You could become the next leader of your race!
I've sorted them by value (least to greatest) and as you can see there are 7 statement possibilities to each statistic.
The mud displays it in a block like this...
Reroll!
STR : People don't often ask you to lift heavy objects.
DEX : You have good balance.
INT : You figure things out a little faster than most.
WIS : You have excellent judgment.
CON : You rarely get sick, and you heal quickly.
CHR : You are popular.
Do these stats look satisfactory to you? [y/n]:
What I would like to do is get it to kick sets that hava any stat in the first 4 categories (only pause if everything is in the upper 3) [to kick it just has to send n to the mud]. Problem I've had is 1 I don't know how to do that without setting triggers for every possible stat set (which obvioulsy there would be alot...) or simply searching for the 24 unacceptable statements. Problem if I do that is I generate more 'n's than are needed to do a reroll and it will buffer them make it to were it will automatically start rerolling.
Please help! |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sun Jul 10, 2005 12:04 am |
Actually, you'd only need to worry about the upper 3. You could make IF statements, stating that if it is NOT a certain thing, then reroll. Here's what I would do...
#TRIGGER {STR : You are slightly favored in tug-o-war games.} {#ADD total {1}} stats
#TRIGGER {STR : You have a well-defined, muscular physique.} {#ADD total {1}} stats
#TRIGGER {STR : Your strength is amazing!} {#ADD total {1}} stats
Do that for all the triggers you want to keep. Make sure they all say {#ADD total {1}} stats for the action.
Then, make this trigger:
#TRIGGER {Do these stats look satisfactory to you? ~[y/n~]:} {#IF (@total = 6) {y} {#VAR total {0};n}} stats
That will reroll them until the stats are all in the upper three that you wish. Plus, you organize them all into a stats folder.
Charneus
P.S. If there is an easier way to do this, let me know. :D |
|
|
|
Vitae Enchanter
Joined: 17 Jun 2005 Posts: 673 Location: New York
|
Posted: Sun Jul 10, 2005 1:27 am |
#VAR rerollstr {You are as feeble as a newborn kitten!|You are a weakling.|People don't often ask you to lift heavy objects.|You have an average strength.}
#VAR rerolldex {Pottery and porcelain shops never allow you in!|You have a tendency to trip and stumble. A lot.|You are slightly clumsy and uncoordinated.|You have good balance.}
#VAR rerollint {Doorknobs frequently outsmart you!|You're a few cards short of a full deck.|You are a bit of a slow learner.|You have an average intelligence.}
#VAR rerollwis {You rush in where fools fear to tread!|You believe anything anyone tells you.|You sometimes learn from your mistakes.|You usually make sound decisions.}
#VAR rerollcon {It's a miracle you survived your own birth!|You are sickly and frail, and tire very easily.|You tire easily.|You are in good health.}
#VAR rerollchr {No one likes you, not even your mother!|You are a social outcast.|You have an annoying personality.|People enjoy your company.}
#TRIGGER "strroll" {STR ~: (%*)} {#IF (%ismember( %1, @rerollstr)) {n} {#T+ dexroll;#t- strroll}}
#TRIGGER "dexroll" {DEX ~: (%*)} {#IF (%ismember( %1, @rerolldex)) {n;#t- dexroll;#t+ strroll} {#T+ introll;#t- dexroll}} "" {disable}
#TRIGGER "introll" {INT ~: (%*)} {#IF (%ismember( %1, @rerollint)) {n;#t- introll;#t+ strroll} {#T+ wisroll;#t- introll}} "" {disable}
#TRIGGER "wisroll" {WIS ~: (%*)} {#IF (%ismember( %1, @rerollwis)) {n#t- wisroll;#t+ strroll} {#T+ conroll;#t- wisroll}} "" {disable}
#TRIGGER "conroll" {CON ~: (%*)} {#IF (%ismember( %1, @rerollcon)) {n;#t- conroll;#t+ strroll} {#T+ chrroll;#t- conroll}} "" {disable}
#TRIGGER "chrroll" {CHR ~: (%*)} {#IF (%ismember( %1, @rerollchr)) {n;#t- chrroll;#t+ strroll} {#ECHO OPTIMAL STATS ROLLED;#T- chrroll}} "" {disable} |
|
|
|
Bounces Newbie
Joined: 09 Jul 2005 Posts: 5
|
Posted: Sun Jul 10, 2005 4:55 am Charnus I like yours with one change |
I don't want the triggers to automattically kick yes if it is within the top three of all stats (still want to make sure that the stats are good for the char type I am making)...
Is there a not equal to command that I can put in the if statement at the end?
If not I could just do:
#TRIGGER {Do these stats look satisfactory to you? ~[y/n~]:} {#IF (@total = 6) {} {n}} stats
but that seems a little sloppy to me
Also you may have noticed that I took out the zeroing out of your variable...it's because I decided to make it a trigger for whenever the scripts detected the line Reroll! instead...like it better that way incase the set comes back in the upper three but I still don't like it (the way you had it if I reset the roller myself it would not automattically reset the variable.) |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sun Jul 10, 2005 6:44 am |
Actually, that trigger, Bounces, works just well. But, you could do:
#TRIGGER {Do these stats look satisfactory to you? ~[y/n~]:} {#IF (@total != 6) {n}} stats
I think that should work.
Also, the resetting of the variable is because if you didn't reset it, then it would just keep adding, so instead of 6 on the next run, you could have 12, then 18, and so forth. So, resetting it back to 0 is safe. It won't do anything but set it to 0, and you can still have control over whether you reroll it or not. Notice the reset was in the {n} command, not the {y}? It's vital for my trigger to work. :P
Charneus |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Sun Jul 10, 2005 10:01 pm |
A Compact Version
Code: |
#ADDITEM Roll.str "You are as feeble as a newborn kitten!"
#ADDITEM Roll.str "You are a weakling."
#ADDITEM Roll.str "People don't often ask you to lift heavy objects."
#ADDITEM Roll.str "You have an average strength."
#ADDITEM Roll.str "You are slightly favored in tug-o-war games."
#ADDITEM Roll.str "You have a well-defined, muscular physique."
#ADDITEM Roll.str "Your strength is amazing!"
#ADDITEM Roll.con "It's a miracle you survived your own birth!"
#ADDITEM Roll.con "You are sickly and frail, and tire very easily."
#ADDITEM Roll.con "You tire easily."
#ADDITEM Roll.con "You are in good health."
#ADDITEM Roll.con "You rarely get sick, and you heal quickly."
#ADDITEM Roll.con "You never get sick and can run miles without tiring."
#ADDITEM Roll.con "Illness is a foreign thing to you!"
#ADDITEM Roll.dex "Pottery and porcelain shops never allow you in!"
#ADDITEM Roll.dex "You have a tendency to trip and stumble. A lot."
#ADDITEM Roll.dex "You are slightly clumsy and uncoordinated."
#ADDITEM Roll.dex "You have good balance."
#ADDITEM Roll.dex "You are nimble and flexible."
#ADDITEM Roll.dex "You are very nimble and have a natural talent for acrobatics."
#ADDITEM Roll.dex "You could dodge sunlight!"
#ADDITEM Roll.int "Doorknobs frequently outsmart you!"
#ADDITEM Roll.int "You're a few cards short of a full deck."
#ADDITEM Roll.int "You are a bit of a slow learner."
#ADDITEM Roll.int "You have an average intelligence."
#ADDITEM Roll.int "You figure things out a little faster than most."
#ADDITEM Roll.int "You are a brilliant and inventive thinker."
#ADDITEM Roll.int "Your intelligence rivals the ancients!"
#ADDITEM Roll.wis "You rush in where fools fear to tread!"
#ADDITEM Roll.wis "You believe anything anyone tells you."
#ADDITEM Roll.wis "You sometimes learn from your mistakes."
#ADDITEM Roll.wis "You usually make sound decisions."
#ADDITEM Roll.wis "You have excellent judgment."
#ADDITEM Roll.wis "You have outstanding judgment--you are wise beyond your years."
#ADDITEM Roll.wis "Your wisdom equals the sum of many lifetimes!"
#ADDITEM Roll.chr "No one likes you, not even your mother!"
#ADDITEM Roll.chr "You are a social outcast."
#ADDITEM Roll.chr "You have an annoying personality."
#ADDITEM Roll.chr "People enjoy your company."
#ADDITEM Roll.chr "You are popular."
#ADDITEM Roll.chr "You are very popular and seem to have a silver tongue."
#ADDITEM Roll.chr "You could become the next leader of your race!"
#TRIGGER "Reroller" {^STR ~: (*)} {Roll.Accept=0;#IF (%ismember( "%1", @Roll.str)>4) {#ADD Roll.Accept 1} {Roll.Accept=0}}
#COND {^DEX ~: (*)} {#IF (%ismember( "%1", @Roll.dex)>=5) {#ADD Roll.Accept 1} {Roll.Accept=0}} {within|param=1}
#COND {^INT ~: (*)} {#IF (%ismember( "%1", @Roll.int)>=5) {#ADD Roll.Accept 1} {Roll.Accept=0}} {within|param=1}
#COND {^WIS ~: (*)} {#IF (%ismember( "%1", @Roll.wis)>=5) {#ADD Roll.Accept 1} {Roll.Accept=0}} {within|param=1}
#COND {^CON ~: (*)} {#IF (%ismember( "%1", @Roll.con)>=1) {#ADD Roll.Accept 1} {Roll.Accept=0}} {within|param=1}
#COND {^CHR ~: (*)} {#IF (%ismember( "%1", @Roll.chr)>=1) {#ADD Roll.Accept 1} {Roll.Accept=0}} {within|param=1}
#COND {^Do these stats look satisfactory to you?} {#IF @Roll.Accept=6 {#BEEP} {#EXECUTE n}} {prompt|nocr} |
Beeps if the stats are where you want them, otherwise rerolls |
|
|
|
Ziah Novice
Joined: 11 Mar 2005 Posts: 40
|
Posted: Mon Jul 11, 2005 3:42 am |
wow.... large...
|
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Mon Jul 11, 2005 6:55 am |
Large.. But only 1 trigger and 1 variable :p
|
|
|
|
Bounces Newbie
Joined: 09 Jul 2005 Posts: 5
|
Posted: Sun Jul 31, 2005 4:02 pm Thanks for the help |
Trigger works great...thanks guys
|
|
|
|
|
|