ashley Posted September 25, 2007 Share Posted September 25, 2007 (edited) i want to so it will constantly click but if ESC is pressed i want it to exit. #include <GUIConstants.au3> #include <Misc.au3> $dll = DllOpen("user32.dll") #Region ### START Koda GUI section ### Form= $GUI = GUICreate("AutoClicker - AGRORS", 229, 56, 303, 219) GUISetIcon("D:05.ico") $Input1 = GUICtrlCreateInput("Click every", 8, 16, 65, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $Input2 = GUICtrlCreateInput("1000", 80, 16, 41, 21) $Input3 = GUICtrlCreateInput("ms", 128, 16, 33, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $Start = GUICtrlCreateButton("Start", 168, 8, 51, 41, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE DllClose($dll) Exit Case $Start While 1 If _IsPressed("{esc}", $dll) Then Exit EndIf $read = GUICtrlRead($Input2) MouseClick("Left") Sleep($read) Wend EndSwitch WEnd Edited September 25, 2007 by ashley Free icons for your programs Link to comment Share on other sites More sharing options...
Monamo Posted September 25, 2007 Share Posted September 25, 2007 (edited) i want to so it will constantly click but if ESC is pressed i want it to exit. #include <GUIConstants.au3> #include <Misc.au3> $dll = DllOpen("user32.dll") #Region ### START Koda GUI section ### Form= $GUI = GUICreate("AutoClicker - AGRORS", 229, 56, 303, 219) GUISetIcon("D:05.ico") $Input1 = GUICtrlCreateInput("Click every", 8, 16, 65, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $Input2 = GUICtrlCreateInput("1000", 80, 16, 41, 21) $Input3 = GUICtrlCreateInput("ms", 128, 16, 33, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $Start = GUICtrlCreateButton("Start", 168, 8, 51, 41, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE DllClose($dll) Exit Case $Start While 1 If _IsPressed("{esc}", $dll) Then Exit EndIf $read = GUICtrlRead($Input2) MouseClick("Left") Sleep($read) Wend EndSwitch WEnd Two things: 1st, _IsPressed should be looking for "1B" (the value that matches the ESC key). 2nd, I think it's just a matter of the Sleep() delay... If you set the 1B and then hit the key like mad, it will stop - but basically you're trying to fit your keypress within that micro-moment between Sleep() cycles. I'd suggest using HotKeySet() instead. Hope that helps Edited September 25, 2007 by Monamo - MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup] Link to comment Share on other sites More sharing options...
JBeef Posted September 25, 2007 Share Posted September 25, 2007 (edited) okey smokey. this with "uh oh" written on it. maybe - #include <GUIConstants.au3> HotKeySet("{ESC}","goobye") $GUI = GUICreate("AutoClicker - AGRORS", 229, 56, 303, 219) GUISetIcon("D:05.ico") $Input1 = GUICtrlCreateInput("Click every", 8, 16, 65, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $Input2 = GUICtrlCreateInput("1000", 80, 16, 41, 21) $Input3 = GUICtrlCreateInput("ms", 128, 16, 33, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $Start = GUICtrlCreateButton("Start", 168, 8, 51, 41, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Start While 1 $read = GUICtrlRead($Input2) MouseClick("Left") Sleep($read) Wend EndSwitch WEnd Func goobye() Exit EndFuncbut watch out for crazy. ~Jap Edited September 25, 2007 by JBeef Link to comment Share on other sites More sharing options...
narayanjr Posted September 25, 2007 Share Posted September 25, 2007 If _IsPressed("1b", $dll) Then Link to comment Share on other sites More sharing options...
ashley Posted September 25, 2007 Author Share Posted September 25, 2007 okey smokey. this with "uh oh" written on it. maybe - #include <GUIConstants.au3> HotKeySet("{ESC}","goobye") $GUI = GUICreate("AutoClicker - AGRORS", 229, 56, 303, 219) GUISetIcon("D:05.ico") $Input1 = GUICtrlCreateInput("Click every", 8, 16, 65, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $Input2 = GUICtrlCreateInput("1000", 80, 16, 41, 21) $Input3 = GUICtrlCreateInput("ms", 128, 16, 33, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $Start = GUICtrlCreateButton("Start", 168, 8, 51, 41, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Start While 1 $read = GUICtrlRead($Input2) MouseClick("Left") Sleep($read) Wend EndSwitch WEnd Func goobye() Exit EndFuncbut watch out for crazy. ~Jap thanks m8 Free icons for your programs Link to comment Share on other sites More sharing options...
aslani Posted September 25, 2007 Share Posted September 25, 2007 I was thinking that instead of While...WEnd, why not Do...Until? But HotKeySet() is better. [font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version 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