Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetGameTime

From RoR Wiki
Revision as of 19:43, 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 · Time functions
Version: WAR 1.4.8

Returns the client's running game clock, in whole seconds.

seconds = GetGameTime()

Arguments

None.

Returns

seconds
number – Whole seconds on the client's game clock.

Details

  • The value is read from the client's high-resolution frame timer, which counts from a fixed point set by the client, and is cut to whole seconds. It is not a date or a time of day; use it to measure intervals.
  • Several data tables give times as game-clock values. The stock UI subtracts GetGameTime() from them to get the seconds remaining (see the example).
  • Arguments are not checked; anything passed is ignored.

Errors

None.

Example

From easystem_utils/source/datautils.lua:

function DataUtils.GetPQTimerRemaining( timerState, timerValue )
    if ( timerState == GameData.PQTimerState.RUNNING )
    then
        -- In this case, timerValue is the game time at which the timer expires
        local timeLeft = timerValue - GetGameTime()

From easystem_tooltips/source/itemtooltips.lua:

currentTimeLeftBeforeDecay = currentTimeLeftBeforeDecay + itemData.timestamp - GetGameTime()

See also