ok, i knew there had to be a way to get around this timer issue, thanks to the "AR Timer ActiveX Library 2.0" you can now have unlimited independant timers
ok, its not the prettiest of timer code but it works and its reliable (some vista feedback plz :yes)
and remember to register the ocx and add the luaCOM plugin to the project
ok, its not the prettiest of timer code but it works and its reliable (some vista feedback plz :yes)
Code:
-- create Timer1 Timer1 = luacom.CreateObject("ARTimerLib.ARTimer") if Timer1 then -- set timer interval Timer1.Interval = 1 -- this is the events table for Timer1 Timer1Event={} -- now connect to the timer events luacom.Connect(Timer1,Timer1Event) -- This event will be fired every time that the amount of time set in Interval is elapsed. -- TT_H, TT_M, TT_S and TT_MS will contain the total amount of time elapsed since the timer was started. -- For convenience, hours, minutes, seconds and milliseconds are given in different variables. function Timer1Event:Timer(nH, nM, nS, nMS) -- put your timer actions here Label.SetText("Label1", nH..nM..nS..nMS); -- just to test, make sure the timer dosent go above 5 seconds if nS == 5 then Timer1:StopTimer() end end -- now start the timer Timer1:StartTimer() else -- there was an error, make sure the ocx is registerd result = Dialog.Message("Error", "Could not create Timer1", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); end
Comment