Arnol5 Posted December 29, 2013 Share Posted December 29, 2013 Can i make my mouse move when the X and Y coordinates remain the same for a cetain moment. I have no Idea how i can put this in some kind of script laguage If mousePosition = for certain thime Then ... Thank in advance Link to comment Share on other sites More sharing options...
JohnOne Posted December 29, 2013 Share Posted December 29, 2013 While...Wend loop MouseGetPos() function If...Else...Then condition MouseMove() function AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Arnol5 Posted December 29, 2013 Author Share Posted December 29, 2013 So i have a bunch of If and else functions insida a wile function in my script but when my program freezes my mouse won't move. So than the mouse has to restart the program. But i don't seem to get how i have to put the time indication and sutch. MouseGetPos () If $array[0] And $array[1] = $array[0] And $array[1] for 500 Then MouseMove($array[0]-50,$array[1]-100) MouseClick($array[0]-50,$array[1]-100) ... ... ... Link to comment Share on other sites More sharing options...
Solution Morthawt Posted December 29, 2013 Solution Share Posted December 29, 2013 Global $Previous, $Current ; create these variables to begin with While 1 ; Do this forever $Current = MouseGetPos(0) & 'x' & MouseGetPos(1) ; Put the current mouse coordinates into the $Current variable If $Previous = $Current Then ; If the $Previous recorded location matches the current one then... MouseMove((@DesktopWidth / 2), (@DesktopHeight / 2) + 20, 2) ; Move the mouse to the middle of the screen, 20 pixle down MouseMove((@DesktopWidth / 2), (@DesktopHeight / 2), 2) ; Move the mouse to the middle of the screen. ConsoleWrite('Moved the mouse due to inactivity' & @CRLF) ; Write to the console view at the bottom of Scite editor when it moves the mouse. EndIf $Previous = MouseGetPos(0) & 'x' & MouseGetPos(1) ; Set the previous mouse to what it is after it was moved by the program. Sleep(5000) ; 5 seconds (5000 milliseconds)to wait before checking WEnd Arnol5 1 Free and easy Autoit scripting video tutorials (plus more videos always coming!) General video tutorials, especially correct and safe TeamSpeak permissions tutorials. Link to comment Share on other sites More sharing options...
Morthawt Posted December 29, 2013 Share Posted December 29, 2013 Also, if you want help with learning Autoit, if you click the link under my posts in the signature area you will get access to youtube videos I have made that cover the basics of how to get started. I have had good feedback on them also, so feel free to check those out. Free and easy Autoit scripting video tutorials (plus more videos always coming!) General video tutorials, especially correct and safe TeamSpeak permissions tutorials. Link to comment Share on other sites More sharing options...
Arnol5 Posted December 29, 2013 Author Share Posted December 29, 2013 It took me a while to get your script working in my script. But i works like a charm now. i'll definitely check out your video's !! Thanks again for the fast and helpful respons Link to comment Share on other sites More sharing options...
Morthawt Posted December 29, 2013 Share Posted December 29, 2013 No problem. Autoit is a fantastic language to code in. Free and easy Autoit scripting video tutorials (plus more videos always coming!) General video tutorials, especially correct and safe TeamSpeak permissions tutorials. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now