Free Friday Assigment 4/24/2026

So today i made outo clicker bitcoins game so i can click it very faster

here you can see the code

import time
import threading
from pynput.mouse import Button, Controller
from pynput.keyboard import Listener, KeyCode


TOGGLE_KEY = KeyCode(char='s') 

EXIT_KEY = KeyCode(char='e')

DELAY = 0.001 


class ClickMouse(threading.Thread):
    def __init__(self, delay, button):
        super(ClickMouse, self).__init__()
        self.delay = delay
        self.button = button
        self.running = False
        self.program_running = True

    def start_clicking(self):
        self.running = True

    def stop_clicking(self):
        self.running = False

    def exit(self):
        self.stop_clicking()
        self.program_running = False

    def run(self):
        while self.program_running:
            while self.running:
                mouse.click(self.button)
                time.sleep(self.delay)
            time.sleep(0.1)

mouse = Controller()
click_thread = ClickMouse(DELAY, Button.left)
click_thread.start()

def on_press(key):
    if key == TOGGLE_KEY:
        if click_thread.running:
            click_thread.stop_clicking()
            print("[STATUS] Paused")
        else:
            click_thread.start_clicking()
            print("[STATUS] Clicking...")
    elif key == EXIT_KEY:
        click_thread.exit()
        listener.stop()
        print("[STATUS] Exited Program")

print(f"--- Autoclicker Active ---")
print(f"Press '{TOGGLE_KEY.char}' to Start/Stop")
print(f"Press '{EXIT_KEY.char}' to Exit entirely")

with Listener(on_press=on_press) as listener:
    listener.join()

here you can see

and I also work on osha

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top