I know it looks and sounds confusing but i basically do this in real life: C key held down 50 seconds and let go after 50 seconds, press number 6 key, lightly tap left key once. hold down C key again for 50 seconds and let go, press number 6 key, lightly tap right key once.
The reason i used a while loop to hold down the key is cause im unable to hold the key down using send and sleep commands. Appreciate all the help that i could get on this.
Also whenever i tried to run script, the error 'break has to be enclosed in a loop' keeps popping up, bamboozling me in the process
Code: Select all
if not A_IsAdmin
{
Run *RunAs "%A_ScriptFullPath%" ; Requires v1.0.92.01+
ExitApp
}
; Run this script as admin, just to make sure....
SetTimer, Spam, 10
SetTimer, Spam, Off
F8::
Toggle := !Toggle
If Toggle = 1
SetTimer, Spam, On
Else
SetTimer, Spam, Off
Return
Spam:
while A_TimeSinceThisHotkey < 50001
Send, c
if A_TimeSinceThisHotkey = 50000
break
return
Send, 6
Sleep 100
Send {Left Down}
Sleep 500
Send {Left Up}
while A_TimeSinceThisHotkey < 50001
Send, c
if A_TimeSinceThisHotkey = 50000
break
return
Send 6
Sleep 100
Send {Right Down}
Sleep 500
Send {Right Up}
Return