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
Martaigne
Wanderer


Joined: 05 Jan 2002
Posts: 88
Location: Atlanta, GA

PostPosted: Tue Jun 08, 2010 5:06 pm   

psub or otherwise append to end of line - RESOLVED
 
I am trying to use PSUB to append some information to the end of a line without much success. The line is fairly complicated and has ansi formatting that I wish to preserve, so I don't want to rebuild the line with SUB or SHOW.

The lines look like this:
Code:
Conditioning            207  M   0.00%
Evasion and Dodging     144 I   22.49%
First Aid                67     20.29%
Foraging                  8     20.46%
Gnosis                   93 I   85.94%
Larceny                  16      4.96%
Lore                     70     11.26%
Melee Weapons           230 IM   0.00%



The trigger pattern to grab all information looks like this:
Code:
^({%w|%w %w|%w and %w})%s(%d) ({I| })({M| })%s(%d~.%d)~%$



I took out the PSUB because I could not get it to work (it kept replacing text early in the line and adding random numbers) and am currently grabbing the entire line as a variable and using #SHOW to redisplay it and append the info I want at the end, but, of course, all ansi formatting is lost. Is what I am attempting even possible?
_________________
Unwritten Legends

Last edited by Martaigne on Tue Jun 08, 2010 5:39 pm; edited 1 time in total
Reply with quote
Martaigne
Wanderer


Joined: 05 Jan 2002
Posts: 88
Location: Atlanta, GA

PostPosted: Tue Jun 08, 2010 5:20 pm   
 
Never mind. I changed the trigger to an ansi trigger and changed the pattern to this to capture everything:

Code:
^{%e[36m|}(({%w|%w %w|%w and %w})%s(%d){%e[0m|} ({%e[33mI%e[0m| })({%e[32mM%e[0m| })%s(%d~.%d)~%)$


Now #SHOW displays the ansi coloring too.
_________________
Unwritten Legends
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue Jun 08, 2010 8:22 pm   
 
Yeah, if the part(s) you are capturing for replacement include ansi codes, you will lose the ansi codes unless it is an ansi trigger.
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