WoW API: UnitIsAFK

From AddOn Studio
Revision as of 04:47, 15 August 2023 by Move page script (talk | contribs) (Move page script moved page API UnitIsAFK to API UnitIsAFK without leaving a redirect)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

WoW API < UnitIsAFK

Checks if a unit is AFK.

isAFK = UnitIsAFK("unit")

Arguments

unit
The UnitId to return AFK status of.

Returns

isAFK
true if unit is AFK, false otherwise.

Example

If the player is AFK, the following script outputs "You are AFK" to the default chat window.

if UnitIsAFK("player") then
  DEFAULT_CHAT_FRAME:AddMessage("You are AFK");
end