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

Script reading quite slow #110

Closed JuanJFG closed 2 years ago

JuanJFG commented 2 years ago

Script reading has become a bit slow this last update. I'm running a Ryzen 7 4700u and it hasn't been this slow in past updates.

0:01:19 ###################################################################### 0:01:19 ###################################################################### 0:01:19 [COMBAT] Starting Combat Mode. 0:01:19 ###################################################################### 0:01:19 ######################################################################

0:01:19 Name of combat script loaded: Light.txt 0:01:19 Size of script commands: 9

0:01:28 [COMBAT] Reading command: "turn 1:"

0:01:34 [COMBAT] Starting Turn 1.

0:01:42 [COMBAT] Reading command: "enablefullauto" 0:01:42 [COMBAT] Bot will now attempt to enable Full Auto... 0:01:45 [COMBAT] Full Auto is now enabled.

It takes a good ~20 seconds from battle start to first action most of the time now.

steve1316 commented 2 years ago

What does the log file say when you turn debug mode on and redo the same scenario as above?

JuanJFG commented 2 years ago

0:02:14 ###################################################################### 0:02:14 ###################################################################### 0:02:14 [COMBAT] Starting Combat Mode. 0:02:14 ###################################################################### 0:02:14 ######################################################################

0:02:14 Name of combat script loaded: Light.txt 0:02:14 Size of script commands: 9

0:02:14 [DEBUG] Starting process to find the ATTACK button image... 0:02:14 [WARNING] Match not found with 0.6909209489822388 not >= 0.8 at Point (207, 726). 0:02:14 [WARNING] Match not found with 0.6909209489822388 not >= 0.8 at Point (207, 726). 0:02:14 [WARNING] Match not found with 0.6909209489822388 not >= 0.8 at Point (207, 726). 0:02:15 [WARNING] Match not found with 0.6909209489822388 not >= 0.8 at Point (207, 726). 0:02:15 [DEBUG] Match found with 0.9889267683029175 >= 0.8 at Point (368, 487)

0:02:15 [DEBUG] Starting process to find the NO_LOOT button image... 0:02:15 [WARNING] Match not found with 0.400038480758667 not >= 0.8 at Point (12, 799). 0:02:15 [WARNING] Match not found with 0.400038480758667 not >= 0.8 at Point (12, 799). 0:02:15 [WARNING] Match not found with 0.400038480758667 not >= 0.8 at Point (12, 799). 0:02:16 [WARNING] Match not found with 0.400038480758667 not >= 0.8 at Point (12, 799). 0:02:16 [WARNING] Match not found with 0.400038480758667 not >= 0.8 at Point (12, 799). 0:02:16 [WARNING] Match not found with 0.400038480758667 not >= 0.8 at Point (12, 799). 0:02:16 [WARNING] Match not found with 0.400038480758667 not >= 0.8 at Point (12, 799). 0:02:16 [WARNING] Match not found with 0.400038480758667 not >= 0.8 at Point (12, 799). 0:02:17 [WARNING] Match not found with 0.400038480758667 not >= 0.8 at Point (12, 799). 0:02:17 [WARNING] Match not found with 0.400038480758667 not >= 0.8 at Point (12, 799).

0:02:17 [DEBUG] Starting process to find the BATTLE_CONCLUDED button image... 0:02:17 [WARNING] Match not found with 0.3911041021347046 not >= 0.8 at Point (158, 982). 0:02:17 [WARNING] Match not found with 0.3911041021347046 not >= 0.8 at Point (158, 982). 0:02:17 [WARNING] Match not found with 0.3911041021347046 not >= 0.8 at Point (158, 982). 0:02:18 [WARNING] Match not found with 0.3911041021347046 not >= 0.8 at Point (158, 982). 0:02:18 [WARNING] Match not found with 0.3911041021347046 not >= 0.8 at Point (158, 982). 0:02:18 [WARNING] Match not found with 0.3911041021347046 not >= 0.8 at Point (158, 982). 0:02:18 [WARNING] Match not found with 0.3911041021347046 not >= 0.8 at Point (158, 982). 0:02:18 [WARNING] Match not found with 0.3911041021347046 not >= 0.8 at Point (158, 982). 0:02:18 [WARNING] Match not found with 0.3911041021347046 not >= 0.8 at Point (158, 982). 0:02:19 [WARNING] Match not found with 0.3911041021347046 not >= 0.8 at Point (158, 982).

