|
drixom Newbie
Joined: 04 Oct 2003 Posts: 6 Location: USA
|
Posted: 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. |
|
|
|
Davos Adept
Joined: 30 Jan 2003 Posts: 228 Location: USA
|
Posted: 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 |
|
|
|
drixom Newbie
Joined: 04 Oct 2003 Posts: 6 Location: USA
|
Posted: 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. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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} |
|
|
|
drixom Newbie
Joined: 04 Oct 2003 Posts: 6 Location: USA
|
Posted: 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.
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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} |
|
|
|
drixom Newbie
Joined: 04 Oct 2003 Posts: 6 Location: USA
|
Posted: Sun Oct 05, 2003 9:26 am |
ah ok didn't know that thats prolly what it is then
|
|
|
|
drixom Newbie
Joined: 04 Oct 2003 Posts: 6 Location: USA
|
Posted: 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}. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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. |
|
|
|
drixom Newbie
Joined: 04 Oct 2003 Posts: 6 Location: USA
|
Posted: 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
|
|
|
|
|
|