<?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%3ASetMacroData</id>
	<title>API:SetMacroData - 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%3ASetMacroData"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:SetMacroData&amp;action=history"/>
	<updated>2026-10-18T23:32:27Z</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:SetMacroData&amp;diff=30728&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:SetMacroData&amp;diff=30728&amp;oldid=prev"/>
		<updated>2026-10-16T19:49:09Z</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;
Sets the name, text and icon of one of the player&amp;#039;s macros.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SetMacroData(name, text, iconNum, macroId)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;name : &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; – Name of the macro. The client copies it into a buffer of 64 characters.&lt;br /&gt;
;text : &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; – Macro text (the command line it runs). The client copies it into a buffer of 256 characters.&lt;br /&gt;
;iconNum : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Icon id of the macro, for [[API:GetIconData|GetIconData]].&lt;br /&gt;
;macroId : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Macro slot, 1 to 48.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The macro in slot &amp;lt;code&amp;gt;macroId&amp;lt;/code&amp;gt; is overwritten. A slot outside 1 to 48 is not written.&lt;br /&gt;
* After the call the client sets &amp;lt;code&amp;gt;GameData.Macros.macrosDirty&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; and broadcasts an event to the UI, also when the slot was out of range.&lt;br /&gt;
* If the client&amp;#039;s macro list is not available, nothing happens.&lt;br /&gt;
* &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; must be wide strings; plain Lua strings raise an &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; error.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call ImportMacroData: You cannot change your macros while in combat.&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;This check exists in the client but never triggers: the flag it tests is never set.&lt;br /&gt;
* The generic &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; message when an argument has the wrong type.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;ea_macrowindow/source/macrowindow.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SetMacroData( TextEditBoxGetText( &amp;quot;EA_Window_MacroDetailsName&amp;quot; ), TextEditBoxGetText( &amp;quot;EA_Window_MacroDetailsText&amp;quot; ), EA_Window_Macro.iconNum, EA_Window_Macro.activeId )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:GetMacrosData|GetMacrosData]]&lt;br /&gt;
* [[API:SetHotbarData|SetHotbarData]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>