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


Joined: 16 Feb 2009
Posts: 38

PostPosted: Tue May 04, 2010 12:33 pm   

Capture ANSI line of text to another window
 
Hi,

How can I capture a ANSI line of text into another window? Keeping the ANSI intact?

Example:

(blue)This is an ANSI (white)line. (yellow)This is an ANSI line. -> #window tells

AND

bonus question: Can I capture a line of text (triggering it non-ansi) and later grab the ansi-version of it?

/kg
Reply with quote
Martaigne
Wanderer


Joined: 05 Jan 2002
Posts: 88
Location: Atlanta, GA

PostPosted: Tue May 04, 2010 1:30 pm   
 
Won't #CAP do this?
_________________
Unwritten Legends
Reply with quote
killergate
Novice


Joined: 16 Feb 2009
Posts: 38

PostPosted: Tue May 04, 2010 1:41 pm   
 
Hi,

It indeed seems like it does that. Ill try.

/kg
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue May 04, 2010 5:49 pm   
 
#CAPTURE will do so, but if you need to work with parts of the text pattern before sending off the result to the window you will need to use an ansi trigger. With local variables, you won't even have to worry about messing up your #WINDOW:

Code:
#trigger {(pattern with ansi codes)} {
  $plainpattern = %stripansi(%1)
  $pattern = %1
  #if ($plainpattern = "something") {#window windowname {$pattern}}
}
_________________
EDIT: I didn't like my old signature
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