Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:InteractSelect

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

Selects an option or a quest from the interaction menu returned by InteractGetBaseInteractionData.

InteractSelect(interactionId, type, slot)

Arguments

interactionId
number – Id of the current interaction, the same value passed to InteractGetBaseInteractionData. Only its low 16 bits are compared.
type
number – The type field of the chosen option or quest.
slot
number – For quests (type 6), the quest's slot field. The stock UI passes 0 for other options.

Returns

Nothing.

Details

  • If interactionId does not match the current interaction, nothing happens.
  • The client runs the action for type. For quests, a slot outside the quest list does nothing; otherwise the client sends the server a request for that quest.
  • type is not range-checked. The client looks it up in a table of handlers for types 0 to 22; the entries for 16 and 17 are empty, and values outside 0–22 are read past the end of the table. Only pass type values received from InteractGetBaseInteractionData.
  • The function needs at least three arguments and only reads the last three.

Errors

None besides the generic Invalid Parameters message when an argument is missing or not a number.

Example

From default/ea_interactionwindow/source/interactionbase.lua:

function EA_Window_InteractionBase.QuestLButtonUp()
    local buttonIndex = WindowGetId(SystemData.ActiveWindow.name)
    local dataIndex   = ListBoxGetDataIndex("EA_Window_InteractionBaseQuestList", buttonIndex)
    local optionData  = EA_Window_InteractionBase.questListData[dataIndex]
   
    InteractSelect(EA_Window_InteractionBase.tempTarget, optionData.type, optionData.slot)
end

From the same file, for a menu option:

InteractSelect(EA_Window_InteractionBase.tempTarget, optionData.type, 0)

See also