Class: Automator

Automator(world)

Automator class for automating generators.

Normally generators are manually controlled, i.e. they generate resources when explicitly told to. Automators are used to trigger generators during the world's update cycles.

Constructor

new Automator(world)

Constructs a new item

Parameters:
Name Type Description
world

World this item belongs to

Author:
  • Harri Pellikka
Source:

Methods

disable()

Disables this automator, effectively turning the automation off.

Source:

enable()

Enables this automator. Automators are enabled by default when they are created.

Source:

getTickRate()

Retrieves the tick rate of this automator.

Source:
Returns:

Tick rate in seconds

getTimerPercentage()

Retrieves the percentage of the tick. Useful when creating progress bars for generators.

Source:
Returns:

Percentage of tick completion

setTickRate(tickRate)

Sets the tick rate of this automator.

Parameters:
Name Type Description
tickRate

Tick rate in seconds

Source: