WoW:USERAPI GetAuctionBuyout: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(New page: GetAuctionBuyout is an API proposed by Tekkub as a standard for getting auction house buyout price recommendations from addons that are so capable. Here's a possible imple...)
 
No edit summary
Line 35: Line 35:
GetAuctionBuyout is supported by:
GetAuctionBuyout is supported by:


* [http://wow.curse.com/downloads/wow-addons/details/auctionlite.aspx AuctionLite] by Merial.
* [http://auctionator-addon.com Auctionator] by [[User:Zirco|Zirco]]
* [http://auctionator-addon.com Auctionator] by [[User:Zirco|Zirco]]



Revision as of 09:33, 24 March 2009

GetAuctionBuyout is an API proposed by Tekkub as a standard for getting auction house buyout price recommendations from addons that are so capable.

Here's a possible implementation that assumes you have an internal function call MyGetAuctionPriceByItemName.


   local origGetAuctionBuyout = GetAuctionBuyout;
 
   function GetAuctionBuyout(item)		-- Tekkub's API
 
     local sellval;
 
     if (type(item) == "string" and MyGetAuctionPriceByItemName(item)) then
         sellval = MyGetAuctionPriceByItemName(item);
     end
 
     if (sellval == nil) then
         local name = GetItemInfo(item);
         if (name and MyGetAuctionPriceByItemName(name)) then
             sellval = MyGetAuctionPriceByItemName(name);
         end
     end
 
     if (sellval) then
          return sellval;
     end
 
     if (origGetAuctionBuyout) then
          return origGetAuctionBuyout(item);
     end
 
     return nil;
   end


GetAuctionBuyout is supported by:


See also: GetSellValue