Originally Posted by lungdesire
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)
|
You will want to do something similar to the following .. it is not complete and not tested. It is based on my work with spell info request on one of my addons. In theory it should work in a similar way.
Lua Code:
-- Register Auction Events
frame:RegisterEvent("REPLICATE_ITEM_LIST_UPDATE") -- Triggers after a call to ReplicateItems()
frame:RegisterEvent("AUCTION_HOUSE_SHOW") -- Triggers when you first show the auction house
-- After event AUCTION_HOUSE_SHOW is triggered use this when you are ready to request items from the auction house
C_AuctionHouse.ReplcateItems()
-- After event REPLICATE_ITEM_LIST_UPDATE is triggered do the following and other similar functions to access the available item details.
-- Find the total number of items found after the call to ReplicateItems()
numReplicateItems = C_AuctionHouse.GetNumReplicateItems()
for index = 1,numReplicateItems do
-- Retrieve info for item on this line
local name, texture, count, qualityID, usable, level, levelType, minBid,
minIncrement, buyoutPrice, bidAmount, highBidder, bidderFullName, owner,
ownerFullName, saleStatus, itemID, hasAllInfo
= C_AuctionHouse.GetReplicateItemInfo(index)
-- Assuming name has a value at this point you should have useful info.
end
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.