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


Joined: 10 Feb 2002
Posts: 1
Location: USA

PostPosted: Sun Feb 10, 2002 7:14 am   

Fun with #if and %ismember
 
I have a trigger for dispel magic that I am working on. If a "friend" asks my character to "dispel mob" the trigger is to check if the request is made by a friend, and then check to see if the "mob" is a valid target before firing the spell. The format is as follows:

(%w) group-says, in Common, 'dispel (%x)'

I have a friendList with a string of all friend names already.

my trigger goes as follows:
#var @petitioner %1
#var @isenemy %2
I want to use ismember to check first if the petitioner is in friendList and also to check if isenemy is NOT in the friendList. I do not want to dispel my friends. ismember does not seem to like being used more than once in an if statement. Please let me know how I can fix this.

Thanks for your help!



Dan
Reply with quote
HariKari
Wanderer


Joined: 16 Feb 2001
Posts: 57

PostPosted: Sun Feb 10, 2002 8:38 am   
 
If you have @petitioner as a list ie HariKari|danluciano|etc and the same for isenemy..
{@petitioner} group-says, in Common, 'dispel ({@isenemy})
c dispel %1
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Feb 10, 2002 2:08 pm   
 
I seem to have no such problem:
#TRIGGER {(%w) group-says, in Common, 'dispel (%x)'} {#IF ((%ismember( %1, @friendlist)) and (!%ismember( %2, @friendlist))) {c dispel %2}}

works just like what you described.

Kjata
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