Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetAFKFlag

From RoR Wiki
Revision as of 19:42, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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 – true if 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 /afk with 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

See also