renatofmmaia / bomb-bot

Bot developed in python, 100% open-source, compatible with Windows and Linux.
67 stars 48 forks source link

Bot frequently refreshing the browser due to : [02-14 16:27] => ?? Ohh no! A error has occurred in the last action. Timeout waiting for screen TREASURE_HUNT. Check the log file for more details. #39

Closed yas51ne closed 2 years ago

yas51ne commented 2 years ago

OS: Linux Browser: Firefox image

The Log file shows the following:

  File "main.py", line 63, in main
    manager.do_what_needs_to_be_done(current_screen)
  File "/home/headless/bombcrypto-bot/bomb-bot-master/module/manager.py", line 46, in do_what_needs_to_be_done
    Hero.who_needs_work(self)
  File "/home/headless/bombcrypto-bot/bomb-bot-master/module/bombScreen.py", line 220, in who_needs_work
    BombScreen.go_to_home(manager)
  File "/home/headless/bombcrypto-bot/bomb-bot-master/module/bombScreen.py", line 95, in go_to_home
    Login.do_login(manager)
  File "/home/headless/bombcrypto-bot/bomb-bot-master/module/bombScreen.py", line 192, in do_login
    if (BombScreen.wait_for_screen(BombScreenEnum.HOME.value) != BombScreenEnum.HOME.value):
  File "/home/headless/bombcrypto-bot/bomb-bot-master/module/bombScreen.py", line 41, in wait_for_screen
    raise Exception(f'Timeout waiting for screen {BombScreenEnum(bombScreenEnum).name}.')
Exception: Timeout waiting for screen HOME.

[02-14 16:24] => Traceback (most recent call last):
  File "main.py", line 63, in main
    manager.do_what_needs_to_be_done(current_screen)
  File "/home/headless/bombcrypto-bot/bomb-bot-master/module/manager.py", line 38, in do_what_needs_to_be_done
    Hero.do_check_error(self)
  File "/home/headless/bombcrypto-bot/bomb-bot-master/module/bombScreen.py", line 296, in do_check_error
    BombScreen.go_to_treasure_hunt(manager)
  File "/home/headless/bombcrypto-bot/bomb-bot-master/module/bombScreen.py", line 126, in go_to_treasure_hunt
    BombScreen.wait_for_screen(BombScreenEnum.TREASURE_HUNT.value)
  File "/home/headless/bombcrypto-bot/bomb-bot-master/module/bombScreen.py", line 41, in wait_for_screen
    raise Exception(f'Timeout waiting for screen {BombScreenEnum(bombScreenEnum).name}.')
Exception: Timeout waiting for screen TREASURE_HUNT.

[02-14 16:27] => Traceback (most recent call last):
  File "main.py", line 63, in main
    manager.do_what_needs_to_be_done(current_screen)
  File "/home/headless/bombcrypto-bot/bomb-bot-master/module/manager.py", line 38, in do_what_needs_to_be_done
    Hero.do_check_error(self)
  File "/home/headless/bombcrypto-bot/bomb-bot-master/module/bombScreen.py", line 296, in do_check_error
    BombScreen.go_to_treasure_hunt(manager)
  File "/home/headless/bombcrypto-bot/bomb-bot-master/module/bombScreen.py", line 126, in go_to_treasure_hunt
    BombScreen.wait_for_screen(BombScreenEnum.TREASURE_HUNT.value)
  File "/home/headless/bombcrypto-bot/bomb-bot-master/module/bombScreen.py", line 41, in wait_for_screen
    raise Exception(f'Timeout waiting for screen {BombScreenEnum(bombScreenEnum).name}.')
Exception: Timeout waiting for screen TREASURE_HUNT.

[02-14 16:29] => Traceback (most recent call last):
  File "main.py", line 63, in main
    manager.do_what_needs_to_be_done(current_screen)
  File "/home/headless/bombcrypto-bot/bomb-bot-master/module/manager.py", line 38, in do_what_needs_to_be_done
    Hero.do_check_error(self)
  File "/home/headless/bombcrypto-bot/bomb-bot-master/module/bombScreen.py", line 295, in do_check_error
    BombScreen.go_to_heroes(manager)
  File "/home/headless/bombcrypto-bot/bomb-bot-master/module/bombScreen.py", line 105, in go_to_heroes
    BombScreen.wait_for_screen(BombScreenEnum.HEROES.value)
  File "/home/headless/bombcrypto-bot/bomb-bot-master/module/bombScreen.py", line 41, in wait_for_screen
    raise Exception(f'Timeout waiting for screen {BombScreenEnum(bombScreenEnum).name}.')
Exception: Timeout waiting for screen HEROES.

My configuration is:

generals:
  # Save all logs in file logs/logger.txt
  #   0: Don't save log
  #   1: Save log
  save_log_file: 0

  # Reset log file on start
  #   0: false
  #   1: true
  reset_log_file: 1

  # Which hotkey is used to refresh the browser
  #   1: CTRL + F5
  #   2: CTRL + SHIFT + R
  refresh_page_shortcut: 2
  # Time format to show on logs:
  # Full date time: "%Y-%m-%d %H:%M:%S"
  time_format: "%m-%d %H:%M"

heroes_work_mod:
  # Properties that identifies heroes to work according rarity and life %;
  #   Available options: 0, 10, 20, 30, 40, 50, 60, 70, 80, 90 or 100.
  Common: 60
  Rare: 40
  SuperRare: 30
  Epic: 30
  Legend: 30
  SuperLegend: 30

screen:
  # Number of login attempts
  number_login_attempts: 3

  # Time to update hero positions on farm screen
  refresh_hunt: 7

  # Timer to check who needs to go back to work
  refresh_heroes: 25

  # Timer to force browser refresh, prevent indestructible blocks and other possibles errors
  refresh_login: 3600

  # Timer to check popup screen errors, if it's in error, restarts with login again
  refresh_check_error: 20

  # Chest photo type, for sending via Telegram
  #   true: The entire screen where the browser tab will be
  #   false: Just chest screen with your coins
  print_full_screen: false

  scroll_heroes:
    # total number of times the screen scrolls down
    repeat: 3

    # distance when scrolling down
    distance: -375

    # duration of scrolling
    duration: 2 

    # Wait time to stop scrolling before checking the heroes on the screen.
    wait: 1

telegram:
  # Settings for telegram integration 
  token: ""
  chat_id: 0

  # Timer when your chest image is sent to telegram
  refresh_print_chest: 60

# xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# DONT CHANGE THIS CONFIGS
# ------------------------
threshold:
  default: 0.7
  hero_to_work: 0.9
# xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hiagopinacio commented 2 years ago

For some reason, Firefox is cutting the top edge of your game. This messed up the recognition of targets and must be what is causing the problem. The game must be showing 100% on the screen