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
Boca
Wanderer


Joined: 04 Mar 2001
Posts: 58
Location: USA

PostPosted: Wed Jan 16, 2002 7:57 pm   

List Question
 
I want to rescue group members if they are
on the GroupList and NOT on the GagList. Will this syntax work?
#IF ((%ismember( %1, @GroupList)) and (%ismember( %1, @GagList)=0)) {rescue %}

Thanks!
Boca
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Wed Jan 16, 2002 11:35 pm   
 
You forgot the 1 at the end. The only other thing is %x references should always be enclosed in quotes to ensure no parsing errors occur. Hence the final line:
#IF ((%ismember( "%1", @GroupList)) and (%ismember( "%1", @GagList)=0)) {rescue "%1"}
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Jan 16, 2002 11:36 pm   
 
quote:

I want to rescue group members if they are
on the GroupList and NOT on the GagList. Will this syntax work?
#IF ((%ismember( %1, @GroupList)) and (%ismember( %1, @GagList)=0)) {rescue %}

Thanks!
Boca



In theory it would, but I'm not sure if %ismember returns 0 or null when a match isn't found. It might be preferable to nest the @gaglist #IF inside the true portion of the @grouplist #IF instead.

#if (%ismember(%1,@GroupList)) {#if (%ismember(%1,@GagList)) {#noop this person is a group member, but he/she is gagged, do not rescue} {#noop all signs good, go help them!;rescue %1}} {#noop this person is not in the grouplist to begin with, so end things right here}

li'l shmoe of Dragon's Gate MUD
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Jan 17, 2002 5:36 pm   
 
According to the helpfile %ignore
quote:
return 0 (false), if s is not a member of the given string list.


LightBulb
All scripts untested unless otherwise noted
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