Hello dear Forum users,
I am currently learning about Pythons Image Recognision and I have encountered this error.
After looking it up online I still cant figure my case out, so I would like to ask for your help on this.
I am currently learning about Pythons Image Recognision and I have encountered this error.
After looking it up online I still cant figure my case out, so I would like to ask for your help on this.
import pyautogui
import keyboard
from time import sleep
while keyboard.is_pressed('m') == False:
if pyautogui.locateOnScreen(r'C:\Users\Jadiac\Desktop\Lolbot1\Images\Hud\ShopIcon.png', region=(320, 860, 1320, 1075), grayscale=True, confidence=0.8) != None:
Shopx, Shopy = pyautogui.locateCenterOnScreen(r'C:\Users\Jadiac\Desktop\Lolbot1\Images\Hud\ShopIcon.png')
print("Shopicon location is:", Shopx, Shopy)
sleep(0.5)
else:
print("Cannot find ShopIcon!")
if pyautogui.locateOnScreen(r'C:\Users\Jadiac\Desktop\Lolbot1\Images\Hud\spawnPad.png', region=(320, 860, 1320, 1075), grayscale=True, confidence=0.3) != None:
Spawnx, Spawny = pyautogui.locateCenterOnScreen(r'C:\Users\Jadiac\Desktop\Lolbot1\Images\Hud\spawnPad.png')
print("Spawn location is:", Spawnx, Spawny)
sleep(0.5)
else:
print("Cannot find Spawnpad!")
print("done")Error:Traceback (most recent call last):
File "c:/Users/Jadiac/Desktop/Test/A.py", line 14, in <module>
Spawnx, Spawny = pyautogui.locateCenterOnScreen(r'C:\Users\Jadiac\Desktop\Lolbot1\Images\Hud\spawnPad.png')
TypeError: cannot unpack non-iterable NoneType objectIf anyone could explain this to me and tell me how to counter this I would love to hear any help :)
