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


Joined: 05 Sep 2004
Posts: 10

PostPosted: Sun Dec 09, 2007 7:33 pm   

Needing to convert comma delineated directions to semicolon delineated?
 
Sorry for the vague subject ... that's the best I could come up with to describe the problem I'm facing...

I've presently got a list of directions i've compiled for a mud, but the directions were written out in long format..
i.e. w,w,w,w,n,n,w,w,w,w,s,s,s,s,s, etc ...

what i'm trying to do is find a quick and painless way to convert these to zMUD friendly semicolon delineated directions like 4w;2n;4w;5s ... the reason I've yet to do this by hand is quite a few of these directions involve going upwards of 20-40 times in a single direction.

Anybody familiar with a function built into zmud that might be able to do this? Or perhaps a utility somewhere that will do the conversion?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Dec 09, 2007 7:39 pm   
 
You want to use %replace and %pathcompress. Asumming you have your path in variable 'x' it would look like this
x=%pathcompress(%replace(@x,",","|"))
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
orcsoul
Beginner


Joined: 05 Sep 2004
Posts: 10

PostPosted: Sun Dec 09, 2007 7:41 pm   
 
ok, right now i've got them set up as aliases ... so should i just convert the aliases to path's and then execute the script?
Which brings up the question, if the answer to the previous is yes, how do I convert/move the aliases over to become paths, short of just copy/pasting the directions for each set as a new path?
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Mon Dec 10, 2007 5:21 am   
 
You can't actually copy and paste into a path because the direction "ne" looks like north, followed by east. The mapper uses hjkl to represent diagonal directions in patterns and Viji's script won't automatically change diagonals into hjkl. You'll need to do that yourself - just use the GUI to enter it yourself.

You could make something more complex using %replace to replace the diagonal directions with the proper letter, but it's probably more effort than it's worth unless you have tons of these aliases.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Mon Dec 10, 2007 7:48 am   
 
%pathcompress(%subregex(%subregex(%subregex(%subregex(%subregex(@X,"nw","h"),"ne","j"),"sw","k"),"se","l"),",","|"))
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
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