Jump to content

Move mouse from current position


Vzy
 Share

Recommended Posts

Hey, I'm a little puzzled here.

I'm trying to make a script where, you put the mouse at a position on the screen, then you press a button, and the cursor moves left from the current position.

Perhaps my explaining is a little confusing, I'll try this:

1 2 3 4
5 6 7 8

Say, I hold the cursor on "1", then press a button, and it auto moves to 2, right through to 8. Oh, and have it click on each one.

I would need to get the current position, then make the mouse movement go off that? That's what I'm trying to figure out.

This is my first time trying to make a script, I hope my explaining wasn't too bad :D

Link to comment
Share on other sites

Hey, I'm a little puzzled here.

I'm trying to make a script where, you put the mouse at a position on the screen, then you press a button, and the cursor moves left from the current position.

Perhaps my explaining is a little confusing, I'll try this:

1 2 3 4
5 6 7 8

Say, I hold the cursor on "1", then press a button, and it auto moves to 2, right through to 8. Oh, and have it click on each one.

I would need to get the current position, then make the mouse movement go off that? That's what I'm trying to figure out.

This is my first time trying to make a script, I hope my explaining wasn't too bad :D

HotKeySet("{NumPad0}", "ToTheRight")

While 1
    Sleep(100)
WEnd

Func ToTheRight()
    $OriginalX = MouseGetPos(0)
    $OriginalY = MouseGetPos(1)
    $MoveX = 50
    $MoveY = 0
    MouseMove($OriginalX + $MoveX, $OriginalY + $MoveY, 5)
    MouseClick("left", MouseGetPos(0), MouseGetPos(1), 1, 0)
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...