Control Flow
loopIndex
$loopIndex
Returns the zero-based index of the current iteration of the innermost loop ($for, $loop, $while, $jsonForEach).
Syntax
$loopIndex
Parameters
None.
Return value
0,1,2… for the successive iterations.- Outside a loop, the error “Loop index outside a loop.” is raised.
Examples
$for[3]
Index $loopIndex
$endFor
Notes
Try it
Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.