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
deathkitty
Apprentice


Joined: 14 Apr 2008
Posts: 105

PostPosted: 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)}
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: 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
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: 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.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: 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
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