Auction House Functions
Overview
The core.auction_house module provides functions for interacting with the World of Warcraft auction house. This includes scanning and replicating auction data, searching for items, managing owned auctions, posting new listings, purchasing items, and querying auction state.
Scanning / Replication Functions
core.auction_house.replicate_items
Syntax
core.auction_house.replicate_items() -> nil
Initiates a full replication of all auction house items. This is a server-side scan that populates the replicate item cache. Use get_num_replicate_items to check how many items were returned.
core.auction_house.get_num_replicate_items
Syntax
core.auction_house.get_num_replicate_items() -> integer
integer: The number of items available from the last replication scan.
Returns the number of items returned by the most recent replicate_items call.
core.auction_house.get_replicate_item_info
Syntax
core.auction_house.get_replicate_item_info(index: integer) -> table
Parameters
index:integer- The index of the replicated item.
table: A table containing item details from the replication scan.
Returns information about a specific item from the replication cache at the given index.
core.auction_house.get_replicate_item_link
Syntax
core.auction_house.get_replicate_item_link(index: integer) -> string
Parameters
index:integer- The index of the replicated item.
string: The item link for the replicated item.
Returns the item link string for a specific item from the replication cache.
core.auction_house.get_replicate_item_time_left
Syntax
core.auction_house.get_replicate_item_time_left(index: integer) -> integer
Parameters
index:integer- The index of the replicated item.
integer: The time-left category for the auction.
Returns the time remaining category for a replicated auction item.
core.auction_house.batch_get_replicate_items
Syntax
core.auction_house.batch_get_replicate_items() -> table
table: An array of replicated item data.
Returns all replicated items in a single batch call. This is more efficient than iterating with get_replicate_item_info for large result sets.
Example Usage
core.auction_house.replicate_items()
local items = core.auction_house.batch_get_replicate_items()
core.log("Total auctions scanned: " .. #items)
Search Functions
core.auction_house.send_search_query
Syntax
core.auction_house.send_search_query() -> nil
Sends a search query to the auction house based on the currently configured search parameters.
core.auction_house.send_sell_search_query
Syntax
core.auction_house.send_sell_search_query() -> nil
Sends a search query for the sell tab, used to check current prices before posting an item.
core.auction_house.get_num_commodity_search_results
Syntax
core.auction_house.get_num_commodity_search_results() -> integer
integer: The number of commodity search results.
Returns the number of results from the most recent commodity search.
core.auction_house.get_commodity_search_result_info
Syntax
core.auction_house.get_commodity_search_result_info(index: integer) -> table
Parameters
index:integer- The result index.
table: A table containing commodity search result details.
Returns information about a specific commodity search result, including unit price, quantity, and seller details.
core.auction_house.has_full_commodity_search_results
Syntax
core.auction_house.has_full_commodity_search_results() -> boolean
boolean:trueif all commodity search results have been received.
Checks whether the full set of commodity search results has been received from the server.
core.auction_house.get_num_item_search_results
Syntax
core.auction_house.get_num_item_search_results() -> integer
integer: The number of item search results.
Returns the number of results from the most recent item (non-commodity) search.
core.auction_house.get_item_search_result_info
Syntax
core.auction_house.get_item_search_result_info(index: integer) -> table
Parameters
index:integer- The result index.
table: A table containing item search result details.
Returns information about a specific item search result, including buyout price, bid amount, and time remaining.
core.auction_house.has_full_item_search_results
Syntax
core.auction_house.has_full_item_search_results() -> boolean
boolean:trueif all item search results have been received.
Checks whether the full set of item search results has been received from the server.
Owned Auction Functions
core.auction_house.query_owned_auctions
Syntax
core.auction_house.query_owned_auctions() -> nil
Queries the server for a list of all auctions owned by the player.
core.auction_house.get_num_owned_auctions
Syntax
core.auction_house.get_num_owned_auctions() -> integer
integer: The number of owned auctions.
Returns the number of auctions currently owned by the player.
core.auction_house.get_owned_auction_info
Syntax
core.auction_house.get_owned_auction_info(index: integer) -> table
Parameters
index:integer- The index of the owned auction.
table: A table containing owned auction details.
Returns information about a specific owned auction, including item details, current bid, buyout, and time remaining.
Example Usage
core.auction_house.query_owned_auctions()
local num = core.auction_house.get_num_owned_auctions()
for i = 1, num do
local info = core.auction_house.get_owned_auction_info(i)
core.log(string.format("Auction %d: %s", i, tostring(info)))
end
Posting Functions
core.auction_house.post_commodity
Syntax
core.auction_house.post_commodity(bag: integer, slot: integer, duration: integer, quantity: integer, unit_price: integer) -> nil
Parameters
bag:integer- The bag index containing the item.slot:integer- The slot index within the bag.duration:integer- The auction duration (1 = 12h, 2 = 24h, 3 = 48h).quantity:integer- The number of items to post.unit_price:integer- The price per unit in copper.
Posts a commodity (stackable) item to the auction house at the specified unit price.
core.auction_house.post_item
Syntax
core.auction_house.post_item(bag: integer, slot: integer, duration: integer, quantity: integer, bid: integer, buyout: integer) -> nil
Parameters
bag:integer- The bag index containing the item.slot:integer- The slot index within the bag.duration:integer- The auction duration (1 = 12h, 2 = 24h, 3 = 48h).quantity:integer- The number of items to post (usually 1 for non-commodities).bid:integer- The starting bid in copper.buyout:integer- The buyout price in copper.
Posts a non-commodity (equipment, unique) item to the auction house with a bid and buyout price.
core.auction_house.pickup_container_item
Syntax
core.auction_house.pickup_container_item(bag: integer, slot: integer) -> nil
Parameters
bag:integer- The bag index.slot:integer- The slot index.
Picks up an item from a container slot, placing it on the cursor for auction house operations.
core.auction_house.click_auction_sell_button
Syntax
core.auction_house.click_auction_sell_button() -> nil
Clicks the sell button in the auction house sell frame, placing the cursor item into the sell slot.
core.auction_house.do_post_auction
Syntax
core.auction_house.do_post_auction() -> nil
Confirms and posts the auction that has been set up in the sell frame.
core.auction_house.get_auction_sell_item_info
Syntax
core.auction_house.get_auction_sell_item_info() -> table
table: A table containing information about the item currently in the sell slot.
Returns details about the item currently placed in the auction house sell slot.
core.auction_house.get_cursor_item_name
Syntax
core.auction_house.get_cursor_item_name() -> string
string: The name of the item currently on the cursor.
Returns the name of the item currently held on the cursor, useful for verifying the correct item before posting.