Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:TextLogGetEntry

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

Returns one entry of a text log.

timestamp, filterType, text = TextLogGetEntry(logName, index)

Arguments

logName
string – Name of the text log.
index
number – Position of the entry, starting at 0 for the oldest entry. Cut to a whole number.

Returns

timestamp
wstring – Local time the entry was added, formatted as [HH:MM:SS].
filterType
number – The entry's filter type.
text
wstring – The entry text, after the <BR>/<P> conversion done by TextLogAddEntry.

Details

  • Entries are in the order they were added. When the log is full, the oldest entry is removed, so the entry at a given index changes as new entries arrive.
  • A negative index or an index of TextLogGetNumEntries or more raises the Index %d is invalid error and returns nothing.
  • The function needs at least two arguments and only reads the last two. Any extra arguments placed in front of them are ignored.
  • The stock UI never calls this function.

Errors

  • Error in function call 'TextLogGetEntry': Text Log %s does not exist
  • Error in function call 'TextLogGetEntry': Index %d is invalid

Example

A minimal example built from the documented signature:

local count = TextLogGetNumEntries( "Chat" )
if count > 0 then
    local timestamp, filterType, text = TextLogGetEntry( "Chat", count - 1 )  -- newest entry
end

See also