ilpersi / BHBot

A bot that automates a game called Bit Heroes
GNU General Public License v3.0
28 stars 32 forks source link

Invasion button 5 seconds delayed #139

Closed ghost closed 4 years ago

ghost commented 4 years ago

Describe the bug Invasion Play button reacts after 5 seconds.

App get restarted when trying invasion: INFO - Attempting invasion... ERROR - Unable to find the Accept button in the Invasion screen WARN - Doing driver emergency restart...

To Reproduce enable setting for invasion

Expected behavior Push accept button on invasion dialog

Desktop (please complete the following information): win7 Chromium as needed BHBot latest version

ilpersi commented 4 years ago

I am unable to reproduce this with many different invasions. I've just released a new preview release (v44pr1) can you have a look to check if that is working fine for you?

ghost commented 4 years ago

Problem remains. What do you mean with different invasions?

Fortigate commented 4 years ago

I'm getting the same issue, I've always assumed it's due to the cue being detected while it's sliding in but it only seems to happen with the 'accept' cue.

Perhaps we should make a clickOnSegSecurely() function?

ilpersi commented 4 years ago

I completed hundreds of instances with no issues.

To better address this we need more details. Please do the following step

Once that the issue is reproduced attach to this issue the detailed log and the screenshot that is generated upon restart (you can find it in the screenshots\errors subfolder inside the BHBot folder).

ghost commented 4 years ago

2020-01-02 17:23:49,490 [main] DEBUG BHBotLogger - Reading JAR File for cues in path cues/familiars/new_format/ 2020-01-02 17:23:50,083 [main] DEBUG BHBotLogger - Found 134 familiar cues. 2020-01-02 17:23:50,098 [main] INFO BHBotLogger - BHBot v43 build on Thu Jan 02 16:57:15 CET 2020 started. 2020-01-02 17:23:50,098 [main] INFO BHBotLogger - GIT commit id: f0e6ae22a59313195071765dbfa1c31c135d563d time: 2019-12-26T00:18:57+0100 2020-01-02 17:23:51,424 [main] WARN BHBotLogger - You are running on a bleeding edge version of BHBot and there may be bugs. 2020-01-02 17:23:51,424 [main] INFO BHBotLogger - Settings loaded from file 2020-01-02 17:23:51,424 [main] DEBUG BHBotLogger - Found Chromium in C:\Users\xxxx\AppData\Local\Chromium\Application\chrome.exe 2020-01-02 17:23:51,424 [main] DEBUG BHBotLogger - Found chromedriver in C:\BHBot\chromedriver.exe 2020-01-02 17:23:51,424 [main] DEBUG BHBotLogger - Found screenshots in C:\BHBot\screenshots 2020-01-02 17:23:51,471 [DungeonThread] INFO BHBotLogger - Bot started successfully! 2020-01-02 17:24:11,519 [DungeonThread] INFO BHBotLogger - Game element found. Starting to run bot.. 2020-01-02 17:24:52,020 [DungeonThread] INFO BHBotLogger - Startup check to make sure autoShrine is initially disabled 2020-01-02 17:24:54,891 [DungeonThread] DEBUG BHBotLogger - Ignore Boss Disabled 2020-01-02 17:24:54,978 [DungeonThread] DEBUG BHBotLogger - Ignore Shrine Disabled 2020-01-02 17:25:00,707 [DungeonThread] DEBUG BHBotLogger - Checking activity: i 2020-01-02 17:25:05,789 [DungeonThread] READOUT BHBotLogger - Badges: 2, required: >0, Invasion cost: 1 2020-01-02 17:25:05,791 [DungeonThread] DEBUG BHBotLogger - autoRunesDefault not defined; aborting autoRunes 2020-01-02 17:25:07,467 [DungeonThread] INFO BHBotLogger - Attempting invasion... 2020-01-02 17:25:14,763 [DungeonThread] ERROR BHBotLogger - Unable to find the Accept button in the Invasion screen, restarting! 2020-01-02 17:25:14,773 [DungeonThread] WARN BHBotLogger - Doing driver emergency restart...

ghost commented 4 years ago

crash_20200102_6

ilpersi commented 4 years ago

Can you please test with this custom build?

Based on the info you provided I've added some additional checks in the code that should address your issue and I have no way of testing them.

ghost commented 4 years ago

Still happening.

ilpersi commented 4 years ago

Can you please post the logs and the screenshot with the updated custom build?

ghost commented 4 years ago

invasion finished yesterday, I dont have debug lvl logs from it

ilpersi commented 4 years ago

The bot archives all the logs in the /logs folder (by month), so if yesterday you run it in debug they should be there.

