Page 1 of 1

How do you make a Targeting alias?

Posted: Sat May 08, 2010 11:49 pm
by Eishi
Can someone tell us? And then how do we use it to attack etc.?

Re: How do you make a Targeting alias?

Posted: Sun May 09, 2010 1:25 am
by Vadi

Re: How do you make a Targeting alias?

Posted: Sun Oct 03, 2010 11:45 pm
by Acarion
Is there a way to call a variable from within the command line so that if I have the simple targetting alias
Pattern: ^t (.*)$
Script:
tar = matches[2]
And I've already defined t by typing "t <mob>", I can then do something like "smite tar" or "punch tar" from within the command line?
(Assuming I don't want to set up a separate SMITE or PUNCH alias)

Re: How do you make a Targeting alias?

Posted: Mon Oct 04, 2010 2:45 am
by tsuujin
Not from within the command line, no. The command line only accepts raw text and sends exactly what you type in.

You can create an alias, however, that can reference the variables you need.

For example, you could do something like:

Syntax: ^punch(?: (.+))?$
Script:
Code: [show] | [select all] lua
if matches[2] then
    send(matches[1])
else
    send(string.format("punch %s",tar))
end
Which would change depending on how you use it. You could save your target as "vadi", for example, and just type in "punch" to make it punch vadi. But if you wanted to punch me instead without changing your target you could type in "punch tsuujin" and it would bypass needing the second argument and use the variable instead.

This is an absurd example, because you could do the exact same thing by just using:
Syntax: ^punch$
Script:
Code: [show] | [select all] lua
send(string.format("punch %s",tar))
and it would still work exactly the same way, but it's still a good example of why aliases are cool and flexible. That said, I have used this technique heavily before if I always want to do some sort of script whenever the punch command is sent other than just punching.