Lua for beginners

Posted by Tisorin on Mon 21 Jan 2013 12:55 PM — 3 posts, 16,734 views.

#0
Greetings,

I'm struggling to create a very easy script which saves a variable and then uses that variable in a trigger.

Example:

Ghir points you the (animal).
Kill (that animal)

I know it is a noob question, but I didn't managed to make it work.
USA #1
The simple answer. (be sure both trigger and alias are set to send to script)

If a trigger matches: Ghir points you the (animal). and puts the animal in %1, all you really need to do to set the variable is:

target = "%1"

And to use it in an alias, send:

Send ("kill " .. target)
Australia Forum Administrator #2
This video about making an alias covers a lot of that stuff:

http://gammon.com.au/forum/?id=9616