Wraithmere Posted September 28, 2007 Share Posted September 28, 2007 Hi all, First post! Am trying to automate a repetitive task. When using creating blend, speckle and other effects in Photoshop and similar I'm often left clicking hundreds of times. I want to automate this by having the left mouse button click as fast as possible when held down. The script below works but left clicking is not yet being toggled by mousedown (left). I've tried various methods of acheiving that but none have worked. WARNING - running this script as it is can result in uncontrollable left clicking! Script to date... HotKeySet("^+s","_Start") HotKeySet("^+p","_Pause") HotKeySet("^+e","_Terminate") ;Determine if user has swapped right and left mouse buttons $k = RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "SwapMouseButtons") ; It's okay to NOT check the success of the RegRead operation If $k = 1 Then $primary = "right" Else;normal (also case if could not read registry key) $primary = "left" EndIf While 1 Sleep(200) WEnd Exit Func _Start() While 1 MouseClick($primary) WEnd EndFunc Func _Pause() While 1 Sleep(200) WEnd EndFunc Func _Terminate() Exit EndFunc Link to comment Share on other sites More sharing options...
BrettF Posted September 28, 2007 Share Posted September 28, 2007 Hi all,First post! Am trying to automate a repetitive task. When using creating blend, speckle and other effects in Photoshop and similar I'm often left clicking hundreds of times. I want to automate this by having the left mouse button click as fast as possible when held down.The script below works but left clicking is not yet being toggled by mousedown (left). I've tried various methods of acheiving that but none have worked. WARNING - running this script as it is can result in uncontrollable left clicking! Script to date...HotKeySet("^+s","_Start")HotKeySet("^+p","_Pause")HotKeySet("^+e","_Terminate");Determine if user has swapped right and left mouse buttons$k = RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "SwapMouseButtons"); It's okay to NOT check the success of the RegRead operationIf $k = 1 Then $primary = "right"Else;normal (also case if could not read registry key) $primary = "left"EndIfWhile 1 Sleep(200)WEndExitFunc _Start()While 1 MouseClick($primary)WEndEndFuncFunc _Pause()While 1Sleep(200)WEndEndFuncFunc _Terminate()ExitEndFuncThere is nothing really wrong, with you code. Great job! Some problems I forsee could be exiting the click loop... I might work up a quick example of how i would do it later, and Ctrl+Shift+S is probably being used already as a hotkey. Try changing it to see if it works Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full 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