WoW:API QueryAuctionItems: Difference between revisions

m
Removed quotes from name in function arguments
m (Removed quotes from name in function arguments)
Line 2: Line 2:
{{wowapi}}
{{wowapi}}


Will return information about items in the auction house. There must be a delay of about 0.3 second between regular queries and 15 minutes between getall queries. Use [[API CanSendAuctionQuery|CanSendAuctionQuery]]() to determine if a query can be done.
Will return information about items in the auction house. There must be a delay of about 0.3 second between regular queries and 15 minutes between getall queries. Use [[API CanSendAuctionQuery|CanSendAuctionQuery]]() to determine if a query can be done.


  QueryAuctionItems("name", minLevel, maxLevel, page,
  QueryAuctionItems(name, minLevel, maxLevel, page,
   isUsable, qualityIndex, getAll, exactMatch, filterData
   isUsable, qualityIndex, getAll, exactMatch, filterData
  )
  )


== Arguments ==
== Arguments ==
:(string type, integer type, integer type, integer type, boolean type, integer type, integer type, integer type, integer type, boolean type)
:;name
:: ''string''
:: A part of the item's name (or the complete name) or "" for no retrenchment. Must be 63 bytes or less.
:;minLevel
:: ''integer (or nil)''
:: Items below this level won't be returned. Either a number or nil for no restrictions.
:;maxLevel
:: ''integer (or nil)''
:: Items above this level won't be returned. Either a number or nil for no restrictions.
:;page
:: ''integer''
:: What page in the auctionhouse this shows up. Note that pages start at 0.
:;isUsable
:: ''boolean (or nil for false)''
:: Is useable by the player.
:;qualityIndex
:: ''integer''
:: Can be one of the following values:
:::0 - No restriction
:::1 - Common Quality (white) or better
:::2 - Uncommon Quality (green) or better
:::3 - Rare Quality (blue) or better
:::4 - Epic Quality (purple) or better


:;name : A part of the item's name (or the complete name) or "" for no retrenchment.  Must be 63 bytes or less.
:;getAll
:;minLevel : Items below this level won't be returned. Either a number or nil for no restrictions.
:: ''boolean''
:;maxLevel : Items above this level won't be returned. Either a number or nil for no restrictions.
:: Download the ENTIRE auction house as one single page. Only allowed when [[API CanSendAuctionQuery|CanSendAuctionQuery]]() returns true as its second return (~every 15 minutes). May disconnect people with low bandwidth. Also see notes on client-to-server traffic in [[API GetAuctionItemInfo|GetAuctionItemInfo]]() (Added in 2.3, though initially disabled. Appears to be enabled as of 2.4)
:;page : What page in the auctionhouse this shows up. Note that pages start at 0.
:;exactMatch
:;isUsable : Is useable by the player (1 = true, 0 = no restrictions)
:: ''boolean''
:;qualityIndex : Can be one of the following values
:: Should the name be used as an exact match or should it match substrings of the auction items.
:::;0 - No restriction
:;filterData
:::;1 - Common Quality (white) or better
:: ''table''
:::;2 - Uncommon Quality (green) or better
:: The old invtypeIndex, classIndex, and subclassIndex roled into one.
:::;3 - Rare Quality (blue) or better
:::;4 - Epic Quality (purple) or better
 
:;getAll : Download the ENTIRE auction house as one single page. Only allowed when [[API CanSendAuctionQuery|CanSendAuctionQuery]]() returns true as its second return (~every 15 minutes). May disconnect people with low bandwidth. Also see notes on client-to-server traffic in [[API GetAuctionItemInfo|GetAuctionItemInfo]]() (Added in 2.3, though initially disabled. Appears to be enabled as of 2.4)




:;exactMatch
: This is the code that builds the filter value(s) for filterData:
: Should the name be used as an exact match or should it match substrings of the auction items.
:;filterData : The old invtypeIndex, classIndex, and subclassIndex roled into one.: This is the code that builds the filter value(s) for filterData:
:  
  local filterData;
  local filterData;
  if categoryIndex and subCategoryIndex and subSubCategoryIndex then
  if categoryIndex and subCategoryIndex and subSubCategoryIndex then
Line 40: Line 55:
  -- not filtering by category, leave nil for all
  -- not filtering by category, leave nil for all
         end
         end
: The following commands will return the currently selected category and subcategory:
/dump AuctionFrameBrowse.selectedCategoryIndex
/dump AuctionFrameBrowse.selectedSubcategoryIndex


== Examples ==
== Examples ==
QueryAuctionItems("", 10, 19, 0, nil, 0, false, nil)
<u>''Note: AH window has to be open before you click the macro.''</u>


=== Script ===
: Finds twink gear, blue armor between lvl 10 and 19:
QueryAuctionItems("", 10, 19, 0, false, 3, false, false, nil)


:Finds twink gear! (blue armor between lvl 10 and 19)
: Finds battle pets that you haven't learned:
:
QueryAuctionItems("", nil, nil, 0, false, 0, false, false, AuctionCategories[10].filters)
:also, the First page is page (0) zero


/script QueryAuctionItems("Nobles", 0, 0, 0, nil, 3, false, nil)
: Finds anything on the AH with the word 'Nobles' in it. Useful for hunting down that elusive last and final Darkmoon Card. :)
 
/script QueryAuctionItems("Nobles", 0, 0, 0, false, 3, false, false, nil)
=== Result ===
:Finds anything on the AH with the word 'Nobles' in it. Useful for hunting down that elusive last and final Darkmoon Card. :)
:Hint: AH window has to be open before you click the macro.


