Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

API AttackTarget

Last wiki revision 2023-08-24

Toggles auto-attacking of the current target. AttackTarget

  • This is actually a toggle. If not currently attacking, it will initiate attack. If currently attacking, it will stop attacking.
  • You can test your current attack "Action slot" using IsCurrentAction(actionSlot) for status (you'll have to find the auto-attack slot, though).
  • If you need a way to always engage auto-attack, rather than toggle it on or off, one workaround is AssistUnit("player") this will always attack if you have "Attack on assist" checked in the Advanced tab of the Interface Options panel. Note that you cannot combine this with TargetNearestEnemy in the same function/macro: the "assist" target isn't updated fast enough.
  • The macro "/startattack" will always initiate auto-attack (or auto-shot for hunters, if the appropriate interface option is active).

Source

https://warcraft.wiki.gg/wiki/API_AttackTarget · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.