Thread: Interval
View Single Post
10-30-11, 07:46 AM   #2
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
You have to use a Frame that you put a OnUpdate script to do the calling for you.

For example;
Code:
local f = CreateFrame("Frame")
local count = 0
f:SetScript("OnUpdate", function(self, elapsed)
  count = count + elapsed
  if count >= 100 then
    count = 0 -- reset to we wait another 100ms before printing
    print("We do this each 100ms.")
  end
end)
There are many other ways too, using the animation system and even the lua threading I reckon, but I am not so god with threading in lua. You can also look up the widget API here: http://wowprogramming.com/docs
  Reply With Quote