ziiion Posted December 15, 2004 Share Posted December 15, 2004 (edited) hi im tryin to test this codes but i got stuck on this i got it to work after 30min =) but now i get the same mouse coordinates every time i click how can i do to make it show updated coordinates of the mouse . :"> im trying to make a Script that captures the mouse click on window A and does it to another window B ... this were im at =) thanx in advance While 1 If _IsPressed('1b') = 1 Then Exit;1b is ESC If _IsPressed('01') = 1 Then $pos = MouseGetPos() MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1]) Sleep(1) Wend Exit Func _IsPressed($hexKey);no need changing ; $hexKey must be the value of one of the keys. ; _IsPressed will return 0 if the key is not pressed, 1 if it is. Local $aR, $bRv;,$hexKey $hexKey = '0x' & $hexKey $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey) ;If $aR[0] = -32767 Then If $aR[0] <> 0 Then $bRv = 1 Else $bRv = 0 EndIf Return $bRv EndFunc ;==>_IsPressed Edited December 15, 2004 by ziiion Link to comment Share on other sites More sharing options...
killaz219 Posted December 15, 2004 Share Posted December 15, 2004 (edited) While 1 If _IsPressed('1b') = 1 Then Exit;1b is ESC If _IsPressed('01') = 1 Then $pos = MouseGetPos() MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1]) EndIf Sleep(1) Wend Exit Func _IsPressed($hexKey);no need changing ; $hexKey must be the value of one of the keys. ; _IsPressed will return 0 if the key is not pressed, 1 if it is. Local $aR, $bRv;,$hexKey $hexKey = '0x' & $hexKey $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey) ;If $aR[0] = -32767 Then If $aR[0] <> 0 Then $bRv = 1 Else $bRv = 0 EndIf Return $bRv EndFunc;==>_IsPressed In you code the Then $pos = mousegetpos is the only thing the if statement preformed so it kept just going onto the msgbox Edited December 15, 2004 by killaz219 Link to comment Share on other sites More sharing options...
pcdestroyer Posted December 16, 2004 Share Posted December 16, 2004 func ReportClick() $pos = MouseGetPos() MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1]) endfunc While 1 If _IsPressed('1b') = 1 Then Exit;1b is ESC If _IsPressed('01') = 1 Then ReportClick() Sleep(1) endif Wend Exit Func _IsPressed($hexKey);no need changing ; $hexKey must be the value of one of the keys. ; _IsPressed will return 0 if the key is not pressed, 1 if it is. Local $aR, $bRv;,$hexKey $hexKey = '0x' & $hexKey $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey) ;If $aR[0] = -32767 Then If $aR[0] <> 0 Then $bRv = 1 Else $bRv = 0 EndIf Return $bRv EndFunc ;==>_IsPressed try this just needed a little function and it works enjoy Link to comment Share on other sites More sharing options...
ziiion Posted December 16, 2004 Author Share Posted December 16, 2004 func ReportClick() $pos = MouseGetPos() MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1])endfuncWhile 1 If _IsPressed('1b') = 1 Then Exit;1b is ESC If _IsPressed('01') = 1 Then ReportClick() Sleep(1) endif WendExitFunc _IsPressed($hexKey);no need changing ; $hexKey must be the value of one of the keys. ; _IsPressed will return 0 if the key is not pressed, 1 if it is. Local $aR, $bRv;,$hexKey $hexKey = '0x' & $hexKey $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey) ;If $aR[0] = -32767 Then If $aR[0] <> 0 Then $bRv = 1 Else $bRv = 0 EndIf Return $bRvEndFunc ;==>_IsPressedtry this just needed a little function and it works enjoy<{POST_SNAPBACK}>thx so much i just got in from work =) that will help me understand this and now i can move on with the script 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