API:GetAFKFlag
From RoR Wiki
UI Lua API · Social functions
Version: WAR 1.4.8
Returns whether the player is flagged as away from keyboard (AFK).
isAFK = GetAFKFlag()
Arguments
None.
Returns
- isAFK
boolean–trueif the player is AFK.
Details
- The flag is the client's copy; the function does not contact the server.
- There is no function to set the flag. The stock UI toggles it by sending the chat command
/afkwith SendChatText.
Errors
None.
Example
From default/ea_socialwindow/source/socialwindowtaboptions.lua:
function SocialWindowTabOptions.OnPressAFKButton()
local afkNote = L""
if GetAFKFlag() == false
then
afkNote = TextEditBoxGetText("SocialWindowTabOptionsAFKNoteEditBox")
end
SendChatText( L"/afk "..afkNote, L"" )
end
