Jump to content

Mouse Get Cursor?


kforsey
 Share

Recommended Posts

Retrieves the current position of the mouse cursor.

$array[0] = X coord (horizontal)

$array[1] = Y coord (vertical)

$pos = MouseGetPos ( )

Msgbox(0,"Mouse Positions","X: " & $pos[0] & " Y: " & $pos[1])
Edited by burrup

qq

Link to comment
Share on other sites

CaretCoordMode Sets the way coords are used in the caret functions, either absolute coords or coords relative to the current active window:

0 = relative coords to the active window

1 = absolute screen coordinates (default)

2 = relative coords to the client area of the active window

Opt("CaretCoordMode", 1)       ;1=absolute, 0=relative

qq

Link to comment
Share on other sites

the below waits until u have clicked the left mouse button then saves it to an ini file ... working in second problem now

While 1
   If _Ispressed('01') = 1 Then
      $pos = MouseGetPos ( )
      IniWrite ( "Mouse Co-ordinates.ini", "Mouse Co-ordinates", "X",$pos[0])
      IniWrite ( "Mouse Co-ordinates.ini", "Mouse Co-ordinates", "Y",$pos[1])
      Msgbox(0,"Mouse Positions","X: " & $pos[0] & " Y: " & $pos[1] & " have been save to Mouse Co-Ordinates.ini")
      Exit
   EndIf
Wend

Func _IsPressed($hexKey)
   Local $aR
   $hexKey = '0x' & $hexKey
   $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey)
   If Not @error And BitAND($aR[0],0x8000) = 0x8000 Then Return 1
   Return 0
EndFunc
Edited by burrup

qq

Link to comment
Share on other sites

i used this to click on a different window .. i tested it on "Halo" the game.... i have Sleep(5000) there so i have enought time to switch the "Halo" .. its full screen game .... and it clicked in the coordinates i sed ... it doesnt move but .. like if u do it one the desktop the mouse glides across the screen .. if u do it in "halo" it clicks instantly .. hope that helps

Opt("CaretCoordMode", 0)
Sleep(5000)
MouseClick("left", 10, 10, 1,20)

qq

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