# repeat alias

Share your scripts and packages with other Mudlet users.
Post Reply
User avatar
Vadi
Posts: 4462
Joined: Sat Mar 14, 2009 3:13 pm

# repeat alias

Post by Vadi » Fri Feb 05, 2010 6:18 pm

Import xml, and you can do #number thing.

For example, #5 hi will send hi five times.
Attachments
#-repeat-alias.xml
(411 Bytes) Downloaded 468 times

ulysses
Posts: 14
Joined: Fri Jan 05, 2018 7:43 pm

Re: # repeat alias

Post by ulysses » Sat Feb 10, 2018 8:33 am

This is very nice, but what happens if you want to repeat an alias defined in MUDlet. In this case it doesn't work as it sends the alias string to the mud.

User avatar
Vadi
Posts: 4462
Joined: Sat Mar 14, 2009 3:13 pm

Re: # repeat alias

Post by Vadi » Sat Feb 10, 2018 1:18 pm

Replace 'send(matches[3])' with 'expandAlias(matches[3])'

ulysses
Posts: 14
Joined: Fri Jan 05, 2018 7:43 pm

Re: # repeat alias

Post by ulysses » Sat Feb 10, 2018 1:29 pm

Parfait! Excellent! Thanks!

ulysses
Posts: 14
Joined: Fri Jan 05, 2018 7:43 pm

Re: # repeat alias

Post by ulysses » Mon Feb 12, 2018 11:03 am

Vadi wrote:
Sat Feb 10, 2018 1:18 pm
Replace 'send(matches[3])' with 'expandAlias(matches[3])'
Actually that only works with single line aliases. For multi-line aliases it does not work! For example I have a alias

Code: Select all

pp
which looks like this:

Code: Select all

send("open pouch")
send("put "..matches[2].." in pouch")
send("close pouch")
If I do #10 pp alabaster, it just executes it once. Why?

User avatar
Vadi
Posts: 4462
Joined: Sat Mar 14, 2009 3:13 pm

Re: # repeat alias

Post by Vadi » Mon Feb 12, 2018 11:51 am

No idea. Check the errors view, might give you a clue.

ulysses
Posts: 14
Joined: Fri Jan 05, 2018 7:43 pm

Re: # repeat alias

Post by ulysses » Mon Feb 12, 2018 1:29 pm

Vadi wrote:
Mon Feb 12, 2018 11:51 am
No idea. Check the errors view, might give you a clue.
There is an error, it says;

Code: Select all

LUA: ERROR running script # repeat alias (Alias23) ERROR:expandAlias: wrong argument type

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest