|
Anders Novice
Joined: 14 Jul 2003 Posts: 31 Location: USA
|
Posted: Fri Mar 17, 2006 6:32 am
Trubble with putting text with ['s to variable. |
For some time now I have been using ansi trigger to capture my roomnames, the same trigger adds the entire roomname and exits to a variable.
I was making minor changes to the trigger and suddenly the ['s and ]'s disappeard from the variable that I store the name to.
The text I get from the mud is:
Code: |
Sea of Hylar[32m [n,e,s,w,d][0m. |
And before that is what got enterd into the variable.
But now the variable only contains:
Code: |
Sea of Hylar[32m n,e,s,w,d[0m. |
I have made no changes at all to the line which adds to the variable, which follows:
How do I make it work again?
I have tried %quote but it does not work.
The name sent to the mapper has change the same way, the line is:
|
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Fri Mar 17, 2006 6:43 am |
The characters '[' and ']' are special characters in zMud. If you're matching on them you can use '~' to match explicitly. If you just the value, then on your trigger check the options and make sure the option for 'Verbatim' is selected.
|
|
_________________ Asati di tempari! |
|
|
|
Anders Novice
Joined: 14 Jul 2003 Posts: 31 Location: USA
|
Posted: Fri Mar 17, 2006 6:50 am |
Perhaps you missunderstood me. The trigger fires, it's just that not the entire string gets added to the variable.
If anyone wonders, the trigger pattern is:
Code: |
^((*){|$}%e[{|0;}32m ~[(*)~]%e[0m.)$ |
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Mar 17, 2006 11:39 pm |
Quote: |
^((*){|$}%e[{|0;}32m ~[(*)~]%e[0m.)$
|
You problem stems from early expansion of %1...%99 variables. To get around this, either play around with the %expand() function or remove the outermost set of parentheses and either stuff all the ansi code/plain text into one of the two remaining sets of parentheses or rebuild the string you want using %concat().
#trigger {^(*){|$}%e[{|0;}32m ~[(*)~]%e[0m.$} {
blah blah blah
CurrentRoom = %concat("%1", "%e[32m ~[", "%2", "~]%e[0m.")
blah blah blah
} |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Anders Novice
Joined: 14 Jul 2003 Posts: 31 Location: USA
|
Posted: Fri Mar 24, 2006 12:54 am |
Thank you. That seems to be working good.
|
|
|
|
|
|