FindImagePos always returns 1 even if the image is not yet displayed in the window. This results in random clicking and uncontrolled script execution.
I tried the SCREEN option and the WINDOW option, I tried several precision values etc. All resulted in the same issue.
The script worked for a couple of weeks now it works sometimes after a PC restart for 5-10 executions.
Here my code example:
// First WaitScreen + FindImage works fine
WaitScreenImage>%BMP_DIR%\image_65.bmp,0.7,CCOEFF
FindImagePos>%BMP_DIR%\image_65.bmp,WINDOW:Mobizen Mirroring,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
LClick
Endif
// 2nd WaitScreenImage does not wait and continues directly
WaitScreenImage>%BMP_DIR%\image_75.bmp,0.7,CCOEFF
FindImagePos>%BMP_DIR%\image_77.bmp,WINDOW:Mobizen Mirroring,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
LClick
EndIf
... (several FindImagePos / WaitScreenImage to follow)
Anyone had the same issue?
FindImagePos/WaitScreenImage issue
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: FindImagePos/WaitScreenImage issue
If it returns one it has found a match. If you don't see it then you have a false positive. Maybe you need to make your needle image more defined. Capture less background for example, make it smaller, remove any chance of it being confused with something else. Or consider using the EXACT matching method.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Newbie
- Posts: 2
- Joined: Sat Nov 05, 2016 11:14 am
Re: FindImagePos/WaitScreenImage issue
Thanks for the reply.
EXACT did not work. I took once again the pictures and it works fine now.
EXACT did not work. I took once again the pictures and it works fine now.