Our guild uses EPGP and I'm writing an addon that streamlines the loot distribution, so the Masterlooter initiates a loot round that triggers custom dialogs on each raiders screen. I've added automatic responses for items that players cannot use and for players that have their /afk flag set.
However sometimes the masterlooter still has to wait for afk players (who aren't flagged as such). Therefore I want to include a timeout for the dialog.
I found the sample code below:
local f = CreateFrame("Frame")
f:SetScript("OnShow", function() timer = 30 end)
f:SetScript("OnUpdate", function(self, elap)
timer = timer - elap
if timer > 0 then return end
--do stuff here--
My questions are:
1) is this the appropiate way of handling this (given the context of what I want to do).
2) how often does OnUpdate trigger? The wowwiki page tells me it is only triggered when the frame is redrawn- does that mean each screenrefresh or each time the frame is changed (repainted)?
3) if the frame is hidden, the OnUpdate is no longer triggered in the background? (which seems to imply an update on screenrefresh, but just asking to be sure).
The questions may sound a bit n00bish, but I want to be sure not to cause a major performance issue for calling this event like 60 times per second. Especially if I want to add a bar later on, ticking down the time left to answer the question.