Auctionator

Auctionator

141M Downloads

Buy button throwing error

ceylina opened this issue ยท 1 comments

commented

Auctionator\AuctionatorBuy.lua:158: bad argument #2 to 'QueryAuctionItems' (number expected, got string) [C]: in functionQueryAuctionItems'
Auctionator\AuctionatorBuy.lua:158: in function Atr_Buy_SendQuery' Auctionator\AuctionatorBuy.lua:183: in functionAtr_Buy_Idle'
Auctionator\Auctionator-4.0.0.lua:2933: in function Atr_Idle' Auctionator\Auctionator-4.0.0.lua:2878: in functionAtr_OnUpdate'
[string ":OnUpdate"]:1: in function <[string ":OnUpdate"]:1>

Locals:
(_temporary) = "Shal'dorei Silk"
(_temporary) = ""
(_temporary) = ""
(_temporary) = nil
(_temporary) = 0
(_temporary) = 0
(_temporary) = 0
(_temporary) = nil
(_temporary) = nil
(_temporary) = false
(_temporary) = true
(_temporary) = "number expected, got string"
`

commented

This is line 158

QueryAuctionItems( queryString, "", "", nil, 0, 0, gAtr_Buy_CurPage, nil, nil, false, true )

This is the old

QueryAuctionItems("name", minLevel, maxLevel, invTypeIndex, classIndex, subclassIndex, page, isUsable, qualityIndex, getAll)

This is how it is come legion

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

Looks like the second and third return (min/max level) there should be nil, not "" (nil passes no restrictions)

Also here are the parameters from wowwiki

http://wowwiki.wikia.com/wiki/API_QueryAuctionItems

I think something like this should pass properly

QueryAuctionItems( queryString, nil, nil, gAtr_Buy_CurPage, 0, 0, false, false, nil )

Not sure about the last two returns (exactMatch, filterData) but I am pretty sure the last filterdata should be nil as there is a comment in the function that states "leave nil for all"


    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

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