мой скрипт стреляет 1 раз после чего не работает и нужно отжимать и зажимать шифт заново может кто знает как сделать так что бы он работал так что я зажимаю шифт и он стреляет пока не пропадет цвет? было бы здорово #Persistent #NoEnv SetBatchLines, -1 CoordMode, Pixel, Screen ; === НАСТРОЙКИ === triggerKey := "LShift" ; Клавиша активации fireKey := "k" ; Клавиша стрельбы tolerance := 70 ; Цветовой допуск radius := 5 ; Радиус в пикселях delay := 30 ; Задержка между выстрелами (мс) targetColor := 0xFF5AF0 ; Целевой цвет (BGR) ; === ГЛАВНЫЙ ЦИКЛ === SetTimer, CheckTrigger, 1 return CheckTrigger: if GetKeyState(triggerKey, "P") { ; Проверка на цвет if DetectColor(radius, targetColor, tolerance) { ; Пока цвет найден и клавиша зажата — стреляем Loop { if !GetKeyState(triggerKey, "P") break if !DetectColor(radius, targetColor, tolerance) break Send {%fireKey% down} Sleep 10 Send {%fireKey% up} Sleep delay } } } return ; === Проверка цвета в зоне (радиус вокруг центра экрана) === DetectColor(radius, color, tol) { centerX := A_ScreenWidth // 2 centerY := A_ScreenHeight // 2 Loop, % radius * 2 + 1 { dx := A_Index - radius - 1 Loop, % radius * 2 + 1 { dy := A_Index - radius - 1 PixelGetColor, pxColor, centerX + dx, centerY + dy, RGB pxColor := pxColor & 0xFFFFFF if CompareColor(pxColor, color, tol) return true } } return false } CompareColor(c1, c2, tol) { r1 := c1 & 0xFF, g1 := (c1 >> 8) & 0xFF, b1 := (c1 >> 16) & 0xFF r2 := c2 & 0xFF, g2 := (c2 >> 8) & 0xFF, b2 := (c2 >> 16) & 0xFF return Abs(r1 - r2) <= tol && Abs(g1 - g2) <= tol && Abs(b1 - b2) <= tol } Code #Persistent #NoEnv SetBatchLines, -1 CoordMode, Pixel, Screen ; === НАСТРОЙКИ === triggerKey := "LShift" ; Клавиша активации fireKey := "k" ; Клавиша стрельбы tolerance := 70 ; Цветовой допуск radius := 5 ; Радиус в пикселях delay := 30 ; Задержка между выстрелами (мс) targetColor := 0xFF5AF0 ; Целевой цвет (BGR) ; === ГЛАВНЫЙ ЦИКЛ === SetTimer, CheckTrigger, 1 return CheckTrigger: if GetKeyState(triggerKey, "P") { ; Проверка на цвет if DetectColor(radius, targetColor, tolerance) { ; Пока цвет найден и клавиша зажата — стреляем Loop { if !GetKeyState(triggerKey, "P") break if !DetectColor(radius, targetColor, tolerance) break Send {%fireKey% down} Sleep 10 Send {%fireKey% up} Sleep delay } } } return ; === Проверка цвета в зоне (радиус вокруг центра экрана) === DetectColor(radius, color, tol) { centerX := A_ScreenWidth // 2 centerY := A_ScreenHeight // 2 Loop, % radius * 2 + 1 { dx := A_Index - radius - 1 Loop, % radius * 2 + 1 { dy := A_Index - radius - 1 PixelGetColor, pxColor, centerX + dx, centerY + dy, RGB pxColor := pxColor & 0xFFFFFF if CompareColor(pxColor, color, tol) return true } } return false } CompareColor(c1, c2, tol) { r1 := c1 & 0xFF, g1 := (c1 >> 8) & 0xFF, b1 := (c1 >> 16) & 0xFF r2 := c2 & 0xFF, g2 := (c2 >> 8) & 0xFF, b2 := (c2 >> 16) & 0xFF return Abs(r1 - r2) <= tol && Abs(g1 - g2) <= tol && Abs(b1 - b2) <= tol }