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


Joined: 27 May 2002
Posts: 13

PostPosted: Sat Oct 31, 2009 2:25 pm   

Which # command shall I use?
 
I am trying to change an entry..such as this:
Ettan leaves down.
how do I make that show
Ettan leaves D O W N. in #CW 2 ?

or
Ettan has arrived from above.

Ettan has arrived from A B O V E. in #CW 2 ?

thanks
_________________
towel
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Oct 31, 2009 7:22 pm   
 
There are two ways you can do it.

1)use the #SUBSTITUTE command. It replaces the entire line, even if the pattern you match is not the entire line.

#trigger {^Ettan leaves down.$} {#sub %concat(%ansi(2),"Ettan leaves D O W N.")}

2)use the #PSUB command. It only replaces the parts of the line you tell it to, kind of like the relationship between #COLOR and #CW. #PSUB allows you to specify either a starting and ending character position (X and Y), or you can use the %x1...%99 variables to refer to variable parts of your pattern.

#trigger {^Ettan leaves (down).$} {#PSUB %concat(%ansi(2),"D O W N") %x1}
_________________
EDIT: I didn't like my old signature
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sat Oct 31, 2009 10:13 pm   
 
#SUB doesn't do the entire line. It just does the part that matches the trigger.

I think it'd be better to use #PSUB, though.

If I were at my computer, I would give you another option to take. But sadly, nowhere near it right now.

Charneus
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