0:02:19 [DEBUG] Starting process to find the EXP_GAINED button image... 0:02:19 [WARNING] Match not found with 0.34115302562713623 not >= 0.8 at Point (160, 984). 0:02:19 [WARNING] Match not found with 0.34115302562713623 not >= 0.8 at Point (160, 984). 0:02:19 [WARNING] Match not found with 0.34115302562713623 not >= 0.8 at Point (160, 984). 0:02:19 [WARNING] Match not found with 0.34115302562713623 not >= 0.8 at Point (160, 984). 0:02:20 [WARNING] Match not found with 0.34115302562713623 not >= 0.8 at Point (160, 984). 0:02:20 [WARNING] Match not found with 0.34115302562713623 not >= 0.8 at Point (160, 984). 0:02:20 [WARNING] Match not found with 0.34115302562713623 not >= 0.8 at Point (160, 984). 0:02:20 [WARNING] Match not found with 0.34115302562713623 not >= 0.8 at Point (160, 984). 0:02:20 [WARNING] Match not found with 0.34115302562713623 not >= 0.8 at Point (160, 984). 0:02:21 [WARNING] Match not found with 0.34115302562713623 not >= 0.8 at Point (160, 984).

0:02:21 [COMBAT] Reading command: "turn 1:"

0:02:21 [DEBUG] Starting process to find the DIALOG_LYRIA button image... 0:02:21 [WARNING] Match not found with 0.4200456738471985 not >= 0.8 at Point (26, 506). 0:02:21 [WARNING] Match not found with 0.4278981387615204 not >= 0.8 at Point (26, 506). 0:02:21 [WARNING] Match not found with 0.4219397008419037 not >= 0.8 at Point (26, 506). 0:02:21 [WARNING] Match not found with 0.4063929319381714 not >= 0.8 at Point (26, 506). 0:02:21 [WARNING] Match not found with 0.400997132062912 not >= 0.8 at Point (26, 506). 0:02:22 [WARNING] Match not found with 0.39477041363716125 not >= 0.8 at Point (104, 3). 0:02:22 [WARNING] Match not found with 0.39477041363716125 not >= 0.8 at Point (104, 3). 0:02:22 [WARNING] Match not found with 0.39477041363716125 not >= 0.8 at Point (104, 3). 0:02:22 [WARNING] Match not found with 0.39477041363716125 not >= 0.8 at Point (104, 3). 0:02:22 [WARNING] Match not found with 0.4001322388648987 not >= 0.8 at Point (26, 506).

0:02:22 [DEBUG] Starting process to find the DIALOG_VYRN button image... 0:02:23 [WARNING] Match not found with 0.508460521697998 not >= 0.8 at Point (112, 3). 0:02:23 [WARNING] Match not found with 0.508460521697998 not >= 0.8 at Point (112, 3). 0:02:23 [WARNING] Match not found with 0.508460521697998 not >= 0.8 at Point (112, 3). 0:02:23 [WARNING] Match not found with 0.508460521697998 not >= 0.8 at Point (112, 3). 0:02:23 [WARNING] Match not found with 0.508460521697998 not >= 0.8 at Point (112, 3). 0:02:23 [WARNING] Match not found with 0.508460521697998 not >= 0.8 at Point (112, 3). 0:02:24 [WARNING] Match not found with 0.508460521697998 not >= 0.8 at Point (112, 3). 0:02:24 [WARNING] Match not found with 0.508460521697998 not >= 0.8 at Point (112, 3). 0:02:24 [WARNING] Match not found with 0.508460521697998 not >= 0.8 at Point (112, 3). 0:02:24 [WARNING] Match not found with 0.508460521697998 not >= 0.8 at Point (112, 3).

0:02:24 [COMBAT] Starting Turn 1.

