https://i.imgur.com/jELhyV1.gif
The issues is the ball is moving back and forth, and I want it to hit space only when the ball is in the roughly middle of the bar contained inside the 2 yellow lines.
Code: Select all
; COLOR DETECTION
; Goal: If Pixel is detected in square send space
; Issue: The object is moving back and forth
1::
Loop {
PixelSearch, Px, Py, 902, 814, 928, 837, 0x11A7EA, 1, Fast
if (ErrorLevel = 0) {
Send {Space}
}
; else {
; MsgBox, ERROR: Color not detected
; }
}
2::exitapp