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
teknique55
Newbie


Joined: 05 Feb 2005
Posts: 4

PostPosted: Wed Mar 26, 2008 12:02 pm   

breaking up a %0 script into subparts for color coding purposes.
 
Hi,

I have a desire to make a script where I insert different colorcodes into a string based on a proportion of the string length.

I've tried using %len(%0) and using math to divide the length into subportions, but I do not know how to store the values of each string subpart so that I can correctly insert the colorcodes into the correct order of subparts.

In the helpfile it says something about using &nn where nn is the character #, but because I can't seem to output the string value, I end up with numbers that the mud doesn't understand.

Any help will be much appreciated in this matter.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Mar 26, 2008 8:57 pm   
 
If you want to do this after matching the entire line, look into the use of %right(), %rightback(), %left(), and %leftback(). Maybe %copy(), but I'm not at all familiar with that one.
_________________
EDIT: I didn't like my old signature
Reply with quote
teknique55
Newbie


Joined: 05 Feb 2005
Posts: 4

PostPosted: Fri Mar 28, 2008 4:00 am   
 
Hi,

Thanks for your assistance.

I was able to get the script to cut off at certain points using %remove, %delete, and using %right, however, when I try to input it, there were text characters that got cut off due to Zmud rounding when I took the string length and divided by the number of subparts for each color coded part.

I came across the %insert command, but I cannot seem to insert multiple colorcode commands at different points, and when I try to use it, it doesn't seem to want to insert what I want to happen.

I'm not sure how to go about doing this now?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Mar 28, 2008 10:45 am   
 
Perhaps some examples of the original strings you are working with, how you are capturing it, and what you want the final output to be would allow us to help you further.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
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