; keepalive_f5.ahk ; Sends F5 to the AC window every 60 s via SendInput so DirectInput sees it. ; Brings AC to foreground briefly each pulse (focus-stealing is unavoidable ; for SendInput). ; ; Run with: AutoHotkey64.exe bin\keepalive_f5.ahk #Requires AutoHotkey v2.0 #SingleInstance Force SetTitleMatchMode 2 WinTitle := "ahk_class Turbine Device Class" LogFile := "C:\Users\acbot\leakhunt\artifacts\phase1\keepalive.log" LogPulse(msg) { global LogFile FileAppend("[" FormatTime(A_Now, "yyyy-MM-dd HH:mm:ss") "] " msg "`n", LogFile) } LogPulse("AHK keepalive starting, alternating z/c (2s hold) every 600s (10 min)") i := 0 Loop { if not WinExist(WinTitle) { LogPulse("AC window not present - waiting 10s") Sleep 10000 continue } try { WinActivate(WinTitle) Sleep 200 if (Mod(i, 2) = 0) { Send("{z down}") Sleep 2000 Send("{z up}") LogPulse("pulse " i ": z held 2s") } else { Send("{c down}") Sleep 2000 Send("{c up}") LogPulse("pulse " i ": c held 2s") } i := i + 1 } catch as e { LogPulse("ERROR: " e.Message) } Sleep 600000 ; 10 min production interval }