lemming Posted November 17, 2005 Report Share Posted November 17, 2005 This is my general purpose routine for breaking out of a repeat loop without keyboard input. With this routine, you only need to move the mouse cursor to the upper left-hand corner of your screen to break out of a loop (or even your macro). The routine checks the current mouse cursor position, and if it's in the upper left-hand corner, a Break command (formerly Repeat Exit) will be issued, thus ending the loop. The routine actually checks a 3x3 (9 pixel) square starting from the upper left-hand corner (position 0,0). This is to account for "drifting" mice, and users with bad "aim". AFAIK, this routine is not processor-intensive, so you can stick it into multiple points in your repeat loops to ensure the mouse position is checked often. // --- Start mouse position checker --- Get Mouse Position Screen: %N7%, %N8% If Variable %N7% <= 2 AND If Variable %N8% <= 2 Break // break out of loop if upper left-hand corner End If // --- Ends mouse position checker --- Lemming <REM2:Author: Lemming - Company: Star Publications><REM2:A general purpose routine for breaking out of a repeat loop.><REM2:This checks the current mouse cursor position, and if it's in the><REM2:upper left-hand corner, a Break command (formerly Repeat Exit) will ><REM2:be issued, thus ending the loop.><REM2:><REM2:--- Start mouse position checker ---><MOUSEPOS:T:07:08><IFVAR2:2:07:6:2><AND><IFVAR2:2:08:6:2><BREAK><REM2:break out of loop if upper left-hand corner><ENDIF><REM2:--- Ends mouse position checker ---> Quote Link to comment Share on other sites More sharing options...
champgm Posted June 12, 2006 Report Share Posted June 12, 2006 Heh. Your post made me think. Just fooling around, I decided to make a mouse-restriction macro. At first, I kept the cursor in a 100x100 box, so you could still move it around some, but couldn't get outside of set boundaries. That didn't work so well, you could get outside of the box momentarily; while ME was running a loop to check if you were outside of the right boundary, you could go outside of the top boundaries or left one for a moment, only to be snapped back inside when it came around to check that position. Instead, I settled for a macro that first checks mouse position and then goes into a an infinate loop of setting the mouse position to that first one. Instead of a mouse trap, it's more of a mouse lock now. I'm not real sure if it'll be of any use, but I thought it might come in handy. <MOUSEPOS:T:07:08><REP3:08:000001:000001:0001:0:01:d><MMS2:7N,8N><MSD:1><ENDREP> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.