Random choosing

Asked Jan 5, 2020·1 reply·Last activity 6 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

I have a question, how can I set this if you e.g. job writes that the nightbot writes butcher the first time and baker the second time.
how can I make the nightbot randomly choose that.
thank you i would like to know

1 reply

In the command code below, enter a list of choices bounded by backticks and separated by commas.

$(eval a=[`enter`,`a`,`list`,`of`,`choices`];a[Math.floor(Math.random()*a.length)])