Jump to content

Moving Mouse, And Clicking.


Siiig
 Share

Recommended Posts

Hello, I was wondering if you guys could give me a hand.

Well im looking to make a script that moves the mouse to a certin place, then click the spot. What i have so far is these too commands.

MouseMove()

MouseClick()

Now i have two questiong, first, do i need anything after MouseClick()? (im looking for a left click). Also, how would i find the screen positions for MouseMove() and what format to they need to be in?

Link to comment
Share on other sites

After you read the help file you might just use MouseClick since it can move the mouse before the click.

As for finding the coordinates - look at the windows info tool that comes with the standard AutoIt install.

Start > Programs > AutoIt v3 > AutoIt Window Info

Be sure to explore the settings under "Options".

Another way to find the coordinates is to use a little script like this:

AutoItSetOption("MouseCoordMode", 1)
AutoItSetOption("TrayIconDebug", 1)

HotKeySet("{PAUSE}", "Terminate")

While 1
    $pos = MouseGetPos()
    ToolTip("Desktop X: " & $pos[0] & ", " & "Desktop Y: " & $pos[1] & " Pause2exit")
    Sleep(10)
WEnd

Func Terminate()
    ClipPut('MouseClick("left",' & $pos[0] & ',' & $pos[1] & ',1,1); wrt DESKTOP')
    Exit
EndFunc  ;==>Terminate
Run the code above and see what you get.

[it was copied from someone else in the forum...]

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

auto-it has a "Autoit Window Info" program, that automaticaly tells you the co-ords of your mouse, aswell as other info.... lol very easy and idiot-proof

I think that I mentioned that:

As for finding the coordinates - look at the windows info tool that comes with the standard AutoIt install.

Start > Programs > AutoIt v3 > AutoIt Window Info

Be sure to explore the settings under "Options".

...but I would say the there are several idiots (including me) that did not discover the "Coord Mode" on the first day of use and that messed me up for a while.

...besides, the code in my other post writes the line of code for you. :-)

One improvement on that code would be to display all 3 "Coord Modes" with a different hotkey for each.

[size="1"][font="Arial"].[u].[/u][/font][/size]

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