0
votes

I am a complete noob in autohotkey and I basically need a script that uses the F1 key to execute multiple steps in a loop. Here is my current script...

$F1::fileappend, `n<!><1><!>, C:\Users\Administrator\Documents\count.log
$F1::fileappend, `n<!><2><!>, C:\Users\Administrator\Documents\count.log
$F1::fileappend, `n<!><3><!>, C:\Users\Administrator\Documents\count.log
$F1::fileappend, `n<!><4><!>, C:\Users\Administrator\Documents\count.log
$F1::fileappend, `n<!><5><!>, C:\Users\Administrator\Documents\count.log
$F1::fileappend, `n<!><6><!>, C:\Users\Administrator\Documents\count.log
$F1::fileappend, `n<!><7><!>, C:\Users\Administrator\Documents\count.log

I understand why this doesn't work, I just need help making a script to loop through 1-7 using the same hotkey on press.

Thanks in advance! ^^

2

2 Answers

0
votes
$F1::
Loop, 7
FileAppend,% "`n<!><" A_Index "><!>", C:\Users\Administrator\Documents\count.log
return
0
votes

Thanks to budRich I've got my answer.

n := 1

$F1::
FileAppend,% "`n<!><" n "><!>", C:\Users\Administrator\Documents\count.log
if (n>=7)
  n=0
n++
return