steve1316 / granblue-automation-pyautogui

Educational application aimed at automating user-defined workflows for the mobile game, "Granblue Fantasy", using a variety of CV technologies in the backend such as OpenCV, PyAutoGUI and EasyOCR and a frontend coded in Typescript.
https://github.com/steve1316/granblue-automation-pyautogui/wiki
120 stars 36 forks source link

Bug trying to start event drawbox raid #23

Closed stijnvcp closed 3 years ago

stijnvcp commented 3 years ago
################################################################################
################################################################################
0:00:05 [FARM] Starting Farming Mode for Event (Token Drawboxes).
0:00:05 [FARM] Farming 15x Repeated Runs at EX Event Raid.
################################################################################
################################################################################

0:00:05 [SUCCESS] Bot's current location is at HOME.
0:00:05 [INFO] Bot is at the Home screen.
0:00:05 [SUCCESS] Bot's current location is at HOME.
0:00:05 [DEBUG] Attempting to find and click the button: "home_menu".
0:00:05 [SUCCESS] Found the HOME_MENU button at Point(x=3254, y=136).
0:00:07 [INFO] Occurrence for EVENT_BANNER found at: Point(x=2891, y=745)
0:00:10 [WARNING] Failed to confirm the bot's location at EVENT_DAILY_MISSIONS.
0:00:10 [DEBUG] Now scrolling the screen from the "Home" button's coordinates at (3240, 1352) by -200 clicks...
0:00:11 [INFO] Now hosting Event Raid...
0:00:11 [DEBUG] Attempting to find and click the button: "event_raid_battle".
0:00:11 [SUCCESS] Found the EVENT_RAID_BATTLE button at Point(x=2890, y=552).
0:00:12 [DEBUG] Now scrolling the screen from the "Home" button's coordinates at (3240, 1352) by -400 clicks...
0:00:13 [DEBUG] Attempting to find and click the button: "event_raid_extreme".
0:00:13 [SUCCESS] Found the EVENT_RAID_EXTREME button at Point(x=3049, y=579).

0:00:14 [INFO] Now waiting for event_raid_extreme to vanish from screen...
0:00:18 [ERROR] event_raid_extreme should have vanished from the screen after 3 seconds but did not. Exact error is: 
The target event_raid_extreme was found on the screen while it was not expected
0:00:18 [INFO] Not enough materials to host Extreme. Hosting Very Hard instead...
0:00:18 [DEBUG] Attempting to find and click the button: "event_very_hard_raid".

0:00:18 [ERROR] Bot encountered exception in MapSelection select_map(): 
Traceback (most recent call last):
  File "C:\Users\Stijn\Desktop\granblue-automation-pyautogui-main\map_selection.py", line 633, in select_map
    self._game.find_and_click_button("event_very_hard_raid")
  File "C:\Users\Stijn\Desktop\granblue-automation-pyautogui-main\game.py", line 332, in find_and_click_button
    temp_location = self.image_tools.find_button(button_name.lower(), tries=tries, suppress_error=suppress_error)
  File "C:\Users\Stijn\Desktop\granblue-automation-pyautogui-main\image_utils.py", line 107, in find_button
    button_location = pyautogui.locateCenterOnScreen(f"images/buttons/{button_name.lower()}.png", confidence=custom_confidence, grayscale=grayscale_check,
  File "C:\Users\Stijn\AppData\Local\Programs\Python\Python38\lib\site-packages\pyautogui\__init__.py", line 175, in wrapper
    return wrappedFunction(*args, **kwargs)
  File "C:\Users\Stijn\AppData\Local\Programs\Python\Python38\lib\site-packages\pyautogui\__init__.py", line 207, in locateCenterOnScreen
    return pyscreeze.locateCenterOnScreen(*args, **kwargs)
  File "C:\Users\Stijn\AppData\Local\Programs\Python\Python38\lib\site-packages\pyscreeze\__init__.py", line 400, in locateCenterOnScreen
    coords = locateOnScreen(image, **kwargs)
  File "C:\Users\Stijn\AppData\Local\Programs\Python\Python38\lib\site-packages\pyscreeze\__init__.py", line 360, in locateOnScreen
    retVal = locate(image, screenshotIm, **kwargs)
  File "C:\Users\Stijn\AppData\Local\Programs\Python\Python38\lib\site-packages\pyscreeze\__init__.py", line 340, in locate
    points = tuple(locateAll(needleImage, haystackImage, **kwargs))
  File "C:\Users\Stijn\AppData\Local\Programs\Python\Python38\lib\site-packages\pyscreeze\__init__.py", line 197, in _locateAll_opencv
    needleImage = _load_cv2(needleImage, grayscale)
  File "C:\Users\Stijn\AppData\Local\Programs\Python\Python38\lib\site-packages\pyscreeze\__init__.py", line 160, in _load_cv2
    raise IOError("Failed to read %s because file is missing, "
OSError: Failed to read images/buttons/event_very_hard_raid.png because file is missing, has improper permissions, or is an unsupported or invalid format

0:00:18 [ERROR] Bot encountered exception in Farming Mode: 
Traceback (most recent call last):
  File "C:\Users\Stijn\Desktop\granblue-automation-pyautogui-main\game.py", line 2010, in start_farming_mode
    raise Exception("Confirming the location of the Summon Selection screen after selecting the mission returned False.")
Exception: Confirming the location of the Summon Selection screen after selecting the mission returned False.

################################################################################
################################################################################
0:00:18 [FARM] Ending Farming Mode.
################################################################################
################################################################################

Bot ends with cursor hovering the image of the raid image

steve1316 commented 3 years ago

Just updated the bot to fix the issue. Let me know how it goes!

steve1316 commented 3 years ago

Closing issue as the Event has ended.