Hi, I need to determinate different immages that pops up with a random but short period of time (from 30 secs to 5 mins).
What i want to do is a WaitScreenImage, FindImagePos and LClick an image, if that image didn't show up i want to check if another one comes up and do the same thing as the first one. If not, repeat the same process for about 5 images...
Is it possible? I know how to find an image and click it, what i can't do is the switch between different images. I know how to do it in C++ but it doesn't work on here...
Any suggestions?
Thanks
Detect diffrent immages
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Detect diffrent immages
I think what you are saying is you want to keep checking to see if any one of a bunch of images appears. You don't know when which will pop up, so you want to keep checking until one of them does. To do this just put multiple FindIMagePos checks inside a loop. Keep looping until one is found.
Psuedocode:
This code will check to see if image1 exists. If not it will check to see if image2 exists ... add more nested ifs for more images. At the end it will see if any were found. If not it will loop back and keep checking.
Consider that WaitScreenImage is nothing more than FindImagePos in a loop. Well here we have a multiple FindImagePos loop.
Psuedocode:
Code: Select all
Let>found=0
While>found=0
FindImagePos>image1 ....
If>found=1
MouseMove>...
LClick
Else
FindImagePos>image2...
If>found=1
MouseMove>...
LClick
Else
..
... etc
Endif
Endif
Wait>0.02
EndWhile
Consider that WaitScreenImage is nothing more than FindImagePos in a loop. Well here we have a multiple FindImagePos loop.
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?