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
drixom
Newbie


Joined: 04 Oct 2003
Posts: 6
Location: USA

PostPosted: Sat Oct 04, 2003 5:16 am   

trigger and varible help
 
Ok I need help with a compare trigger that exutes an actin on if a specific group of people appears in the room i'm in from a gate here is how i tried it but it's not working.
#pattern %1 appears from the chaos gate.
#command 1 #var name %1
#command 2 #if @name=@locale {look @name}

the locale variable is set to a stringvariable with the names of the people i wan't too look at as they appear for some reason the trigger either look at everybody or noone depending onwhat syntax i use. I'm using version 6.16 by the way. if anybody knows what i'm doing wrong or how too do it another way besides a seperate trigger for each charater plaese tell me.
Reply with quote
Davos
Adept


Joined: 30 Jan 2003
Posts: 228
Location: USA

PostPosted: Sat Oct 04, 2003 5:59 am   
 
Code:
#TRIGGER {(%w) appears from the chaos gate.} {#IF (%ismember( %1, @locale)) {look %1}}


This should Fix your issue
Reply with quote
drixom
Newbie


Joined: 04 Oct 2003
Posts: 6
Location: USA

PostPosted: Sat Oct 04, 2003 7:40 am   
 
thanks davos but it didn't work with my version it just comes up as
#if (0) {look %1}
i pasted it just like you had it still no go any other ideas.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Oct 04, 2003 7:01 pm   
 
You must have copied it incorrectly, or to the wrong location. This is a command-line entry. For use in the settings editor, you have to paste the individual sections to the related boxes.
#TRIGGER {(%w) appears from the chaos gate.} {#IF (%ismember( %1, @locale)) {look %1}}

Pattern: (%w) appears from the chaos gate.
Value: #IF (%ismember( %1, @locale)) {look %1}
Reply with quote
drixom
Newbie


Joined: 04 Oct 2003
Posts: 6
Location: USA

PostPosted: Sun Oct 05, 2003 3:33 am   
 
Yeah i understood that part and thats what i did but it still didn't work just retried it shows up right now but still doesn't fire.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Oct 05, 2003 4:19 am   
 
If the trigger doesn't fire, your pattern doesn't match the MUD.
If the trigger fires, but you don't look at people you think you ought to, you probably used the wrong case when you put them in @locale. %ismember is case-sensitive.

#ADDI locale drixom
#ADDI locale Davos
#ADDI locale LightBulb
Drixom appears from the chaos gate. Trigger fires. No match because Drixom doesn't match drixom.
Lightbulb appears from the chaos gate. Trigger fires. No match because Lightbulb doesn't match LightBulb.
Davos appears from the chaos gate. Trigger fires. You look at Davos, because Davos does match Davos.

Another method, which ignores case, is to use the list in the pattern.
#TR {({@locale}) appears from the chaos gate.} {look %1}
Reply with quote
drixom
Newbie


Joined: 04 Oct 2003
Posts: 6
Location: USA

PostPosted: Sun Oct 05, 2003 9:26 am   
 
ah ok didn't know that thats prolly what it is then
Reply with quote
drixom
Newbie


Joined: 04 Oct 2003
Posts: 6
Location: USA

PostPosted: Sun Oct 05, 2003 10:39 am   
 
Ok I had both versions working for about ten minutes then somebody crashed the mud ,and they stopped working. I know the trigger is firing checked it with mud output. It's just not performing the
look %1. I'm guessing this has something too do with the variable @locale now i think i have it right, but i'm not certain. Too set a list variable do you use {Drixom|LightBulb} or {Drixom | LightBulb}.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Oct 05, 2003 4:21 pm   
 
That depends on whether you want the spaces or not.
Probably {Drixom|LightBulb}.

Of course, you could just do it the way I did, using #ADDITEM.
Reply with quote
drixom
Newbie


Joined: 04 Oct 2003
Posts: 6
Location: USA

PostPosted: Sun Oct 05, 2003 10:13 pm   
 
Thanks guys got it working now now i just have too figure out the rest of the set for auto challenge and comparing the odds
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