<?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%3ACreateAuction</id>
	<title>API:CreateAuction - 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%3ACreateAuction"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:CreateAuction&amp;action=history"/>
	<updated>2026-10-17T15:21:59Z</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:CreateAuction&amp;diff=30264&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:CreateAuction&amp;diff=30264&amp;oldid=prev"/>
		<updated>2026-10-16T19:41:48Z</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=Auction}}&lt;br /&gt;
Asks the server to put an item from one of the player&amp;#039;s backpacks up for auction.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CreateAuction(slot, backpackType, price, restriction)&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; – Slot of the item inside the backpack, starting at 1.&lt;br /&gt;
;backpackType : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Which backpack the item is in, 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;
;price : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Buy-out price in brass.&lt;br /&gt;
;restriction : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Who may buy the item. The stock UI passes the index selected in its restriction combo box.&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;backpackType&amp;lt;/code&amp;gt; must be 2, 3 or 4. Any other value (including 1, the quest backpack) raises the error below and nothing is sent.&lt;br /&gt;
* The client converts &amp;lt;code&amp;gt;slot&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;backpackType&amp;lt;/code&amp;gt; into an absolute inventory slot before sending. &amp;lt;code&amp;gt;slot&amp;lt;/code&amp;gt; is truncated to its low byte (0–255) first.&lt;br /&gt;
* The client does not check the price, the deposit or that the slot holds an item. The stock UI does its own checks (enough money for the deposit, a price of at least 1) before calling.&lt;br /&gt;
* The function needs at least four arguments and only reads the last four.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;CreateAuction&amp;#039;: Invalid backpack type.&amp;lt;/code&amp;gt;&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;
From &amp;lt;code&amp;gt;default/ea_auctionhousewindow/source/auctionwindowsellcontrols.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local restrictionChoice = ComboBoxGetSelectedMenuItem( SELL_CONTROLS_NAME..&amp;quot;RestrictionComboBox&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
CreateAuction( AuctionWindowSellControls.itemInventorySlot.slot, AuctionWindowSellControls.itemInventorySlot.backpack, buyOutPrice, restrictionChoice )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:BuyAuction|BuyAuction]]&lt;br /&gt;
* [[API:CancelAuction|CancelAuction]]&lt;br /&gt;
* [[API:SendAuctionSearch|SendAuctionSearch]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>