Originally Posted by Eleuthria
I'm working on an addon which grabs some information from /who requests which are going to be sent by the addon.
How can I make it so it sends the different /who requests every 'X' seconds, since you can't send multiple requests back-to-back.
|
You'll have to use the OnUpdate handler.
Example (using no XML)
Code:
local MyAddon = CreateFrame("frame")
local elapsed = 0
function MyAddon:OnUpdate(update)
elapsed = elapsed + update
if (elapsed > 3) then
SendWho("Doomchicken")
elapsed = 0
end
end
MyAddon:SetScript("OnUpdate", function(self, update) self:OnUpdate(update) end)
Since OnUpdate is called every... 0.05 sec or so, you might want to disable it when you're not using it via MyAddon:SetScript("OnUpdate", nil)