Black Crescent Black Crescent - 1 year ago 168
Python Question

Pyautogui click not clicking properly

in this code:

temp = None
while temp == None:
temp = pyautogui.locateOnScreen("Play_Button.PNG")

play_buttonx, play_buttony =, play_buttony, duration = 0.3)

The pointer heads to the center of the button and stops!

I tried the win32api + win32con, still it didn't work, I tried setting "clicks" to a different number, changing intervals, etc..., yet nothing works, once I touch my mousepad the button is clicked and the game starts...

Answer Source

Apparently the game detects injected mouse clicks and key presses, so I need to bypass the injected flag.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download