Wowpedia
Advertisement
Game Flavors
Links
Patch
Added in 8.3.0

Starts a commodity item purchase.

C_AuctionHouse.StartCommoditiesPurchase(itemID, quantity)

Arguments

itemID 
number
quantity 
number

Details

Example

  • Buys 3x Wool Cloth and uses a delay to wait for the auction house to process.
function Example() -- /run Example()
	C_AuctionHouse.StartCommoditiesPurchase(2592, 3)
	C_Timer.After(.5, function() C_AuctionHouse.ConfirmCommoditiesPurchase(2592, 3) end)
end
local item = {}

function TestPurchaseCommodity(itemID, quantity)
	C_AuctionHouse.StartCommoditiesPurchase(itemID, quantity)
	item.itemID = itemID
	item.quantity = quantity
end

local function OnEvent(self, event)
	if next(item) then
		C_AuctionHouse.ConfirmCommoditiesPurchase(item.itemID, item.quantity)
		wipe(item)
	end
end

local f = CreateFrame("Frame")
f:RegisterEvent("AUCTION_HOUSE_THROTTLED_SYSTEM_READY")
f:SetScript("OnEvent", OnEvent)

-- /run TestPurchaseCommodity(2592, 2)
  • Presses the "Buy" button, in a macro suitable format which uses a secure template. Split into two parts since it doesn't fit within <255 chars.

1. Initializes the secure template.

/run if not AHBuyC then local f=CreateFrame("Button","AHBuyC",nil,"SecureActionButtonTemplate")f:SetAttribute("type","click")f:SetAttribute("clickbutton",AuctionHouseFrame.CommoditiesBuyFrame.BuyDisplay.BuyButton)end

2. Buys the commodity items.

/click AHBuyC
/run C_Timer.After(1, function() AuctionHouseFrame.BuyDialog.BuyNowButton:Click() end)

Patch changes

See also


Advertisement