В общем подправил код, самый внешний иф (первая его половина) работает как часы, хотя и есть минусы. Берусь за решение того, что после вылова русалки ( ELSE самого внешнего ифа) он походу не видит пиксель, попробую разобраться, вот код, я не стал редактировать отступы
#ps2_keyboard
#ps2_mouse
#logfile
M5:
DEFINE($C, 0)
DEFINE($A, 0)
DEFINE($Blue, 0)
GETSCREEN
IF(PXL(1197,43) = 14406087) //ïðîâåðêà íà ïîÿâëåíèå îêíà ðûáàëêè
M1:
GETSCREEN
IF((PXL(1104,287) = 7886082)|(PXL(1104,287) = 401020) //ïðîâåðêà íà ïîÿâëåíèå ïîëîñêè
M2:
GETSCREEN
IF((PXL(1104,287) = 7886082)|(PXL(1104,287) = 401020))
IF(PXL(1104,287) = 7886082) // Åñëè ïîëîñà ñèíÿÿ
$Blue = PXLCOUNT(1106,287,1331,287, 10446592)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 10118913)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 10249473)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 10315265)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 10315264)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 10381056)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 10446848)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 10447104)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 10447360)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 10118401)
IF($C ! 1)
$C = $C + 1
$A = $Blue
KEYPRESS(#F2)
WAITMS(2000)
GOTO(M2)
ELSE
END_IF
IF($A>$Blue)
LOGWRITE ("F2 Blue 1 ", $Blue, " A1 ",$A)
$A = $Blue
KEYPRESS(#F2)
WAITMS(2000)
GOTO(M2)
ELSE
LOGWRITE ("F3 Blue 1 ", $Blue, " A1 ",$A)
$A = $Blue
KEYPRESS(#F3)
WAITMS(2000)
GOTO(M4)
END_IF
ELSE //èíà÷å
IF(PXL(1104,287) = 401020) //åñëè ïîëîñà êðàñíàÿ
$Blue = PXLCOUNT(1106,287,1331,287, 468366)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 468109)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 468110)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 468111)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 468112)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 468113)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 468369)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 468368)
IF($C ! 1)
$C = $C + 1
$A = $Blue
KEYPRESS(#F2)
WAITMS(2000)
GOTO(M2)
ELSE
END_IF
IF($A>$Blue)
LOGWRITE ("F2 Blue 1 ", $Blue, " A1 ",$A)
$A = $Blue
KEYPRESS(#F2)
WAITMS(2000)
GOTO(M2)
ELSE
LOGWRITE ("F3 Blue 1 ", $Blue, " A1 ",$A)
$A = $Blue
KEYPRESS(#F3)
WAITMS(2000)
GOTO(M4)
END_IF
ELSE
GOTO(M5)
END_IF
END_IF //êîíåö âåòêè êðàñíûé/ñèíèé
ELSE
GOTO(M5)
END_IF //êîíåö ïðîâåðêè íà êðàñíûé/ñèíèé
M4:
GETSCREEN
IF((PXL(1104,287) = 7886082)|(PXL(1104,287) = 401020))
IF(PXL(1104,287) = 7886082)
$Blue = PXLCOUNT(1106,287,1331,287, 10446592)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 10118913)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 10249473)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 10315265)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 10315264)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 10381056)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 10446848)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 10447104)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 10447360)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 10118401)
IF($A>$Blue)
LOGWRITE ("F3 Blue 1 ", $Blue, " A1 ",$A)
$A = $Blue
KEYPRESS(#F3)
WAITMS(2000)
GOTO(M2)
ELSE
LOGWRITE ("F2 Blue 1 ", $Blue, " A1 ",$A)
$A = $Blue
KEYPRESS(#F2)
WAITMS(2000)
GOTO(M4)
END_IF
ELSE
IF(PXL(1104,287) = 401020) //åñëè ïîëîñà êðàñíàÿ
$Blue = PXLCOUNT(1106,287,1331,287, 468366)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 468109)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 468110)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 468111)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 468112)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 468113)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 468369)
$Blue = $Blue+PXLCOUNT(1106,287,1331,287, 468368)
IF($A>$Blue)
LOGWRITE ("F3 Blue 1 ", $Blue, " A1 ",$A)
$A = $Blue
KEYPRESS(#F3)
WAITMS(2000)
GOTO(M2)
ELSE
LOGWRITE ("F2 Blue 1 ", $Blue, " A1 ",$A)
$A = $Blue
KEYPRESS(#F2)
WAITMS(2000)
GOTO(M4)
END_IF
ELSE
GOTO(M5)
END_IF
END_IF
ELSE
GOTO(M5) // åñëè ïîëîñêè íåò âîîáùå
END_IF
ELSE
WAIT(1)
GOTO(M5)
END_IF
ELSE
IF(PXL(685, 195) = 12377059)
WAITMS(10)
KEYSTRING(/target)
KEYPRESS(32)
KEYDOWN(#CTRL)
KEYPRESS(#SHIFT)
KEYUP(#CTRL)
KEYDOWN(#SHIFT)
KEYPRESS(#p)
KEYUP(#SHIFT)
KEYSTRING(jkjnfz)
KEYDOWN(#SHIFT)
KEYPRESS(#h)
KEYUP(#SHIFT)
KEYSTRING(ecfkrf)
KEYDOWN(#CTRL)
KEYPRESS(#SHIFT)
KEYPRESS(#SHIFT)
KEYUP(#CTRL)
KEYPRESS(#ENTER)
KEYSTRING(/target)
KEYPRESS(32)
KEYDOWN(#CTRL)
KEYPRESS(#SHIFT)
KEYUP(#CTRL)
KEYDOWN(#SHIFT)
KEYPRESS(#p)
KEYUP(#SHIFT)
KEYSTRING(jkjnfz)
KEYDOWN(#SHIFT)
KEYPRESS(#h)
KEYUP(#SHIFT)
KEYSTRING(ecfkrf)
KEYDOWN(#CTRL)
KEYPRESS(#SHIFT)
KEYPRESS(#SHIFT)
KEYUP(#CTRL)
KEYPRESS(#ENTER) //íàáðàòü â ÷àò /target Çîëîòàÿ Ðóñàëêà 2 ðàçà, ó÷èòûâàÿ ñìåíó ÿçûêîâ. (âî âðåìÿ ðàáîòû ìàêðîñà äîëæåí áûòü âêëþ÷¸ííûìè ðóññêèé ÿçûê)
WAITMS(500)
GETSCREEN
IF(PXL(1347,470) = 13748415)
MOVE(1250,602)
WAITMS(500)
KEYPRESS(#ESC)
WAITMS(10)
KEYPRESS(#ESC)
WAITMS(10)
KEYPRESS(#F1)
WAIT(2)
GOTO(M5)
ELSE
KEYPRESS(#F1)
WAIT(2)
GOTO(M5)
END_IF
ELSE
KEYPRESS(#F1)
WAIT(2)
GOTO(M5)
END_IF
KEYPRESS(#F1)
WAIT(2)
GOTO(M5)
END_IF