#πŸ”’ Script breaking after checking screen for image

7 messages Β· Page 1 of 1 (latest)

craggy knot
#

here's pastebin to CP error: https://pastebin.com/ukeRr4VA

and here's the original code
https://pastebin.com/63LW0WNB

I've lowered the confidence and changed the JPG but was still met with same error, any idea on how to tweak this? ---- As for what should happen with this code, the game checks the screen for an image, if the image is present, the script does not move on and should keep checking for when the image is not present. When the image is not present, it should move on to the next phase but it never gets to the point currently.

sullen topazBOT
#

@craggy knot

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

fading flume
#

You can put the image locating part in a try except block

try:
    code ....
except pyautogui.ImageNotFoundException: 
 Error handling... 
#

Use a while loop to check it a few times, also use a counter to break out of the loop

verbal igloo
#

Heya @craggy knot πŸ‘‹
See above message.
This function used to return None when image was not found, they changed it to raising an error.
The current code setup you have is still from the old returning None. You'll find a lot of this in guides online still.

sullen topazBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.