|
LessConfused Newbie
Joined: 17 Jan 2008 Posts: 1
|
Posted: Thu Jan 17, 2008 12:22 am
Question on making an autoroller |
I haven't played MUDs in like 9 or 10 years but i thought i would get back into it. So here is what i have figured out so far. It will read what stat i get and save it as the variable, but im confused as to how to compare the variable wis to any of the acceptable goodWis variables. Also i'm not quite sure how to set it so that if reroll = 1 then it sends yes (yes to reroll) #SA isnt doing it for me, is there something else i should be using instead? Ill be doing something similar for the other stats, but i wanted to get this figured out before i moved on. Are there other examples like this where the autoroller is based on words and not numbers for stats? Thanks for the help.
Code: |
#TRIGGER {Wis ~[(%s)(%x)~]} {#VAR wis %2}
#VAR reroll {0}
#VAR goodWis {Shrewd|Astute|Wise}
#IF wis=goodWis {reroll = 0} {reroll = 1}
#IF reroll=1 {#SA yes}
|
|
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Thu Jan 17, 2008 12:30 am |
Since you are using a string list variable for your acceptable wis values, then just do:
#IF (%ismember(@wis,@goodWis)) {reroll = 0} {reroll = 1} |
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Thu Jan 17, 2008 5:39 am |
Code: |
#TRIGGER {Wis ~[%s(%w)~]} {#IF %ismember(@goodwis, %1) {#SEND no} {#SEND yes}} |
I'm assuming you don't really want the space captured, since you're not using it in your script. All you need to have is the goodwis variable defined. And I'm also assuming that if it IS a member of goodwis, you want to send no to tell it not to reroll. Also, if all your goodwis are words, then use %w, not %x.
Charneus |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu Jan 17, 2008 5:53 am |
Assuming that you're not going to change your good values, you don't even need the @goodwis variable:
#TRIGGER {Wis ~[%s(%w)~]} {#IF %ismember("shrewd|astute|wise", %1) {#SEND no} {#SEND yes}}
Your example had an unmatched brace, charneus, which I've fixed. |
|
|
|
|
|