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

Post Reply
User avatar
tincan
Posts: 13
Joined: Sun Sep 11, 2016 8:01 am

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

Post by tincan » Mon Sep 26, 2016 7:28 am

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...
I was sane once. I got better.

chrio
Posts: 66
Joined: Mon Aug 22, 2016 11:34 am

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

Post by chrio » Mon Sep 26, 2016 9:23 am

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

User avatar
tincan
Posts: 13
Joined: Sun Sep 11, 2016 8:01 am

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

Post by tincan » Sun Oct 02, 2016 7:59 am

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.
I was sane once. I got better.

chrio
Posts: 66
Joined: Mon Aug 22, 2016 11:34 am

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

Post by chrio » Sun Oct 02, 2016 8:52 am

No, not in the substitution, but in the big box below it where it says "Enter your lua code..."

User avatar
tincan
Posts: 13
Joined: Sun Sep 11, 2016 8:01 am

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

Post by tincan » Sun Oct 02, 2016 9:53 am

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!
I was sane once. I got better.

chrio
Posts: 66
Joined: Mon Aug 22, 2016 11:34 am

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

Post by chrio » Sun Oct 02, 2016 4:27 pm

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!

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

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

Post by Nyyrazzilyss » Mon Oct 03, 2016 12:07 am

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

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest