WoW API: UnitIsAFK

WoW API < UnitIsAFK

Checks if a unit is AFK.

isAFK = UnitIsAFK("unit")

ArgumentsEdit

unit
The UnitId to return AFK status of.

ReturnsEdit

isAFK
true if unit is AFK, false otherwise.

ExampleEdit

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