KeyRoutines
StepFreemath.random

Pick a random number between two values in a routine

Random number picks a number between a smallest and largest value. By default it's a whole number from 1 to 100, like a dice with a hundred sides.

How it works

  • Set the minimum and maximum; they can be typed in either order.
  • Keep "whole numbers" on for dice-style results, or turn it off to allow fractions.
  • An advanced seed gives the same numbers every run, which helps when testing.
  • A range with no whole number in it, like 1.2 to 1.8 with whole numbers on, is refused.

Routines that use it

Random wallpaper

Pick a number up to the count of images and set that one with Set wallpaper.

Coin flip

Pick 1 or 2 and use Compare values to choose between two playlists with Media control.

Varied break reminder

Pick 20 to 40 minutes and use it as the wait in Delay before showing a banner.

Settings

SettingWhat it does
MinThe smallest number it can be.
MaxThe largest number it can be.
Whole numberOnly whole numbers (like a dice roll), not fractions.
SeedadvancedGive the same numbers every run, from this starting value (for testing).

Questions

How do I roll a dice in KeyRoutines?
Use Random number with minimum 1, maximum 6 and whole numbers on.
Can I get the same random numbers every time?
Yes. Set the advanced seed and the step gives the same numbers on each run.

Pairs well with

Build this routine in KeyRoutines

Free from the Microsoft Store for Windows 11 and 10. Pro is a one-time upgrade.