WoW:API UnitIsAFK: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
(Updated to match the current API boilerplate.)
Line 1: Line 1:
{{Stub/API}}
{{wowapi}} __NOTOC__
{{wowapi}}
 
== Parameters ==
 
Checks if a unit is AFK.
isAFK = UnitIsAFK([[UnitId|unitId]])
 
 
=== Arguments ===
=== Arguments ===
:;unitId : The [[UnitId]] to check


:;unitName : The [[API TYPE UnitId|Unit id]] you want debuff information for.


=== Returns ===
=== Returns ===
:; isAFK : [[Boolean]] - Whether the unit is AFK


:;afk


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


<pre> afk = UnitIsAFK("player"); </pre>
<big>'''Results'''</big>


Checks if the player is AFK.
If the player is AFK, it outputs "You are AFK" to the default chat window.

Revision as of 18:39, 25 June 2007

WoW API < UnitIsAFK


Checks if a unit is AFK.

isAFK = UnitIsAFK(unitId)


Arguments

unitId
The UnitId to check


Returns

isAFK
Boolean - Whether the unit is AFK


Example

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

Results

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