This commit is contained in:
kepler155c@gmail.com
2019-04-25 14:44:36 -04:00
parent 0e3cb15356
commit f4bcd61116
5 changed files with 10 additions and 5 deletions

View File

@@ -118,12 +118,16 @@ function Event.off(h)
end
function Event.onInterval(interval, fn)
return Event.addRoutine(function()
local h = Event.addRoutine(function()
while true do
os.sleep(interval)
fn()
end
end)
function h.updateInterval(i)
interval = i
end
return h
end
function Event.onTimeout(timeout, fn)