<?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%3ASendUseItem</id>
	<title>API:SendUseItem - 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%3ASendUseItem"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:SendUseItem&amp;action=history"/>
	<updated>2026-10-17T14:22:14Z</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:SendUseItem&amp;diff=30707&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:SendUseItem&amp;diff=30707&amp;oldid=prev"/>
		<updated>2026-10-16T19:48:49Z</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;
Asks the server to use an item, optionally on another item.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SendUseItem(location, slot, option, targetLocation, targetSlot)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;location : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Where the item is, as a &amp;lt;code&amp;gt;GameData.ItemLocs&amp;lt;/code&amp;gt; value.&lt;br /&gt;
;slot : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Slot of the item in &amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt;, starting at 1.&lt;br /&gt;
;option : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Extra choice sent with the request, as a single byte. The stock UI passes 0, the 0-based index of a &amp;quot;use option&amp;quot; picked in a dialog, or an ability value for targeted uses.&lt;br /&gt;
;targetLocation : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Location of the target item, or 0 for no target.&lt;br /&gt;
;targetSlot : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Slot of the target item, or 0 for no target.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* Supported locations are &amp;lt;code&amp;gt;EQUIPPED&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;INVENTORY&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;QUEST_ITEM&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;INVENTORY_OVERFLOW&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CRAFTING_ITEM&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CURRENCY_ITEM&amp;lt;/code&amp;gt;. For any other location, including &amp;lt;code&amp;gt;BANK&amp;lt;/code&amp;gt;, nothing is sent.&lt;br /&gt;
* The target is converted the same way. An unsupported or 0 target location is sent as &amp;quot;no target&amp;quot;.&lt;br /&gt;
* The client does not check that the slot holds an item, or that the item can be used. The server decides.&lt;br /&gt;
* If there is no player object, 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;
None besides 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;
Using an item from the backpack, from &amp;lt;code&amp;gt;default/ea_backpackwindow/source/backpackutils.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if not ItemUtils.ShowUseOptions(itemData, GameData.ItemLocs.INVENTORY, slot)&lt;br /&gt;
then&lt;br /&gt;
    SendUseItem( GameData.ItemLocs.INVENTORY, slot, 0, 0, 0 )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using an item on another item, from &amp;lt;code&amp;gt;default/ea_modifyitem/source/useitemtargeting.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SendUseItem(sourceLoc, sourceSlot, ability, targetLoc, targetSlot)&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:DyePreview|DyePreview]]&lt;br /&gt;
* [[API:CanUseDyeItem|CanUseDyeItem]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>