It's very common in programming languages to use if/else if/else (or switch, which Lua doesn't support) blocks for this purpose, see here for Lua's implementation: https://www.lua.org/pil/4.3.1.html
It's also generally considered bad programming to use goto. I mean, for a simple script like this in application processed code, it really isn't a big deal, just mentioning it in case this leads you down the road of programming in some way :)
I haven't tested this, but using if/elseif would look something like this:if acGetNumberVariable("Test") == 1 then
acSendKeys("Variable 1")
acSetNumberVariable("Test", 2)
elseif acGetNumberVariable("Test") == 2 then
acSendKeys("Variable 2")
acSetNumberVariable("Test", 3)
elseif acGetNumberVariable("Test") == 3 then
acSendKeys("Variable 3")
acSetNumberVariable("Test", 1)
end
Only one condition can be met at any time, or none in this code if none match. Adding an else block before the end would allow you to do something if no other conditions are met, like a catch all.
Also, the reason goto is considered evil by many is that except for some very specific/rare circumstances, a goto is never needed and only serves to make the code harder to read/follow.