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()
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.
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()
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()
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.
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.
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
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))
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.
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()
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()
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.
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.
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()
Bit late with the answer, but here goes for anyone else wondering: Add Key at the end of import line like this "from pynput.keyboard import Listener, KeyCode, Key" And change TOGGLE_KEY line to "TOGGLE_KEY = Key.f5" or whatever.
@@ThisIsAUsername69 thanks bro, but wanna ask for how can make pick the location cursor ?, i means if we press keyboard then the cursor location as we was set it
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
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
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
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?
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.
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.
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.
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()
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()
thanks
tysm
what application do i use the code in? im new to this
@@donnydavenport4804 i use vscode
@@donnydavenport4804 pycharm
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.
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 😂😂
You have to finish the work not how much hours you have worked
@@ranwinsu8351 it's totally depends on how much you get payed 😂
@@techera3563 In India it's always less only no need to worry🤣😃
Nice try jeffrey, see you in HR tomorrow
Your IT gonna find this probly
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()
nice
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()
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! ♥
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.
Hello😄 ¿How could I establish some coordinates so that it clicks on those coordinates?🤔
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.
Is it possible to make it click when you have left click held down?
How do i add EXIT_KEY = KeyCode(char="e") to work as a exit button to terminate the program?
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()
Thanks
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
do you get answers?
@@Dr.Computer365 hmm no didn't get one. Do you have it ^^?
@@HansiKlein maybe chatgpt can! it says to use Linux
Is it possible to randomize sleep times within a small range so that backdoor software won't detect the program as too predictable?
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))
@Zlyphe Thanks, I learned something new today!
@@LordRyn randrange(1, 100) returns a random integer where 1
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.
Question: In 2:36, why did you go for “while true” and “if clicking” instead of “while clicking”
Because the sleep at the bottom has to be executed even if clicking is False
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()
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()
Can we do something that can automate series of clicks ?
is it possible to set this to autoclick a key, for example press the space bar every second?
primeira vez que um tutorial de python deu certo pra mim! obrigado, thx, like like like
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 ??
what does listener.join() do?
I keep getting the error: TypeError: 'Listener' object is not callable
with Listener(on_press=on_press) as listener:
listener.join()
Look for Caps
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.
can run a loop, where click is done as long as the "t" key is down... but threading is cooler.
is it possible to click on a location without the cursor being affected so you can use the cursor freely in the meanwhile?
no
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.
Good luck catching me now Jagex!
Interesting topic. As a C dev I have to take a look at how pynput does it below the hood.
Nice, however looks like the click does not work for windows dialog box 😢
hey what program do you use to code in python?
VS Code is better than his and it's free!
Pycharm
@@SidTheGreat420 mid
@@deleted_channel-y2e fax not gonna lie
what version of python are you using? specifically what are you actually writing the code in?
i think thats pycharm(jetbrains)
Kool can you make one more advanced with color , text or picture recognation ? Thx.
hey man. i need code that automatically goes to on a website and clicking on a button.can you educate it?
I just copied the exact same code but is doing nothing when I press "t"
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()
Sir how to remove that key event I have tried to unistall pynput but it is not going
Did you manage to delete it?
Good job dude 😎
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?
did you find out?
Bit late with the answer, but here goes for anyone else wondering:
Add Key at the end of import line like this "from pynput.keyboard import Listener, KeyCode, Key"
And change TOGGLE_KEY line to "TOGGLE_KEY = Key.f5" or whatever.
@@ThisIsAUsername69 thanks bro, but wanna ask for how can make pick the location cursor ?, i means if we press keyboard then the cursor location as we was set it
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
Youliterally used minus instead of equal sign💀
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!
Wowowww, you're really amazing!!!!!
Hi, please, how can I use this to click on apps on android?
bro you crashed my laptop. the first time it doesnt work. when i restarted my laptop it freezed
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
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?
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.
please what type of python do you have? mine doe not display like yours
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.
Please make a video on data engineering
the pynput download doesnt work for me
What programe are you using when u coding pls help i am so much beginner :( !!!
VS code
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
What about for a certain amount of clicks
Thank you sir for tutorial😎
Thanks, I just got 99 magic via alching!
all good til u get banned hahaha
I LIKE IT! THANKS!!!!
You can use pyautogui
I love this guy
TypeError: toggle_event() missing 1 required positional argument: 'key'
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()
Can you make bots for online games with Python?
yes
Thanks!
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.
Same for me.
make sure you have the threading pip installed, if this isn't it.. at least i tired.
it doesnt work anymore it was working earlier what happened?
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
THX 💪
Bro how to make the clicking slower
increas time
thanks bro
can you make this into a rpf file for GTA
how start it without saving
ModuleNotFoundError: No module named 'pynput' and i did the cmd part
same for me, did you ever figure it out
pip install pynput
It does not work with VScode and I’m not sure why
what is this progrm? is not phyton
Has anyone found any bug in the code ?
"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.
Figured out that issue, but now I'm getting \pynput\keyboard\_base.py", line 66, in __init__
raise ValueError(kwargs)
ValueError: {'Char': 't'}
i get toggle_event is not defined
just contr
how to change cps?
i use VSC and not work
Download archive pls?
how 2 no do anymore help pls
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.
this didnt work for me why?
i did it on IDLE and it didnt work!
code?
Cool!
HOW DO I STOP IT
click t again
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()
what needs to be changed to make it work for "space"?
Why? Does it have more specifications?
Sir make a video on how to become block miner in blockxhain
Sorry blockchain
just import keyboard for keybinds and mouse lol
no work
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()
2030 Anyone?
Are u albanian?
:)
Hello is there a way I can email you!?