File ./LibScriptableUtils-1.0/LibScriptableUtilsTimer-1.0/LibScriptableUtilsTimer-1.0.lua

Functions

LibTimer:Del () Delete a LibTimer object
LibTimer:New (name, duration, repeating, callback, data, errorLevel) Create a new LibTimer object
LibTimer:Start (duration, data, func) Start a timer.
LibTimer:Stop () Stop a timer
LibTimer:TimeRemaining () Return the timer's remaining duration


Functions

LibTimer:Del ()
Delete a LibTimer object

Usage:

object:Del()

Return value:

Nothing
LibTimer:New (name, duration, repeating, callback, data, errorLevel)
Create a new LibTimer object

Parameters

  • name: A name for this timer object
  • duration: The timer's duration in milliseconds.
  • repeating: Whether to repeat the timer or not
  • callback: Function to call when the timer has expired
  • data: Data to pass to the callback
  • errorLevel: Error verbosity level

Usage:

LibScriptableTimer:New(name, duration, repeating, callback, data, errorLevel, durationLimit)

Return value:

A new LibScriptableTimer object
LibTimer:Start (duration, data, func)
Start a timer.

Parameters

  • duration: The duration in milliseconds. This is optional. The timer's initialized duration will be replaced by this value.
  • data: Replace the timer's data that will be sent through the callback with this value.
  • func: Replace the timer's callback function

Usage:

object:Start([duration], [data])
LibTimer:Stop ()
Stop a timer

Usage:

object:Stop()

Return value:

True if the timer was stopped
LibTimer:TimeRemaining ()
Return the timer's remaining duration

Usage:

object:TimeRemaining()

Return value:

The remaining duration

Valid XHTML 1.0!