-
Notifications
You must be signed in to change notification settings - Fork 0
New library: timer
The timer library is a very useful set of functions which allow you to run a function periodically or after a given delay.
dounai_lib.timer.Adjust(name, delay, repetitions, func)Adjusts a previously created timer with the given identifier.
Return: bool
name: string
delay: number
repetitions: number
func: function
dounai_lib.timer.AdjustTick(name, tick, repetitions, func)Adjusts a previously created tickrate-based timer with the given identifier.
Return: bool
name: string
tick: number
repetitions: number
func: function
dounai_lib.timer.Create(name, delay, repetitions, func)Creates a new timer that will repeat its function given amount of times.
name: string
delay: number
repetitions: number
func: function
dounai_lib.timer.CreateTick(name, tick, repetitions, func)Creates a new tickrate-based timer that will repeat its function given amount of ticks.
name: string
tick: number
repetitions: number
func: function
dounai_lib.timer.Exists(name)Returns whenever the given timer exists or not.
Return: bool
name: string
dounai_lib.timer.Pause(name)Pauses the given timer.
name: string
dounai_lib.timer.Remove(name)Stops and removes a timer.
name: string
dounai_lib.timer.RepsLeft(name)Returns amount of repetitions/executions left before the timer destroys itself.
Return: number
name: string
dounai_lib.timer.Simple(delay, func)Creates a simple timer that runs the given function after a specified delay.
delay: number
func: function
dounai_lib.timer.SimpleNextTick(func)Creates a simple timer that runs in the next tick.
func: function
dounai_lib.timer.TickLeft(name)Returns amount of ticks left before the timer executes its function.
If the timer is paused, the amount will be negative.
Return: number
name: string
dounai_lib.timer.TimeLeft(name)Returns amount of time left (in seconds) before the timer executes its function.
If the timer is paused, the amount will be negative.
Return: number
name: string
dounai_lib.timer.Toggle(name)Runs either dounai_lib.timer.Pause() or dounai_lib.timer.UnPause() based on the timer's current status.
name: string
dounai_lib.timer.UnPause(name)Unpauses the timer.
name: string