There's more than one way to solve this problem. Rather than any loop inside of a loop, here's an answer with a single loop.
In a loop, you have the variable A_
Index. We will use this in conjunction with the
Ceil() function (Ceil, rounds up) and the
Mod() function (Modulus, calculates a remainder from division).
I am going to use the
Ternary operator which is a way to say If/else.
The . in there is a concatenate
operator. This is how we'll put a number with a letter.
You will see me using a Forced
Expression by using a lone % at the start of the Send parameter.
Code: Select all
Loop, 15 ; make into 1500 if you want 1a-500c
{ ; optional when only a single command is in the Loop
Send % Ceil(A_Index/3) . (Mod(A_Index,3)=1 ? "a" : Mod(A_Index,3) = 2 ? "b" : "c")
}
return
The answer by Datapoint reminded me about the Chr() function and that may be used here in fact. It's just a little messy since Mod will loop, when the divisor is 3, between values 1, 2, 0, not 0, 1, 2.
Code: Select all
Loop, 15
Send % Ceil(A_Index/3) . (Mod(A_Index,3)=0 ? "c" : Chr(96 + Mod(A_Index,3)))
return