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
Evangelist
Adept


Joined: 10 Oct 2000
Posts: 224
Location: USA

PostPosted: 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.
Reply with quote
zex0s
Wanderer


Joined: 29 Jun 2003
Posts: 64

PostPosted: 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
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: 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}
Reply with quote
Evangelist
Adept


Joined: 10 Oct 2000
Posts: 224
Location: USA

PostPosted: Thu Jul 31, 2003 2:19 am   
 
WOrks great as usual :) Thanks for the help lightbulb, you are truly amazing.
Reply with quote
Evangelist
Adept


Joined: 10 Oct 2000
Posts: 224
Location: USA

PostPosted: Thu Jul 31, 2003 2:20 am   
 
I suppose #DELITEM participants {@exitchar} would remove them from the list?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Jul 31, 2003 7:09 am   
 
Exactly.
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