'Python auto clicker not working on pc but working on mac
so ive been trying to make an auto clicker for my pc.....the code I created works on my mac but not my pc......I cant figure out what the difference is and I've been trying to figure this out for hours
here is the code:
from pynput.mouse import Listener
import pyautogui
import keyboard
import random
# default is 0.1
# pyautogui.PAUSE = 0
pyautogui.PAUSE = 0.1
def on_click(x, y, button, pressed):
if button == button.left and not keyboard.is_pressed('caps lock'):
num = random.random()
num *= 100
num = int(num % 100)
if num < 25:
pyautogui.click()
with Listener(on_click=on_click) as listener:
clicked = False
listener.join()
if someone could try and help me that would be awesome!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|