i made a small script for click on the right zone of a minigame
x = first white pixel from left
x2 = first white pixel from right
x3 = position of the red bar
if the red bar is in the right side it go from right to left otherwise and i switch x2 with x and start the 2nd cicle where i search when the red bar go on the clickable area and send the click
the problem i think is a fps lag or something else so i need to check more than a pixel for the bar but if i add other PixelGetColor it will reduce the accuracy of the check
the minigame last less than a second
any hint how i can increase the accuracy of the 2nd while?
Code: Select all
i:=0
while i<4000 {
PixelSearch, x, y, 780, 890, 1160, 890, 0xFFFFFF , 5, fast
if (ErrorLevel = 0) {
j :=0
PixelSearch, x2, y, x, 890, 1160, 890, 0x7F7F7F , 5, fast
PixelSearch, x3, y, 750, 890, 1180, 890, 0xFF0000 , 5, fast RGB
if (x3 > 1100) {
x := x2 +30
}
else {
x:=x-30
}
while j<100 { ;found the white area
PixelGetColor, color, x,y, RGB
ifEqual, color, %red%
{
Click
sleep, 200
break
}
j++
}
}
sleep, 20
i++
}