![](templates/Classic/images/spacer.gif) |
wrym Magician
Joined: 06 Jul 2007 Posts: 349 Location: The big palace, My own lil world
|
Posted: Sun Aug 28, 2011 1:23 am
Pattern matching anomaly |
I have a group of triggers, they USED to work but I haven't had to use them in a while. When I attempted to use them they failed to work and after investigating I determined that the pattern matching wasn't correctly matching on the pattern wizard tab.
Code: |
<trigger priority="11970" id="238">
<pattern>({@autotformnames}) gives you (*).$</pattern>
<value>#addkey {tformowners} {%2} {%trim(%1)}
keyw inv</value>
</trigger>
<var name="autotformnames" type="StringList" usedef="true">
<value>sam|bob</value>
<json>["sam","bob"]</json>
</var>
|
Testing on the following string:
Code: |
bob gives you a cloak. |
Matches with the string anchored to the end, BUT! %1 matches "a cloak" and %2 matches as empty. If I anchor the beginning it fails to match at all!
If I change the pattern to:
Code: |
(({@autotformnames})) gives you (*).$ |
%1 matches nothing %2 matches "a cloak" and %3 matches empty.
Can anyone duplicate this? or have a solution? or am I doing something stupid here?
Currently running 3.34, not sure what version when this was last working.
Thanks for any help. |
|
_________________ "To the engineer, all matter in the universe can be placed into one of two categories: (1) things that need to be fixed, and (2) things that will need to be fixed after you've had a few minutes to play with them" - Scott Adams, The Dilbert Principle |
|
|
![](templates/Classic/images/spacer.gif) |
Fizgar Magician
Joined: 07 Feb 2002 Posts: 333 Location: Central Virginia
|
Posted: Sun Aug 28, 2011 2:29 am |
Using the first block of code in your post and using #show to echo the string you are trying to trigger on %1=bob and %2=a cloak when I test. I get the same result if I anchor at the beginning or end of the pattern. Maybe a case of package corruption? Try to export your package to .xml then re import in to a new clean session and give it a try.
|
|
_________________ Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34 |
|
|
![](templates/Classic/images/spacer.gif) |
wrym Magician
Joined: 06 Jul 2007 Posts: 349 Location: The big palace, My own lil world
|
Posted: Sun Aug 28, 2011 3:55 am |
I exported and re imported this stuff not that long ago, but i just re-did it, i'm still having the same problem. Maybe i'll reinstall cmud and see if that fixes the problem.
|
|
_________________ "To the engineer, all matter in the universe can be placed into one of two categories: (1) things that need to be fixed, and (2) things that will need to be fixed after you've had a few minutes to play with them" - Scott Adams, The Dilbert Principle |
|
|
![](templates/Classic/images/spacer.gif) |
geniusclown Magician
![](images/avatars/20731695274100366dc4c2e.jpg)
Joined: 23 Apr 2003 Posts: 358 Location: USA
|
Posted: Sun Aug 28, 2011 2:05 pm |
I copied and pasted your XML to a blank session, and it functions as expected: %1 = bob and %2 = a cloak. Also using v3.34
|
|
_________________ .geniusclown |
|
|
![](templates/Classic/images/spacer.gif) |
wrym Magician
Joined: 06 Jul 2007 Posts: 349 Location: The big palace, My own lil world
|
Posted: Tue Aug 30, 2011 10:35 pm |
Ok, I fixed it. the triggers I posted here were in a secondary package. which did not appear to be corrupted but when I exported and import my MAIN session package the problem was resolved, evidently something got corrupted there and was messing up these triggers.
Thanks for the help |
|
_________________ "To the engineer, all matter in the universe can be placed into one of two categories: (1) things that need to be fixed, and (2) things that will need to be fixed after you've had a few minutes to play with them" - Scott Adams, The Dilbert Principle |
|
|
![](templates/Classic/images/spacer.gif) |
|
|