<?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%3ASetHotbarData</id>
	<title>API:SetHotbarData - 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%3ASetHotbarData"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:SetHotbarData&amp;action=history"/>
	<updated>2026-10-18T06:58:51Z</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:SetHotbarData&amp;diff=30723&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:SetHotbarData&amp;diff=30723&amp;oldid=prev"/>
		<updated>2026-10-16T19:49:05Z</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=Hotbar}}&lt;br /&gt;
Puts an action into a hotbar slot, or clears the slot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SetHotbarData(slot, actionType, actionId)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;slot : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Hotbar slot, 1 to 132 (&amp;lt;code&amp;gt;GameData.HOTBAR_TOTAL_SLOT_COUNT&amp;lt;/code&amp;gt;). A value of 0 or less places the action in the first empty slot; the stock UI uses -1.&lt;br /&gt;
;actionType : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Type of the action, a &amp;lt;code&amp;gt;GameData.PlayerActions&amp;lt;/code&amp;gt; value. 0 together with &amp;lt;code&amp;gt;actionId&amp;lt;/code&amp;gt; 0 clears the slot.&lt;br /&gt;
;actionId : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Id of the action (ability id, item id, macro slot, …).&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* Before writing, the client checks the slot and the ability against the player&amp;#039;s hotbar state and does nothing if the check fails.&lt;br /&gt;
* If the slot already holds the same action, nothing changes.&lt;br /&gt;
* When the slot changes, the client sends the change to the server for slots that the server stores, and notifies the UI for every hotbar slot that shows this entry.&lt;br /&gt;
* If no slot is empty when &amp;lt;code&amp;gt;slot&amp;lt;/code&amp;gt; is 0 or less, nothing is stored.&lt;br /&gt;
* For a slot above 132 the error below is logged (not raised as a Lua error) and nothing changes.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;SetHotbarData&amp;#039;: slot must be less than GameData.HOTBAR_TOTAL_SLOT_COUNT.&amp;lt;/code&amp;gt; (logged)&lt;br /&gt;
* The generic &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; message when an argument is not a number.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Placing an ability in the first free slot, from &amp;lt;code&amp;gt;ea_abilitieswindow/source/abilitieswindow.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SetHotbarData( -1, GameData.PlayerActions.DO_ABILITY, abilityData.id )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clearing a slot, from &amp;lt;code&amp;gt;ea_actionbars/source/actionbutton.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SetHotbarData (self:GetSlot (), 0, 0)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:GetHotbarData|GetHotbarData]]&lt;br /&gt;
* [[API:SetMoraleBarData|SetMoraleBarData]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>