 |
sun2gohan Beginner
Joined: 15 Aug 2004 Posts: 22
|
Posted: Mon Aug 16, 2004 1:56 pm
Pattern match ansi? |
Hi everyone,
I have read through the forums and from what I understand if you use an ANSI trigger and try to match a line that contains ANSI codes with * it won't work.
I have a multistate trigger..once one keyword triggers the first trigger..the second trigger is ready (which is ANSI). Essentially I want to grab the next line after the initial trigger with color codes intact.
The only problem is, the ^(*)$ trigger i use for the second line/state doesn't seem to fire for a line with ansi codes... is there a way to handle that? Or am I just doing something wrong.
The first trigger fires fine, its just the second one that doesn't.
Any help would be great :) Thanks.
S2G |
|
|
|
 |
sun2gohan Beginner
Joined: 15 Aug 2004 Posts: 22
|
Posted: Mon Aug 16, 2004 2:06 pm |
Sorry for the addition... but the reason as I understood it, was something about escape characters and the fact that the ANSI codes contain ; which is what confuses the * pattern from working.
As an aside..what does %* represent in pattern matching? It doesn't seem to be in the patterns page of the help file.
Thanks
S2G |
|
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: Mon Aug 16, 2004 9:58 pm |
In current versions of zMud the %* wildcard has the same value as *. Zugg was able to alter things when he added the regex functionality to provide better protection against misuse of special characters. So while %* still exists it will forever remain undocumented.
In my experience * has no problems matching multiple ANSI sequences containing ';'. I haven't tested this in a few versions.
I also recall last time I played with this the ANSI option was ruquired to be set for all or none of the states of a multi-state trigger. I would suggest turning on ANSI in the first state to double-check this. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
 |
sun2gohan Beginner
Joined: 15 Aug 2004 Posts: 22
|
Posted: Tue Aug 17, 2004 1:43 pm |
Thanks for the reply Vijilante,
I finally got it to work... I had to use multistates for each line as trying to grab multilines in one trigger didn't quite work.
In any case, with multistate ANSI triggers.. There might be a bug?
If you make your first trig, set it to ansi..i also have Trigger on Trigger turned off for all of these.
Make your second, etc.
After putting in the pattern and then the action to do when triggered, you have to immediately click ANSI on in the options menu and save. If you save before clicking ANSI on, it will not save properly afterwards in the IDE like interface.
As a result, I had to copy and paste out the whole script from the class definition and then copy it back in with the {color} option in place where it was missing for certain #COND statements.
In any case, other than that it does the job. It just feels like zMUDs crashing down around me. Maybe it's because i'm always running an auto-run script whenever I edit the settings within zMUD and variables and such are contantly changing.
Thanks
S2G |
|
|
|
 |
|
|
|