Humanizer

Scheduled short and AFK pauses for this plugin.

Methods
9
Fields
None

Methods

MethodReturnsDescription
register(number, number, number, number)()Declares this plugin's windows, in whole minutes between pauses: a short pause every shortMin to shortMax, an AFK pause every afkMin…
unregister()()Forgets this plugin's windows and any running pause. Call it from shutDown.
paused()booleanWhether a pause of this plugin's is running: when it is, sit out this tick. false for a plugin that has not registered.
pauseKind()string?The running pause's kind, "short" or "afk"; nil when none is running.
remainingTicks()numberGame ticks left in the running pause; 0 when none is running.
activity()string?What the running pause is doing, in words ("open inventory tab"); nil for an AFK pause, a quiet short pause, or when none is running.
atSafeSpot()booleanSays this is a safe spot: starts a pause when one is due, an AFK pause before a short one. true while a pause is running, so the plugin s…
atShortSafeSpot()booleanAs atSafeSpot, but only a short pause may start here: for a spot where the plugin can spare a moment and not minutes.
cancel()()Ends the running pause, if any, and restarts both clocks.

Method details

register

register: (number, number, number, number) -> ()

Declares this plugin's windows, in whole minutes between pauses: a short pause every shortMin to shortMax, an AFK pause every afkMin to afkMax. A maximum of 0 turns that kind off. Calling it again replaces the windows and restarts both clocks.

unregister

unregister: () -> ()

Forgets this plugin's windows and any running pause. Call it from shutDown.

paused

paused: () -> boolean

Whether a pause of this plugin's is running: when it is, sit out this tick. false for a plugin that has not registered.

pauseKind

pauseKind: () -> string?

The running pause's kind, "short" or "afk"; nil when none is running.

remainingTicks

remainingTicks: () -> number

Game ticks left in the running pause; 0 when none is running.

activity

activity: () -> string?

What the running pause is doing, in words ("open inventory tab"); nil for an AFK pause, a quiet short pause, or when none is running.

atSafeSpot

atSafeSpot: () -> boolean

Says this is a safe spot: starts a pause when one is due, an AFK pause before a short one. true while a pause is running, so the plugin sits out the tick. No pause starts during a break (BreakManager). Call it wherever stopping would do no harm.

atShortSafeSpot

atShortSafeSpot: () -> boolean

As atSafeSpot, but only a short pause may start here: for a spot where the plugin can spare a moment and not minutes.

cancel

cancel: () -> ()

Ends the running pause, if any, and restarts both clocks.