Good Morning Ladies and Gentlemen!
Can someone tell me what I am doing wrong in this script? I am trying to make this work in a non-active window selecting F keys for particular functions. Starting by pushing the F3 key, single instant, the only key that needs to be held down, is the F4 key at the end for 10min. I need this whole function to work on a continuous loop. Please see below.
If WinExist("ahk_exe BingBong.exe")
setKeyDelay, 10, 10
setMouseDelay, 10
^q::
Loop
{
Send {F3 down}
Sleep 100
Send {F3 Up}
Sleep 100
Send {F6 Down}
Sleep 100
Send {F6 Up}
Sleep 100
Send {F8 Down}
Sleep 100
Send {F8 Up}
Sleep 100
Send {F10 Down}
Sleep 100
Send {F10 Up}
Sleep 100
Send {F11 Down}
Sleep 100
Send {F11 Up}
Sleep 100
Send {F12 Down}
Sleep 100
Send {F12 Up}
Sleep 100
Send {F4 Down}
Sleep 10000 ;------If I am understanding right, this will hold the F4 key down for 10min?
Send {F4 up}
Sleep 100
}
Return
; all loops should have some emergency pause, suspend or exit key
Esc::
Pause
Scripting Help
-
- Posts: 6
- Joined: 16 Jan 2018, 12:26
Re: Scripting Help
1 second == 1,000 milliseconds
therefore, 10 minutes == 1,000 * 60 = 60,000 * 10 = 600,000ms
assuming your program accepts controlsend, this should work for you, sending keystrokes to a background window.
therefore, 10 minutes == 1,000 * 60 = 60,000 * 10 = 600,000ms
assuming your program accepts controlsend, this should work for you, sending keystrokes to a background window.
Code: Select all
global procName := "BingBong.exe"
^q:: ;control q
loop {
sendInactive("F3")
sendInactive("F6")
sendInactive("F8")
sendInactive("F10")
sendInactive("F11")
sendInactive("F12")
sendInactive("F4",600000)
}
return
esc::pause
sendInactive(key,delay=100) {
ControlSend,,{%key% down}, ahk_exe %procName%
sleep 100
ControlSend,,{%key% up}, ahk_exe %procName%
sleep delay
}
Some of my AHK programs: 3D Voxel Game - Platformer Game
GitHub projects : Image/Pixel scanning class - Direct2D overlay class
GitHub projects : Image/Pixel scanning class - Direct2D overlay class
Who is online
Users browsing this forum: No registered users and 67 guests