Hello there. I've been very pleased with the help I've gotten from the forum not only from searching others questions, but also from posting my own questions. Thanks everyone.
My question now is:
I have been using the WaitScreenImage command and like it. It has really helped (I was using the command to wait till the rectangle has changed, but didn't work as well for me). Is there a way to increase the frequency that that image is checked, or to limit the area of the screen that is being checked.
I notice when it is waiting, you can see the mouse flash at a certain interval as if it is looking at that frequency. It would be good for my application to stop waiting as soon as the image pops up.
The number at the end is the adjust the color tolerance, correct?
Thanks again.
Brad
WaitScreenImage>test.BMP,0
WAIT check frequency
Moderators: Dorian (MJT support), JRL
WaitScreenImage, FindImagePos, and ScreenCapture
Hi Brad,
If there is a way to increase the frequency WaitScreenImage scans the screen, it is undocumented. Most of the time spend by this function is actually performing the scan. Whether it inserts a small delay between scans, I do not know.
The best way to increase the frequency is to decrease the size of the image file as much as possible while making sure it is still unique on the screen. This will decrease the amount of work it needs to do.
Another way is to build your own version of WaitScreenImage using FindImagePos and ScreenCapture in a loop. Other posts by Marcus say WaitScreenImage is simply these more basic functions in a loop. If you are sure the image you are looking for is in a small portion of the screen you can use ScreenCapture to limit your search to improve performance.
Yes, the second argument of WaitScreenImage is the color tolerance. Changing this will not make it work faster, but will improve reliability when there are variations in the screen display.
If there is a way to increase the frequency WaitScreenImage scans the screen, it is undocumented. Most of the time spend by this function is actually performing the scan. Whether it inserts a small delay between scans, I do not know.
The best way to increase the frequency is to decrease the size of the image file as much as possible while making sure it is still unique on the screen. This will decrease the amount of work it needs to do.
Another way is to build your own version of WaitScreenImage using FindImagePos and ScreenCapture in a loop. Other posts by Marcus say WaitScreenImage is simply these more basic functions in a loop. If you are sure the image you are looking for is in a small portion of the screen you can use ScreenCapture to limit your search to improve performance.
Yes, the second argument of WaitScreenImage is the color tolerance. Changing this will not make it work faster, but will improve reliability when there are variations in the screen display.
-
- Newbie
- Posts: 17
- Joined: Sun Dec 21, 2008 6:58 am
Thanks for the tip.
After some thinking, that's what I thought too.
I was thinking that making a comparebitmap loop would work for my application.
Basically, I'm trying to see if a "submit" button is ready to be pushed or if it is unavailable (greyed out). So, if it is grey, keep checking and comparing until the results are 100%. if they are 100% continue on with the rest of the script.
Does this sound like a feasible solution?
Thanks
Brad
After some thinking, that's what I thought too.
I was thinking that making a comparebitmap loop would work for my application.
Basically, I'm trying to see if a "submit" button is ready to be pushed or if it is unavailable (greyed out). So, if it is grey, keep checking and comparing until the results are 100%. if they are 100% continue on with the rest of the script.
Does this sound like a feasible solution?
Thanks
Brad
Images to represent state of buttons.
Yes, that is feasible and a good idea.
By distinguishing between different states of the button you can achieve better script synchronization. You may also want to add a counter so you can exit if neither state of the button is found.
Gale
By distinguishing between different states of the button you can achieve better script synchronization. You may also want to add a counter so you can exit if neither state of the button is found.
Gale