<?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%3AUpgradeEquipment</id>
	<title>API:UpgradeEquipment - 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%3AUpgradeEquipment"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:UpgradeEquipment&amp;action=history"/>
	<updated>2026-10-17T08:25:22Z</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:UpgradeEquipment&amp;diff=30849&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:UpgradeEquipment&amp;diff=30849&amp;oldid=prev"/>
		<updated>2026-10-16T19:51:07Z</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=Item}}&lt;br /&gt;
Sends an equipment upgrade request for an item, optionally with a second item used for the upgrade.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
UpgradeEquipment(isTest, mainBackpack, mainSlot, secondBackpack, secondSlot)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;isTest : &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; – Sent with the request. The stock UI passes the &amp;lt;code&amp;gt;isTest&amp;lt;/code&amp;gt; flag of its upgrade window.&lt;br /&gt;
;mainBackpack : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Backpack of the item to upgrade, as an &amp;lt;code&amp;gt;EA_Window_Backpack.TYPE_*&amp;lt;/code&amp;gt; value: 2 (&amp;lt;code&amp;gt;TYPE_INVENTORY&amp;lt;/code&amp;gt;), 3 (&amp;lt;code&amp;gt;TYPE_CURRENCY&amp;lt;/code&amp;gt;) or 4 (&amp;lt;code&amp;gt;TYPE_CRAFTING&amp;lt;/code&amp;gt;).&lt;br /&gt;
;mainSlot : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Slot of that item inside the backpack, starting at 1.&lt;br /&gt;
;secondBackpack : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Backpack of the second item, same values as &amp;lt;code&amp;gt;mainBackpack&amp;lt;/code&amp;gt;, or 0 for no second item.&lt;br /&gt;
;secondSlot : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Slot of the second item, or 0.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* &amp;lt;code&amp;gt;mainBackpack&amp;lt;/code&amp;gt; must be 2, 3 or 4, or the error below is raised and nothing is sent.&lt;br /&gt;
* If &amp;lt;code&amp;gt;secondBackpack&amp;lt;/code&amp;gt; is not 2, 3 or 4, the request is sent without a second item.&lt;br /&gt;
* Both items are converted to absolute inventory slots before sending.&lt;br /&gt;
* &amp;lt;code&amp;gt;isTest&amp;lt;/code&amp;gt; must be a real boolean. Passing &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; or a number raises an &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; error.&lt;br /&gt;
* If there is no player object or the Lua state is not available, nothing happens.&lt;br /&gt;
* The function needs at least five arguments and only reads the last five.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;UpgradeEquipment&amp;#039;: Invalid main item backpack.&amp;lt;/code&amp;gt;&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;default/ea_craftingwindow/source/equipmentupgradewindow.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
UpgradeEquipment( isTest, currentItems[SLOT_MAINITEM].sourceBackpack, currentItems[SLOT_MAINITEM].sourceSlot, currentItems[SLOT_REFINEMENT].sourceBackpack, currentItems[SLOT_REFINEMENT].sourceSlot )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Without a second item:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
UpgradeEquipment( isTest, currentItems[SLOT_MAINITEM].sourceBackpack, currentItems[SLOT_MAINITEM].sourceSlot, 0, 0 )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:GetSingleItem|GetSingleItem]]&lt;br /&gt;
* [[API:RequestSalvageItem|RequestSalvageItem]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>