#comments-start AutoClicker.au3 v1.0.0 small random delay auto clicker program with GUI, made with AutoIt changelog 1.0.0 - 2019-02-16 -initial release #comments-end #include #include GUICreate("AutoClicker", 440, 130) Opt("GUICoordMode", 0) GUICtrlCreateGroup("Settings", 10, 10, 180, 110) GUICtrlCreateLabel("Click interval:", 10, 22) GUICtrlCreateLabel("Click amount:", 0, 22) GUICtrlCreateLabel("Random delay:", 0, 22) Global $clickInterval = GUICtrlCreateInput ("0.5", 75, -45, 35) Global $clickAmountInput = GUICtrlCreateInput ("5", 0, 22, 35) Global $randomDelay = GUICtrlCreateInput ("0.3", 0, 22, 35) GUICtrlCreateLabel("seconds", 40, -42) GUICtrlCreateLabel("times", 0, 22) GUICtrlCreateLabel("seconds", 0, 22) Opt("GUICoordMode", 1) GUICtrlCreateGroup("Instructions", 195, 10, 230, 110) GUICtrlCreateLabel("• Script left-clicks at set intervals" & @CRLF & "• Enter 0 to click amount for infinite clicker" & @CRLF & "• Random delay is added between clicks"& @CRLF & "• Enter 0 to random delay to disable it" & @CRLF & "• Press F9 to start clicking, F10 to stop" & @CRLF & "• Press ESC to exit program" , 205, 25, 210, 80) GUISetState() Func myExit() exit EndFunc Func idle() While 1 If GUIGetMsg() = $GUI_EVENT_CLOSE Then exit EndIf sleep(50) WEnd EndFunc Func click() Local $clickIntervalMs = Number(GUICtrlRead($clickInterval)) * 1000 Local $clickAmount = Number(GUICtrlRead($clickAmountInput)) Local $randomDelayMs = Number(GUICtrlRead($randomDelay)) * 1000 Local $clicks = 0 While 1 If $clickAmount <> 0 And $clicks > $clickAmount Then ExitLoop Else MouseClick($MOUSE_CLICK_LEFT) $clicks += 1 sleep($clickIntervalMs + Random(0, $randomDelayMs, 1)) EndIf WEnd idle() EndFunc HotkeySet ("{F9}", click) HotkeySet ("{F10}", idle) HotkeySet ("{ESC}", myExit) idle()