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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
gmueller
Apprentice


Joined: 06 Apr 2004
Posts: 173

PostPosted: Sun May 20, 2007 1:15 am   

ANSI Trigger not firing.
 
Code:
#REGEX {\033\[33m([A-Z]+.*\.)\033\[0m$} {#SAY hi} "mapping" {case|color}



this is actually the roomname trigger I have from my zmud system, the normal body of this is something like:
Code:
#REGEX {\033\[33m([A-Z]+.*\.)\033\[0m$} {#roomname = %line;#TAG name {@roomname}}


The ANSI codes correspond to the color I have for my roomnames (yellow-gold)
Code:
Reply with quote
gmueller
Apprentice


Joined: 06 Apr 2004
Posts: 173

PostPosted: Sun May 20, 2007 1:19 am   
 
sorry the forum stripped some of the escape codes, it's better now
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Sun May 20, 2007 8:42 am   
 
Well ANSI colors are a little frizzed right now.

I'm hoping the last of color quirks will be addressed in the next version. With the colors being frizzed said trigger probably won't fire properly.

Basically when an ANSI trigger fires, it's not firing on the original ANSI but the recreation of it based on CMUD colors but this is what's frizzed. It's high on the list, so I'm pretty sure it will be resolved in the next version.
_________________
Asati di tempari!
Reply with quote
gmueller
Apprentice


Joined: 06 Apr 2004
Posts: 173

PostPosted: Sun May 20, 2007 8:54 pm   
 
eh... so let me get this right... cmud processes the text, alters it, then will alter it again depending on the trigger... suppose that the result of the trigger were a #GAG, or a color change... then it would in effect be processed 3 times...

sounds a bit convoluted?

my two cents.
(ps criticism doesn't mean I don't appreciate what you're doing)
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon May 21, 2007 5:31 pm   
 
CMUD (and zMUD) always processes triggers based upon the actual text displayed on the screen. This was decided many years ago to prevent MUDs from messing up your triggers by just inserting random control characters (stuff that didn't effect the text display, but only added control characters to the input stream). So yes, Tech is correct that when you use an ANSI trigger, CMUD has to try and reproduce the original ANSI color codes based upon how the text looks on the screen. It does not save the raw input from the MUD.

I don't know what you mean by "processed 3 times". That's not true. Normal triggers are processed when a newline is received from the MUD. So it doesn't matter if you #GAG or change the color.

In any case, the problem is that the #REGEX command doesn't seem to handle escape codes properly. You need to use a normal CMUD trigger syntax for this:
Code:
#TRIGGER {%e[33m([A-Z]*.)%e[0m$} {#SAY hi} "mapping" {case|color}

and then it will work.
Reply with quote
gmueller
Apprentice


Joined: 06 Apr 2004
Posts: 173

PostPosted: Mon May 21, 2007 6:33 pm   
 
by processed I mean that the engine has to look at it 3 times.
1 in preprocess removing/altering display codes
1 in matching the trigger
1 rendering the output text

whereas I was assuming that an ansi trigger could look at the text before a preprocess.
1 in matching the trigger
1 rendering the output text

I guess my version of the trigger would require a rewrite of the whole trigger pipeline and priorities setup, so probably too hard to impliment easily.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue May 22, 2007 5:01 pm   
 
Yep, it's not going to change. And there really isn't any way to remove step 1 (preprocess to remove display codes) because it would still need to preprocess to handle MXP, MCCP, telnet options, and all of the other possible "hidden" codes that the MUD can send. For example, #GAG shouldn't have any effect on telnet options. So there really wouldn't be much savings in performance.

I'm not sure why the #REGEX command broke. I took a quick look at the source code and it looks like it should still be working with ANSI triggers. Maybe it's something in how the \ character is being handled. It's on the bug list so I'll look into this more in a future version.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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