Я правильно понял
//1
SUB(имя)
FOR($b=0,$b<5)
GETSCREEN
IF_PICTURE_IN (0,0, $_xmax,$_ymax, "img1.bmp", -1, 100)
LCLICK($_return1, $_return2)
WAITMS(100)
KEYPRESS(#L)
WAITMS(50)
ELSE
IF_PICTURE_IN (0,0, $_xmax,$_ymax, "img2.bmp", -1, 100)
LCLICK($_return1, $_return2)
WAITMS(100)
KEYPRESS(#S)
WAITMS(50)
ELSE
IF_PICTURE_IN (0,0, $_xmax,$_ymax, "img3.bmp", -1, 100)
LCLICK($_return1, $_return2)
WAITMS(100)
ELSE
WAITMS(50)
END_CYC
END_SUB
//2
FOR($a=0,$a<5)
GETSCREEN
IF_PICTURE_IN (0,0, $_xmax,$_ymax, "img1.bmp", -1, 100)
LCLICK($_return1, $_return2)
WAITMS(100)
KEYPRESS(#L)
WAITMS(50)
ELSE
IF_PICTURE_IN (0,0, $_xmax,$_ymax, "img2.bmp", -1, 100)
LCLICK($_return1, $_return2)
WAITMS(100)
KEYPRESS(#S)
WAITMS(50)
ELSE
IF_PICTURE_IN (0,0, $_xmax,$_ymax, "img3.bmp", -1, 100)
LCLICK($_return1, $_return2)
WAITMS(100)
ELSE
WAITMS(50)
END_CYC