WoW:API TargetUnit: Difference between revisions

no edit summary
m (Added other category.)
No edit summary
Line 20: Line 20:
;''Example''
;''Example''
  TargetUnit("player");
  TargetUnit("player");
:When the player changes his target there is a small delay before the global variable 'playertarget' is updated. This can be exploited and used for restoring your old target.
:Example:
:TargetUnit("unit")<br>
:CastSpell()<br>
:TargetUnit("playertarget") -- This will restore your old target because of the delay. It will not clear your target if you didnt have one.


;''Result''
;''Result''
Line 27: Line 35:


: Selects the specified id as the current target. One can use any of the defined [[API TYPE UnitId|UnitId]] values. One can also use the [[API TargetUnitsPet|TargetUnitsPet("unit")]] function to target a pet.
: Selects the specified id as the current target. One can use any of the defined [[API TYPE UnitId|UnitId]] values. One can also use the [[API TargetUnitsPet|TargetUnitsPet("unit")]] function to target a pet.


{{Template:WoW API}}
{{Template:WoW API}}
[[Category:API Targetting Functions|TargetUnit]]
[[Category:API Targetting Functions|TargetUnit]]
[[Category:API Unit Functions|TargetUnit]]
[[Category:API Unit Functions|TargetUnit]]
Anonymous user