hook( id, table, function, argument )

instance function

Hook a function on to the Timer. This function will be called every time the Timer ticks. You can add as many hooks to a timer as you want.

Parameters

Name Type Description
id String Unique identifier for the hook
table Table The table the hook function belongs to (can be nil)
function Function The hook function to call on tick
argument Any An argument to pass to the hook function

Returns

Type Description
Boolean True if the hook was added successfully

Notes

The callback function should have the following signature - timer is the Timer that invoked the call and hook is a TimerHook object.

function ExampleTable:exampleFunction( timer, hook )