Page 1 of 1

Stacked movement (for a lack of a better term?)

Posted: Mon Sep 26, 2016 7:28 am
by tincan
So I'm a recovering zMUD user, and I've figured how to rekey my numpad to move directionally. But I've encountered another issue: I used to be able to type .20n3ws and it would move me 20 rooms north, 3 west, one south. (I believe it only worked for the four cardinal directions, and up and down... could be wrong though.) Is there some sort of function in Mudlet that also does this, or some script I can find to do so? I honestly have no idea how to even start searching for it...

Re: Stacked movement (for a lack of a better term?)

Posted: Mon Sep 26, 2016 9:23 am
by chrio
make an alias with the pattern

Code: Select all

^\.(.*)$
that runs the code

Code: Select all

speedwalk(matches[2])
It is not exactly the same .ne will try to go northeast once, instead of north,east, so in your case, instead of writing .20n3ws you have to separate the direction by space or commas: .20n 3w s

If you need a delay between each step you can change the code into

Code: Select all

speedwalk(matches[2],false,0.5)
to get a 0.5 second delay

Re: Stacked movement (for a lack of a better term?)

Posted: Sun Oct 02, 2016 7:59 am
by tincan
Um, I assumed you meant to put ^\.(.*)$ in the pattern and speedwalk(matches[2]) for the substitution? I typed .5n and got an input of speedwalk(matches[2]), which resulted (as I'd expect) as a What? in the mud.

Re: Stacked movement (for a lack of a better term?)

Posted: Sun Oct 02, 2016 8:52 am
by chrio
No, not in the substitution, but in the big box below it where it says "Enter your lua code..."

Re: Stacked movement (for a lack of a better term?)

Posted: Sun Oct 02, 2016 9:53 am
by tincan
Well, now that you clarified, it works. But there's no "enter your lua code" notations... just saying.
I'm coming from a very linear zMUD backround (and a mud that forbade speedwalking before I started playing again when they relaxed their rules), and completely unfamiliar with this whole setup; I'm relying on you folks to explain how this works. And to be honest, most of what I learned from coding in zMUD was what others told me.

But now that you've clarified, my skipping around works just dandy. Thank you!

Re: Stacked movement (for a lack of a better term?)

Posted: Sun Oct 02, 2016 4:27 pm
by chrio
tincan wrote:Well, now that you clarified, it works. But there's no "enter your lua code" notations... just saying.
Really? Might be a difference from my version then, anyway, glad that it works for you now!

Re: Stacked movement (for a lack of a better term?)

Posted: Mon Oct 03, 2016 12:07 am
by Nyyrazzilyss
Here's one i've used for quite awhile - It doesn't use the speedwalk command btw, and I have an alias to capture individual movement (you may wish to change expandAlias to send)


tintin . speedwalk

Alias: ^[.]([0-9nsweudNSWEUD]+)
Code: [show] | [select all] lua
local dirString   =   matches[2]:lower()
local i

for count, direction in string.gmatch(dirString, "([0-9]*)([neswud])") do      
	count = (count == "" and 1 or count)
   for i=1, count do
   		expandAlias(direction)
   end
end