Package Guides
/

Repetition

Terminology

Command

Every utterance gets parsed into commands.

  • 🔉dizzle🔉 => `os:undo` command
  • 🔉shock🔉 => `common:enter` command
  • 🔉hello🔉 => `core:literal` command, with `hello` parameter

Chain

A series of commands parsed from a single utterance.

🔉dizzle shock hello🔉 =>

```

[

  { command: 'os:undo' },

  { command: 'common:enter' },

  { command: 'core:literal', arguments: 'hello' }

]

``

History

A list of previously executed `Chains`. [0] being current chain, [1] being previous chain, and so on.

History window

In order to understand repetition better, open up the History window using `core:toggle-history-window` 🔉histogram🔉

Command repetition

`repetition:command` 🔉repple🔉 will repeat the command before it N times (up to `Settings.repetition.maxRepetitionCount = 100` maximum for safety). Defaults to one time, If no parameter given.

  • 🔉hello repple two🔉 => types `hellohello`
  • 🔉shock repple five🔉 => presses `return` key 5 times

Note, 🔉hello repple one🔉 will also output hellohello, as in this case it means 'repeat previous once more', whereas every parameter more than 1 means 'repeat previous N times in total'

Command repetition shorthands

  • 🔉hello repple two🔉 => 🔉hello soup🔉
  • 🔉hello repple three🔉 => 🔉hello trace🔉

```

Settings.repetition =

  values:

    wink: 1

    soup: 2

    trace: 3

    quarr: 4

    fypes: 5

``

Command repetition as first command

Let's assume first utterance is 🔉shock arch🔉 which gets parsed as:

```

[

  { command: 'common:enter' },

  { command: 'core:literal', arguments: 'a' }

]

``

Starting the next utterance with a repetition command will use last command of last Chain, in this case `core:literal('a')`

🔉trace brov🔉 => types `aaab`

Chain repetition

`repetition:chain` 🔉creek🔉 repeats the Nth chain in history. If no parameter is given, will repeat the most recent Chain.

  • 🔉hello world clamor trace🔉
  • 🔉shock creek🔉

Produces:

```

hello world!!!

hello world!!!

``

Chain repetition and History

Note how the repetition commands themselves do not appear in the history window, instead, they get substituted by those commands which they have repeated. A chain consisting of a single `repetition:chain` 🔉creek🔉 (with any N parameter) does not alter History at all. On the contrary, a chain of multiple `repetition:chain` gets appended as a new chain.

Chain repetition shorthands

In order to repeat the fifth and third command in History, instead of 🔉creek five creek three🔉, use shorthand 🔉creek five three🔉. For repeating history sequences in descending order, e.g 3, 2 & 1, use `repetition:last-N-chains` 🔉recon three🔉

Chain in-line repetition

You are not limited to repeating past commands. Adding `Settings.repetition.chainRepetitionSuffix` (default is 'way') suffix to `Settings.repetition.values` will repeat the current chain.

Saying 🔉arch crunder soup way shock trace way🔉 would type

```

a_a_

a_a_

a_a_

``

Repeating multiple successive chains

`repetition:last-N-chains` 🔉recon🔉 with integer N as a parameter will call chain N, N-1, ... until most recent chain(inclusive).

  • 🔉arch🔉 => types `a`
  • 🔉brov🔉 => types `b`
  • 🔉char🔉 => types `c`
  • 🔉recon three🔉 => types `abc`

Previous command repetition with new parameters

`repetition:previous-command-with-new-argument` 🔉beep🔉

  • 🔉snake hello world🔉 => types `hello_world`
  • 🔉beep new parameters🔉 => types `new_parameters`