Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
ytin
Newbie


Joined: 20 Nov 2002
Posts: 2

PostPosted: 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.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: 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
Reply with quote
ytin
Newbie


Joined: 20 Nov 2002
Posts: 2

PostPosted: 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? :)
Reply with quote
Castaway
GURU


Joined: 10 Oct 2000
Posts: 793
Location: Swindon, England

PostPosted: 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.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net