I'm pretty new to AHK scripting.
Do you mind to help me implement some optimization to low my CPU load.
Code: Select all
#NoEnv
#MaxHotkeysPerInterval 99000000
#HotkeyInterval 99000000
#KeyHistory 0
ListLines Off
Process, Priority, , low
SetBatchLines, -1
SetKeyDelay, -1, -1
SetMouseDelay, -1
SetDefaultMouseSpeed, 0
SetWinDelay, -1
SetControlDelay, -1
SendMode Input
Loop {
ImageSearch, FoundX, FoundY, 8, 8, 500, 160, %A_WorkingDir%\pic1.bmp
if ErrorLevel = 0
SoundPlay, %A_ScriptDir%\ringout.wav, wait
else
SoundPlay, no.wav
ImageSearch, FoundX, FoundY, 8, 8, 500, 160, %A_WorkingDir%\pic2.bmp
if ErrorLevel = 0
SoundPlay, %A_ScriptDir%\ringout.wav, wait
else
SoundPlay, no.wav
ImageSearch, FoundX, FoundY, 8, 8, 500, 160, %A_WorkingDir%\pic3.bmp
if ErrorLevel = 0
SoundPlay, %A_ScriptDir%\ringout.wav, wait
else
SoundPlay, no.wav
}