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
Jim Vance
Beginner


Joined: 07 Dec 2006
Posts: 16

PostPosted: Tue Oct 14, 2008 3:26 am   

Concatenating a long string into a shorter string
 
I have created a script to work off my automapper that will change the zMUD path syntax to one that will work off a command on a MUD I play. The MUD command is called "do" and allows you to add a list of different commands to a single string; this includes movement. So here are a couple of simple examples:

Code:
do 5n,6e,7sw,2w
do n,e,s,10w


Right now, my script will create a string that is not "optimized" (if you want to call it that), and creates long strings such as

Code:
do n,n,n,n,n,n,n,n,n


rather than just

Code:
do 9n


I would like to have it so that any directions that are the same are concatenated in much the same way that the original zMUD path was.

Any help would be greatly appreciated.

Thanks.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Tue Oct 14, 2008 8:13 am   
 
Check this out. You can use %replace or %subchar to get | instead of commas.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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