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
tessellated
Beginner


Joined: 19 Feb 2005
Posts: 12

PostPosted: Thu Mar 03, 2005 9:36 am   

capturing raw ansi text to a variable
 
Hi! I want to make a trigger that matches against a line of text example:

Name 'foo'

What's more, I want the "foo" part from above to be saved to a variable including all of the it's raw ansi color information. Thanks in advance!
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Thu Mar 03, 2005 1:46 pm   
 
Here ya go, Captures the escape sequance and everything and the "%1" tells the trigger store it literaly (doesn't parse the escape sequance) And the {color} option, well that tells it to match escape sequances, Keep in mind that #SAY @colvar will return the string colored, and #SAY %stripansi(@colvar) will return the string without coloring, However I can't find a way to return the string raw (showing escapes without coloring)

#TRIGGER "ansi_to_var" {Name '(*)'} {ColVar="%1"} "" {color}
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Thu Mar 03, 2005 4:02 pm   
 
#say %replace(@colvar,%e,"ESC")
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
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