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
LessConfused
Newbie


Joined: 17 Jan 2008
Posts: 1

PostPosted: 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}
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: 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
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: 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
Reply with quote
Fang Xianfu
GURU


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

PostPosted: 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.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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