0:02:24 [DEBUG] Starting process to find the NO_LOOT button image... 0:02:24 [WARNING] Match not found with 0.400038480758667 not >= 0.8 at Point (12, 799). 0:02:25 [WARNING] Match not found with 0.400038480758667 not >= 0.8 at Point (12, 799). 0:02:25 [WARNING] Match not found with 0.400038480758667 not >= 0.8 at Point (12, 799). 0:02:25 [WARNING] Match not found with 0.400038480758667 not >= 0.8 at Point (12, 799). 0:02:25 [WARNING] Match not found with 0.400038480758667 not >= 0.8 at Point (12, 799). 0:02:25 [WARNING] Match not found with 0.400038480758667 not >= 0.8 at Point (12, 799). 0:02:26 [WARNING] Match not found with 0.400038480758667 not >= 0.8 at Point (12, 799). 0:02:26 [WARNING] Match not found with 0.400038480758667 not >= 0.8 at Point (12, 799). 0:02:26 [WARNING] Match not found with 0.400038480758667 not >= 0.8 at Point (12, 799). 0:02:26 [WARNING] Match not found with 0.400038480758667 not >= 0.8 at Point (12, 799).

0:02:26 [DEBUG] Starting process to find the BATTLE_CONCLUDED button image... 0:02:26 [WARNING] Match not found with 0.3911041021347046 not >= 0.8 at Point (158, 982). 0:02:26 [WARNING] Match not found with 0.3911041021347046 not >= 0.8 at Point (158, 982). 0:02:27 [WARNING] Match not found with 0.3911041021347046 not >= 0.8 at Point (158, 982). 0:02:27 [WARNING] Match not found with 0.3911041021347046 not >= 0.8 at Point (158, 982). 0:02:27 [WARNING] Match not found with 0.3911041021347046 not >= 0.8 at Point (158, 982). 0:02:27 [WARNING] Match not found with 0.3911041021347046 not >= 0.8 at Point (158, 982). 0:02:27 [WARNING] Match not found with 0.3911041021347046 not >= 0.8 at Point (158, 982). 0:02:28 [WARNING] Match not found with 0.3911041021347046 not >= 0.8 at Point (158, 982). 0:02:28 [WARNING] Match not found with 0.3911041021347046 not >= 0.8 at Point (158, 982). 0:02:28 [WARNING] Match not found with 0.3911041021347046 not >= 0.8 at Point (158, 982).

0:02:28 [DEBUG] Starting process to find the EXP_GAINED button image... 0:02:28 [WARNING] Match not found with 0.3411537706851959 not >= 0.8 at Point (160, 984). 0:02:28 [WARNING] Match not found with 0.3411537706851959 not >= 0.8 at Point (160, 984). 0:02:29 [WARNING] Match not found with 0.3411537706851959 not >= 0.8 at Point (160, 984). 0:02:29 [WARNING] Match not found with 0.3411537706851959 not >= 0.8 at Point (160, 984). 0:02:29 [WARNING] Match not found with 0.3411537706851959 not >= 0.8 at Point (160, 984). 0:02:29 [WARNING] Match not found with 0.3411537706851959 not >= 0.8 at Point (160, 984). 0:02:29 [WARNING] Match not found with 0.3411537706851959 not >= 0.8 at Point (160, 984). 0:02:29 [WARNING] Match not found with 0.3411537706851959 not >= 0.8 at Point (160, 984). 0:02:30 [WARNING] Match not found with 0.3411537706851959 not >= 0.8 at Point (160, 984). 0:02:30 [WARNING] Match not found with 0.3411537706851959 not >= 0.8 at Point (160, 984).

0:02:30 [COMBAT] Reading command: "enablefullauto" 0:02:30 [COMBAT] Bot will now attempt to enable Full Auto...

0:02:30 [DEBUG] Attempting to find and click the button: "full_auto".

0:02:30 [DEBUG] Starting process to find the FULL_AUTO button image... 0:02:30 [DEBUG] Match found with 0.9694948196411133 >= 0.8 at Point (57, 516) 0:02:30 [DEBUG] Old coordinates: (57, 516) 0:02:30 [DEBUG] New coordinates: (52, 515) 0:02:33 [COMBAT] Full Auto is now enabled.

steve1316 commented 2 years ago

You have your "General Image Template Matching for Buttons" set to 10 which is why the bot spends so much time searching for locations that are not there.

JuanJFG commented 2 years ago

Thank you very much, it's fixed now.