skip to content
MusesΜοῦσαιdocs

pointing / 09 of 13

Macros

A macro is a run of clicks recorded on the grid. Replay it with @ and one key, or find it by name.

Recording

In the grid, before typing a letter, press `. A REC badge shows in the top-left corner. Then click as usual: pick a cell and press Space, Enter, m, Delete or Insert. Each click happens for real, and the grid comes back for the next.

Two more steps can be recorded:

  • A hover. Tab after picking a cell records moving the pointer there, without a click, for menus that open under the pointer.
  • A drag. / starts one, as outside a recording. Pick the end and press Space, or press / again to call it off.

Backspace steps back as usual, and Escape abandons the recording.

Press ` again to stop. stochos asks for a key to bind the macro to: press one, or Enter to leave it unbound. Then it asks for a name: type one, and press Enter to save. A macro without a name is called macro 1, macro 2 and so on. Escape at either prompt throws the recording away.

Binding a key that another macro already has replaces that macro.

Saving a single click

Outside a recording, pick a cell and press Tab. stochos saves a one-step macro that clicks there, and asks for its key and name the same way.

Replaying

@ and then a macro’s key replays it, and stochos exits when it’s done. A key with no macro takes you back to the grid.

Tab, before typing a letter, lists your macros by name. Type to narrow the list. The letters only need to appear in order, as in gtp for “git push”. Tab moves down the list, and Enter replays the selected macro.

Try it here

Record a click, replay it with @
keys·Focus the screen, then press ` to record.
Focus the screen and type. Macros here last until the page reloads. stochos keeps them in macros.json.

Record two clicks a moment apart, the field and then Send, and replay them: the second waits as long as you did.

Timing

stochos records how long you took between steps and waits as long on replay, so a menu has time to open before the next click. The first step runs straight away. playback_speed scales the waits:

config.toml
[macros]
playback_speed = 2.0

2.0 replays twice as fast and 0.5 at half speed. 0, or anything below it, doesn’t wait at all.

macros.json

stochos keeps macros in macros.json, beside config.toml:

macros.json
[
  {
    "name": "open settings",
    "actions": [
      { "kind": { "Click": "pak" } },
      { "kind": { "Click": "jlx" }, "wait_ms": 420 }
    ],
    "bind_key": "s"
  }
]

A step stores the keys it was picked with, not a position. A macro clicks the same cells on any screen with the same grid. Change grid.hints and old macros point somewhere else.

wait_ms is how long to wait before the step, in milliseconds, and you can edit it by hand. A step’s kind is Move, Click, DoubleClick, TripleClick, RightClick or MiddleClick with its keys, or Drag with two: { "Drag": ["as", "pa"] }.