Jump to content

_MouseWrap Function


erifash
 Share

Recommended Posts

Thanks to ezzetabi's _MouseTrap function topic for the idea!

Just some cool piece of code I put together in less than five minutes...

Func _MouseWrap()
  While 1
    $pos = MouseGetPos()
    If $pos[0] < 2 Then MouseMove(@DeskTopWidth - 2, $pos[1], 1)
    If $pos[0] > @DeskTopWidth - 2 Then MouseMove(2, $pos[1], 1)
    If $pos[1] < 2 Then MouseMove($pos[0], @DesktopHeight - 2, 1)
    If $pos[1] > @DeskTopHeight - 2 Then MouseMove($pos[0], 2, 1)
  Wend
EndFunc

Any comments/questions would be greatly appreciated!

Link to comment
Share on other sites

I usually use Sleep(10) but it really dosen't matter. I remember a BIG debate about that awile ago.

Func _MouseWrap()
  While 1
    $pos = MouseGetPos()
    If $pos[0] < 2 Then MouseMove(@DeskTopWidth - 2, $pos[1], 1)
    If $pos[0] > @DeskTopWidth - 2 Then MouseMove(2, $pos[1], 1)
    If $pos[1] < 2 Then MouseMove($pos[0], @DesktopHeight - 2, 1)
    If $pos[1] > @DeskTopHeight - 2 Then MouseMove($pos[0], 2, 1)
    Sleep(1)
  Wend
EndFunc
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...