|
Bajed Novice
Joined: 15 Aug 2004 Posts: 33
|
Posted: Sun Nov 13, 2005 1:11 am
Triggers with list variable in pattern stop working... |
This happens to me about once or twice a day, and I think it usually occurs if I disconnect/reconnect (although not close zMud totally)... I have a few triggers that use list variables in the pattern, and they just stop working sometimes. Here's an example of a perl trigger that the problem affects:
Let's say MyEnemies variable contains: Person1|Person2|Person3
Pattern: ^((?:@MyEnemies)) has entered the zone\.$
Value: say %1 is here!!!
This should fire whenever Person1, Person2, or Person3 enteres the zone... like:
Person1 has entered the zone.
And it normally works perfectly, but something happens somewhere along the lines that stops this trigger from working. The solution I've found is to edit the trigger in some way, save it, change it back to how it was before, and save it again. This usually fixes that trigger in particular.
Here's another example of a trigger that isn't a perl trigger:
Pattern: %q{@MyEnemies}%q
Value: #cw red,high
This colors any names in the MyEnemies list red whenever I see that name, it also stops working sometimes, and only starts working again when I use the above method to fix it. (Note, that this problem as well as the previous example can also be fixed by closing zMud completely and re-opening it)
Any ideas why lists in trigger patterns like this would cause a problem? |
|
|
|
Bajed Novice
Joined: 15 Aug 2004 Posts: 33
|
Posted: Mon Nov 14, 2005 11:28 pm |
Any ideas??
|
|
|
|
yejun Wanderer
Joined: 13 Jun 2005 Posts: 51
|
Posted: Tue Nov 15, 2005 7:38 pm |
it happens to me randomly as well. I usually cut and paste it to get it work again.
It's a basic prompt trigger and other triggers are not affected. |
|
|
|
bushd Newbie
Joined: 15 Nov 2005 Posts: 8
|
Posted: Tue Nov 15, 2005 10:16 pm |
I had an issue like this where the list didn't even work. I made a work around for it and will work everytime, so long as you have a decent computer:
Code: |
Trigger: ^(*) arrives from the (*).$
Code:
#if (@killing != %1) {
#FORALL @enemy_list {
#if (%1 == %i) {
#gag
#SAY ~<~< Enemy %ansi( yellow)%upper( %1)%ansi( 11) has arrived ~>~>
}
}
} {
#if (@killing == %1) {
#gag
#SAY ~<~< Target %ansi( yellow)%upper( %1)%ansi( 11) has arrived ~>~>
}
}
|
And yes, the #SAY messages are someone elses who freely allows them to be downloaded. Wouldn't want to pass %ansi and %upper in a #say off as my own work. |
|
|
|
saplingg Novice
Joined: 06 Oct 2005 Posts: 31
|
Posted: Wed Nov 16, 2005 12:20 pm |
Weird. Aren't you supposed to use curly brackets to expand variables? Or am I very wrong :P
|
|
|
|
Bajed Novice
Joined: 15 Aug 2004 Posts: 33
|
Posted: Wed Nov 16, 2005 3:31 pm |
saplingg wrote: |
Weird. Aren't you supposed to use curly brackets to expand variables? Or am I very wrong :P |
I do, in my second example. Just not in the regular expression version... since (?:...) is the equivalent... I think! |
|
|
|
Slaem Apprentice
Joined: 20 Sep 2005 Posts: 135
|
Posted: Thu Nov 17, 2005 6:04 am |
Pattern: ^((?:@MyEnemies)) has entered the zone\.$
I don't use much regex. Can you explain why the double parenthesis? (?:@MyEnemies) doesn't store the expression, but then you surround it in parenthesis to store it. If it's a regex trig, then why not just (@MyEnemies) ? Thanks in advance for any comments. |
|
|
|
|
|