import pyautogui
while True:
mouse_position = pyautogui.position()
print(mouse_position)
if pyautogui.pixel(mouse_position)[0] == 255:
pyautogui.mouseDown()
pyautogui.mouseUp()
print("Target detected!")
else:
print("Nothing detected!")`
I'm getting the mouse position (x, y) but when I put it in the parenthesis pyautogui.pixel(mouse_position)
it gives me the error:
TypeError: pixel() missing 1 required positional argument: 'y'