kforsey Posted February 23, 2005 Share Posted February 23, 2005 (edited) 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!! Edited February 23, 2005 by kforsey Link to comment Share on other sites More sharing options...
buzz44 Posted February 23, 2005 Share Posted February 23, 2005 (edited) 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 February 23, 2005 by burrup qq Link to comment Share on other sites More sharing options...
kforsey Posted February 23, 2005 Author Share Posted February 23, 2005 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? Link to comment Share on other sites More sharing options...
buzz44 Posted February 23, 2005 Share Posted February 23, 2005 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 More sharing options...
buzz44 Posted February 23, 2005 Share Posted February 23, 2005 u need the _IsPressed Function ... gimme a bit ill make code for u =) qq Link to comment Share on other sites More sharing options...
kforsey Posted February 23, 2005 Author Share Posted February 23, 2005 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? Link to comment Share on other sites More sharing options...
buzz44 Posted February 23, 2005 Share Posted February 23, 2005 (edited) 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 February 23, 2005 by burrup qq Link to comment Share on other sites More sharing options...
buzz44 Posted February 23, 2005 Share Posted February 23, 2005 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 More sharing options...
buzz44 Posted February 23, 2005 Share Posted February 23, 2005 anytime qq Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now