Originally Posted by
phagotron
Thanx TM, would be great to have another pic set available. Please put them into a separate folder like set2 with same name. Im awaiting an alt set where the sec is very close behind the numbers, seems as if this is another tor trick ... so selecting an alt set or searching more than one img might help us for some time. Even if with tolerance around 100 slight differences of brightness should not matter that much.
It seems to be time to get hands on imgsearch, maybe there is a way to improve it.
Welcome!
No worries, I was planning on keeping the new set separate for testing. I'd like to standardize the naming scheme for the timer images to something straightforward as well. Once the images are ready (along with the alt set you're getting) I figure we can update and test each mission. I envision something along the lines of:
Code:
Func WaitForMissionTimerInit($mission, $image1, $image2, $image3, $ms)
Local $script_start = TimerInit()
Local $result = 0
Local $x=0
Local $y=0
dmsg($mission & ": scanning for mission timer init (tolerance: " & $img_tolerance & ")")
Switch
Case FileExists($image1) = 0
dmsg($mission & " Error: " & $image1 & " doesnt exist or isnt readable.")
sleep(3000)
Return 0
Case FileExists($image2) = 0
dmsg($mission & " Error: " & $image2 & " doesnt exist or isnt readable.")
sleep(3000)
Return 0
Case FileExists($image3) = 0
dmsg($mission & " Error: " & $image3 & " doesnt exist or isnt readable.")
sleep(3000)
Return 0
EndSwitch
Do
Sleep(50)
$result1 = _Imagesearcharea($image1, 1, 825, 40, 930, 80, $x, $y, $img_tolerance)
$result2 = _Imagesearcharea($image2, 1, 825 ,40, 930, 80, $x, $y, $img_tolerance)
$result3 = _Imagesearcharea($image3, 1, 825, 40, 930, 80, $x, $y, $img_tolerance)
Until $result1 = 1 Or $result2 = 1 Or $result3 = 1 Or TimerDiff( $script_start ) > $ms
If $result = 1 Then
dmsg($mission & ": mission timer init succeeded.")
AdlibRegister("mission_progress",250)
MouseMove(612,390)
Return 1
Else
dmsg($mission & ": mission timer init failed.")
Return 0
EndIf
EndFunc
and in the mission script:
Code:
If $result=WaitForMissionTimerInit($mission_name & " 7:55 " , "pictures/55a.png", "pictures/55b.png", "pictures/55c.png", 7000) = 1 Then
$mission_secs = 480 ; (7:55)
Else
Send("{ESCAPE 1}")
space_ende()
Return 0
EndIf