Jump to content
Sign in to follow this  
kforsey

Mouse Get Cursor?

Recommended Posts

Where do i find this mouse get cursor that show me the location of the mouse? Please help me, I cant seem to find it anywhere. HELP ME!! :lmao:

Edited by kforsey

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Ok well that works, but lets just say... That i was trying to make it work in a game and not on desktop. The co-ordinates it gives me ingame are different then the actual ones. Anyone know what to do?

Share this post


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

Share this post


Link to post
Share on other sites

Thanks for your help i really appreciate it but lets say i wanted to move my curor MouseClick("left", 500, 500) in the caret mode thing. How would i write that?

Share this post


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

Share this post


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

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...