checking for movement
Moderators: Dorian (MJT support), JRL
checking for movement
I am trying to write a script that checks for any changes in the screen. The waitrectchanged command doesnt seem to work. I can activate my script and not move the mouse or anything, and it will supposedly detect movement, or I can do everything possible to change the screen appearance and it will not detect anything. Does the cursor count as possible rectangle changes? The syntax of tlx,tly,brx,bry,timeout doesnt seem to work as it should. Any ideas?[/quote]
- Marcus Tettmar
- Site Admin
- Posts: 7380
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
No, the cursor doesn't have anything to do with the screen images.
Also, keep the rectangles very small as the algorithm needed to calculate a unique outcome for a rectangle based on each pixel position and colour is computationaly intensive, so it can take some time for the rectangle checksum to be calculated. So keep the coordinates small.
If you just want to watch for the cursor to be moved, use the GetCursorPos command - there's a script at http://www.mjtnet.com/scripts.hts which uses this techique to watch for inactivity/activity.
If you're watching an application for changes, my advice is to stick to a small area - like a status bar, and preferably just wait for a single pixel in that region to change.
Also, keep the rectangles very small as the algorithm needed to calculate a unique outcome for a rectangle based on each pixel position and colour is computationaly intensive, so it can take some time for the rectangle checksum to be calculated. So keep the coordinates small.
If you just want to watch for the cursor to be moved, use the GetCursorPos command - there's a script at http://www.mjtnet.com/scripts.hts which uses this techique to watch for inactivity/activity.
If you're watching an application for changes, my advice is to stick to a small area - like a status bar, and preferably just wait for a single pixel in that region to change.