Hack Forums
[Python] Error with pyautogui (image locator) - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Python] Error with pyautogui (image locator) (/showthread.php?tid=6112550)



Error with pyautogui (image locator) - Crypt - Sep 29, 2020

Trying to figure out why I'm getting this error "TypeError: _locateAll_python() got an unexpected keyword argument 'confidence'"


Code
def main():
    while pyautogui.locateOnScreen('spikes.png', confidence=0.8) is not None:
      print("I see it")
      pyautogui.moveTo(1843, 82)
      pyautogui.click(1843, 82)
      #move to stair recognition
      stairs()
    else:
        print(" I don't see it")

For some reason it's not liking the confidence part?


Update: I figured out both errors. I needed OpenCV as well.

Closing thread.