timer_check - kemonologic/fuwafuwa GitHub Wiki

timer_check(timer)

Returns: (bool) Whether the timer has completed or not.

Argument Type Name Desc
0 map timer The timer to check.
1 real* nodePos The node in the timer sequence to check. (default: current node)

Returns whether or not the timer has completed or not. Timers set to repeat will also return true on the frame they complete.

While fuwafuwa has a lot of functionality, the goal was to create a timer system where only one line was necessary to both create or check a timer. This does the latter, and so is probably going to be the most commonly used function when using the library.

Optionally, using nodePos, you can check whether a previous node in the sequence had finished.

Special cases:

  • Please note this will continue to return true after a timer has gone off until the timer is destroyed, restarted, etc.
  • Destroyed timers will return false, but it's suggested to set variables that referenced a destroyed timer to undefined just in case.