Auto Clicker Bot in Python

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии • 148

  • @seran3514
    @seran3514 Год назад +61

    This is the full code:
    import time
    import threading
    from pynput.mouse import Button, Controller
    from pynput.keyboard import Listener, KeyCode
    TOGGLE_KEY = KeyCode(char="s")
    clicking = False
    mouse = Controller()
    def clicker():
    while True:
    if clicking:
    mouse.click(Button.left, 1)
    time.sleep(0.0001)
    def toggle_event(key):
    if key == TOGGLE_KEY:
    global clicking
    clicking = not clicking
    click_thread = threading.Thread(target=clicker)
    click_thread.start()
    with Listener(on_press=toggle_event) as listener:
    listener.join()

  • @lucidhydra2446
    @lucidhydra2446 2 года назад +12

    Mac OS users : Make sure to have accessiblity and input monitoring, allowed in privacy.
    Note: id allow it for not just the IDE your using, but also the Python download and the idle, and if that doesnt work , perhaps the terminal aswell.

  • @DonovanKong
    @DonovanKong 2 года назад +55

    Thank you for sharing this! I modified this code so when I'm taking a 'break' from work, my work laptop doesn't auto lock itself 😂😂

    • @ranwinsu8351
      @ranwinsu8351 2 года назад +2

      You have to finish the work not how much hours you have worked

    • @techera3563
      @techera3563 2 года назад +6

      ​@@ranwinsu8351 it's totally depends on how much you get payed 😂

    • @ranwinsu8351
      @ranwinsu8351 2 года назад +1

      @@techera3563 In India it's always less only no need to worry🤣😃

    • @frostman3
      @frostman3 2 года назад +6

      Nice try jeffrey, see you in HR tomorrow

    • @christalball93_
      @christalball93_ Год назад +2

      Your IT gonna find this probly

  • @jasoncooke5741
    @jasoncooke5741 8 месяцев назад +2

    A couple struggles along the way. Had to learn how to add system variables for python and pip so that I could pip install pynput. For some reason was getting an error saying toggle_event not defined but code was right. After I restarted my Visual Studio Code program I was able to get it to run and it works perfect. I didn't want to download some auto clicker from the internet they were all getting virus hits from virus total and other scan tools so I was worried. This worked perfect. The only thing I think would make it better is to have another hot key to turn off the program so you can move to another site for a moment and not worry you will auto click something. Something like ctrl + t + e then the program pauses and allows you to type without it coming on. All in all it works great thank you so much.

  • @DaRkStyLe69boombang
    @DaRkStyLe69boombang 2 года назад +5

    Hello😄 ¿How could I establish some coordinates so that it clicks on those coordinates?🤔

  • @cyborgsmurf6446
    @cyborgsmurf6446 Год назад +4

    The thing you said about sleeping was so eye openeing for me. Thank you so much, this also makes so much sense. Love it bro! ♥

  • @Megaheropap
    @Megaheropap 2 года назад +4

    Is it possible to make it click when you have left click held down?

  • @mywillbedonex
    @mywillbedonex 10 месяцев назад +2

    How do i add EXIT_KEY = KeyCode(char="e") to work as a exit button to terminate the program?

  • @DRVGON-1
    @DRVGON-1 2 года назад +5

    here is the code if your lazy: def clicker():
    while True:
    if clicking:
    mouse.click(Button. Left, 1)
    time.sleep(0.001)
    def toggle_event(key)
    if key == TOGGLE_KEY:
    global clicking
    clicking = not clicking
    click_thread = threading.Thread(target=clicker)
    click_thread.start()
    with Listener(on_press=toggle_event) as Listener:
    listener.join()

    • @KontrolStyle
      @KontrolStyle 2 года назад

      nice

    • @Dr.Computer365
      @Dr.Computer365 3 месяца назад +1

      let me make it bater using chatgpt but giveing it gui like if rinning it says running in bottom left corner of screen hear is code :)
      import time
      import threading
      from pynput.mouse import Controller, Button
      from pynput.keyboard import Listener, KeyCode
      import tkinter as tk
      TOGGLE_KEY = KeyCode(char="q")
      clicking = False
      mouse = Controller()
      def clicker():
      while True:
      if clicking:
      mouse.click(Button.left, 1)
      time.sleep(5)
      def toggle_event(key):
      global clicking
      if key == TOGGLE_KEY:
      clicking = not clicking
      update_gui()
      def update_gui():
      if clicking:
      status_label.config(text="Running", bg="#66CDAA") # Medium green
      else:
      status_label.config(text="Off", bg="#FA8072") # Medium red
      def start_clicker_thread():
      click_thread = threading.Thread(target=clicker, daemon=True)
      click_thread.start()
      def start_listener():
      with Listener(on_press=toggle_event) as listener:
      listener.join()
      # Create the GUI in the main thread
      root = tk.Tk()
      root.title("Clicker Status")
      # Position the window at the bottom right corner and make it smaller
      screen_width = root.winfo_screenwidth()
      screen_height = root.winfo_screenheight()
      window_width = 60
      window_height = 30
      root.geometry(f"{window_width}x{window_height}+{screen_width - window_width}+{screen_height - window_height}")
      # Use slightly darker colors for the background
      status_label = tk.Label(root, text="Off", bg="#FA8072", fg="white", font=("Arial", 10)) # Medium red
      status_label.pack(fill="both", expand=True)
      # Remove the window border to make it less obtrusive
      root.overrideredirect(True)
      # Keep the window always on top
      root.attributes("-topmost", True)
      # Start the clicking and listener in separate threads
      start_clicker_thread()
      threading.Thread(target=start_listener, daemon=True).start()
      # Start the tkinter main loop in the main thread
      root.mainloop()

  • @Ricocase
    @Ricocase 2 года назад +5

    Is it possible to randomize sleep times within a small range so that backdoor software won't detect the program as too predictable?

    • @LordRyn
      @LordRyn 2 года назад +3

      Edit: Zlyphes comment has a better usage of random
      import random and then use random.randrange(1, 100) where 1 is the lowest and 100 is the highest spot. Then just put that in time.sleep(). for example:
      import time
      import random
      time.sleep(random.randrange(5, 25))

    • @LordRyn
      @LordRyn 2 года назад +1

      @Zlyphe Thanks, I learned something new today!

    • @quasii7
      @quasii7 2 года назад

      @@LordRyn randrange(1, 100) returns a random integer where 1

    • @kulkid_
      @kulkid_ 2 года назад

      You can do that. You need to import random and generate a random number between 1 and 10. Every time it clicks the sleep would have this random number and devide it by 1000.

  • @happyfishgaming68
    @happyfishgaming68 Год назад +1

    is it possible to set this to autoclick a key, for example press the space bar every second?

  • @blitz-nk8fw
    @blitz-nk8fw 6 месяцев назад +1

    Here is the full code if anyone needs it :
    import time
    import threading
    from pynput.mouse import Controller, Button
    from pynput.keyboard import Listener, KeyCode
    TOGGLE_KEY = KeyCode(char="t")
    clicking = False
    mouse = Controller()
    def clicker():
    while True:
    if clicking:
    mouse.click(Button.left, 1)
    time.sleep(0.0001)
    def toggle_event(key):
    if key == TOGGLE_KEY:
    global clicking
    clicking = not clicking
    click_thread = threading.Thread(target=clicker)
    click_thread.start()
    with Listener(on_press=toggle_event) as Listener:
    Listener.join()

    • @Dr.Computer365
      @Dr.Computer365 3 месяца назад

      let me make it bater using chatgpt but giveing it gui like if rinning it says running in bottom left corner of screen hear is code :)
      import time
      import threading
      from pynput.mouse import Controller, Button
      from pynput.keyboard import Listener, KeyCode
      import tkinter as tk
      TOGGLE_KEY = KeyCode(char="q")
      clicking = False
      mouse = Controller()
      def clicker():
      while True:
      if clicking:
      mouse.click(Button.left, 1)
      time.sleep(5)
      def toggle_event(key):
      global clicking
      if key == TOGGLE_KEY:
      clicking = not clicking
      update_gui()
      def update_gui():
      if clicking:
      status_label.config(text="Running", bg="#66CDAA") # Medium green
      else:
      status_label.config(text="Off", bg="#FA8072") # Medium red
      def start_clicker_thread():
      click_thread = threading.Thread(target=clicker, daemon=True)
      click_thread.start()
      def start_listener():
      with Listener(on_press=toggle_event) as listener:
      listener.join()
      # Create the GUI in the main thread
      root = tk.Tk()
      root.title("Clicker Status")
      # Position the window at the bottom right corner and make it smaller
      screen_width = root.winfo_screenwidth()
      screen_height = root.winfo_screenheight()
      window_width = 60
      window_height = 30
      root.geometry(f"{window_width}x{window_height}+{screen_width - window_width}+{screen_height - window_height}")
      # Use slightly darker colors for the background
      status_label = tk.Label(root, text="Off", bg="#FA8072", fg="white", font=("Arial", 10)) # Medium red
      status_label.pack(fill="both", expand=True)
      # Remove the window border to make it less obtrusive
      root.overrideredirect(True)
      # Keep the window always on top
      root.attributes("-topmost", True)
      # Start the clicking and listener in separate threads
      start_clicker_thread()
      threading.Thread(target=start_listener, daemon=True).start()
      # Start the tkinter main loop in the main thread
      root.mainloop()

  • @HansiKlein
    @HansiKlein 2 года назад +7

    Salve
    Ist it possible to click into an window at a specific position, while it is minimised (is that the right word?)
    And is it possible to perform this in the background and continue working normal with other applications?
    Like a running VM?
    Kind regards
    Hans

    • @Dr.Computer365
      @Dr.Computer365 3 месяца назад

      do you get answers?

    • @HansiKlein
      @HansiKlein 3 месяца назад +1

      @@Dr.Computer365 hmm no didn't get one. Do you have it ^^?

    • @Dr.Computer365
      @Dr.Computer365 3 месяца назад +1

      @@HansiKlein maybe chatgpt can! it says to use Linux

  • @Feavv11
    @Feavv11 2 года назад +9

    Great tutorial! I watch ur vids all the time they always help me with any problems I have with coding. :) and btw, What theme are you using? it looks nice.

  • @BruceVayne
    @BruceVayne 10 месяцев назад +1

    I just copied the exact same code but is doing nothing when I press "t"

    • @Dr.Computer365
      @Dr.Computer365 3 месяца назад

      let me make it bater using chatgpt but giveing it gui like if rinning it says running in bottom left corner of screen hear is code :)
      import time
      import threading
      from pynput.mouse import Controller, Button
      from pynput.keyboard import Listener, KeyCode
      import tkinter as tk
      TOGGLE_KEY = KeyCode(char="q")
      clicking = False
      mouse = Controller()
      def clicker():
      while True:
      if clicking:
      mouse.click(Button.left, 1)
      time.sleep(5)
      def toggle_event(key):
      global clicking
      if key == TOGGLE_KEY:
      clicking = not clicking
      update_gui()
      def update_gui():
      if clicking:
      status_label.config(text="Running", bg="#66CDAA") # Medium green
      else:
      status_label.config(text="Off", bg="#FA8072") # Medium red
      def start_clicker_thread():
      click_thread = threading.Thread(target=clicker, daemon=True)
      click_thread.start()
      def start_listener():
      with Listener(on_press=toggle_event) as listener:
      listener.join()
      # Create the GUI in the main thread
      root = tk.Tk()
      root.title("Clicker Status")
      # Position the window at the bottom right corner and make it smaller
      screen_width = root.winfo_screenwidth()
      screen_height = root.winfo_screenheight()
      window_width = 60
      window_height = 30
      root.geometry(f"{window_width}x{window_height}+{screen_width - window_width}+{screen_height - window_height}")
      # Use slightly darker colors for the background
      status_label = tk.Label(root, text="Off", bg="#FA8072", fg="white", font=("Arial", 10)) # Medium red
      status_label.pack(fill="both", expand=True)
      # Remove the window border to make it less obtrusive
      root.overrideredirect(True)
      # Keep the window always on top
      root.attributes("-topmost", True)
      # Start the clicking and listener in separate threads
      start_clicker_thread()
      threading.Thread(target=start_listener, daemon=True).start()
      # Start the tkinter main loop in the main thread
      root.mainloop()

  • @lowelectronics
    @lowelectronics Год назад +3

    import time
    import threading
    from pynput.mouse import Controller, Button
    from pynput.keyboard import Listener, KeyCode
    TOGGLE_KEY = KeyCode(char='t')
    clicking = False
    mouse = Controller()
    def clicker():
    while True:
    if clicking:
    mouse.click(Button.left, 1)
    time.sleep(0.0001)
    def toggle_event(key):
    global clicking
    if key == TOGGLE_KEY:
    clicking = not clicking
    click_thread = threading.Thread(target=clicker)
    click_thread.start()
    with Listener(on_release=toggle_event) as listener:
    listener.join()

  • @mivano3236
    @mivano3236 2 года назад +4

    Question: In 2:36, why did you go for “while true” and “if clicking” instead of “while clicking”

    • @NeuralNine
      @NeuralNine  2 года назад +10

      Because the sleep at the bottom has to be executed even if clicking is False

  • @manoranjanbasak5429
    @manoranjanbasak5429 8 месяцев назад

    Thanx! would you please bulid a Python Bot with following features:
    #Click once
    #A specific button on screen, which is previously introduced to the Bot, & the button is *changeable
    #Just at a point of presetted time, up to the lowest possible fraction or precision of time supported by the system, which is *modifiable
    #*Changeable, *modifiable -using GUI.

  • @FRESHWWW
    @FRESHWWW Год назад +1

    Thanks alot bro, i needed to ask if there is a way to make a mouse auto clicker click following a directed or a specific sound ??

  • @nmhero4824
    @nmhero4824 2 года назад +2

    what does listener.join() do?
    I keep getting the error: TypeError: 'Listener' object is not callable

    • @seran3514
      @seran3514 Год назад

      with Listener(on_press=on_press) as listener:
      listener.join()
      Look for Caps

  • @TomasSab3D
    @TomasSab3D 2 года назад

    can run a loop, where click is done as long as the "t" key is down... but threading is cooler.

  • @UnknownContentCreator_Real
    @UnknownContentCreator_Real 8 месяцев назад

    bro you crashed my laptop. the first time it doesnt work. when i restarted my laptop it freezed

  • @mista_ia
    @mista_ia 9 месяцев назад

    Nice, however looks like the click does not work for windows dialog box 😢

  • @kekyes715
    @kekyes715 Год назад +1

    is it possible to click on a location without the cursor being affected so you can use the cursor freely in the meanwhile?

  • @lalitmehra4751
    @lalitmehra4751 6 месяцев назад

    Can we do something that can automate series of clicks ?

  • @wolfgaming2724
    @wolfgaming2724 Год назад

    how come it keeps saying failed to launch debug adapter additional information may be available in the output window? I really wanna get into coding but idk why this is happening.

  • @TecnologiaAnimada
    @TecnologiaAnimada Год назад +2

    primeira vez que um tutorial de python deu certo pra mim! obrigado, thx, like like like

  • @billigerfusel
    @billigerfusel 2 года назад

    Interesting topic. As a C dev I have to take a look at how pynput does it below the hood.

  • @graydonpivec6728
    @graydonpivec6728 5 месяцев назад +1

    what version of python are you using? specifically what are you actually writing the code in?

    • @bloober216
      @bloober216 5 месяцев назад

      i think thats pycharm(jetbrains)

  • @MasterlionGT
    @MasterlionGT Год назад

    it says this when i try to save it: Traceback (most recent call last):
    File "C:/Users/lenovo/Desktop/auto lol.py", line 6, in
    TOGGLE_KEY - KeyCode(char="c")
    NameError: name 'TOGGLE_KEY' is not defined

    • @martin_taavet
      @martin_taavet Год назад +1

      Youliterally used minus instead of equal sign💀

  • @santoshkumargouda6033
    @santoshkumargouda6033 2 года назад +1

    Please make a video on data engineering

  • @philtoa334
    @philtoa334 2 года назад

    Kool can you make one more advanced with color , text or picture recognation ? Thx.

  • @GrayM2
    @GrayM2 2 года назад

    Hey man it’s telling me that”This process is not trusted! Input event monitoring will not be possible until it is added to accessibility clients.”I use a Mac and visual studio code. Got any idea on how I could make it work?

    • @gabbygabby7915
      @gabbygabby7915 Год назад

      Mac OS users : Make sure to have accessiblity and input monitoring, allowed in privacy.
      Note: id allow it for not just the IDE your using, but also the Python download and the idle, and if that doesnt work, perhaps the terminal aswell.

  • @MasterlionGT
    @MasterlionGT Год назад

    it doesnt work anymore it was working earlier what happened?

  • @23matija
    @23matija 4 месяца назад

    Can anyone help with number of clicks per second. I wanted to set to be one click per second, but when I change time.sleep to 1, or 100 , it doesn't change anything. How to make clicking slower? Thx in advance

  • @mmmmm-k1m
    @mmmmm-k1m Год назад

    hey man. i need code that automatically goes to on a website and clicking on a button.can you educate it?

  • @fernandopeaz1009
    @fernandopeaz1009 Год назад

    What about for a certain amount of clicks

  • @coopcoop8
    @coopcoop8 2 года назад

    Good luck catching me now Jagex!

  • @clearshot6353
    @clearshot6353 2 года назад +1

    Thanks, I just got 99 magic via alching!

    • @suertesamp
      @suertesamp 2 года назад

      all good til u get banned hahaha

  • @tcgvsocg1458
    @tcgvsocg1458 2 года назад

    Thx for all your great video can you show how to inject script like change stat in elden ring / nioh game this will be really interesting

  • @naganarasimhasaigurajala5888
    @naganarasimhasaigurajala5888 2 года назад +1

    Sir how to remove that key event I have tried to unistall pynput but it is not going

  • @happyfishgaming68
    @happyfishgaming68 Год назад

    what if i want the toggle to be a key like f12, do i just type f12 or do i need to do something else?

    • @Vamka
      @Vamka Год назад

      did you find out?

  • @jinjin1111
    @jinjin1111 2 года назад

    TypeError: toggle_event() missing 1 required positional argument: 'key'

    • @seran3514
      @seran3514 Год назад

      def on_press(key):
      if key == start_stop_key:
      if thread.running:
      thread.stop_clicking()
      else:
      thread.start_clicking()
      elif key == exit_key:
      thread.exit()
      listener.stop()

  • @FNJoJoSiwa
    @FNJoJoSiwa 2 года назад +1

    anyone know how to fix this it's my only errors
    Import "pynput.mouse" could not be resolved from source (PylancereportMissingModuleSource)
    and
    Import "pynput.keyboard" could not be resolved from source (PylancereportMissingModuleSource)
    thanks it will help me a lot

    • @РенатаРитм
      @РенатаРитм Год назад

      I have the same problem however I installed pynput. Help us please!

  • @IamGbono
    @IamGbono 2 месяца назад

    Hi, please, how can I use this to click on apps on android?

  • @cagataydemirbas7259
    @cagataydemirbas7259 2 года назад

    Can you make bots for online games with Python?

  • @S_yIvie
    @S_yIvie 28 дней назад

    the pynput download doesnt work for me

  • @theindooroutdoorsman
    @theindooroutdoorsman Год назад

    "pip install pynput
    'pip' is not recognized as an internal or external command,
    operable program or batch file."
    Didn't take me long to fuck it up.

    • @theindooroutdoorsman
      @theindooroutdoorsman Год назад

      Figured out that issue, but now I'm getting \pynput\keyboard\_base.py", line 66, in __init__
      raise ValueError(kwargs)
      ValueError: {'Char': 't'}

  • @shocco0816
    @shocco0816 2 года назад +1

    hey what program do you use to code in python?

  • @user-lg3rp9hq2r
    @user-lg3rp9hq2r 2 года назад

    i love this video but now that i have set it up i can't stop it from starting when i hit the button can anyone help me

  • @ProfGira
    @ProfGira 2 года назад

    Hey, I am a noob at programming, and python will run the script, but it just doesn't work. Not sure what I am doing wrong, but the code is the same, the program is running, but I am hitting T and nothing is happening.

    • @piotrmakowski1961
      @piotrmakowski1961 2 года назад

      Same for me.

    • @KontrolStyle
      @KontrolStyle 2 года назад

      make sure you have the threading pip installed, if this isn't it.. at least i tired.

  • @jamesonmollis3210
    @jamesonmollis3210 2 года назад

    please what type of python do you have? mine doe not display like yours

    • @mcnastysavageyt656
      @mcnastysavageyt656 8 месяцев назад

      He's using an IDE, which are just basically compilers. Not sure which one he is using though. Pyhton does offer a list of trusted IDE's on their website you can look at. They all pretty much function the same.

  • @_ja.kubix.shorts
    @_ja.kubix.shorts 2 года назад

    You can use pyautogui

  • @nadavoshka2164
    @nadavoshka2164 2 года назад +1

    ModuleNotFoundError: No module named 'pynput' and i did the cmd part

    • @kaosdavy8702
      @kaosdavy8702 2 года назад

      same for me, did you ever figure it out

    • @teorailin
      @teorailin 2 года назад

      pip install pynput

    • @braydenmccauley1522
      @braydenmccauley1522 Год назад

      It does not work with VScode and I’m not sure why

  • @rasseto4835
    @rasseto4835 Год назад +1

    What programe are you using when u coding pls help i am so much beginner :( !!!

  • @homerlee1333
    @homerlee1333 2 года назад +1

    what is this progrm? is not phyton

  • @UnknownContentCreator_Real
    @UnknownContentCreator_Real 8 месяцев назад

    how start it without saving

  • @21st44
    @21st44 2 года назад

    Has anyone found any bug in the code ?

  • @yaman09
    @yaman09 2 года назад

    this didnt work for me why?

  • @prada4559
    @prada4559 Год назад

    can you make this into a rpf file for GTA

  • @AxelBlazeGG
    @AxelBlazeGG Год назад

    Bro how to make the clicking slower

  • @migsjashensofia
    @migsjashensofia Год назад

    Can you teach us a auto clicker bot to instantly clicked a new message on gmail for example and also clicked the pop up message along with it.

  • @NDNGR
    @NDNGR 2 года назад

    Thank you sir for tutorial😎

  • @hid721
    @hid721 2 года назад

    i use VSC and not work

  • @jesusdacoast872
    @jesusdacoast872 2 года назад

    Good job dude 😎

  • @joaopedro7457
    @joaopedro7457 2 года назад

    Download archive pls?

  • @BobaJuicy
    @BobaJuicy Год назад

    i did it on IDLE and it didnt work!

  • @somerandomuserfromootooob
    @somerandomuserfromootooob 2 года назад

    Wowowww, you're really amazing!!!!!

  • @kamisage8990
    @kamisage8990 Год назад

    how to change cps?

  • @_Tomaszeq
    @_Tomaszeq Год назад

    I LIKE IT! THANKS!!!!

  • @kratos5944
    @kratos5944 Год назад

    Thanks!

  • @BoingyJRon360
    @BoingyJRon360 Год назад

    i get toggle_event is not defined

  • @chxrry_blossomz
    @chxrry_blossomz 8 месяцев назад

    how 2 no do anymore help pls

  • @spikecarlsson2685
    @spikecarlsson2685 Год назад

    I love this guy

  • @Watermelon_cat815
    @Watermelon_cat815 4 месяца назад

    code?

  • @pylejjy6279
    @pylejjy6279 2 года назад

    just import keyboard for keybinds and mouse lol

  • @satyadev2011
    @satyadev2011 10 месяцев назад

    Cool!

  • @happyncode
    @happyncode 2 года назад

    thanks bro

  • @culan_SCP
    @culan_SCP 9 месяцев назад

    HOW DO I STOP IT

  • @jawadalhassan5110
    @jawadalhassan5110 2 года назад

    no work

  • @arijanrahimic3210
    @arijanrahimic3210 2 года назад

    THX 💪

  • @khadijaarts890
    @khadijaarts890 2 года назад

    Sir make a video on how to become block miner in blockxhain

  • @Dr.Computer365
    @Dr.Computer365 3 месяца назад

    let me make it bater using chatgpt but giveing it gui like if rinning it says running in bottom left corner of screen hear is code :)
    import time
    import threading
    from pynput.mouse import Controller, Button
    from pynput.keyboard import Listener, KeyCode
    import tkinter as tk
    TOGGLE_KEY = KeyCode(char="q")
    clicking = False
    mouse = Controller()
    def clicker():
    while True:
    if clicking:
    mouse.click(Button.left, 1)
    time.sleep(5)
    def toggle_event(key):
    global clicking
    if key == TOGGLE_KEY:
    clicking = not clicking
    update_gui()
    def update_gui():
    if clicking:
    status_label.config(text="Running", bg="#66CDAA") # Medium green
    else:
    status_label.config(text="Off", bg="#FA8072") # Medium red
    def start_clicker_thread():
    click_thread = threading.Thread(target=clicker, daemon=True)
    click_thread.start()
    def start_listener():
    with Listener(on_press=toggle_event) as listener:
    listener.join()
    # Create the GUI in the main thread
    root = tk.Tk()
    root.title("Clicker Status")
    # Position the window at the bottom right corner and make it smaller
    screen_width = root.winfo_screenwidth()
    screen_height = root.winfo_screenheight()
    window_width = 60
    window_height = 30
    root.geometry(f"{window_width}x{window_height}+{screen_width - window_width}+{screen_height - window_height}")
    # Use slightly darker colors for the background
    status_label = tk.Label(root, text="Off", bg="#FA8072", fg="white", font=("Arial", 10)) # Medium red
    status_label.pack(fill="both", expand=True)
    # Remove the window border to make it less obtrusive
    root.overrideredirect(True)
    # Keep the window always on top
    root.attributes("-topmost", True)
    # Start the clicking and listener in separate threads
    start_clicker_thread()
    threading.Thread(target=start_listener, daemon=True).start()
    # Start the tkinter main loop in the main thread
    root.mainloop()

  • @contentmajesties
    @contentmajesties 4 месяца назад

    2030 Anyone?

  • @notbarbara2647
    @notbarbara2647 2 года назад +6

    try this:
    import time
    import threading
    from pynput.mouse import Button, Controller
    from pynput.keyboard import Listener, KeyCode
    delay = 0.001
    button = Button.left
    start_stop_key = KeyCode(char='s')
    exit_key = KeyCode(char='e')
    class ClickMouse(threading.Thread):
    def __init__(self, delay, button):
    super(ClickMouse, self).__init__()
    self.delay = delay
    self.button = button
    self.running = False
    self.program_run = True
    def start_clicking(self):
    self.running = True
    def stop_clicking(self):
    self.running = False
    def exit(self):
    self.stop_clicking()
    self.program_run = False
    def run(self):
    while self.program_run:
    while self.running:
    mouse.click(self.button)
    time.sleep(self.delay)
    time.sleep(1)
    mouse = Controller()
    thread = ClickMouse(delay, button)
    thread.start()
    def on_press(key):
    if key == start_stop_key:
    if thread.running:
    thread.stop_clicking()
    else:
    thread.start_clicking()
    elif key == exit_key:
    thread.exit()
    listener.stop()
    with Listener(on_press=on_press) as listener:
    listener.join()

  • @promax1st
    @promax1st 2 года назад +1

    :)

  • @GleniLame
    @GleniLame Год назад

    Are u albanian?

  • @blakebartley9636
    @blakebartley9636 2 года назад

    Hello is there a way I can email you!?