Page 1 of 1

Help with aliases to allow targeting me or ally?

Posted: Thu Jul 21, 2022 6:58 am
by MechaGodJovi
I'm quite unsure how to do this and after reading the manual over and over and searching the forums but I'm just confused.

So the aliases are simple and I understand how to to do but as example for the spell haste I have:

^hh$
c 'haste'

Obviously It works and it targets me but can someone explain to me like I'm 5 on how to also have it cast haste on someone else regardless of the targets name yet still cast haste on me when I don't input a target? Thanks.

Re: Help with aliases to allow targeting me or ally?

Posted: Thu Jul 21, 2022 1:34 pm
by demonnic
If you use the pattern

^hh( \w+)?$

Then it will match on either hh by itself, or hh followed by a word. Then remove anything you might have in the 'command' line, and instead use the script box at the bottom, with something like this
Code: [show] | [select all] lua
local target = matches[2] or ""
send("c 'haste'" .. target)
First line sets the local variable target to the word you used, if there is one. Otherwise if you didn't use a word, it just sets it to the empty string.
Second line uses send to send the command "c 'haste'" if there's no target, or "c 'haste' bob" if you passed in bob.

Re: Help with aliases to allow targeting me or ally?

Posted: Thu Jul 21, 2022 10:16 pm
by MechaGodJovi
Thank you so much that works perfectly I appreciate it!