![]() |
Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
Selects a gossip (conversation) option.
C_GossipInfo.SelectOption(optionID [, text, confirmed])
Arguments[]
- optionID
- number -
gossipOptionIDfrom C_GossipInfo.GetOptions() - text
- string?
- confirmed
- boolean?
Example[]
Prints gossip options and automatically selects the vendor gossip when e.g. at an innkeeper.
local function OnEvent(self, event)
local info = C_GossipInfo.GetOptions()
for i, v in pairs(info) do
print(i, v.icon, v.name, v.gossipOptionID)
if v.icon == 132060 then -- interface/gossipframe/vendorgossipicon.blp
print("Selecting vendor gossip option.")
C_GossipInfo.SelectOption(v.gossipOptionID)
end
end
end
local f = CreateFrame("Frame")
f:RegisterEvent("GOSSIP_SHOW")
f:SetScript("OnEvent", OnEvent)
Patch changes[]
Patch 10.0.0 (2022-10-25): Changed index param to optionID.
Patch 9.0.1 (2020-10-13): Moved to C_GossipInfo.SelectOption()
Patch 1.0.0 (2004-10-08): Added as SelectGossipOption()
See also[]
- UI SelectGossipOption - This is an API for players and addon authors to continue to be able to select by index rather than ID
