https://wowpedia.fandom.com/wiki/API_C_Timer.After
Lua Code:
local needTimer = true
local tauntedMobs = {}
local function timesUp()
needTimer = true
-- do whatever you want with tauntedMobs
end
local function onSubEvent(subevent, ...)
if subevent == "SPELL_AURA_APPLIED" then
spellId, spellName, spellSchool = select(12, ...)
if spellName == "Righteous Defense" and Tair_BattleLog_SourceIsPlayer(sourceName) then
--print("Taunted "..destName)
table.insert(tauntedMobs, destName)
if (needTimer) then
needTimer = false
C_Timer.After(0, timesUp)
end
end
end
end
PS. I'm not sure where 'destName' comes from.