WoW:API TargetUnit: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
(Removed reference to TargetUnitsPet())
Line 34: Line 34:
;''Description''
;''Description''


: 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.




----
----
{{WoW API}}
{{WoW API}}

Revision as of 05:12, 23 January 2006

TargetUnit -Documentation by danboo-

Selects the specified id as the current target.

TargetUnit("unit");

Arguments
("unit")
unit
String - The UnitId to select as a target.

Returns
nil

Example
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")
CastSpell()
TargetUnit("playertarget") -- This will restore your old target because of the delay. It will not clear your target if you didnt have one.
Result

Description
Selects the specified id as the current target. One can use any of the defined UnitId values.



Template:WoW API