Ryusenko Posted February 8, 2014 Posted February 8, 2014 (edited) Hello everyone. I need help with a script. I want the script to [click left mouse button, wait(specified time), click left mouse button again] when i press a certain key. Right now the script does that one time, but it only clicks one time afterwards. Right now my script is this. Help please. #RequireAdmin #include <Misc.au3> $dll = DllOpen("user32.dll") While 1 Do Sleep(10) Until _IsPressed(39, $dll) Sleep(10) MouseClick("left") Sleep(1000) Send("{CTRLDOWN}") MouseClick("left") Send("{CTRLUP}") WEnd DllClose($dLL) Nevermind. I fixed it. Needed to put sleep longer. Edited February 8, 2014 by Ryusenko
l3ill Posted February 8, 2014 Posted February 8, 2014 Maybe this works better... untested: #RequireAdmin #include <Misc.au3> $dll = DllOpen("user32.dll") While 1 Sleep(10) WEnd If _IsPressed(39, $dll) Then Sleep(10) MouseClick("left") Sleep(1000) Send("{CTRLDOWN}") MouseClick("left") Send("{CTRLUP}") EndIf DllClose($dLL) My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
Solution l3ill Posted February 8, 2014 Solution Posted February 8, 2014 Or this will work for sure... #RequireAdmin HotKeySet("{F2}", "_func") ; HotKeySet uses F2 to start script change to whatever you want... While 1 Sleep(10) WEnd Func _func() Sleep(10) MouseClick("left") Sleep(1000) Send("{CTRLDOWN}") MouseClick("left") Send("{CTRLUP}") EndFunc ;==>_func My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
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