i got ChatGPT to whip this up for me a bit ago.
Lua Code:
--/dump C_GossipInfo.GetOptions()
--use above on every dialog to capture gossip IDs
local NPC_LIST = {
["Katy Stampwhistle"] = {48598},
["Haephesta"] = {56395, 55039}, --selects option 1, then 3
}
local AutoGossip = CreateFrame("Frame")
function AutoGossip:OnEvent(_, type)
if IsShiftKeyDown() then return end
if type ~= Enum.PlayerInteractionType.Gossip then return end
local npcName = GossipFrame.TitleContainer.TitleText:GetText()
if not npcName then return end
local gossips = NPC_LIST[npcName]
if not gossips then return end
local options = C_GossipInfo.GetOptions()
if not options then return end
for _, option in ipairs(options) do
if tContains(gossips, option.gossipOptionID) then
C_GossipInfo.SelectOption(option.gossipOptionID)
return
end
end
end
AutoGossip:SetScript("OnEvent", AutoGossip.OnEvent)
AutoGossip:RegisterEvent("PLAYER_INTERACTION_MANAGER_FRAME_SHOW")