|
Evangelist Adept
Joined: 10 Oct 2000 Posts: 224 Location: USA
|
Posted: Wed Jul 30, 2003 6:18 am
Syntax error? |
#IF (%ismember( @partchar, @participants)) {
#var participants %additem( @partchar, @participants)
#ECHO @partchar added
} {
tell @partchar you are already added
#ECHO @partchar denied!
}
Is there something wrong with that syntax?
The trigger is &partchar tells you 'add me'
It keeps default to true and saying you are already added. Any clue whats wrong with my syntax?
The stringlist is participants, the person telling me is partchar. |
|
|
|
zex0s Wanderer
Joined: 29 Jun 2003 Posts: 64
|
Posted: Wed Jul 30, 2003 7:34 am |
From the looks of it, it appears you have it backwards.. it's checking if they are a member, then if they are, add them, but if they're not, then tell them they are.
#IF !(%ismember( @partchar, @participants)) {
#var participants %additem( @partchar, @participants)
#ECHO @partchar added
} {
tell @partchar you are already added
#ECHO @partchar denied!
}
try it like that instead, and see what happens.
Zex0s |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Jul 30, 2003 8:08 am |
Since you're allowing anyone who asks, why bother with checking? If you use #ADDITEM, instead of %additem, you won't get duplicates anyway.
#ADDITEM participants {@partchar}
#ECHO @partchar added} |
|
|
|
Evangelist Adept
Joined: 10 Oct 2000 Posts: 224 Location: USA
|
Posted: Thu Jul 31, 2003 2:19 am |
WOrks great as usual :) Thanks for the help lightbulb, you are truly amazing.
|
|
|
|
Evangelist Adept
Joined: 10 Oct 2000 Posts: 224 Location: USA
|
Posted: Thu Jul 31, 2003 2:20 am |
I suppose #DELITEM participants {@exitchar} would remove them from the list?
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Jul 31, 2003 7:09 am |
Exactly.
|
|
|
|
|
|