Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:LogDisplayGetStringFromCursorPos

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

Returns the line of text of a LogDisplay at a given position.

text = LogDisplayGetStringFromCursorPos(logDisplayName, x, y)

Arguments

logDisplayName
string – Name of a LogDisplay window.
x, y
number – The position to test. The stock UI passes the cursorX, cursorY values handed to its spam-report handler (see the example).

Returns

text
wstring – The text at that position, or L"" if there is none.

Details

  • The client finds the character at the position in the display's text, then returns everything from the line break before it to the line break after it. The result can start with that leading line break.
  • If nothing is found at the position, an empty string is returned.
  • If the window does not exist or is not a LogDisplay, the error is logged and nothing is returned.
  • The function needs at least three arguments and only reads the last three.

Errors

These are written to the UI log; the call returns normally.

  • Error in function call 'LogDisplayGetStringFromCursorPos': Window %s does not exist
  • Error in function call 'LogDisplayGetStringFromCursorPos': Window %s is not a TextLogDisplay

Example

Grabbing the chat line to report as spam, from ea_playermenu/source/playermenuwindow.lua:

function PlayerMenuWindow.OnReportSpam(wndGroupId, cursorX, cursorY)
    ...
    local offendingMessage = LogDisplayGetStringFromCursorPos(activeTabName.."TextLog", cursorX, cursorY)
    HelpUtils.AutoReportGoldSeller(PlayerMenuWindow.curPlayer.name, offendingMessage)

See also