2
« on: February 21, 2020, 07:56:15 PM »
от полый скрипт ...
SUB(sort_win)
$siz = ARRSIZE($window)
$srtcheck = 0
FOR($a=$siz-2, $a > 0, -2)
FOR($b=0, $b < $a, 2)
IF($window[$b] > $window[$b+2])
$srtcheck = 1
$tmp = $window[$b]
$tmp2 = $window[$b+1]
$window[$b] = $window[$b+2]
$window[$b+1] = $window[$b+3]
$window[$b+2] = $tmp
$window[$b+3] = $tmp2
END_IF
END_CYC
IF($srtcheck = 0)
$a = 0
END_IF
END_CYC
END_SUB
SUB(check_1)
WAITMS(160)
$ok = 0
getscreen($x+50,$y-70, $x+200,$y-30)
IF_PICTURE_IN($x+50,$y-70, $x+200,$y-30, "ne1.bmp")
$ok = 1
ELSE
IF_PICTURE_IN($x+50,$y-70, $x+200,$y-30, "ne2.bmp")
$ok = 1
ELSE
IF_PICTURE_IN($x+50,$y-70, $x+200,$y-30, "ne3.bmp")
$ok = 1
END_IF
END_IF
END_IF
END_SUB
SUB(action_1)
lclick($x, $y+5)
END_SUB
SUB(action_2)
lclick($x+50, $y-23)
END_SUB
SUB(find_501)
IF_PICTURE_IN($x-10,$y-35, $x+34,$y, "501.bmp")
lclick($x, $y-25)
check_1()
IF($ok)
LOGWRITE("Найден не тот объект" )
action_1()
// добавляем неправильный объект в список
$object = STRCONCAT(":", $x, ",", $y, ":")
$bad_objects = STRCONCAT($bad_objects, $object)
ELSE
LOGWRITE(" подтверждён ")
action_2()
END_IF
END_IF
//MOVE($ox, $oy)
WAITMS(5)
END_SUB
SUB(find_500)
getscreen(1920,153, 2920,350)
scanpicture($var, 1920,153, 2920,350, "500.bmp")
while(arrsize($var) > 0)
$y = arrpop($var)
$x = arrpop($var)
// проверяем на вхождение в список неправильных
$object = STRCONCAT(":", $x, ",", $y, ":")
$bad = 0
$bad = STRPOS($bad_objects, $object)
IF($bad = 0)
find_501()
END_IF
end_cyc
END_SUB
$bad_objects = "" // сбрасываем список неправильных объектов когда нужно
find_500()
SUB(find_6)
GETSCREEN($wx1,$wy1, $wx2,$wy2)
IF_PICTURE_IN($wx1,$wy1, $wx2,$wy2, "6.bmp")
LCLICK($_return1, $_return2)
LCLICK($_return1+60, $_return2+9)
END_IF
END_SUB
SUB(find_10)
GETSCREEN(1267,569, 1705,782)
IF_PICTURE_IN(1267,569, 1705,782, "10.bmp")
LCLICK($_return1, $_return2)
LCLICK($_return1+60, $_return2+9)
END_IF
END_SUB
SUB(check_count)
$ok = 0
IF_PICTURE_IN($ox,$oy, $ox+48,$oy+48, "1.1.bmp")
$ok = 1
ELSE
IF_PICTURE_IN($ox,$oy, $ox+48,$oy+48, "1.2.bmp", -1,40)
$ok = 1
END_IF
END_IF
END_SUB
SUB(action)
LCLICK($ox, $oy)
WAITMS(20)
LCLICK($ox+60, $oy+9)
END_SUB
SUB(find_object, $filename)
UNDEFINE($object)
//GETSCREEN($wx1,$wy1, $wx2,$wy2)
SCANPICTURE($object, $wx1,$wy1, $wx2,$wy2, $filename)
$object_size = ARRSIZE($object)
FOR($i=0, $i < $object_size, 2)
$ox = $object[$i]
$oy = $object[$i+1]
check_count()
IF($ok)
LOGWRITE("Найден объект ", $filename, " в окне № ", $w/2 + 1)
action()
ELSE
LOGWRITE("НЕ подтверждён ", $filename, " Окно № ", $w/2 + 1)
END_IF
//MOVE($ox, $oy)
WAITMS(5)
END_CYC
END_SUB
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
UNDEFINE($window)
GETSCREEN
SCANPICTURE($window, 0,0, 1850,650, "main.bmp", -1,70)
$window_count = ARRSIZE($window)
LOGWRITE("Найдено окон: ", $window_count/2)
sort_win()
WHILE(1)
FOR($w = 0, $w < $window_count, 2)
$wx1 = $window[$w] + 28
$wy1 = $window[$w+1] + 24
$wx2 = $window[$w] + 302
$wy2 = $window[$w+1] + 140
find_object("1.bmp")
find_object("3.bmp")
find_object("4.bmp")
find_object("7p.bmp")
find_500()
find_6()
find_100()
END_CYC
WAITMS(3)
END_CYC
HALT