@fluxflux: I don't think that's possible through LUA alone. What you could do is setup a table and call the TargetUnit function, e.g. something like this as a possibility:
Code:
local myTable = {
-- Set autoTarget to true or false, to allow automatic targeting of the unit
-- All names are strictly case-sensitive!
{unitName = "Twilight Assault Drake", autoTarget = true},
{unitName = "Twilight Assassin", autoTarget = true}
{unitName = "Raider's Training Dummy", autoTarget = true},
{unitName = "Arm Tentacle", autoTarget = true},
{unitName = "Wing Tentacle", autoTarget = true},
{unitName = "Mutated Corruption", autoTarget = true},
{unitName = "Mana Void", autoTarget = true},
{unitName = "Elementium Bolt", autoTarget = true},
{unitName = "Burning Tendons", autoTarget = true},
{unitName = "Warmaster Blackhorn", autoTarget = true},
{unitName = "Goriona", autoTarget = true}
}
for i=1,#myTable do
if myTable[i].autoTarget == true then
if not UnitExists("target") then
-- Fetch a target
TargetUnit(myTable[i].unitName, true)
return false
else
-- Are we in range?
if IsSpellInRange(GetSpellInfo(8092), "target") == 1
and not UnitIsDeadOrGhost("target")
and UnitCanAttack("player","target")
then return true else ClearTarget() return false end
end
end
end
This should try and automatically target a unit matching the exact name (I can't stress that enough), closest to you. I added in Raider's Training Dummy for convenience reason, if you want to check it out, paste this code into an ability with ID 0, set the delay to 100-200 and place the ability at the top of your rotation. Then start it up and test to see if it targets anything.
Update:
Updated the coding a little bit.. Should help validate a target in case of multiple entries.
However, I probably won't ever support this kind of targeting and probably won't use it within my own profiles because I feel and want the people using it to learn from it, while actually actively playing their class, rather than PQR doing everything for them.