Originally Posted by
averykey
how to check if there is a lootable target nearby? does someone have a function made, I can't find one in the api.]
this won't work because when you leave combat, your target is cleared.
PHP Code:
if UnitAffectingCombat("player") == nil and UnitIsDeadOrGhost("target") ~= nil then
InteractUnit("target")
RunMacroText("/cleartarget")
end
try this:
PHP Code:
if UnitAffectingCombat("player") == nil then
TargetLastTarget()
if UnitIsDeadOrGhost("target") ~= nil then
InteractUnit("target")
RunMacroText("/cleartarget")
end
end