I have a script which is using both FindImage and Waitscreen to look for one of two images that will appear.
FindImagePos/image_2 & WaitScreenImage/image_1 work fine in the loop, however when FindImagePos/image_4 appears it skips to WaitScreenImage/image_1 and of course it wont find it because its already found image_4 so its stuck in limbo searching for image_1.
I found that its doing this because the script is reacting faster than screen updates. I can get around this by using the wait function at line 17-18 but I would much prefer to have the wait function only used for FindImagePos/image_4.
I hope this makes sense. If anyone has any suggestions I would appreciate your reply.
Code: Select all
1 // Test Script
2 SetFocus>Application01
3
4 Label>start
5
6 //Find image_2
7 FindImagePos>%BMP_DIR%\image_2.bmp,WINDOW:Application01,0.7,1,XArr,YArr,NumFound,CCOEFF
8 If>NumFound>0
9 HoldKey>v,50,0
10 Wait>0.900
11 HoldKey>a,50,0
12 Wait>0.900
13 HoldKey>g,50,0
14 Wait>0.900
15 HoldKey>t,50,0 - // Search can take 1-6 seconds
16 Endif
17
18
19 //Find Image_4
20 FindImagePos>%BMP_DIR%\image_4.bmp,WINDOW:Application01,0.7,1,XArr,YArr,NumFound,CCOEFF
21 If>NumFound>0
22 HoldKey>v,50,0
23 Wait>0.500
24 HoldKey>s,50,0
25 Wait>0.500
26 Endif
27
28
29 //Wait for
30 WaitScreenImage>%BMP_DIR%\image_1.bmp,0.7,CCOEFF
31 HoldKey>v,50,0
32 Wait>0.100
33
34 goto>start