<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AInteractSelect</id>
	<title>API:InteractSelect - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AInteractSelect"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:InteractSelect&amp;action=history"/>
	<updated>2026-10-17T18:28:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:InteractSelect&amp;diff=30512&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:InteractSelect&amp;diff=30512&amp;oldid=prev"/>
		<updated>2026-10-16T19:45:44Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=Interact}}&lt;br /&gt;
Selects an option or a quest from the interaction menu returned by [[API:InteractGetBaseInteractionData|InteractGetBaseInteractionData]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
InteractSelect(interactionId, type, slot)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;interactionId : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Id of the current interaction, the same value passed to [[API:InteractGetBaseInteractionData|InteractGetBaseInteractionData]]. Only its low 16 bits are compared.&lt;br /&gt;
;type : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – The &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; field of the chosen option or quest.&lt;br /&gt;
;slot : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – For quests (&amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; 6), the quest&amp;#039;s &amp;lt;code&amp;gt;slot&amp;lt;/code&amp;gt; field. The stock UI passes &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; for other options.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* If &amp;lt;code&amp;gt;interactionId&amp;lt;/code&amp;gt; does not match the current interaction, nothing happens.&lt;br /&gt;
* The client runs the action for &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt;. For quests, a &amp;lt;code&amp;gt;slot&amp;lt;/code&amp;gt; outside the quest list does nothing; otherwise the client sends the server a request for that quest.&lt;br /&gt;
* &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; 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 &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; values received from [[API:InteractGetBaseInteractionData|InteractGetBaseInteractionData]].&lt;br /&gt;
* The function needs at least three arguments and only reads the last three.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
None besides the generic &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; message when an argument is missing or not a number.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;default/ea_interactionwindow/source/interactionbase.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function EA_Window_InteractionBase.QuestLButtonUp()&lt;br /&gt;
    local buttonIndex = WindowGetId(SystemData.ActiveWindow.name)&lt;br /&gt;
    local dataIndex   = ListBoxGetDataIndex(&amp;quot;EA_Window_InteractionBaseQuestList&amp;quot;, buttonIndex)&lt;br /&gt;
    local optionData  = EA_Window_InteractionBase.questListData[dataIndex]&lt;br /&gt;
   &lt;br /&gt;
    InteractSelect(EA_Window_InteractionBase.tempTarget, optionData.type, optionData.slot)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the same file, for a menu option:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
InteractSelect(EA_Window_InteractionBase.tempTarget, optionData.type, 0)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:InteractGetBaseInteractionData|InteractGetBaseInteractionData]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>