|
XonDK Apprentice
Joined: 01 Dec 2006 Posts: 178
|
Posted: Sat Nov 17, 2012 1:53 pm
Triggering a NON colored line possible? |
I was wondering if it is possible to make an ansi trigger that will only trigger when the line given is NOT colored, as in the normal standard grey color, but won't trigger on other colors?
I have tried to set it up via the %e code for the normal color but that doesn't seem to work. Or maybe I'm doing it wrong..
any ideas? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Sat Nov 17, 2012 3:16 pm |
well a non ansi trigger will fire on non colored lines... it just wont exclude colored lines.
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
XonDK Apprentice
Joined: 01 Dec 2006 Posts: 178
|
Posted: Sat Nov 17, 2012 3:27 pm |
Aye and that's the problem. I want to exclude colored lines.
Specificly its for aetolia, since I've colored deathsight to a specific color to catch it easier. But inroom deathmessages are gray and I want to capture them with a different set of actions |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Sat Nov 17, 2012 3:32 pm |
well.. alternatively, you could make a trigger for the colored lined (assuming they have the same pattern other than color)
give it a higher priority (closer to 1) than the non ansi trigger
and check the 'stop further processing' option
that will do nothing and keep the non ansi trigger from firing on it as well
its not a clean solution, but it will work |
|
_________________ Discord: Shalimarwildcat |
|
|
|
XonDK Apprentice
Joined: 01 Dec 2006 Posts: 178
|
Posted: Sat Nov 17, 2012 3:47 pm |
ah, 'stop further processing' works for that specific line from the server only? thought it stopped processing of several lines?
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Sat Nov 17, 2012 3:49 pm |
it stops other triggers from also firing on the same line, according to priority
weather from the MUD or a local #ECHO does not matter |
|
_________________ Discord: Shalimarwildcat |
|
|
|
XonDK Apprentice
Joined: 01 Dec 2006 Posts: 178
|
Posted: Sat Nov 17, 2012 4:01 pm |
I've tested it and it does not seem to work, I've tested it with also switching around their priorities in terms of numbers, and both triggers still fire. :( *fidles*
|
|
|
|
XonDK Apprentice
Joined: 01 Dec 2006 Posts: 178
|
Posted: Sat Nov 17, 2012 4:18 pm |
hmmm is there any way for a normal trigger to test to see if there is is color in a trigger? I'm thinking the %line function and then test the %line function for color coding?
|
|
|
|
XonDK Apprentice
Joined: 01 Dec 2006 Posts: 178
|
Posted: Sat Nov 17, 2012 5:10 pm |
hmm guess I've found a solution that works, just make sure the colored trigger, is a higher priority then the none color specific and have the colored trigger set a variable to 1 and just have the script in the none colored only fire if the variable is 0
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Sat Nov 17, 2012 5:14 pm |
thats another way to manage it... though the further processing option should work... have you restarted CMUD lately? It might be an indication of corruption.
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Nov 17, 2012 9:10 pm |
Try using a stringlist pattern for the beginning of the line, where the ansi code would be. The non-ansi version would just be a null element, and you should be able to patternize the ansi code:
^({%e*|})text of the line{%e[0m|}$
Assuming that works, you can then use a #switch to test for any specific color conditions:
Code: |
#switch (%1 = "") {
//this is an uncolored line
}
(%begins(%1,%e"[1;31m")) {
//this line is colored bright red
}
(1) {
//this line is colored, but it's some other color
} |
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
|
|