macaroni

random

Description:
The random executor picks a random string from a set of choices (or a variable filled with choices)

Parent: execute, then, else

Value (simple form): string specifying valid choices to pick between
Value (sequence form):

# simple form
- random: (string)

# simple example
- random: '{mymusic}'

# sequence form
- random:
  - (string1)
  - (string2)
  - ...

# sequence example
- random:
  - red
  - blue
  - green

EXAMPLE

variables:
  mymusic:
    files: 'C:\Users\robc\OneDrive\Music'

# plays a random song from a directory of music files
commands:
- name: play random song
  triggers:
  - play [a] random song
  execute:
  - random: '{mymusic}'
  - listen: keyword
  - play: '{random.value}'

Status: ✅ IMPLEMENTED