WoW:API UnitIsAFK: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
Line 7: Line 7:


=== Returns ===
=== Returns ===
; isAFK : 1 if unit is AFK, nil otherwise.
; isAFK
: true if unit is AFK, false otherwise.


== Example ==  
== Example ==  

Revision as of 21:15, 3 November 2019

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