Go to Page... |
Thread Tools | Display Modes |
05-06-20, 10:18 PM | #1 |
My LUA code dont work in new API 8.3.0 [ auction ] ]
Hello.
My LUA code work in old API. Code:
local frame = CreateFrame("Frame"); frame:RegisterEvent("AUCTION_HOUSE_SHOW"); frame:RegisterEvent("AUCTION_ITEM_LIST_UPDATE"); frame:Hide(); frame:SetScript("OnEvent", function(self, event, ...) if (event == "AUCTION_HOUSE_SHOW") then local val auk = { "GUMM-E", "Sunreaver Micro-Sentry" } for key, val in pairs(auk) do QueryAuctionItems(val, minLevel, maxLevel, invTypeIndex, classIndex, subclassIndex, page, isUsable, qualityIndex); print(val); end; end; if (event == "AUCTION_ITEM_LIST_UPDATE") then local name, texture, count, quality, canUse, level, levelColHeader, minBid, minIncrement, buyoutPrice, bidAmount, highBidder, highBidderFullName, owner, ownerFullName, saleStatus, itemId, hasAllInfo = GetAuctionItemInfo("list", 1); print(name, buyoutPrice) end end) Dont know, how work "C_AuctionHouse.GetReplicateItemInfo". Thanks all. |
|
05-07-20, 07:54 AM | #2 |
I don't see AUCTION_ITEM_LIST_UPDATE on the 8.3 auction house event list.
Here are the APIs too, if you are interested. |
|
05-07-20, 09:33 AM | #3 |
Ok. Why this code dont work?
Code:
local frame = CreateFrame("Frame"); frame:RegisterEvent("AUCTION_HOUSE_SHOW"); frame:Hide(); frame:SetScript("OnEvent", function(self, event, ...) if (event == "AUCTION_HOUSE_SHOW") then local name, texture, count, quality, canUse, level, levelColHeader, minBid, minIncrement, buyoutPrice, bidAmount, highBidder, highBidderFullName, owner, ownerFullName, saleStatus, itemId, hasAllInfo = C_AuctionHouse.ReplicateItems("Anchor Weed", nil, nil, 0, 0 , 0, 0, 0, 0, false, false); print(name) end end) |
|
05-07-20, 09:48 AM | #4 | |
Lua Code:
To go with the link already provided .. Auction House specific events https://wow.gamepedia.com/Events#C_AuctionHouse Auction House specific functions https://wow.gamepedia.com/World_of_W...#Auction_House Some haven't been fully tracked down/identified yet so you may have to trial and error things to find out how they all work and when to use them.
__________________
Characters: Gwynedda - 70 - Demon Warlock Galaviel - 70 - Resto Druid Gamaliel - 70 - Disc Priest Lienae - 70 - Resto Shaman Velandryn - 70 - Prot Paladin (TR) + 5 at 60+ + 2 at 40+ Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818 Last edited by Xrystal : 05-07-20 at 10:21 AM. |
||
05-09-20, 07:34 AM | #5 |
Thank you i will try
|
|
05-10-20, 04:51 PM | #6 |
please talk to me how work tis code?
local auctions = {}
local function OnEvent(self, event) if event == "AUCTION_HOUSE_SHOW" then C_AuctionHouse.ReplicateItems() elseif event == "REPLICATE_ITEM_LIST_UPDATE" then wipe(auctions) for i = 1, C_AuctionHouse.GetNumReplicateItems() do auctions[i] = {C_AuctionHouse.GetReplicateItemInfo(i)} end print(format("Queried %d items", #auctions)) end end local f = CreateFrame("Frame") f:RegisterEvent("AUCTION_HOUSE_SHOW") f:RegisterEvent("REPLICATE_ITEM_LIST_UPDATE") f:SetScript("OnEvent", OnEvent) |
|
05-10-20, 05:39 PM | #7 | |
Also, have you looked at the code for the auction addons that are likely doing similar access requests ? Ah .. I see .. Replicate_Item_List_Update hangs the game and causes you to crash out .. Trying another angle.
__________________
Characters: Gwynedda - 70 - Demon Warlock Galaviel - 70 - Resto Druid Gamaliel - 70 - Disc Priest Lienae - 70 - Resto Shaman Velandryn - 70 - Prot Paladin (TR) + 5 at 60+ + 2 at 40+ Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818 Last edited by Xrystal : 05-10-20 at 06:00 PM. |
||
05-10-20, 07:18 PM | #8 |
Not sure if it is a bug or not, or we are using it wrong but "REPLICATE_ITEM_LIST_UPDATE" event triggers no sooner than every 15 minutes when the request is sent .. but ... the moment it triggers it hangs the game, even though I am testing for 0 results and not going any further.
So .. instead I registered for every AuctionHouse event to see what did what .. "AUCTION_HOUSE_BROWSE_RESULTS_UPDATED" appears to trigger when you click the search button. It will return 500 items off the bat This is an example of one of the table entries that you can retrieve after that event using C_AuctionHouse.GetBrowseResults() which returns a table. Lua Code:
When you select an item in the list the event "AUCTION_HOUSE_NEW_RESULTS_RECEIVED" is triggered along with the relevant itemKey info. An example of which is as follows: Lua Code:
AUCTION_HOUSE_NEW_RESULTS_RECEIVED also triggers when you click search but the argument is nil so testing for a nil value before trying to process it will stop those errors. The only other thing you might want to look into is the following: https://wow.gamepedia.com/API_C_Auct...endBrowseQuery However, I haven't played with this as it involved building a search query to send, similar to selecting an item type then clicking search. Here is my addon file that I used to get the above results. Lua Code:
__________________
Characters: Gwynedda - 70 - Demon Warlock Galaviel - 70 - Resto Druid Gamaliel - 70 - Disc Priest Lienae - 70 - Resto Shaman Velandryn - 70 - Prot Paladin (TR) + 5 at 60+ + 2 at 40+ Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818 |
|
05-10-20, 10:20 PM | #9 | |
I only tested it on the PTR which had around 40 different items on the whole auction house, I knew it would spam but didn't really expect the game to crash; will have to resub and update the snippet to somehow throttle itself as well Last edited by Ketho : 05-10-20 at 10:32 PM. |
||
05-11-20, 12:06 AM | #10 |
But how print in chat minPrice and name seller? Need an example "Sealed Tome of the Lost Legion". Thanks
|
|
05-11-20, 06:37 AM | #11 | |
I just noticed that "ITEM_SEARCH_RESULTS_UPDATED" event has the following event parameters local itemKey, auctionID = ...; But I haven't figured out which of the different functions/events will utilise that auctionID to get access to the individual owner of that auction. However, result = C_AuctionHouse.GetItemSearchResultInfo(itemKey, itemSearchResultIndex) returns multiple details for that particular item, including a list of owners selling that particular item. Remember, the change made to the auction house is that rather than seeing an individual auction item you are seeing an item being auctioned by many people and you are just buying x amount of them without knowing who you are buying from. https://wow.gamepedia.com/API_C_Auct...archResultInfo The above think will work after a call to this function ( 100 per minute allowed ) C_AuctionHouse.SendSearchQuery(itemKey, sorts, separateOwnerItems) https://wow.gamepedia.com/API_C_Auct...endSearchQuery This call then has the events "COMMODITY_SEARCH_RESULTS_UPDATED" "ITEM_SEARCH_RESULTS_UPDATED" that will trigger when the results are ready and you can use the above GetItemSearchResult functions to get the Item details and there are functions that work similarly for commodities. There may be more fancier ways of getting at the data though if the Blizzard Auction House code is to go by. https://www.townlong-yak.com/framexm...eFrame.lua#628 This link details the changes made to the AuctionHouse as a whole. It might be that your addon will have to change to work within the new system. https://www.wowhead.com/news=295491/...sions-of-nzoth
__________________
Characters: Gwynedda - 70 - Demon Warlock Galaviel - 70 - Resto Druid Gamaliel - 70 - Disc Priest Lienae - 70 - Resto Shaman Velandryn - 70 - Prot Paladin (TR) + 5 at 60+ + 2 at 40+ Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818 Last edited by Xrystal : 05-11-20 at 07:58 AM. |
||
05-11-20, 11:50 AM | #12 |
Okay .. after playing with my little project addon for a little while I came up with the following results.
Events: AUCTION_HOUSE_BROWSE_RESULTS_UPDATED - Triggered when you click Search AUCTION_HOUSE_NEW_RESULTS_RECEIVED - Triggered when you click on a specific item on the list Functions: local results = C_AuctionHouse.GetBrowseResults() Used after AUCTION_HOUSE_BROWSE_RESULTS_UPDATED returns a table with the following as example entries Lua Code:
local itemKeyInfo = C_AuctionHouse.GetItemKeyInfo(itemKey) Used after AUCTION_HOUSE_NEW_RESULTS_RECEIVED returns the following table The following are two tables, one commodity, one item Lua Code:
You can then use the following function to find out what auctions there are relating to that item Lua Code:
This then results in either an ITEM_SEARCH_RESULTS_UPDATED event call or COMMODITY_SEARCH_RESULTS_UPDATED event call. For Items .. Lua Code:
Resulting in the following table contents Lua Code:
For Commodities .. Lua Code:
Which results in the following table of data Lua Code:
It is then the case of accessing the table contents as per normal for display purposes. This of course still relies on you making that initial search and clicking the button and isn't automated at all. I suspect there is a way of doing this periodically using other functions. But whichever way you use auction house api ( if there is more than one way ) you will ultimately end up with repeating event calls for commodity and item updates after you have requested an auction search query. I then added the following to automate searching for a specific set of items and then one of the items in the list generated.. it didn't work quite right but will give an idea of what is possible but it does mean you don't have to click and select to get information out. You just have to have opened the auction house window to start it off. Lua Code:
So my final version of my addon file is as follows: Lua Code:
Hopefully this will help lead you to identifying what you need to do to make your addon work as close to its original design as possible. Printing out the results are as simple as accessing the relevant part of the table returned.
__________________
Characters: Gwynedda - 70 - Demon Warlock Galaviel - 70 - Resto Druid Gamaliel - 70 - Disc Priest Lienae - 70 - Resto Shaman Velandryn - 70 - Prot Paladin (TR) + 5 at 60+ + 2 at 40+ Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818 |
|
05-15-20, 06:29 AM | #13 |
Thanks, I will work with your code.
|
|
05-21-20, 07:21 AM | #14 | |
I updated the wiki with an approach that caches items with ItemMixin:ContinueOnItemLoad() https://wow.gamepedia.com/API_C_Auct...ReplicateItems Lua Code:
|
||
WoWInterface » Developer Discussions » Lua/XML Help » My LUA code dont work in new API 8.3.0 [ auction ] ] |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|