Null33 Posted August 1, 2012 Share Posted August 1, 2012 Hi, first of all sorry for my english . I want to make a counter of the left mouse button and I want that it is ever active until I press the Stop button and I want that a Label shows the numbers of clicks. I write this: #include #include Global $clicks $clicks=1 $Form1 = GUICreate("Form1", 251, 134, -1, -1) $Label1 = GUICtrlCreateLabel("Number = ", 24, 8, 196, 25) $Button1 = GUICtrlCreateButton("Active", 24, 56, 201, 25, 0) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button1 _Func1() EndSwitch WEnd Func _Func1() While 1 If _IsPressed(01) Then GUICtrlSetData($Label1, "Number = " & $clicks) EndIf if _IsPressed(01) Then $clicks+=1 While _IsPressed(01) Sleep(1) WEnd EndIf WEnd EndFunc I don't know how to terminate it, and if I add MouseClick("left",x,x,x,x) it doesn't count the click of the mouse. I want add this function in an AutoClick of the left button of the mouse, so I want to know how many times the left button is clicked. I don't know if you understand Sorry again for my english. Thanks Link to comment Share on other sites More sharing options...
JohnOne Posted August 1, 2012 Share Posted August 1, 2012 You can use a hotkey to terminate, or close the gui. MouseClick(blah) $clicks += 1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Null33 Posted August 1, 2012 Author Share Posted August 1, 2012 I don't know why but it doesn't count the click of MouseClick, there is an other way to count the click? Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 1, 2012 Moderators Share Posted August 1, 2012 Hi, Null33. Posting your code seems to have stripped which files you're including, but you have only two, when you need three. You need GUIConstantsEX.au3 and WindowsConstants.au3 to create the GUI, and Misc.au3 for the _IsPressed function. When I include all three of these files, the code you have works and counts the mouse clicks just fine. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Null33 Posted August 1, 2012 Author Share Posted August 1, 2012 Problem solved ... thanks to all in particular thank JohnOne 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