Help with alias

Post Reply
WobblingEars
Posts: 4
Joined: Mon Feb 25, 2013 12:50 am

Help with alias

Post by WobblingEars »

Hi,

I have created an alias "ko" for "kill orc".
If there are more orcs around I might also want to do "ko 2" for "kill orc 2".

Is there an easy way to have this optional part in the same alias or is it easier to just make 2 different ones?

User avatar
Belgarath
Posts: 232
Joined: Fri Jul 26, 2013 7:19 am
Discord: macjabeth#7149

Re: Help with alias

Post by Belgarath »

Mudlet makes your wildest dreams come to life, so yes <3
Change your alias to: ^ko( \w+)?$
Then in the script box you can put:
Code: [show] | [select all] lua
send("kill orc" .. (matches[2] or "")

WobblingEars
Posts: 4
Joined: Mon Feb 25, 2013 12:50 am

Re: Help with alias

Post by WobblingEars »

Ah, the space inside the brackets!

Thank you very much for helping me out.

Post Reply