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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Fri Jan 02, 2009 3:27 am   

[2.37] Trouble matching ansi escape sequences in trigger
 
So a feature of my mud is MIP, which in the infinitely wise implementation decided not to put and carriage returns/line feeds after the information is sent. Basically it was designed for a mud client, portal, which makes use of it but since that has gone open source I saw how to get the mud to send me that information, so I'm working on writing scripts to capture the information. Anyways, due to this whole cr/lf issue, you can get a line like this:

#K%28001123FFFA~12~B~2323You hit a mob very hard!

or
#K%28001123FFFA~12~B~2323#K28001123BAE0.00#K%28001123FFFA~124~C~23

So in the first example, the You hit a mob very hard! would be in red, so a sequence I've been trying to use to match it is:

Code:
~#K~%28001%dFFF&hpstring%e


However, this flat out doesn't work. I tried switching to regex and use the \033 code for it, but still no luck with matching. So does anyone have any idea why the ansi escape sequences may not be working? Essentially what is happening is &hpstring is capturing everything, including the ansi tag, so what I've been doing is a regex search for the ansi tag and inserting a | before it so i can manipulate the hpstring data and keep the other information. But it really seems like I should be able to just match an escape code and use that as my anchoring point.

Also I might as well toss this out here now, but for the instance of multiple codes of MIP showing on the same line, any idea how to deal with that other than using a reparse trigger?
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Fri Jan 02, 2009 3:18 pm   
 
Can you post some actual debug output from the game or something? I like using \e to match the escape character in my ansi-regex triggers and it seems to work for me.

You can let the trigger fire multiple times on one line, which can occasionally be useful (and interesting...very interesting).
Reply with quote
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Fri Jan 02, 2009 5:34 pm   
 
Quote:

0.5326 | i 3kingdom <#K%28001008FFFC~953#K%28001008FFFC~954<ESC>[32;1mThe broodlings chitter anxiously.<ESC>[0m<CR><LF>
0.0049 | a 3kingdom |#K%28001008FFFC~953#K%28001008FFFC~954The broodlings chitter anxiously.
0.0034 | h 3kingdom |<ESC>[0S#K%28001008FFFC~953#K%28001008FFFC~954<ESC>[1;32mThe broodlings chitter anxiously.<ESC>[0m

0.0024 | <ESC>[0S#K%28001013FFFC~948~L~41<ESC>[37mThe dust<ESC>[0S is everywhere.<ESC>[0m

0.0021 | <ESC>[0S#K%28001013FFFC~904~L~51<ESC>[31mThe brood claws viciously at Mischievous Ruffian!<ESC>[0m
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Fri Jan 02, 2009 6:11 pm   
 
Code:
#K%28001\d+FFF(?hpstring:.*)\e


Regex, ansi.
Reply with quote
cazador
Apprentice


Joined: 08 Dec 2005
Posts: 108

PostPosted: Mon Mar 30, 2009 5:36 pm   
 
I am trying to get the cmud to use MIPS too .. I wasn't able to figure out how to send the jump command to get it all started. (i.e 3klient #~<version> ) How did you do that?

Thanks in advance
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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