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


Joined: 08 Dec 2005
Posts: 108

PostPosted: Thu Jan 24, 2008 7:38 pm   

psub help
 
I have a trigger that triggers on ^Your * ($dam:{@Dam_in}) ($target:*)[!.]$
I want to be able to add some text to the following line that it was triggered from.
I know I can do something like
#SUB %trigger <color red> New text </color>
But this doesn't keep the %trigger doesn't keep the ansi escape sequence for %trigger. I would like to keep the original colors in the line the same.
I have thought of using #PSUB, but I am not able to get it to put it at the end of the line.
I would use something like #PSUB {<color red> New text </color>}

How would I make this psub be at the end of the line?
Reply with quote
Fluffy
Newbie


Joined: 06 Jan 2008
Posts: 8
Location: Houston, TX

PostPosted: Thu Jan 24, 2008 10:47 pm   
 
Wait wait, there may be a better way.. Lets think on this for a minute!!

What *exactly* are you trying to do? I understand the trigger being on one line, but why not trigger on the second line? Or if not possible, why do you need the exact same colors? Give us an example of what you are trying to trigger on (and what you want to replace..)
Reply with quote
MrCheviot
Novice


Joined: 02 Dec 2007
Posts: 42

PostPosted: Fri Jan 25, 2008 5:45 pm   
 
^Your * ($dam:{@Dam_in}) ($target:*)[!.]$

Right now, you get $dam and $target as local variables. You can put empty ()'s before the $ to capture an empty variable (think it would be %3 in this case but not 100% sure).

Then #psub %concat(%ansi(red),"Next text",%ansi(white)) %x3

PSUB will substitute things into variable positions. If %3 contained text that you wanted to modify, you could include that in the %concat(), and then use %x3 to replace it.


As for Fluffy's comment, if you are triggering and want a new line added beneath the line triggered, just use #show (or #mxp if you so desire), since #SUB will replace the triggered line entirely.

Hope this helps, if not post more of what you're trying to accomplish.

-MrC
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