Black Crescent Black Crescent - 27 days ago 7
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 = pyautogui.center(temp)

pyautogui.click(play_buttonx, 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

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