Skip to content

Commit

Permalink
Fixed slow clicking bug, new features: 1. Clicking types either singl…
Browse files Browse the repository at this point in the history
…e or double, 2. You can set the clicking interval in seconds.
  • Loading branch information
zSynctic committed Sep 3, 2022
1 parent 49187dc commit 0e70aaf
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 14 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Synctic

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
# AutoClicker
A simple AutoClicker that has the ability to autoclick and hold the mouse down

A simple AutoClicker that can automatically click the mouse so fast and hold the mouse button down <br />

The new version has a new feature that lets you choose which mouse button to click!

# Features

1. Fast autoclicking
2. Free and Open Source <br />
3. Choose between which mouse button to click as <br />
4. Hold the mouse button down 5. No advertisements
5. Convenient - Hotkey works while application is in background <br />
6. Simple Clean and modern interface
83 changes: 70 additions & 13 deletions autoclicker.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import pyautogui
import customtkinter
import threading
import pydirectinput

customtkinter.set_appearance_mode("black")
customtkinter.set_default_color_theme("blue")
Expand All @@ -13,6 +12,7 @@
holdm_key = Key.f6

button1 = "left"
clicktype = "Single"

pause = False

Expand All @@ -23,7 +23,7 @@ class App(customtkinter.CTk):
auto1 = False

WIDTH = 300
HEIGHT = 500
HEIGHT = 510

def __init__(self):
super().__init__()
Expand Down Expand Up @@ -78,12 +78,37 @@ def __init__(self):
self.buttonmenu_var = customtkinter.StringVar(value="left")

self.buttonmenu = customtkinter.CTkOptionMenu(master=self.frame, text_font=(
"Roboto Medium", -16), width=100, fg_color="black", button_color="black", variable=self.buttonmenu_var, command=self.buttonmenu_event, values=["left", "middle", "right"])
self.buttonmenu.place(x=90, y=370)
"Roboto Medium", -14), width=100, fg_color="black", button_color="black", variable=self.buttonmenu_var, command=self.buttonmenu_event, values=["left", "middle", "right"])
self.buttonmenu.place(x=30, y=370)

self.mousebuttontxt = customtkinter.CTkLabel(
master=self.frame, text="Mouse Button:", text_font=("Roboto Medium", -16))
self.mousebuttontxt.place(x=70, y=340)
master=self.frame, text="Mouse Button:", text_font=("Roboto Medium", -15))
self.mousebuttontxt.place(x=12, y=340)

self.clicktype_var = customtkinter.StringVar(value="Single")

self.clicktypemenu = customtkinter.CTkOptionMenu(master=self.frame, text_font=(
"Roboto Medium", -14), width=100, fg_color="black", button_color="black", variable=self.clicktype_var, command=self.clicktype_event, values=["Single", "Double"])
self.clicktypemenu.place(x=150, y=370)

self.clicktypetxt = customtkinter.CTkLabel(
master=self.frame, text="Click Type:", text_font=("Roboto Medium", -15))
self.clicktypetxt.place(x=130, y=340)

self.clickinterval_var = customtkinter.StringVar(
master=self.frame, value=str(0.01))

self.clickinterval = customtkinter.CTkEntry(master=self.frame, text_font=(
"Roboto Medium", -14), width=80, textvariable=self.clickinterval_var)
self.clickinterval.place(x=100, y=440)

self.clickintervaltxt = customtkinter.CTkLabel(
master=self.frame, text="Click interval", text_font=("Roboto Medium", -14))
self.clickintervaltxt.place(x=70, y=410)

self.secondstxt = customtkinter.CTkLabel(
master=self.frame, text="seconds", text_font=("Roboto Medium", -13), width=10)
self.secondstxt.place(x=185, y=445)

def buttonmenu_event(self, choice):
global button1
Expand All @@ -95,6 +120,14 @@ def buttonmenu_event(self, choice):
if choice == "right":
button1 = "right"

def clicktype_event(self, choice):
global clicktype

if choice == "Single":
clicktype = "Single"
if choice == "Double":
clicktype = "Double"

def start_button1(self):
threading.Thread(target=self.autoHold).start()
self.start_hold_button.configure(state="disabled")
Expand Down Expand Up @@ -144,33 +177,57 @@ def autoClick(self):
lis = Listener(on_press=self.on_press)
lis.start()

self.interval = float(self.clickinterval.get())

while self.auto1:
if not pause:
if button1 == "left":
pyautogui.leftClick()
if button1 == "middle":
pyautogui.middleClick()
if button1 == "right":
pyautogui.rightClick()
if button1 == "left" and clicktype == "Single":
pyautogui.click(button="left")
pyautogui.PAUSE = self.interval
if button1 == "middle" and clicktype == "Single":
pyautogui.click(button="middle")
pyautogui.PAUSE = self.interval
if button1 == "right" and clicktype == "Single":
pyautogui.click(button="right")
pyautogui.PAUSE = self.interval

if button1 == "left" and clicktype == "Double":
pyautogui.doubleClick(button="left")
pyautogui.PAUSE = self.interval
if button1 == "middle" and clicktype == "Double":
pyautogui.doubleClick(button="middle")
pyautogui.PAUSE = self.interval
if button1 == "right" and clicktype == "Double":
pyautogui.doubleClick(button="right")
pyautogui.PAUSE = self.interval
if pause:
break
lis.stop()

def stop_button1(self):
pause = True
self.auto = False

if button1 == "left":
pyautogui.mouseUp(button="left")
if button1 == "middle":
pyautogui.mouseUp(button="middle")
if button1 == "right":
pyautogui.mouseUp(button="right")

self.start_hold_button.configure(state="enabled")

def stop_button2(self):
pause = True
self.auto1 = False
pyautogui.mouseUp()

if button1 == "left" and clicktype == "Single":
pyautogui.mouseUp(button="left")
if button1 == "middle" and clicktype == "Single":
pyautogui.mouseUp(button="middle")
if button1 == "right" and clicktype == "Single":
pyautogui.mouseUp(button="right")

self.start_auto_button.configure(state="enabled")

def on_close(self, event=0):
Expand Down

0 comments on commit 0e70aaf

Please sign in to comment.