Alias Question

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

Alias Question

Post by cannuck1974 » Sun Mar 25, 2018 8:08 pm

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#2283

Re: Alias Question

Post by Belgarath » Wed Mar 28, 2018 4:43 am

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: 912
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Alias Question

Post by SlySven » 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...

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

Re: Alias Question

Post by Belgarath » Sat Jun 16, 2018 3:32 am

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

Who is online

Users browsing this forum: Baidu [Spider] and 4 guests