Docs · random

random

4 random commands, generated from the engine's own registry — signatures, parameters and a worked example each. A does something command acts on the game; a needs x() one answers a confident wrong answer when its client hooks are missing.

chance returns bool
chance(percent: int) -> bool

True this often. Percent rather than a fraction because the language has no floating point, and a percentage is how anybody would say it anyway.

ParameterTypeWhat it does
percentrequired int how often, 0 to 100
Example
if chance(5) { wait random(2000, 6000) }
humanised returns int
humanised(min: int, max: int) -> int

A number clustered around the middle of the range rather than flat across it. What to wait for: a person's timings are not uniform, so a uniform delay is itself a pattern.

ParameterTypeWhat it does
minrequired int the smallest it can be
maxrequired int one past the largest it can be
Example
wait humanised(600, 1200)
random returns int
random(min: int, max: int) -> int

A number from min up to but not including max. Flat: every value is as likely as every other.

ParameterTypeWhat it does
minrequired int the smallest it can be
maxrequired int one past the largest it can be
Example
wait random(600, 900)
randomBelow returns int
randomBelow(bound: int) -> int

A number from zero up to but not including bound. Zero when bound is zero or less, rather than a failure - there is exactly one number below one.

ParameterTypeWhat it does
boundrequired int one past the largest it can be
Example
let slot = randomBelow(30)