Jump to content
bioloyx

How do you get the mouse coordinates?

Recommended Posts

bioloyx

I'm sorry for my lack of knowledge, but I don't know how...

Thanks in advance.

Share this post


Link to post
Share on other sites
Ace08

well that depends on how you intend to use the coordiantes rogue5099 already gave what you need or is it not?

$MousePos = MouseGetPos()
$MousePos[0] ; Mouse X position
$MousePos[1] ; Mouse Y position 
msgbox(0,"Debug","Cursor located at " & $MousePos[0] & "," & $MousePos[1])
Edited by Ace08

Work smarter not harder.My First Posted Script: DataBase

Share this post


Link to post
Share on other sites
wakillon

I'm sorry for my lack of knowledge, but I don't know how...

Thanks in advance.

Be serious !

when i paste "coordinates" in the search Tab of AutoIt help file, i find :

MouseGetPos,

_WinAPI_GetMousePos

_WinAPI_GetMousePosX

_WinAPI_GetMousePosY

with examples !


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
CODEXTRM

I think what he is asking is  , Picture a grid on your screen and move the  cursor  to any spot on monitor HOW will he know what Cord to enter in his script . kinda like a road map looking for the cord of a st or an ave

 

Share this post


Link to post
Share on other sites
aa2zz6

AutoIt has a built in application that allows the user to find x and y coordinates. See picture below. 

Another option is to use this script that displays the coordinates of where the cursor is click on the computer.

#include <Misc.au3>

HotKeySet("{END}", "_Quit") ; Hit "END" to quit

$dll = DllOpen("user32.dll")
While 1
    If _IsPressed("01", $dll) Then
        $avMousePos = MouseGetPos()
        ToolTip("x = " & $avMousePos[0] & "  y = " & $avMousePos[1])
    EndIf
WEnd

Func _Quit()
    DllClose($dll)
    Exit
EndFunc   ;==>_Quit

And if you want to move the mouse to a certain location and then reset the cursor back in the original position then you can use this piece of code.

Sleep(3000)
$pos=MouseGetPos()
MouseClick("left",200,200,1,0)
MouseMove($pos[0],$pos[1],0)

 Feel free to browse the forums!

AutoIt WinInfo.png

  • Like 1

Share this post


Link to post
Share on other sites
InunoTaishou

Hopefully your post will back to the year 2011 and answer OP's question lmfao

Share this post


Link to post
Share on other sites
aa2zz6

#backtothefuture #backtothefuture2

Someone will see the post and find it useful. Lol

Edited by aa2zz6
  • Like 1

Share this post


Link to post
Share on other sites
Wrackz

i did thanks a lot.

 

Share this post


Link to post
Share on other sites
Wrackz
Just now, Jos said:

meaning what exactly?

fumbled  but was answering to aa2zz6 :)

Gave me a good idea for my script

Share this post


Link to post
Share on other sites
xCROv

This post is old enough to be in school at this point lol. :lol:

Share this post


Link to post
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

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.