Updated the function to new arguement structure of 7.0.3.
(Updated with new information) |
(Updated the function to new arguement structure of 7.0.3.) |
||
| Line 3: | Line 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, page, | ||
isUsable, qualityIndex, getAll, exactMatch, filterData | |||
) | ) | ||
== Arguments == | == Arguments == | ||
:(string type, integer type, integer type, integer type, | :(string type, integer type, integer type, integer type, boolean 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. | |||
:;minLevel : Items below this level won't be returned. Either a number or nil for no restrictions. | :;minLevel : Items below this level won't be returned. Either a number or nil for no restrictions. | ||
:;maxLevel : Items above this level won't be returned. Either a number or nil for no restrictions. | :;maxLevel : Items above this level won't be returned. Either a number or nil for no restrictions. | ||
:;page : What page in the auctionhouse this shows up. Note that pages start at 0. | :;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) | :;isUsable : Is useable by the player (1 = true, 0 = no restrictions) | ||
| Line 52: | Line 25: | ||
:;exactMatch | |||
: 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; | |||
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 | |||
== Examples == | == Examples == | ||
QueryAuctionItems("", 10, 19, 0, | QueryAuctionItems("", 10, 19, 0, nil, false, false, nil) | ||
=== Result === | === Result === | ||
| Line 61: | Line 48: | ||
:also, the First page is page (0) zero | :also, the First page is page (0) zero | ||
/script QueryAuctionItems("Nobles", 0, 0, 0, | /script QueryAuctionItems("Nobles", 0, 0, 0, nil, false, false, nil) | ||
=== Result === | === Result === | ||
| Line 68: | Line 55: | ||
== Notes == | == 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. | :;If any of the entered arguments is of the wrong type, the search assumes a nil value. | ||