Jump to content

Click a spot then click a previous spot


 Share

Recommended Posts

I wrote a script that has been suiting my needs, but I was wondering if there is a way to modify it.

Basically what it does is this:

While 1
    Sleep(300)
    $var = PixelGetColor( 637, 446 )
    If $var = 0x55291B Then Send("{4}")
    If $var = 0x3B0C08 Then Send("{2}")
    If $var = 0x967928 Then Send("{9}")
    If $var = 0x7B0000 Then Send("{d}")
    If $var = 0x1C0500 Then Send("{5}")
    If $var = 0xF1CC7B Then Send("{0}")
    If $var = 0x4A292C Then Send("{a}")
    If $var = 0xCD5113 Then Send("{3}")
    If $var = 0xB597DA Then Send("{F3}")
    WEnd

I would like it to click a specific spot on the screen and then move the curse back to the location that it was before. I know how to make it click a spot on the screen but I am unsure if there is a way for it to move the cursor back to the spot it started at.

TIA

Link to comment
Share on other sites

$mousedata = MouseGetPos()

MouseClick("left", 5, 5)
MouseMove($mousedata[0], $mousedata[1])

Edit: If you want it to be instant then you can use this

$mousedata = MouseGetPos()

MouseClick("left", 5, 5, 1, 0)
MouseMove($mousedata[0], $mousedata[1], 0)
Edited by Hawkwing

The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

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...