Вот так будет точнее
IF($time1 <= $_ms)
GETSCREEN(1031,268,1046,667)
IF_PIXEL_IN(1030,267,1045,666, 3823071) // красный
LOGWRITE ("Красный")
$peremennaya = 1
else
IF_PIXEL_IN(1030,267,1045,666, 7186218) // зеленый
LOGWRITE ("Зеленый")
$peremennaya = 0
END_IF
END_IF
$time1 = $_ms + 60000
END_IF