Jump to content

_MouseTrap


 Share

Recommended Posts

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
Link to comment
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.

Link to comment
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?
Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...