Alexis Posted March 19, 2012 Report Share Posted March 19, 2012 Is it possible to let a macro wait for the mouse starting to move? Thank You Alexandra Quote Link to comment Share on other sites More sharing options...
Cory Posted March 19, 2012 Report Share Posted March 19, 2012 I don't know o any "wait for" commands but you could create a loop with a small delay that gets the mouse coordinates and advances only when the coordinates change. Quote Link to comment Share on other sites More sharing options...
Alexis Posted March 19, 2012 Author Report Share Posted March 19, 2012 Yeah, that is what i did already: Comparing old with new mouse coordinates. Somehow it crashs all the time. I tried Repeat until and also If Then checks within the loop. Thank You Alexandra Quote Link to comment Share on other sites More sharing options...
paul Posted March 19, 2012 Report Share Posted March 19, 2012 This is what I do in a macro which is only called by other macros. It displays a countdown message ("sleeping in n seconds") where n reduces by 1 each second. If any mouse movement is detected, the macro stops since I don't want to put the computer to sleep if I'm using it. n91 is preinitialized to 10. Text Box Display: Pausing Get Mouse Position into (%nMouseX1%, %nMouseY1%) Relative to Screen Repeat Until %n[91]% Equals "0" Delay: 1 seconds Get Mouse Position into (%nMouseX2%, %nMouseY2%) Relative to Screen If Variable %nMouseX1% Does not Equal "%nMouseX2%" Or If Variable %nMouseY1% Does not Equal "%nMouseY2%" Macro Stop Else If Window "Pausing" is running Variable Modify Integer %n[91]%: Decrement Else Macro Stop End If End If Update Textbox: Pausing End Repeat Quote Link to comment Share on other sites More sharing options...
Alexis Posted March 20, 2012 Author Report Share Posted March 20, 2012 Thanks Paul, Cory BTW did you know the command Get the Idle Time in the Variable Set Integer command already? Get the Idle Time Get the Idle Time calculates the computer idle time and saves the value to a variable. The idle time is specified as no mouse or keyboard activity occurring. The amount of time since the last mouse event or keyboard activity is saved to the Integer variable. The value is saved in time increments of seconds. Thank You Alexandra Quote Link to comment Share on other sites More sharing options...
paul Posted March 20, 2012 Report Share Posted March 20, 2012 BTW did you know the command Get the Idle Time in the Variable Set Integer command already? No, I didn't know that. Thanks for sharing. Quote Link to comment Share on other sites More sharing options...
Cory Posted March 20, 2012 Report Share Posted March 20, 2012 I knew that but you said mouse movement and idle time is based on multiple things. Also in my experience some programs can reset the idle time counter with no user input. 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.