Sandbox: Lua: Timer - ov-studio/Vital.sandbox GitHub Wiki

» Overview

Timers are essential for executing specific handlers at regular intervals. The default MTA timers have limitations, particularly when passing arguments like tables, as they don't pass arguments by reference.

» APIs

  • timer:getType() - shared

    Retrieve's instance's type.

    local string: type = self:getType()
    
  • timer:create() - shared

    Creates a new timer.

    local timer: cTimer = timer:create(
       function: exec,
       int: interval,
       int: executions,
       ~: ...arguments
    )
    
  • timer:destroy() - shared

    Destroys an existing timer.

    local bool: result = self:destroy()