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


Joined: 06 Sep 2002
Posts: 4
Location: Australia

PostPosted: Thu Jul 17, 2003 2:49 am   

bot variable trouble
 
ok here is what i got
trigger
(%2) says 'j (%2)'

#if (%2=@spells) {c '%2' %1} {#abort}

variable
spells

{bless|armor|flurry|mortal restore|sanctuary|weed shield|regeneration|heal}
lil help plz it wont work
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Jul 17, 2003 3:45 am   
 
Glad you got it, because you didn't say what you want it to do. I will take a wild guess at what you want though.

#TR {(%w) says 'j ({@spells})'} {c '%2' %1}
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Jul 17, 2003 3:52 am   
 
That's because you have %2 in your pattern twice. %2 really shouldn't be in the pattern at all, it's only intended for use in the value portion of the trigger. There are other wildcards intended for use in the pattern.

You've also mistakenly tried to compare a single value to a list of values as though they were numbers. This is guaranteed to produce undesired results. Instead, you need to check for membership in the list. Finally, you don't really need to use #ABORT. The default action for a false result is nothing.

#TR {(*) says 'j (*)'} {#IF (%ismember( "%2", @spells)) {c '%2' %1}}
Reply with quote
donkey_boy_1
Newbie


Joined: 06 Sep 2002
Posts: 4
Location: Australia

PostPosted: Thu Jul 17, 2003 10:01 am   
 
thanks for the help it works great
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