HyperScript 1.7.56
Loops know what they are on: loop-value, numbered for a loop inside a loop, and a loop that counts from one number to another.
Added
loop-valueis what the loop around a line is on, in every kind of loop: the number of the round inloop <n> times, the element infor each, the player inloop all players, the seconds left incountdown. In text it is%loop-value%.
loop 3 times:
send "&7Round %loop-value%"
- In a loop inside a loop the values are numbered from the outside in:
loop-value-1is the first loop's,loop-value-2the one inside it, and so on. The plainloop-valueis always the innermost loop's.
loop from 1 to 3:
loop from 1 to 3:
send "&7%loop-value-1% x %loop-value-2% = &f%loop-value-1 * loop-value-2%"
loop from <number> to <number>:counts from the one to the other, both included, up or down:loop from 1 to 10:,loop from 10 to 1:.by <number>is how far apart the numbers are:loop from 0 to 100 by 25:,loop from 0 to 1 by 0.25:.loop <list>:goes through a list without naming a local for the element:loop {queue}:. The element isloop-value.loop-indexis which round a loop is on, from 1, whatever it goes through, so"%loop-index%. %loop-value%"numbers a list.loop-index-1,loop-index-2for loops inside loops.
Changed
loop-numberworks in every loop and is the same asloop-index. Before, it was only set inloop all players.loop-valueoutside a loop, and a number no loop has (loop-value-3inside two loops), are refused when the script loads, with a message that says how many loops there are.
Everything that worked before still does: loop 5 times with {_i}:, loop-player, for each {_x} in ....