nnm Posted November 9, 2004 Share Posted November 9, 2004 I need auto click left mouse button ON when left mouse button pressed, and OFF when released i try to do it, it starts clicking, but dont sets OFF... expandcollapse popup;AutoItSetOption("MustDeclareVars", 1) ;AutoItSetOption("MouseCoordMode", 0) ;AutoItSetOption("PixelCoordMode", 0) ;AutoItSetOption("RunErrorsFatal", 0) ;AutoItSetOption("TrayIconDebug", 0) AutoItSetOption("WinTitleMatchMode", 2) AutoItSetOption("MouseClickDelay", 3) While 1 If _IsPressed('01') = 1 Then $i = 0 While $i <= 10 MouseClick("left") wend Else If _IsPressed('01') = 0 Then while 1 sleep (10000) wend EndIf EndIf If _IsPressed('4e') = 1 Then MsgBox(0, '', 'Wow');4e is the N Sleep(10) Wend Exit Func _IsPressed($hexKey) ; $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 which i write wrong? Link to comment Share on other sites More sharing options...
nnm Posted November 9, 2004 Author Share Posted November 9, 2004 (edited) the API call in _IsPressed returns differently for different key (or mouse) states. You need a more robust function.Lar<{POST_SNAPBACK}>How can i do it? mb whith MouseDown("left") ?i try to do it but it not workcan any1 help me? Edited November 9, 2004 by nnm Link to comment Share on other sites More sharing options...
nnm Posted November 10, 2004 Author Share Posted November 10, 2004 (edited) oh, but I see your problem... you cannot send mouseclicks, when you are holding down the mouse button... perhaps you should use another button (middle) or a key to trigger auto clicking... I cannot figure a way to do your original request...Lar.edit: see, sending mouseclicks is the same as clicking the mouse button, so the button IS released, by the function call to MouseClick("left")... it is like saying, you want to press the mouse button down and automatically have it release the mouse button until you release the mouse button... isn't that absurd?<{POST_SNAPBACK}>no. its have statement which calls mouse button down or not. its dont depends on clicking of mouse button... hmm... can it call ingame procedure which will do same as uto clicks?for example in CS +attack...???hmm. no. Im wrong. winAPI have instanse which changes when mouse button down.and another statement which changes when mouse button up...so script must set ON as below and OFF when HARDWARE mouse button released Edited November 10, 2004 by nnm Link to comment Share on other sites More sharing options...
nnm Posted November 10, 2004 Author Share Posted November 10, 2004 as i think u can do mousedown("left") mouseclick("left", , 100) mouseup("left") Link to comment Share on other sites More sharing options...
nnm Posted November 10, 2004 Author Share Posted November 10, 2004 1st can i do this: When I press MOUSE1 AutoIt will click mouse3 repeatly When I release MOUSE1 AutoIt stop clicking mouse3? 2nd: mb any1 can help me with this?http://www.mentalis.org/apilist/mouse_event.shtml 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