...Start and stop it with a global hotkey (F6 by default) that works from any window. It clicks at the cursor or along a route of saved points, at intervals down to 1 ms or within a random range.
For anything longer than a click, the script editor has seven step types, with loops and If image / If pixel branches. A script can wait until an image appears on screen and then click it, so a button is clicked when it shows up and not before.
It is one portable file: nothing to install, no account, no licence key, no ads and no telemetry. GPL-3.0, source on GitHub.