I know Invasion is over, I was hoping to get some additional info to tweak the code even more for the next time Invasion is up.

ghost commented 4 years ago

unfortunately I turned off debug after the first try. Did you added new debug messages?

2020-01-02 18:36:11,836 [DungeonThread] INFO BHBotLogger - Bot started successfully! 2020-01-02 18:36:31,418 [DungeonThread] INFO BHBotLogger - Game element found. Starting to run bot.. 2020-01-02 18:37:12,907 [DungeonThread] INFO BHBotLogger - Startup check to make sure autoShrine is initially disabled 2020-01-02 18:37:28,583 [DungeonThread] READOUT BHBotLogger - Badges: 4, required: >0, Invasion cost: 1 2020-01-02 18:37:30,314 [DungeonThread] INFO BHBotLogger - Attempting invasion... 2020-01-02 18:37:37,899 [DungeonThread] ERROR BHBotLogger - Unable to find the Accept button in the Invasion screen, restarting! 2020-01-02 18:37:37,909 [DungeonThread] WARN BHBotLogger - Doing driver emergency restart...

screenshot looks the same as in the first try

ghost commented 4 years ago

The problem is after click on blue PLAY button. It takes 5 seconds that play button is released and screen with ACCEPT button is opened. This is game behavior not caused with BOT.

ilpersi commented 4 years ago

@Hakatitla is this still happening with invasion?

ghost commented 4 years ago

Problem occurring again

ilpersi commented 4 years ago

Can you confirm you are running the newly released v44.1?

ghost commented 4 years ago

yes, updated today

ilpersi commented 4 years ago

Can you please put the log to DEBUG and attach it, togheter with a screenshot of the crash, to this thread?

Make sure to hide sensitive information.

ghost commented 4 years ago

2020-03-21 23:14:02,230 [main] INFO BHBotLogger - BHBot v44.1 build on Sat Mar 21 11:21:05 CET 2020 started. 2020-03-21 23:14:02,232 [main] INFO BHBotLogger - GIT commit id: f46bb00e805aa1be3ee631a019f95df1b4e80c2c time: 2020-03-20T16:43:06+0100 2020-03-21 23:14:03,421 [main] DEBUG BHBotLogger - BHBot is running on the latest version. 2020-03-21 23:14:03,422 [main] INFO BHBotLogger - Settings loaded from file 2020-03-21 23:14:03,424 [main] DEBUG BHBotLogger - Found Chromium in C:\Users\seinsitiveInfo\AppData\Local\Chromium\Application\chrome.exe 2020-03-21 23:14:03,426 [main] DEBUG BHBotLogger - Found chromedriver in C:\BHBot\chromedriver.exe 2020-03-21 23:14:03,427 [main] DEBUG BHBotLogger - Found screenshots in C:\BHBot\screenshots 2020-03-21 23:14:03,479 [DungeonThread] INFO BHBotLogger - Bot started successfully! 2020-03-21 23:14:25,595 [DungeonThread] INFO BHBotLogger - Game element found. Starting to run bot.. 2020-03-21 23:17:58,335 [DungeonThread] INFO BHBotLogger - Initializing autoShrine to make sure it is disabled 2020-03-21 23:18:02,125 [DungeonThread] DEBUG BHBotLogger - Ignore Boss Disabled 2020-03-21 23:18:02,164 [DungeonThread] DEBUG BHBotLogger - Ignore Shrine Disabled 2020-03-21 23:18:05,381 [DungeonThread] DEBUG BHBotLogger - Checking activity: i 2020-03-21 23:18:09,448 [DungeonThread] READOUT BHBotLogger - Badges: 1, required: >0, Invasion cost: 1 2020-03-21 23:18:09,449 [DungeonThread] DEBUG BHBotLogger - autoRunesDefault not defined; aborting autoRunes 2020-03-21 23:18:11,159 [DungeonThread] INFO BHBotLogger - Attempting invasion... 2020-03-21 23:18:14,555 [DungeonThread] INFO BHBotLogger - Detected invasion cost: 5, settings cost is 1. Changing.. 2020-03-21 23:18:28,361 [DungeonThread] ERROR BHBotLogger - Unable to find the Accept button in the Invasion screen, restarting! 2020-03-21 23:18:28,364 [DungeonThread] WARN BHBotLogger - Doing driver emergency restart...

ghost commented 4 years ago

crash_20200321_11

Bot is doing restart just before dialog in screenshot opens.

ilpersi commented 4 years ago

Can you please test this build?

I've increased the timeout for the accept window.

ghost commented 4 years ago

@ilpersi works ok. Thank you