WoW:API UnitIsAFK: Difference between revisions

mNo edit summary
m (Move page script moved page API UnitIsAFK to API UnitIsAFK without leaving a redirect)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Stub/API}}
{{wowapi}} __NOTOC__
{{wowapi}}
Checks if a unit is AFK.
== Parameters ==
isAFK = UnitIsAFK("unit")
 
=== Arguments ===
=== Arguments ===
 
;unit : The [[UnitId]] to return AFK status of.
:;unitName : The [[API TYPE UnitId|Unit id]] you want debuff information for.


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


== Example ==  
== Example ==  
 
If the player is AFK, the following script outputs "You are AFK" to the default chat window.
<pre> afk = UnitIsAFK("player"); </pre>
if UnitIsAFK("player") then
 
  DEFAULT_CHAT_FRAME:AddMessage("You are AFK");
Checks if the player is AFK.
end

Latest revision as of 04:47, 15 August 2023

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