Sign in to follow this  
Followers 0
TRK

_MouseTrap

5 posts in this topic

#1 ·  Posted (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 by TRK

Share this post


Link to post
Share on other sites



You want to move the mouse to the center of the screen and then move it for 1 seconds? :mellow:

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Ill see if I can work with this, thank you. But Im more specifically trying to get it to work with the Mousetrap function.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0