|
tessellated Beginner
Joined: 19 Feb 2005 Posts: 12
|
Posted: 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! |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: 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} |
|
|
|
Dharkael Enchanter
Joined: 05 Mar 2003 Posts: 593 Location: Canada
|
Posted: 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." |
|
|
|
|
|