Repetition
Terminology
Command
Every utterance gets parsed into commands.
- 🔉dizzle🔉 =>
os:undo
command - 🔉shock🔉 =>
common:enter
command - 🔉hello🔉 =>
core:literal
command, withhello
parameter
Chain
All commands parsed from a single utterance. 🔉dizzle shock hello🔉 =>
[
{command: 'os:undo'},
{command: 'common:enter'},
{command: 'core:literal', arguments: 'hello'}
]
History
List of previously executed chains 0
being current, 1
being previous 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🔉 repeats the command before it N times (up to Settings.repetition.maxRepetitionCount = 100
maximum). If no parameter given - uses 1
.
- 🔉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: {
// you can add more repetition commands like this
wink: 1,
soup: 2,
trace: 3,
quarr: 4,
fypes: 5
}
}
Command repetition as first command
Let's assume first utterance is 🔉shock arch🔉 which is getting parsed as
[
{command: 'common:enter'},
{command: 'core:literal', arguments: 'a'}
]
Starting next utterance with a repetition command, will use last command of last chain i.e a
literal.
🔉trace brov🔉 => types aaab
Chain repetition
repetition:chain
🔉creek🔉 repeats Nth chain in history. If no parameter given - uses 1
.
- 🔉hello world clamor trace🔉
- 🔉shock creek🔉
hello world!!!
hello world!!!
Chain repetition and History
Note how 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 = 'way'
suffix to Settings.repetition.values
will repeat current chain.
🔉arch crunder soup way shock trace way🔉 => types
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).