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


Joined: 28 Oct 2001
Posts: 43
Location: USA

PostPosted: Wed Jul 17, 2002 9:17 pm   

help with an IF trigger
 
my trigger looks like this ...

pattern:
%1 is scorched by flames!

value:
#if (%1 = @friends) {} {
ki %1
m
}

friends var is a list of people i dont want to attack ... but i attack everyone instead of just people not on the list. ANy ideas why its not working?
Reply with quote
Toetag
Magician


Joined: 10 Oct 2000
Posts: 356
Location: USA

PostPosted: Wed Jul 17, 2002 9:32 pm   
 
if %1 = bob and
@friends = bob|john|mary

how could %1 = @friends?

might need to use the %ismember function. Check the help files.

Killing a fly on a friends forhead may not be overkill, use a hatchet to make sure the job is done.
Reply with quote
snoogans
Novice


Joined: 28 Oct 2001
Posts: 43
Location: USA

PostPosted: Wed Jul 17, 2002 10:41 pm   
 
if @friends = bob|john|mary then @friends = bob ... @friends = john ... and @friends = mary ... i got that from the help files, i just changed %1 to %d and it worked
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Thu Jul 18, 2002 1:08 am   
 
Instead of %1 in the pattern use %w. Enclose it in parentheses so that it is captured to %1.

Pattern:
(%w) is scorched by flames!

For your value, use the %ismember function. Trying to compare %1 to the friend list with an equals sign will cause it to treat the friends list as a single string.

Value:
#IF %ismember(%1,@friends) {#NOOP} {ki %1; m}

Troubadour
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