Expression Functions
This page defines all of the built-in functions added to expr-eval.
chance
Section titled “chance”Returns true with the provided probability, false otherwise.
chance: Probability between 0 and 1.
Gets the environment variable with the provided name. It will attempt to parse booleans and
numbers. For booleans, it must be the string true and false.
name: The environment variable name.
Produces a random number with a normal distribution.
mean: The mean. Defaults to 0.stdDev: The standard deviation. Defaults to 1.
jitter
Section titled “jitter”Adds or subtracts a random “jitter” [-amt, amt) to the provided value.
value: The initial value.amt: The max amount of jitter to add or subtract.
min_to_ms
Section titled “min_to_ms”Converts the provided minutes into milliseconds.
n: The number of minutes.
Picks a random element from the provided array with equal probability.
l: The array.
sec_to_ms
Section titled “sec_to_ms”Converts the provided seconds into milliseconds.
n: The number of seconds.