Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
Completes a commodity item purchase.
C_AuctionHouse.ConfirmCommoditiesPurchase(itemID, quantity)
Arguments[]
- itemID
- number
- quantity
- number
Details[]
- Requires the same
itemID
andquantity
as set in C_AuctionHouse.StartCommoditiesPurchase()
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
- Waits for AUCTION_HOUSE_THROTTLED_SYSTEM_READY instead of using a delay. Note that
C_AuctionHouse.StartCommoditiesPurchase
requires a hardware event.
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 LeftButton 1
/run C_Timer.After(1, function() AuctionHouseFrame.BuyDialog.BuyNowButton:Click() end)
Patch changes[]
Patch 8.3.0 (2020-01-14): Added.
|