if IsShiftKeyDown() then return end |
|
if event == "GOSSIP_SHOW" then |
-- Don't automate if available quests |
if GetNumGossipAvailableQuests() > 0 then |
return |
end |
-- Don't automate if quests ready for turn-in |
-- TODO: check repeatable quests |
local numActiveQuests = GetNumGossipActiveQuests() |
if numActiveQuests > 0 then |
for i = 1, numActiveQuests, 5 do |
local title, _, _, complete = select(i * 5 - 4, GetGossipActiveQuests()) |
if complete then |
return |
end |
end |
end |
-- Don't automate on work order NPCs, eg. at garrison barn |
local target |
for i = 1, GetNumGossipOptions() do |
local gossipText, gossipType = select(i * 2 - 1, GetGossipOptions()) |
if gossipText == GOSSIP_TEXT then |
return SelectGossipOption(i, "", true) |
target = i |
elseif gossipType == "workorder" then |
-- known types: banker, battlemaster, binder, gossip, healer, petition, tabard, taxi, trainer, unlearn, vendor, workorder |
return |
end |
end |
if target then |
SelectGossipOption(target, "", true) |
end |
elseif message == CONFIRM_TEXT and cost == 1000 then |
local dialog = StaticPopup_FindVisible(event) |
if dialog then |