|
Rose Beginner
Joined: 23 Oct 2003 Posts: 15
|
Posted: Wed Dec 17, 2003 4:32 pm
Need help with Ansi Trigger |
I am using zmud 6.66 beta
I need a trigger that detects an ENTIRE line of yellow color. I am using this trigger at the moment
#TRIGGER {^%e[1;33m(*)$} {do something} "" {color}
However, this trigger detect all lines that START with yellow, including other color text on the same line. How can I modify it to detect on the ENTIRE line of that color?
Thanks. |
|
|
|
Toetag Magician
Joined: 10 Oct 2000 Posts: 356 Location: USA
|
|
|
|
Rose Beginner
Joined: 23 Oct 2003 Posts: 15
|
Posted: Fri Dec 19, 2003 1:49 am |
That was exactly how I created it. But I needed to show what my trigger is to ask my question, and therefore I have exported it out to text and copy and paste as above.
That does not answer my question. My question is how to modify the trigger to detect ENTIRE line of the same color, currently, the trigger fires on any line that STARTS with that color. Without the ^, it fires on any line that contains that color in anywhere of the line.
I need to use (*) here, as I will use it as %1 to do something. |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Fri Dec 19, 2003 2:05 am |
Pure conjecture, if your testing is right, that the (*) is capturing color changes. How about try the line color option in the triggers?
#TRIGGER {^(*)$} {#SHOW %ansi(blue)That was yellow.} "" {line=14} |
|
|
|
Rose Beginner
Joined: 23 Oct 2003 Posts: 15
|
Posted: Sat Dec 20, 2003 6:47 pm |
I tried out the Line Color option, and it seems to be working the same way as the #TRIGGER {^%e[1;33m(*)$} {do something} "" {color}, detecting all lines that STARTS with that color. TonDiening, would it be possible for you to test it out to see if you get the same thing?
I begin to wonder if this is a beta bug or just no way to do it.
Thanks. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Dec 21, 2003 1:47 am |
The Line Color option is supposed to match any line which STARTS with the specified color. This is correct behavior.
Clearly, the * matches more than you want. You'll have to find (or make) a more restrictive wildcard. You should probably consider using the [range] wildcard. |
|
|
|
SolReapr Beginner
Joined: 03 Sep 2003 Posts: 13 Location: USA
|
Posted: Tue Dec 23, 2003 9:10 am |
If your mud ends every line with the code to return the line color to default then this might work.
#TRIGGER {^%e[1;33m(*)%e[0m$} {#IF (%pos( %e[, "%1")) {#NOOP} {do_something}} "" {color} |
|
|
|
|
|