Pause an automation
The pause field of the module header spaces runs out: after the automation runs, it stays silent for the duration you set. It is the per-automation frequency control; the executor also enforces ceilings of its own, see Limits.
Pause — stay silent after a run
Section titled “Pause — stay silent after a run”Add pause to the header of an event module (kind: 'event'), with a duration and a scope. A button or schedule module with pause is refused at save time: A pause applies to event modules only.
pause: { for: '60s', per: 'player' },A duration is a number and a unit s, m, h or d. The default for every new automation is no pause: leave the field out, and the automation runs every time. You only need to add it if repeated firing is a problem.
Example: for: '60s' on the whole automation — no matter how many chat messages match, the automation runs at most once per minute.
per — whole automation or per player
Section titled “per — whole automation or per player”per has two options:
- per whole automation — one shared pause for everyone. Use this to cap the automation regardless of who caused the event.
- per player (
'player') — a separate pause per player, so silencing one offender does not mute the reaction to another. An event with no player behind it — a round or map change, a broadcast, a chat message without an EOS ID — shares one pause for the whole automation, as with the whole-automation option.
The exact literal for each option is in the generated Module header reference.
Each server in the automation’s scope keeps its own pause: a pause on one server never silences the others.
The pause is kept in memory, so a restart of heliana, or a move of the server, resets it. The cost is one extra run.
Other ceilings
Section titled “Other ceilings”Besides the pause, the header may carry limits: { bansPerMinute, kicksPerMinute }, which only narrow the ceilings the platform already applies to the whole organization. See Limits.
“N times in a window”
Section titled ““N times in a window””A pause spaces runs out; it cannot make an automation wait for the N-th matching event. For that, declare a counter and compare ctx.counter.<name> in run — for example, ban only once ctx.counter.tk reaches 7. See Counting with counter.<name>.