gottygolly Posted April 1, 2014 Share Posted April 1, 2014 (edited) It's working fine but I just want to make it go faster without it being so jumpy (skipping pixels) and I just don't how to do it, hopefully someone else does. Thanks. #include<misc.au3> Func exits() Exit EndFunc while 1 Sleep(100) HotKeySet("{F1}","exits") If _IsPressed("25") Then ;left $mouse_pos = MouseGetPos() $lx = $mouse_pos[0] - 2 ;$ly = $mouse_pos[1] + 5 MouseMove($lx,$mouse_pos[1],1) EndIf If _IsPressed("26") Then ;up $mouse_pos = MouseGetPos() ;$lx = $mouse_pos[0] - 5 $ly = $mouse_pos[1] - 2 MouseMove($mouse_pos[0],$ly,1) EndIf If _IsPressed("27") Then ;right $mouse_pos = MouseGetPos() $lx = $mouse_pos[0] + 2 ;$ly = $mouse_pos[1] + 5 MouseMove($lx,$mouse_pos[1],1) EndIf If _IsPressed("28") Then ;down $mouse_pos = MouseGetPos() ;$lx = $mouse_pos[0] - 5 $ly = $mouse_pos[1] + 2 MouseMove($mouse_pos[0],$ly,1) EndIf WEnd Edited April 1, 2014 by gottygolly Link to comment Share on other sites More sharing options...
Geir1983 Posted April 2, 2014 Share Posted April 2, 2014 The sleep(100) tells your script to pause for 100ms. This makes it exectue around 10 times every second. If you reduce the sleep to 10 it would execute 100 times each second instead. For each execution you move the mouse 2 pixels at the time ($mouse_pos[0] - 2). you can also play around with this, if you reduce/increase it will move the mouse a different amount of pixels for each execution. Link to comment Share on other sites More sharing options...
gottygolly Posted April 2, 2014 Author Share Posted April 2, 2014 I failed to realize that the Sleep(100) was affecting the whole script. I played around with the pixel move and 2 seems to be the best. Thanks. 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