Trevor Posted January 18, 2013 Share Posted January 18, 2013 Total AutoIt noob here ... I'm not looking for a fully automated script just yet. My intention is to write a script that will allow my mouse button to click initially and then repeat at a given interval until the mouse button is released. This way I can hold the mouse button down and the script will do the timing for me until I release the click. Any help is appreciated, even just pointing me in the right direction. Link to comment Share on other sites More sharing options...
guinness Posted January 18, 2013 Share Posted January 18, 2013 Just a quick question, why do you require such a script? What's its usage? UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Trevor Posted January 18, 2013 Author Share Posted January 18, 2013 Repetitive tasks that require multiple mouse-clicks. As much as I am working with my PC I'd like a way to not have to click...click...click any more. Just one click set to an interval if I hold the click, or just one click if I click. Simplifying this small task would be a huge help in daily tasks. Link to comment Share on other sites More sharing options...
Trevor Posted January 19, 2013 Author Share Posted January 19, 2013 Any help would be appreciated! Link to comment Share on other sites More sharing options...
Trevor Posted January 22, 2013 Author Share Posted January 22, 2013 Still looking for a simple way to simplify a delayed mouse click ... I didn't think it would be this difficult. Link to comment Share on other sites More sharing options...
JohnOne Posted January 22, 2013 Share Posted January 22, 2013 In 3 days, have you tried anything? 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...
careca Posted January 22, 2013 Share Posted January 22, 2013 Still looking for a simple way to simplify a delayed mouse click ... I didn't think it would be this difficult.If you search in the help file, i trust youll find something, then, when you have doubts, come back and state them. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
Mat Posted January 22, 2013 Share Posted January 22, 2013 Detecting the first mouse click is trickier than it sounds. The easiest approach is to make a loop, and use the _IsPressed function to see if the mouse button is pressed. Once that's done, then take a look at MouseClick and AdlibRegister. Here's something to get you started. The main loop requires a bit of thinking. If you can figure out what the loop is actually doing and when the variables will be set/unset then you can probably understand most of all programming logic. #include <Misc.au3> Local $fClicking = False ; This variable will store whether we are doing the auto-clicking Local $fPressed = False ; Another variable, will store whether the mouse button was pressed last iteration of the loop While 1 If $fClicking Then If _IsPressed("01") Then $fPressed = True Elseif $fPressed Then $fPressed = False $fClicking = False AdlibUnRegister("ClickFunction") EndIf Else If _IsPressed("01") Then $fPressed = True ElseIf $fPressed Then ; The mouse was pressed, but is now released $fClicking = True $fPressed = False AdlibRegister("ClickFunction", 1000) EndIf EndIf Sleep(10) ; If you don't sleep in a tight loop like this, your cpu will be very high WEnd Func ClickFunction() MouseClick("left") EndFunc ;==>ClickFunction Trevor 1 AutoIt Project Listing Link to comment Share on other sites More sharing options...
Trevor Posted January 22, 2013 Author Share Posted January 22, 2013 Detecting the first mouse click is trickier than it sounds. The easiest approach is to make a loop, and use the _IsPressed function to see if the mouse button is pressed. Once that's done, then take a look at MouseClick and AdlibRegister. Here's something to get you started. The main loop requires a bit of thinking. If you can figure out what the loop is actually doing and when the variables will be set/unset then you can probably understand most of all programming logic. #include <Misc.au3> Local $fClicking = False ; This variable will store whether we are doing the auto-clicking Local $fPressed = False ; Another variable, will store whether the mouse button was pressed last iteration of the loop While 1 If $fClicking Then If _IsPressed("01") Then $fPressed = True Elseif $fPressed Then $fPressed = False $fClicking = False AdlibUnRegister("ClickFunction") EndIf Else If _IsPressed("01") Then $fPressed = True ElseIf $fPressed Then ; The mouse was pressed, but is now released $fClicking = True $fPressed = False AdlibRegister("ClickFunction", 1000) EndIf EndIf Sleep(10) ; If you don't sleep in a tight loop like this, your cpu will be very high WEnd Func ClickFunction() MouseClick("left") EndFunc ;==>ClickFunction I appreciate the heads up on this, I have been reading through the help file to no avail. This is all new to me and every time I write something it just takes off on its own until I end the script. I didn't expect anyone to do all of the work, just give a little help and point me in the right direction. This helped a lot! Thanks a million! Link to comment Share on other sites More sharing options...
Mat Posted January 22, 2013 Share Posted January 22, 2013 I appreciate the heads up on this, I have been reading through the help file to no avail. This is all new to me and every time I write something it just takes off on its own until I end the script.I didn't expect anyone to do all of the work, just give a little help and point me in the right direction.This helped a lot!Thanks a million!I did the easy bit: writing it. It's up to you to understand it (which is not as easy as it sounds).And also my pseudo code usually ends up as AutoIt code anyway. Unsure if that's a good or a bad thing yet. AutoIt Project Listing Link to comment Share on other sites More sharing options...
guinness Posted January 22, 2013 Share Posted January 22, 2013 And also my pseudo code usually ends up as AutoIt code anyway. Unsure if that's a good or a bad thing yet.Is it pseudo code anymore? hmm ... there's pause for thought. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 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