i took these code from shestakui, it could auto take a screenshot when you earned a achievement, but I want it auto take a screenshot when bg/arena finished too, is there anyone know how to modify it?
Lua Code:
local function TakeScreen(delay, func, ...)
local waitTable = {}
local waitFrame = CreateFrame("Frame", "WaitFrame", UIParent)
waitFrame:SetScript("onUpdate", function (self, elapse)
local count = #waitTable
local i = 1
while (i <= count) do
local waitRecord = tremove(waitTable, i)
local d = tremove(waitRecord, 1)
local f = tremove(waitRecord, 1)
local p = tremove(waitRecord, 1)
if d > elapse then
tinsert(waitTable, i, {d-elapse, f, p})
i = i + 1
else
count = count - 1
f(unpack(p))
end
end
end)
tinsert(waitTable, {delay, func, {...} })
end
local function OnEvent(...)
TakeScreen(1, Screenshot)
end
local frame = CreateFrame("Frame")
frame:RegisterEvent("ACHIEVEMENT_EARNED")
frame:SetScript("OnEvent", OnEvent)