Speedwalk

Speedwalk

Postby DarkArtist » Tue Dec 10, 2013 7:45 pm

Alias Speedwalk

Pattern:
^([0-9neswdu]+)$

for count, direction in string.gmatch(matches[2], "([0-9]*)([neswdu])") do
count = (count == "" and 1 or count)
for i=1, count do send(direction,false) end
end

--Except that this matches on the opening screen when you hit 1 to enter the game. If anyone can figure out how to fix the pattern to not match on a single \d, pls post it.

to correct this i added:

if matches[1]="1" then send("1") else ...

It'd be better to just fix the pattern tho.
DarkArtist
Double 40 Poster
 
Posts: 111
Joined: Tue Dec 10, 2013 6:18 pm
Status: Offline

Re: Speedwalk

Postby Avar » Wed Dec 11, 2013 3:49 pm

Maybe this will work:
^([0-9neswud]*[neswud]+)$
Avar
 
Posts: 2
Joined: Wed Nov 14, 2012 2:41 pm
Status: Offline

Re: Speedwalk

Postby DarkArtist » Thu Dec 12, 2013 8:41 am

Yup, thanks :)
DarkArtist
Double 40 Poster
 
Posts: 111
Joined: Tue Dec 10, 2013 6:18 pm
Status: Offline


Return to Mudlet - unlimited possibilities

Who is online

Users browsing this forum: No registered users and 2 guests