WoWInterface - View Single Post - QueryAuctionItems causes error in Blizzard_AuctionUI.lua
View Single Post
07-22-16, 04:45 PM   #6
A Wyrmkin Dreamwalker
Join Date: Oct 2014
Posts: 50
Lastly, the changes to queryAuctionItems in 7.0 are this (3 items merged into one, removed, and placed at the end)

pre 7.0
QueryAuctionItems(text, minLevel, maxLevel, invType, class, subclass, page, usable, rarity, false, exactMatch);

QueryAuctionItems(text, minLevel, maxLevel, page, usable, rarity, false, exactMatch, filterData);

So invType, class, subclass were rolled into filterData and the new value is nil for not filtering categories.

That false you see above in both code is the GetALL argument that has not changed. it is a boolean value where true means scan all auction items and return a single page mass query (able to be done every 15 minutes or when CanSendAuctionQuery() returns true,true) and false is the normal 50 items per page query results.

So from a script stand point, the arguments themselves have not changed, only been slightly moved around.

To check the returns of some of these arguments, you can do these dumps in game to find the value. Open the AH and at browse, run any of these to see the default value or the selected value corresponding to the arguments that QueryAuctionItems() can accept

/dump BrowseName:GetText()
/dump BrowseMinLevel:GetNumber()
/dump BrowseMaxLevel:GetNumber()
/dump AuctionFrameBrowse.selectedCategoryIndex
/dump AuctionFrameBrowse.selectedSubCategoryIndex
/dump AuctionFrameBrowse.selectedSubSubCategoryIndex
/dump AuctionFrameBrowse.page
/dump IsUsableCheckButton:GetChecked()
/dump UIDropDownMenu_GetSelectedValue(BrowseDropDown)
/dump ExactMatchCheckButton:GetChecked()

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;
		-- not filtering by category, leave nil for all

Here are what those variables equate to:

categoryIndex = AuctionFrameBrowse.selectedCategoryIndex
subCategoryIndex = AuctionFrameBrowse.selectedSubCategoryIndex
subSubCategoryIndex = AuctionFrameBrowse.selectedSubSubCategoryIndex