isRunning := false
x1 := 0
y1 := 0
x2 := A_ScreenWidth
y2 := A_ScreenHeight
F4:: {
global isRunning
isRunning := true
SoundBeep(1000, 150)
ToolTip("ПОШУК ЗАПУЩЕНО")
SetTimer(() => ToolTip(), -1000)
}
F5:: {
global isRunning
isRunning := false
SoundBeep(400, 150)
ToolTip("ЗУПИНЕНО")
SetTimer(() => ToolTip(), -1000)
}
Loop {
if (!isRunning) {
Sleep(100)
continue
}
actions := ["c", "e", "n", "s", "j", "q", "l", "k", "r"]
scales := [0.8, 0.9, 1.0, 1.1, 1.2]
foundInThisCycle := false
for key in actions {
purePath := A_ScriptDir "\images\" key ".png"
if !FileExist(purePath) {
MsgBox("ФАЙЛ НЕ ЗНАЙДЕНО: " purePath)
isRunning := false
break
}
for s in scales {
imagePath := "*100 " purePath
try {
if ImageSearch(&foundX, &foundY, x1, y1, x2, y2, imagePath) {
Send(key)
foundInThisCycle := true
break
}
}
}
if foundInThisCycle
break
}
Sleep(50)
}