GHI_Timer

Pilus edited this page Aug 11, 2015 · 1 revision
Clone this wiki locally

Syntax:

GHI_Timer(func, interval, onceOnly)

Arguments:

GHI_Timer has 2 required arguments and 1 optional argument.

func
''Function''
Define a function as a variable and pass it to GHI_Timer to have it executed at predetermined intervals. The function must be define, even if it is a standard function.
interval
''Number''
This is the time between executions of the function listed in seconds.
onceOnly [optional]
''Boolean''
If marked true, the function will trigger only once after the interval has passed. If marked false or left off the function will repeat until the UI is reloaded.

Example:

local func = function() GHI_ScreenFlash(1, 1, 2,"teal") end

local interval = 2

GHI_Timer(func,interval)

This script will cause the screen to continuously flash teal.