Open TheBMaxus opened 3 years ago
I've encountered this error too What I did which worked was to convert the arguments to int explicitly (although I am not sure why this is needed). e.g.
return pyautogui.pixelMatchesColor(int(x), int(y), (214, 190, 0), tolerance=10)
I'm trying to check a certain pixel and see if it's color matches a certain RGB tone. This is the line that gives the error:
This is the error that prints out on the console:
Traceback (most recent call last): File "C:\Users\User\PycharmProjects\Project\m.py", line 196, in
status()
File "C:\Users\User\PycharmProjects\Project\m.py", line 26, in status
buy()
File "C:\Users\User\PycharmProjects\Project\m.py", line 144, in buy
if pyautogui.pixelMatchesColor(hisLeft + 48, hisTop + 128, (0, 95, 0)) is True:
File "C:\Users\User\PycharmProjects\Project\venv\lib\site-packages\pyscreeze__init.py", line 589, in pixelMatchesColor
pix = pixel(x, y)
File "C:\Users\User\PycharmProjects\Project\venv\lib\site-packages\pyscreeze\init__.py", line 608, in pixel
color = windll.gdi32.GetPixel(hdc, x, y)
ctypes.ArgumentError: argument 2: <class 'TypeError'>: Don't know how to convert parameter 2
I tried to look online, and I didn't find much on this error, and the only fix that I found didn't work. Does anyone know the problem?