Need help creating a speedwalk system
Posted: Sat Dec 26, 2009 5:51 am
Hello,
For the mud I play there is a online guide that gives a series of speedwalk directions to locations in the mud. The format of these directions are {# of steps}<cardinal dir> repeat.
So for example, one path might be:
15e5s2e2s
representing go 15 east, 5 south, 2 east, and 2 south
While another might be:
9sws3ws2w2s2w3sws5w2sws2w3s6wswn3ws4wnwsw2n3w3nw5n2wn7w2nwsws3wndn2e4n8ws
which is a chain I will not expand for you, since it's long, but you get the point.
I need an alias or script of some time that can recognize this speed dirs (maybe by a special character I put in front of them, I am partial to the tilda (~) and then expand them into a chain that the mud will accept. Might need a char at the end to let the script know the dirs are done to...not sure
For example, that first speed walk I gave would need to output as:
e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;s;s;s;s;s;e;e;s;s
I am figuring probably a while loop that concatenates the directions into a long string and then sends that string as an output, but I am not skilled enough in lua code or regular expressions to be able to build it myself.
Can a script kiddie out there help me? It would be super keen.
Thanks!
-The Bouncy One.
For the mud I play there is a online guide that gives a series of speedwalk directions to locations in the mud. The format of these directions are {# of steps}<cardinal dir> repeat.
So for example, one path might be:
15e5s2e2s
representing go 15 east, 5 south, 2 east, and 2 south
While another might be:
9sws3ws2w2s2w3sws5w2sws2w3s6wswn3ws4wnwsw2n3w3nw5n2wn7w2nwsws3wndn2e4n8ws
which is a chain I will not expand for you, since it's long, but you get the point.
I need an alias or script of some time that can recognize this speed dirs (maybe by a special character I put in front of them, I am partial to the tilda (~) and then expand them into a chain that the mud will accept. Might need a char at the end to let the script know the dirs are done to...not sure
For example, that first speed walk I gave would need to output as:
e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;s;s;s;s;s;e;e;s;s
I am figuring probably a while loop that concatenates the directions into a long string and then sends that string as an output, but I am not skilled enough in lua code or regular expressions to be able to build it myself.
Can a script kiddie out there help me? It would be super keen.
Thanks!
-The Bouncy One.