TaskManager

local TaskManager = require("Starlit/TaskManager")

The TaskManager module allows for scheduling code.

Many functions in this module take as argument a function to call and a list of arguments to call it with. Remember that if you are using classes, self should be passed as the first argument.

Functions

repeatEveryTicks(func: function, ticks: integer, : ...: any)

Creates a task to repeat a function every N ticks. Note that it is not guaranteed that every invocation is exactly the given number of ticks apart.

Parameters:
  • func (function) – The function to call.

  • ticks (integer) – How often, in ticks, to call the function.

  • ... (any) – Any arguments to the function.

delayTicks(func: function, ticks: integer, : ...: any)

Creates a task to call a function after a delay of N ticks.

Parameters:
  • func (function) – The function to call.

  • ticks (integer) – The amount of ticks to delay the calling by.

  • ... (any) – Any arguments to the function.