In case you haven't found it yet (you probably have), a basic
for loop in Lua looks like this:
Code:
for i = 1, 10 do
reaper.ShowConsoleMsg("i = "..i.."\n")
end
You can also provide a third number to use as the 'step' amount:
Code:
for i = 10, 1, -1 do
...
end
for i = 1, 10, 0.5 do
...
end
Also useful is being able to exit the loop early:
Code:
for i = 1, 10 do
reaper.ShowConsoleMsg("i = "..i.."\n")
if i == 8 then
break
end
end