# repeat alias

Share your scripts and packages with other Mudlet users.
Jor'Mox
Posts: 1153
Joined: Wed Apr 03, 2013 2:19 am

Re: # repeat alias

Post by Jor'Mox »

I think you have it right, the matches table is overwritten when a new alias is called, so you need to save the relevant values before you call expandAlias.

User avatar
ulysses
Posts: 52
Joined: Fri Jan 05, 2018 7:43 pm

Re: # repeat alias

Post by ulysses »

I fixed this my making matches local like this:

Code: Select all

local myMatches = matches
for i = 1, tonumber(myMatches[2]) do
	expandAlias(myMatches[3])
end
Perhaps this could be put in the package above at the start of this thread?

Thanks!
U
Wod :mrgreen:
CthulhuMUD
www.cthulhumud.com
A hugely entertaining MUD based on the horror writings of HP Lovecraft.

hsima
Posts: 1
Joined: Thu Sep 03, 2020 8:23 pm

Re: # repeat alias

Post by hsima »

Patched and tested, seems to work as desired.
Attachments
repeat.xml
(634 Bytes) Downloaded 793 times

codrus
Posts: 5
Joined: Tue Apr 09, 2013 5:53 pm

Re: # repeat alias

Post by codrus »

I like to be able to do things like: 13w or 9ne

So to do that you can change it to: ^(\d+)(.*)$

Post Reply