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

Loot Screen Stuck #5

Closed zorkings closed 3 years ago

zorkings commented 3 years ago

If you get an emp mastery level up notice of a character after battle victory it hangs on checking loot in the script

qwe8585 commented 3 years ago

True zorkings there is no check for emp mastery level up check after battles.

steve1316 commented 3 years ago

Thank you for reporting that! I completely forgot this was a thing. It should be a very easy fix.

steve1316 commented 3 years ago

Just pushed a simple update that will double click the screen in the while loop that tries to clear away any popups during loot collection. Let me know how it goes!

zorkings commented 3 years ago

Did get stuck today as well, but I wasn't paying attention, could it be consecutive EMP level ups or does it recheck for obstructions each time it clears one away

steve1316 commented 3 years ago

In my collect_loot() method, there is a while loop that will continuously click any detected "OK", "Cancel", and "Close" buttons in that order and then it will double click the screen to hopefully clear away any EMP level ups.

This will go on indefinitely until it detects the "loot_collected_header" image: loot_collected_header

Have not seen any infinite loop hangups when collecting while farming raids this morning. If you can, can you turn on "Debug Mode" in the Settings Page and upload the text log here when you get stuck again?

Or even better, screenshot/record it running when it gets stuck. I feel like I covered every possible case that could cause the bot to loop infinitely while checking for loot but I could always be wrong.

steve1316 commented 3 years ago

Commit 429b7b05d0069fe9486c3ff6fcf8c97fb6229a48 has just been posted and it deals with some bugs, mainly the double clicking on the screen has now been replaced with detection of the EMP level up pop up and subsequent clicking on the "NEW" portion of the popup.

This should eliminate cases where on smaller screens, the previous method of double clicking the screen would accidentally click on an item or button and mess up the bot.

steve1316 commented 3 years ago

Closing this issue due to inactivity. Please feel free to open another issue in the future when you encounter further problems!