Page 1 of 1

Alias Question

Posted: Sun Mar 25, 2018 8:08 pm
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

Re: Alias Question

Posted: Wed Mar 28, 2018 4:43 am
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.

Re: Alias Question

Posted: Tue Apr 03, 2018 9:59 pm
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...

Re: Alias Question

Posted: Sat Jun 16, 2018 3:32 am
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).