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
Madamegato
Beginner


Joined: 27 Nov 2002
Posts: 27
Location: USA

PostPosted: Thu Jan 09, 2003 1:30 am   

Array list not working
 
Hello All.

I want to have a list (similar to a blacklist) but for people that I want to emote a specific way to when they interact to my bot.

Lets say for instance, when someone shakes my hand, I want 4 people to get, shakes your hand wildly, and all the rest to get, smiles and nods.

I have the variable @friendlyemotes and the list has persona|personb|personc|persond.

My trigger shows:
#IF %ismember(%1,@friendlyemotes) {shakes %1 hand wildly} {smiles and nods at %1}

When I hold the cursor over the %1,@friendlyemotes, it says =0 (false). So regardless of who shakes my hand, it reports false and gives the second emote.

I've looked over the forum and can't find anything that I haven't already used to set up the trigger and so forth...can someone tell me what I am doing wrong?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Jan 09, 2003 2:14 am   
 
quote:

Hello All.

I want to have a list (similar to a blacklist) but for people that I want to emote a specific way to when they interact to my bot.

Lets say for instance, when someone shakes my hand, I want 4 people to get, shakes your hand wildly, and all the rest to get, smiles and nods.

I have the variable @friendlyemotes and the list has persona|personb|personc|persond.

My trigger shows:
#IF %ismember(%1,@friendlyemotes) {shakes %1 hand wildly} {smiles and nods at %1}

When I hold the cursor over the %1,@friendlyemotes, it says =0 (false). So regardless of who shakes my hand, it reports false and gives the second emote.

I've looked over the forum and can't find anything that I haven't already used to set up the trigger and so forth...can someone tell me what I am doing wrong?



Always check the helpfile to best ensure you are employing correct syntax. Unless there's a weird little glitch in your copy of ZMud, the fact you did not enclose the #IF condition clause in parentheses is usually the cause for a problem like yours.

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


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Jan 09, 2003 4:40 am   
 
The complete text of the trigger, both its pattern and its value, would be helpful. At a guess, you have something similar to this:

Pattern: (%w) shakes your hand
Value: emote #IF %ismember(%1,@friendlyemotes) {shakes %1 hand wildly} {smiles and nods at %1}

Unfortunately, #IF can't be used in the middle of a line like that. Instead, you'd need something more like:
Value: #IF %ismember(%1,@friendlyemotes) {emote shakes %1 hand wildly} {emote smiles and nods at %1}

You should also make sure you use the same capitalization as the MUD when adding names to @friendlyemotes. For %ismember, persona, Persona, personA, and PersonA are four different people.

LightBulb
Senior Member
Reply with quote
Madamegato
Beginner


Joined: 27 Nov 2002
Posts: 27
Location: USA

PostPosted: Thu Jan 09, 2003 5:13 am   
 
I'll give you what I have:

Pattern: ^(%w) shakes your hand
Value: #IF %ismember(%1, @friendlyemotes) {pm shakes %1 hand wildly} {pm gives a nod to %1}

The variable is set to @friendlyemotes, with proper capitalization on the names, so that it would be similar to:
Persona|Personb|Personc|Persond

I did not enclose the #IF in parenthesis, but all of the other triggers where I use the #IF statement work without enclosure, and if I do enclose it, I get a nice, glaring red syntax error. i.e.:

(#IF blah blah
^syntax error

So, when the MUD shows:
Persona shakes your hand
It sends:
pm gives a nod to Persona
When it should send:
pm shakes Persona hand wildly
As, Persona is in the @friendlyemotes list.

Any other suggestions?
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Thu Jan 09, 2003 5:48 am   
 
Value: #IF (%ismember(%1, @friendlyemotes)) {pm shakes %1 hand wildly} {pm gives a nod to %1}

is what i think you need
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Jan 09, 2003 7:42 am   
 
There must be something you aren't telling us. I opened a test window, copied your trigger and variable exactly, no changes, and it works flawlessly.

LightBulb
Senior Member
Reply with quote
Madamegato
Beginner


Joined: 27 Nov 2002
Posts: 27
Location: USA

PostPosted: Thu Jan 09, 2003 8:31 am   
 
*bows to Emit*
I see!!!

I didn't realize that the parenthesis needed to be outside the %ismember. It works like magic now. *dance*

Thank you all for helping though. This is the best forum I have ever taken part in and it's due to responsive people like yourselves. *smile*
(And yea, I realize that Matt was telling me the same thing...brain fart there. *chuckle*)
-M.
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