Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:TomeGetHistoryAndLoreEntryData

From RoR Wiki

UI Lua API · Tome functions
Version: WAR 1.4.8

Returns the name and text of an unlocked History and Lore entry.

entryData = TomeGetHistoryAndLoreEntryData(entryId)

Arguments

entryId
number – Entry id, as in the entries list of TomeGetHistoryAndLoreZoneData.

Returns

entryData
table – The entry's data, or nothing if the id is invalid or the entry is still locked.
Key Type Meaning
id number Entry id.
zoneId number Id of the zone the entry belongs to.
name wstring Entry name.
text wstring Entry text.

Details

  • Check with TomeIsHistoryAndLoreEntryUnlocked first, as the stock UI does.
  • The error messages carry the name TomeIsHistoryAndLoreEntryUnlocked, not this function's name.
  • The argument check is shared with TomeGetHistoryAndLoreZoneData: if the argument is missing or not a number, the Invalid Parameters message names that function.

Errors

These are written to the UI log, and the function returns nothing.

  • Error in function call 'TomeIsHistoryAndLoreEntryUnlocked': %d is not a valid entry id.
  • Error in function call 'TomeIsHistoryAndLoreEntryUnlocked': You have not yet unlocked entry # %d

Example

From ea_tomeofknowledge/source/tomewindow_historyandlore.lua:

local entryData = TomeGetHistoryAndLoreEntryData( entryId )
if( entryData ~= nil ) then
    name = entryData.name
    text = entryData.text
    ...
end

See also