Alias Question

Post Reply
cannuck1974
Posts: 1
Joined: Sun Mar 25, 2018 8:05 pm

Alias Question

Post by cannuck1974 »

Hello. I am new to using Mudlet and have a question I hope you can assist with. I want to create an alias that does the following:

When I type: k<mob> with <mob> being the short name for the target the alias does the following:

order followers kill <mob>
Headbut <mob>

Thanks for any help you can provide

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

Re: Alias Question

Post by Belgarath »

Pattern: ^k(f|u|n| .+)$
Script:
Code: [show] | [select all] lua
local shortnames = {
  f = ' friends',
  u = ' you',
  n = ' anyone'
}

local mob = shortnames[matches[2]] or matches[2]

send('order followers kill' .. mob)
send('headbut' .. mob)
Using kf for instance would set the mob to friends.
Last edited by Belgarath on Sat Jun 16, 2018 3:36 am, edited 3 times in total.

User avatar
SlySven
Posts: 1019
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Alias Question

Post by SlySven »

You might want to include a space after the k in the pattern so that you can use other single words beginning with k without them firing this alias...

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

Re: Alias Question

Post by Belgarath »

SlySven wrote:
Tue Apr 03, 2018 9:59 pm
You might want to include a space after the k in the pattern so that you can use other single words beginning with k without them firing this alias...
Thanks for pointing that out - I fixed it (two months later).

Post Reply