ясное дело что после ELSE
#name "Attributes_1"
DEFINE ($SXn, 253) // Search area
DEFINE ($SYn, 216) // top left
DEFINE ($SXk, 464) // Search area
DEFINE ($SYk, 268) // bot right
DEFINE ($XBut1, 416) // Button area
DEFINE ($YBut1, 479) //
DEFINE ($XBut2, 328)
DEFINE ($YBut2, 517)
DEFINE ($attr, "11.bmp") // Attribute
DEFINE ($count, 2) // Count
//=============================================
LCLICK($XBut1,$YBut1) // Click Оценка
WAIT(3)
GETSCREEN // Printscreen
COLORMODE(8, $SXn-10, $SYn-10, $SXk+10, $SYk+10) // color correction
SCANPICTURE($ARR_SCAN, $SXn, $SYn, $SXk, $SYk, $attr, -1, 99) // Analyse
LOGWRITE($attr, " count: ", ARRSIZE($ARR_SCAN)/2)
IF(ARRSIZE($ARR_SCAN)/2 > $count-1) // Stop if found >= count
LOGWRITE("Found!")
HALT
ELSE
LOGWRITE("Not found!")
LCLICK($XBut2,$YBut2)
WAIT(1)
END_IF
UNDEFINE($ARR_SCAN)