checking for movement

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
michael
Newbie
Posts: 1
Joined: Wed Sep 25, 2002 6:09 am

checking for movement

Post by michael » Wed Sep 25, 2002 6:16 am

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]

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Sep 25, 2002 9:17 am

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.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts