TRK Posted June 22, 2010 Share Posted June 22, 2010 (edited) I want to use the _MouseTrap function to center the mouse in the middle of my screen and then use sleep to let it move for 1 second. Possible? Note that this is part of an existing script, so sleep cannot interfere with the rest of it. Edited June 22, 2010 by TRK Link to comment Share on other sites More sharing options...
AlmarM Posted June 22, 2010 Share Posted June 22, 2010 You want to move the mouse to the center of the screen and then move it for 1 seconds? Or do you want it to move it to the center of the screen and stop letting the user move it? Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
TRK Posted June 22, 2010 Author Share Posted June 22, 2010 I want the mouse in the center of my screen at all times, with 1 second to move it AWAY from the center of the screen before it moves BACK For example, simply _MouseTrap (Whatever center of screen coords are) Sleep (1000) REPEAT UNTIL FOREVER? Link to comment Share on other sites More sharing options...
AlmarM Posted June 22, 2010 Share Posted June 22, 2010 Something like this? HotKeySet("{ESC}", "_Exit") Global $Timer = TimerInit() While 1 If (TimerDiff($Timer) >= 1000) Then MouseMove(@DesktopWidth / 2, @DesktopHeight / 2, 0) $Timer = TimerInit() EndIf Sleep(20) WEnd Func _Exit() Exit EndFunc Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
TRK Posted June 22, 2010 Author Share Posted June 22, 2010 Ill see if I can work with this, thank you. But Im more specifically trying to get it to work with the Mousetrap function. 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