 |
Boca Wanderer
Joined: 04 Mar 2001 Posts: 58 Location: USA
|
Posted: 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 |
|
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: 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"} |
|
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Jan 17, 2002 5:36 pm |
According to the helpfile %ignorequote: return 0 (false), if s is not a member of the given string list.
LightBulb
All scripts untested unless otherwise noted |
|
|
|
 |
|
|
|