 |
ytin Newbie
Joined: 20 Nov 2002 Posts: 2
|
Posted: Wed Nov 20, 2002 5:43 am
trigger on InDefinite ANSI color? |
I'm having trouble figuring out how to grep the color of a word in a pattern. Say in a line of interest:
You picked up a bunch of [XXXX].
the "XXXX" in the real case would be name of different items with different colors.
If I only wanted to get the name, the following will do:
#trig {You picked up a bunch of ~[(*)~].} {itemName=%1}
But how to get the color info of that item? Certainly one can exhaust all possible colors and setup one trigger for each of them, but that's neither economic or simple. To complicate the situation, the item name could consist words of different colors, where the above method would not work. It seems zmud only handles ANSI sequences that are explicit in the pattern. You can't catch the sequence by a variable or anything...
Please share your thoughts on this. They will always be very much appreicated. |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Nov 20, 2002 2:50 pm |
You asked for my thoughts. Here's a few.
zMUD has limits. It always has. It always will. That's the nature of computer programs. Some people would rather search for something that's difficult to do, then complain about it, rather than enjoy the many things it handles admirably.
LightBulb
Senior Member |
|
|
 |
ytin Newbie
Joined: 20 Nov 2002 Posts: 2
|
Posted: Wed Nov 20, 2002 8:06 pm |
after a few tries, i found that if I didn't change the square thing to %e in the ANSI sequence, it would be able to grep the color info with [(%d)m in the pattern. But it can only handle one color sequence. (More such fields in the pattern would match more than 1 sequence of course).
The forum is to explore the functionality of zMud, is it? :) |
|
|
 |
Castaway GURU

Joined: 10 Oct 2000 Posts: 793 Location: Swindon, England
|
Posted: Wed Nov 20, 2002 9:43 pm |
Hmm.. at first I thought you could use #REGEXP, but thats not really a full regexp (shame)
Another idea, maybe you can get the original line from the zMUD COM object?
(Just tried a (%*) Trigger with ANSI trigger on, _that_ produces some strange effects in the current beta ,)
Hmm...
Lady C. |
|
|
 |
|
|