mirror of
https://github.com/Kiritow/OpenComputerScripts.git
synced 2024-03-22 13:10:46 +08:00
Fix event library
This commit is contained in:
parent
fac04952b6
commit
7965361365
|
@ -31,11 +31,11 @@ end
|
|||
function AddTimer(Interval,CallbackFunction,Times)
|
||||
checknumber(Interval)
|
||||
checkfunction(CallbackFunction)
|
||||
if(type(Times)~=nil) then -- Timer will run [Times] times.
|
||||
checknumber(Times)
|
||||
checknumber(Times)
|
||||
if(Times<1) then -- Timer will infinitly run (when times <0)
|
||||
return event.timer(Interval,CallbackFunction,math.huge)
|
||||
else -- Timer will run [Times] times.
|
||||
return event.timer(Interval,CallbackFunction,Times)
|
||||
else -- Timer will run once.
|
||||
return event.timer(Interval,CallbackFunction)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user