I'm trying to call ReloadUI() method after one minute. This is code I'm using.
Code:
local isEnd = false
local f = CreateFrame("Frame")
function f:onUpdate(sinceLastUpdate)
if isEnd then
print("END")
f:SetScript("OnUpdate",nil)
ReloadUI()
end
self.sinceLastUpdate = (self.sinceLastUpdate or 0) + sinceLastUpdate
if ( self.sinceLastUpdate >= 60 ) then -- in seconds
-- do stuff here
print("MSG")
self.sinceLastUpdate = 0
isEnd = true
end
end
f:SetScript("OnUpdate",f.onUpdate)
When the minute passes I get an error:
How to fix this? Or any ideas how to make one minute delay?
I found other function on
https://wowwiki.fandom.com/wiki/USERAPI_wait
Code:
<PREFIX>_wait(delay, func [, param [,param [,...]]])
But I don't understand how to use it. What is <PREFIX>? And code example on same link not working.