== Notes ==
== Notes ==
;If name is longer than 63 bytes, you'll be disconnected from the server.
If name is longer than 63 bytes, you'll be disconnected from the server.;;If any of the entered arguments is of the wrong type, the search assumes a nil value.
:;If any of the entered arguments is of the wrong type, the search assumes a nil value.


== Pre-Patch 7.0.3 ==
== Pre-Patch 7.0.3 ==


Will return information about items in the auction house. There must be a delay of about 0.3 second between regular queries and 15 minutes between getall queries. Use [[API CanSendAuctionQuery|CanSendAuctionQuery]]() to determine if a query can be done.
Will return information about items in the auction house. There must be a delay of about 0.3 second between regular queries and 15 minutes between getall queries. Use [[API CanSendAuctionQuery|CanSendAuctionQuery]]() to determine if a query can be done.


  QueryAuctionItems("name", minLevel, maxLevel,  
  QueryAuctionItems("name", minLevel, maxLevel,  
Line 72: Line 88:
:(string type, integer type, integer type, integer type, integer type, integer type, integer type, integer type, integer type, boolean type)
:(string type, integer type, integer type, integer type, integer type, integer type, integer type, integer type, integer type, boolean type)


:;name : A part of the item's name (or the complete name) or "" for no retrenchment. Must be 63 bytes or less.
:;name
:;minLevel : Items below this level won't be returned. Either a number or nil for no restrictions.
:: A part of the item's name (or the complete name) or "" for no retrenchment. Must be 63 bytes or less.
:;maxLevel : Items above this level won't be returned. Either a number or nil for no restrictions.
:;minLevel
:;invtypeIndex : Character's slotposition in which the item can be placed in. Can be one of the following values
:: Items below this level won't be returned. Either a number or nil for no restrictions.
:::;1 - Head slot (INVTYPE_HEAD)
:;maxLevel
:: Items above this level won't be returned. Either a number or nil for no restrictions.
:;invtypeIndex
:: Character's slotposition in which the item can be placed in. Can be one of the following values
:::;1 - Head slot (INVTYPE_HEAD)
:::;2 - Neck slot (INVTYPE_NECK)
:::;2 - Neck slot (INVTYPE_NECK)
:::;3 - Shoulder slot (INVTYPE_SHOULDER)
:::;3 - Shoulder slot (INVTYPE_SHOULDER)
Line 99: Line 119:
:::;22 - Both weapon slots (INVTYPE_WEAPON)
:::;22 - Both weapon slots (INVTYPE_WEAPON)
:::;0 - no restrictions
:::;0 - no restrictions
:;classIndex : Returns only item in this class. Integer corresponds to the row number of the table returned by [[API GetAuctionItemClasses|GetAuctionItemClasses]]() or 0 for no restrictions.
 
:;subclassIndex : Returns only items in this subclass. Integer corresponds to the row number of the table returned by [[API GetAuctionItemSubClasses|GetAuctionItemSubClasses]](index) or 0 for no restrictions.
:;classIndex
:;page : What page in the auctionhouse this shows up. Note that pages start at 0.
:: Returns only item in this class. Integer corresponds to the row number of the table returned by [[API GetAuctionItemClasses|GetAuctionItemClasses]]() or 0 for no restrictions.
:;isUsable : Is useable by the player (1 = true, 0 = no restrictions)
:;subclassIndex
:;qualityIndex : Can be one of the following values
:: Returns only items in this subclass. Integer corresponds to the row number of the table returned by [[API GetAuctionItemSubClasses|GetAuctionItemSubClasses]](index) or 0 for no restrictions.
:;page
:: What page in the auctionhouse this shows up. Note that pages start at 0.
:;isUsable
:: Is useable by the player (1 = true, 0 = no restrictions)
:;qualityIndex
:: Can be one of the following values
:::;0 - No restriction
:::;0 - No restriction
:::;1 - Common Quality (white) or better
:::;1 - Common Quality (white) or better
Line 110: Line 136:
:::;4 - Epic Quality (purple) or better
:::;4 - Epic Quality (purple) or better


:;getAll : Download the ENTIRE auction house as one single page. Only allowed when [[API CanSendAuctionQuery|CanSendAuctionQuery]]() returns true as its second return (~every 15 minutes). May disconnect people with low bandwidth. Also see notes on client-to-server traffic in [[API GetAuctionItemInfo|GetAuctionItemInfo]]() (Added in 2.3, though initially disabled. Appears to be enabled as of 2.4)
:;getAll
:: Download the ENTIRE auction house as one single page. Only allowed when [[API CanSendAuctionQuery|CanSendAuctionQuery]]() returns true as its second return (~every 15 minutes). May disconnect people with low bandwidth. Also see notes on client-to-server traffic in [[API GetAuctionItemInfo|GetAuctionItemInfo]]() (Added in 2.3, though initially disabled. Appears to be enabled as of 2.4)


;Examples
;Examples
Line 127: Line 154:
:Hint: AH window has to be open before you click the macro.
:Hint: AH window has to be open before you click the macro.


;Notes
;Notes;;If name is longer than 63 bytes, you'll be disconnected from the server.
:;If name is longer than 63 bytes, you'll be disconnected from the server.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:invTypeIndex does not appear to work for values past 14. If any of the entered arguments is of the wrong type, the search assumes a nil value.
:;invTypeIndex does not appear to work for values past 14.
:;If any of the entered arguments is of the wrong type, the search assumes a nil value.
Anonymous user