Наверное так
thread(thr1)
waitms(rnd(750,1500))
a:
getscreen
if_picture_in(0,0,$_xmax,$_ymax,"53.bmp",-1,90)
lclick($_return1+RND(45,130),$_return2+RND(105,130))
else
getscreen
colormode(6)
if_picture_in(0,0,$_xmax,$_ymax,"мини.bmp",-1,90)
lclick($_return1+RND(20,155),$_return2+RND(110,155))
else
getscreen
if_picture_in(0,0,$_xmax,$_ymax,"миникарта.bmp",-1,90)
lclick($_return1,$_return2)
wait(2)
goto(a)
end_if
end_if
end_if
$time = $_time_t + 5
WHILE($time > $_time_t)
go:
getscreen
if_pixel_in(0,0,$_xmax,$_ymax,2548528)
wndgetinfo(hget($_return1,$_return2),$var1,$var2,$var3,$var4)
$var2 = $var2+75
$var4 = $var4-25
$cent_x=int(($var3-$var1)/2)
$cent_y=int(($var4-$var2)/2)
$x=0
$y=0
GETSCREEN
SCANPXL($arr,$var1,$var2,$var3,$var4,9557759)
SCANPXL($arr,$var1,$var2,$var3,$var4,10386009)
FOR($a=0,$a<ARRSIZE($arr),2)
IF(DIST($arr[$a],$arr[$a+1],$cent_x,$cent_y)<DIST($x,$y,$cent_x,$cent_y))
$x=$arr[$a]
$y=$arr[$a+1]
END_IF
END_CYC
UNDEFINE($arr)
IF(ARRSIZE($arr) ! 0)
LCLICK($x+5,$y+5)
WAIT(2)
goto(go)
END_IF
end_if
WAITMS(10)
END_CYC
goto(a)
end_thread
thread(thr2)
waitms(500)
getscreen
if_pixel_in(0,0,$_xmax,$_ymax,2964963)
setthread(thr4,0)
wait(45)
dblclick($_return1,$_return2+37)
wait(5)
setthread(thr4,1)
end_if
end_thread
thread(thr3)
a:
waitms(rnd(500,1000))
getscreen
if_pixel_in(0,0,$_xmax,$_ymax,2548528)
goto(a)
else
getscreen
if_picture_in(0,0,$_xmax,$_ymax,"ремонт.bmp",-1,90)
setthread(thr4,0)
wait(5)
lclick($_return1,$_return2)
wait(3)
lclick($_return1-119,$_return2+243)
else
goto(a)
end_if
end_if
define($var)
inc($var)
if($var = 15)
setthread(thr4,0)
setthread(thr1,0)
wait(10)
keypress(76)
halt
end_if
wait(10)
setthread(thr4,1)
wait(50)
end_thread
thread(thr4)
keypress(72)
wait(1)
a:
waitms(rnd(750,1500))
getscreen
if_pixel_in(0,0,$_xmax,$_ymax,10328931)
lclick($_return1,$_return2)
end_if
wait(30)
goto(a)
end_thread