WoW:API QueryAuctionItems: Difference between revisions

m
Move page script moved page API QueryAuctionItems to WoW:API QueryAuctionItems without leaving a redirect
(Note that getAll param doesn't actually do anything yet.)
m (Move page script moved page API QueryAuctionItems to WoW:API QueryAuctionItems without leaving a redirect)
 
(8 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Source needed}}
{{wowapi}}
{{wowapi}}


Will return information about items in the auction house. There must be a delay of about 3 second between 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, page,
  isUsable, qualityIndex, getAll, exactMatch, filterData
)
 
== Arguments ==
:;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
 
:;getAll
:: ''boolean''
:: 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
:: ''boolean''
:: Should the name be used as an exact match or should it match substrings of the auction items.
:;filterData
:: ''table''
:: The old invtypeIndex, classIndex, and subclassIndex roled into one.
 
 
: This is the code that builds the filter value(s) for filterData:
local filterData;
if categoryIndex and subCategoryIndex and subSubCategoryIndex then
filterData = AuctionCategories[categoryIndex].subCategories[subCategoryIndex].subCategories[subSubCategoryIndex].filters;
elseif categoryIndex and subCategoryIndex then
filterData = AuctionCategories[categoryIndex].subCategories[subCategoryIndex].filters;
elseif categoryIndex then
filterData = AuctionCategories[categoryIndex].filters;
else
-- not filtering by category, leave nil for all
        end
 
 
: The following commands will return the currently selected category and subcategory:
/dump AuctionFrameBrowse.selectedCategoryIndex
/dump AuctionFrameBrowse.selectedSubcategoryIndex
 
== Examples ==
<u>''Note: AH window has to be open before you click the macro.''</u>
 
: Finds twink gear, blue armor between lvl 10 and 19:
QueryAuctionItems("", 10, 19, 0, false, 3, false, false, nil)
 
: Finds battle pets that you haven't learned:
QueryAuctionItems("", nil, nil, 0, false, 0, false, false, AuctionCategories[10].filters)
 
: 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)
 
== Notes ==
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.
 
== 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.
 
QueryAuctionItems("name", minLevel, maxLevel,  
   invTypeIndex, classIndex, subclassIndex,  
   invTypeIndex, classIndex, subclassIndex,  
   page, isUsable, qualityIndex, getAll
   page, isUsable, qualityIndex, getAll
  )
  )


== Arguments ==
;Arguments
:(string type, string type, string type, index value, )
:(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.
:;name
:;minLevel : Items below this level won't be returned. Either a number or "" 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 "" 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.
:::;INVTYPE_HEAD : Head slot
:;maxLevel
:::;INVTYPE_NECK : Neck slot
:: Items above this level won't be returned. Either a number or nil for no restrictions.
:::;INVTYPE_SHOULDER : Shoulder slot
:;invtypeIndex
:::;INVTYPE_BODY : Body slot
:: Character's slotposition in which the item can be placed in. Can be one of the following values
:::;INVTYPE_CHEST : Chest slot
:::;1 - Head slot (INVTYPE_HEAD)
:::;INVTYPE_WAIST : Waist slot
:::;2 - Neck slot (INVTYPE_NECK)
:::;INVTYPE_LEGS : Leg slot
:::;3 - Shoulder slot (INVTYPE_SHOULDER)
:::;INVTYPE_FEET : Feet slot
:::;4 - Shirt slot (INVTYPE_BODY)
:::;INVTYPE_WRIST : Wrist slot
:::;5 - Chest slot (INVTYPE_CHEST)
:::;INVTYPE_HAND : Hand slot
:::;6 - Waist slot (INVTYPE_WAIST)
:::;INVTYPE_FINGER : Finger slot
:::;7 - Leg slot (INVTYPE_LEGS)
:::;INVTYPE_TRINKET : Trinket slot
:::;8 - Feet slot (INVTYPE_FEET)
:::;INVTYPE_CLOAK : Cloak slot
:::;9 - Wrist slot (INVTYPE_WRIST)
:::;INVTYPE_HOLDABLE : unknown
:::;10 - Hand slot (INVTYPE_HAND)
:::;INVTYPE_WEAPONMAINHAND : Weapon mainhand slot
:::;11 - Finger slot (INVTYPE_FINGER)
:::;INVTYPE_ROBE : Robe slot
:::;12 - Trinket slot (INVTYPE_TRINKET)
:::;INVTYPE_TABARD : Tabard slot
:::;13 - Back slot (INVTYPE_CLOAK)
:::;INVTYPE_BAG : Container slot
:::;14 - Weapon offhand slot (INVTYPE_HOLDABLE)
:::;INVTYPE_2HWEAPON : 2handed weapon (takes two slots)
:::;15 - Weapon mainhand slot (INVTYPE_WEAPONMAINHAND)
:::;INVTYPE_RANGED : Ranged weapon slot
:::;16 - Robe slot (INVTYPE_ROBE)
:::;INVTYPE_SHIELD : Shield slot
:::;17 - Tabard slot (INVTYPE_TABARD)
:::;INVTYPE_WEAPON : Both weapon slots
:::;18 - Container slot (INVTYPE_BAG)
:::;nil : no restrictions
:::;19 - 2handed weapon (takes two slots) (INVTYPE_2HWEAPON)
:;classIndex : Items not in this class won't be returned. Index corresponds to the index returned by [[API GetAuctionItemClasses|GetAuctionItemClasses]]() or nil for no restrictions.
:::;20 - Ranged weapon slot (INVTYPE_RANGED)
:;subclassIndex : Items not in this subclass won't be returned. Index corresponds to the index used in [[API GetAuctionItemSubClasses|GetAuctionItemSubClasses]](index) or nil for no restrictions.
:::;21 - Shield slot (INVTYPE_SHIELD)
:;page : What page in the auctionhouse this shows up
:::;22 - Both weapon slots (INVTYPE_WEAPON)
:;isUsable : Is useable by the player (nil = no restrictions)
:::;0 - no restrictions
:;qualityIndex : The items' quality (nil = no restrictions)
:;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) While this has been 'added', it is marked as [http://forums.worldofwarcraft.com/thread.html?topicId=879058320&sid=1 **DISABLED UNTIL A FUTURE PATCH** ] and does appear to do nothing.


:;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.
:;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
:::;1 - Common Quality (white) or better
:::;2 - Uncommon Quality (green) or better
:::;3 - Rare Quality (blue) or better
:::;4 - Epic Quality (purple) or better


== Example ==
:;getAll
QueryAuctionItems("",10, 19, "", 2, nil, 0, nil, 3)
:: 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)


=== Result ===
;Examples
QueryAuctionItems("", 10, 19, 0, 2, 0, 0, 0, 3, 0)
 
;Script


:Finds twink gear! (blue armor between lvl 10 and 19)
:Finds twink gear! (blue armor between lvl 10 and 19)
:still unsure how to use the forth argument
:
:also, the First page is page (0) zero
:also, the First page is page (0) zero


== Notes ==
/script QueryAuctionItems("Nobles", 0, 0, 0, 0, 0, 0, 0, 0, 0)
 
;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;;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.
Anonymous user