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
Winslow
Novice


Joined: 17 Feb 2007
Posts: 48

PostPosted: Fri Aug 03, 2007 2:38 am   

Wildcards and colors
 
okay, two little porblems that are most likely quite simple but doin't know how to do this.

First, I'm trying to capture the wiz channel into a seperate window. Now, usually on channels, you can capture them easily because they all have a special format "Joe gossips, "blah blah blah"" However the wiz channel just has "Joe : blah blah blah" I've been kinda doing this so far with just the " : " trigger but this captures all sorts of other junk as well. I was thinking if there was a wildcard linda like the & command which would be something like &3-7 meaning if the text before the ":" was anywhere from 3 chars to 7 chars then the trigger would work. This would make it so that almost all names fit into that catagory and jut out a lot of the other junk I'm capturing.

Also, is there a way to triiger on only a color of text. Like it says "You see an apple." but I only want it to trigger if it says that in red, not green, blue to yellow. Any command for that?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Aug 03, 2007 2:57 am   
 
You can do the first very easily with a regex:

\w{3,7} :

Specifies a : preceded by a space and 3-7 word characters (a-zA-Z0-9. You could use [a-zA-Z] instead of \w if you want).

There are two ways to do colour. The first is with the line colour option, where you pick the colour of the line and the trigger only fires if the line is that colour. The whole line needs to be the specified colour for that to work.

For more complex colours, if you copy the coloured text, check the ANSI trigger option, and then paste it into the pattern box, zMUD will rebuild the colour codes for you in the pattern. That lets you create a pattern that matches whatever colours you like.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Aug 04, 2007 3:23 am   
 
Quote:

\w{3,7}


:blink: Now this is something that Zugg's wildcarding doesn't do (well, far as I know, at least). It can only specify a fixed-width pattern (&3) or go with a variable-length pattern such as %w (all of which are internally governed by rules you can't change).
_________________
EDIT: I didn't like my old signature
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sat Aug 04, 2007 4:27 am   
 
Yep. Zugg couldn't really provide all the regex options with his own patterns, because if he did that he might as well just provide the regex engine. Which is what he did :)
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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