View Single Post
05-07-20, 09:48 AM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,919
Originally Posted by lungdesire View Post
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:
  1. -- Register Auction Events
  2.     frame:RegisterEvent("REPLICATE_ITEM_LIST_UPDATE")  -- Triggers after a call to ReplicateItems()
  3.     frame:RegisterEvent("AUCTION_HOUSE_SHOW") -- Triggers when you first show the auction house
  4.  
  5.  
  6. -- After event AUCTION_HOUSE_SHOW is triggered use this when you are ready to request items from the auction house
  7.    C_AuctionHouse.ReplcateItems()
  8.  
  9.  
  10.  
  11. -- After event REPLICATE_ITEM_LIST_UPDATE is triggered do the following and other similar functions to access the available item details.
  12.  
  13. -- Find the total number of items found after the call to ReplicateItems()
  14.    numReplicateItems = C_AuctionHouse.GetNumReplicateItems()
  15.  
  16.  
  17.    for index = 1,numReplicateItems do
  18.  
  19.         -- Retrieve info for item on this line
  20.         local name, texture, count, qualityID, usable, level, levelType, minBid,
  21.         minIncrement, buyoutPrice, bidAmount, highBidder, bidderFullName, owner,
  22.         ownerFullName,  saleStatus, itemID, hasAllInfo
  23.         = C_AuctionHouse.GetReplicateItemInfo(index)
  24.         -- Assuming name has a value at this point you should have useful info.
  25.    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.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818

Last edited by Xrystal : 05-07-20 at 10:21 AM.
  Reply With Quote