|
deathkitty Apprentice
Joined: 14 Apr 2008 Posts: 105
|
Posted: Wed Apr 30, 2008 2:26 pm
how do I make #substitute make an extra line? |
I want to turn
"from here."
into
"from here.
%ansi(high,yellow)---------------------------------------%ansi(reset)"
but using this trigger to do it, it says unmatched braces even though there are obviously the right amount of braces. when i remove the line it works. it's weird :( can anyone help?
pattern:
from here.
action:
#sub {from here.} {from here.
%ansi(high,yellow)---------------------------------------%ansi(reset)} |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Wed Apr 30, 2008 2:35 pm |
Actually, since you're using CMUD, I suggest this:
#TRIGGER {from here.} {#SAYADD {%cr%ansi(high,yellow)---------------------------------------%ansi(reset)}
The reason for the unmatched braces is because you have the lines separated. It's not reading it all as one sub. It's reading as if you're subbing it with "from here." and then throwing in an %ansi command that makes no sense to CMUD.
Charneus |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Wed Apr 30, 2008 3:38 pm |
Charneus is right, CMUD is interpreting the linebreak as a break between commands.
A simpler way to do this would simply be to use the #say (or #show or #echo) command in your trigger. No messy %cr-ing or subbing parts of the line you don't need to. |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Wed Apr 30, 2008 4:09 pm |
Don't use #echo for this.
#echo doesn't necessarily go to the same window that the trigger fired from. [Yes in most cases it should] |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
|
|