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
122 stars 36 forks source link

Crash when trying to select animus as raid #203

Open Darudado opened 1 year ago

Darudado commented 1 year ago

I tried to select animus as a farmable raid. Script got to the selection of the raids, deleted the old slots and then crashed there. Error stack:

0:00:22 [ERROR] Bot encountered exception in Farming Mode:

Traceback (most recent call last):

File "C:\Users\Desktop\auto0\backend\bot\game.py", line 1026, in start_farming_mode

Raid.start(first_run)

File "C:\Users\Desktop\auto0\backend\bot\game_modes\raid.py", line 301, in start

Raid._navigate()

File "C:\Users\Desktop\auto0\backend\bot\game_modes\raid.py", line 283, in _navigate

Raid._join_raid()

File "C:\Users\Desktop\auto0\backend\bot\game_modes\raid.py", line 223, in _join_raid

MouseUtils.move_and_click_point(checkboxes[int(list_pos - 1)][0], checkboxes[int(list_pos - 1)][1], "raid_filter_checkbox")

TypeError: unsupported operand type(s) for -: 'str' and 'int'

christianciu commented 1 year ago

Same issue with me, but for Ultima Unit farm

Tried with Michael Anima and getting same result. It happens after bot clearing filter and choosing Standard / Impossible tabs, then the mouse just moved right outside of game window and crash

christianciu commented 1 year ago

@Darudado so i found the fix

Seems like list_pos data type is str, so all you need to do is edit raid.py line 223 into

MouseUtils.move_and_click_point(checkboxes[int(int(list_pos) - 1)][0], checkboxes[int(int(list_pos) - 1)][1], "raid_filter_checkbox")

Ultima Unit farm still broken for me tho ..... seems like there is a problem with grid position but at least some progress on the issue

christianciu commented 1 year ago

Looks like joining raid is broken for non first row in filter raid

If you really really really need to farm it, i delete code from raid.py line 193-228 This will skip clearing filtered raid and choosing raid, so you need to manually filter the needed raid in First filter. So far working for me when i'm farming Ultima Unit