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

Co-op Combat Mode Hang #68

Closed PortablePanda closed 3 years ago

PortablePanda commented 3 years ago

It seems as if Co-op currently isn't looping properly. After ending a fight, the bot will properly begin a new one, but will not resume combat mode, hanging indefinitely once in combat.

The script used:

// This script starts Full-Auto mode on Turn 1.
// It will go uninterrupted until either the party wipes or the quest/raid ends.

Turn 1:
    character1.useSkill(1)
    back
end

The logs:

0:00:00 [INFO] Initializing EasyOCR reader. This may take a few seconds...
0:00:04 [INFO] EasyOCR reader initialized.

0:00:07 [INFO] Moving back to the Home screen...

0:00:11 [INFO] Optimizing window dimensions...
0:00:11 [INFO] Optimizing window dimensions complete.

0:00:11 ********************************************************************************
0:00:11 ********************************************************************************
0:00:11 [INFO] Screen Size: Size(width=1920, height=1080)
0:00:11 [INFO] Game Window Dimensions: Region(64, 80, 474, 946)
0:00:11 ********************************************************************************
0:00:11 ********************************************************************************

0:00:11 ################################################################################
0:00:11 ################################################################################
0:00:11 [FARM] Starting Farming Mode for Coop.
0:00:11 [FARM] Doing 295x runs for EXP at In a Dusk Dream.
0:00:11 ################################################################################
0:00:11 ################################################################################

0:00:12 [INFO] Bot is at the Home screen.
0:00:17 [INFO] Occurrence for COOP_HOST_QUEST found at: Point(x=306, y=351)
0:00:17 [INFO] Occurrence for COOP_HOST_QUEST found at: Point(x=306, y=471)
0:00:17 [INFO] Occurrence for COOP_HOST_QUEST found at: Point(x=306, y=591)
0:00:17 [INFO] Occurrence for COOP_HOST_QUEST found at: Point(x=306, y=711)
0:00:17 [INFO] Occurrence for COOP_HOST_QUEST found at: Point(x=306, y=831)
0:00:17 [INFO] Occurrence for COOP_HOST_QUEST found at: Point(x=306, y=951)
0:00:20 [WARNING] Failed to find the COOP_HARD_SELECTED button.

0:00:22 [INFO] Hard difficulty for Coop is now selected.
0:00:22 [INFO] Now navigating to "In a Dusk Dream" for Hard difficulty.
0:00:24 [INFO] Occurrence for COOP_HOST_QUEST_CIRCLE found at: Point(x=465, y=445)
0:00:24 [INFO] Occurrence for COOP_HOST_QUEST_CIRCLE found at: Point(x=465, y=520)
0:00:24 [INFO] Occurrence for COOP_HOST_QUEST_CIRCLE found at: Point(x=465, y=595)
0:00:24 [INFO] Occurrence for COOP_HOST_QUEST_CIRCLE found at: Point(x=465, y=670)

0:00:26 [INFO] Opening up a new Coop room...

0:00:32 [INFO] Selecting a Party for Coop mission: "In a Dusk Dream".
0:00:34 [INFO] AP was auto-restored according to your config.ini. Continuing...
0:00:34 [INFO] Now checking if bot is currently at Coop Party Selection screen...
0:00:36 [INFO] Bot is currently at Coop Party Selection screen.

0:00:48 ################################################################################
0:00:48 ################################################################################
0:00:48 [COMBAT] Starting Combat Mode.
0:00:48 ################################################################################
0:00:48 ################################################################################

0:00:48 [COMBAT] Now loading up combat script at D:/Desktop/granblue-automation-pyautogui-main/scripts/slimecoop.txt
0:00:49 [COMBAT] Reading command: turn 1:
0:00:49 [COMBAT] Starting Turn 1.
0:00:50 [COMBAT] Reading command for this Turn block: character1.useskill(1)
0:00:52 [COMBAT] Character 1 uses Skill 1.
0:00:57 [COMBAT] Reading command for this Turn block: back
0:00:59 [COMBAT] Tapped the Back button.
0:01:03 [COMBAT] Reading command for this Turn block: end

0:01:03 [COMBAT] Bot has reached end of script. Automatically attacking until battle ends or Party wipes...

0:01:03 ################################################################################
0:01:03 ################################################################################
0:01:03 [COMBAT] Ending Combat Mode.
0:01:03 ################################################################################
0:01:03 ################################################################################

0:01:03 [INFO] Bot has reached the Quest Results screen.

0:01:07 [INFO] Detecting if any user-specified loot dropped from this run...

0:01:07 ********************************************************************************
0:01:07 ********************************************************************************
0:01:07 [FARM] Farming Mode: Coop
0:01:07 [FARM] Mission: In a Dusk Dream
0:01:07 [FARM] Summons: []
0:01:07 [FARM] Amount of runs completed: 1 / 295
0:01:07 ********************************************************************************
0:01:07 ********************************************************************************

0:01:07 [INFO] Resting period complete.

The screen state on hang:

image

steve1316 commented 3 years ago

Fixed the infinite hang bug for repeated Coop runs. Let me know how it goes!