Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alas stuck on Ambush Warning #3836

Closed
4 tasks done
Luiso9 opened this issue May 31, 2024 · 2 comments
Closed
4 tasks done

Alas stuck on Ambush Warning #3836

Luiso9 opened this issue May 31, 2024 · 2 comments
Labels
bug / 缺陷 Something isn't working

Comments

@Luiso9
Copy link

Luiso9 commented May 31, 2024

Before you asking

  • I have searched the existing issues
  • I spend at least 5 minutes for thinking and preparing
  • I checked Frequently Asked Questions (FAQ) in Wiki page
  • I am using the latest version of Alas

Describe the bug

I'm doing Farm>Main as usual, but got distracted by Ambush warning message which sometimes it goes on its way but also sometimes Alas can't/won't detect it and saying "Image to detect is not in_map". I get the same issue before and i thought its because i choose to Evade Ambush, but now even i choose to not evade ambush its still won't detect the Ambush Warning message (sometimes).

To Reproduce

  1. Do Farming Main
  2. Pick level that dont have 100% clear or dont use auto search
  3. Keep playing as usual until you get Ambush Warning
  4. Alas sometimes cant detect if there's ambush or no
  5. If Alas cant detect it, it will show error like this MapDetectionError: Image to detect is not in_map

Expected behavior

Alas should choose either Evade or Battle.

Relevant log output

INFO     11:24:09.970 │ [prev.center_offset] [0.47899709 0.4419674 ]                           
WARNING  11:24:10.287 │ Image to detect is not in_map                                          
WARNING  11:24:10.634 │ Image to detect is not in_map                                          
WARNING  11:24:11.013 │ Image to detect is not in_map                                          
WARNING  11:24:11.365 │ Image to detect is not in_map                                          
WARNING  11:24:11.703 │ Image to detect is not in_map                                          
WARNING  11:24:12.100 │ Image to detect is not in_map                                          
WARNING  11:24:12.498 │ Image to detect is not in_map                                          
WARNING  11:24:12.911 │ Image to detect is not in_map                                          
WARNING  11:24:13.287 │ Image to detect is not in_map                                          
WARNING  11:24:13.729 │ Image to detect is not in_map                                          
WARNING  11:24:14.137 │ Image to detect is not in_map                                          
WARNING  11:24:14.498 │ Image to detect is not in_map                                          
WARNING  11:24:14.879 │ Image to detect is not in_map                                          
WARNING  11:24:15.277 │ Image to detect is not in_map                                          
ERROR    11:24:15.340 │ MapDetectionError: Image to detect is not in_map                       
         ╭──────────────────────── Traceback (most recent call last) ─────────────────────────╮
         │                                                                                    │
         │ D:\Automation-scripts\ALAS\alas.py:68 in run                                       │
         │                                                                                    │
         │    66 │   │   try:                                                                 │
         │    67 │   │   │   self.device.screenshot()                                         │
         │ ❱  68 │   │   │   self.__getattribute__(command)()                                 │
         │    69 │   │   │   return True                                                      │
         │    70 │   │   except TaskEnd:                                                      │
         │                                                                                    │
         │ ╭───────────────────────────── locals ─────────────────────────────╮               │
         │ │ command = 'main'                                                 │               │
         │ │       e = MapDetectionError('Image to detect is not in_map')     │               │
         │ │    self = <alas.AzurLaneAutoScript object at 0x0000024840458C88> │               │
         │ ╰──────────────────────────────────────────────────────────────────╯               │
         │ D:\Automation-scripts\ALAS\alas.py:343 in main                                     │
         │                                                                                    │
         │   341 │   │   from module.campaign.run import CampaignRun                          │
         │   342 │   │   CampaignRun(config=self.config, device=self.device).run(             │
         │ ❱ 343 │   │   │   name=self.config.Campaign_Name, folder=self.config.Campaign_Even │
         │       mode=self.config.Campaign_Mode)                                              │
         │   344 │                                                                            │
         │   345 │   def main2(self):                                                         │
         │                                                                                    │
         │ ╭─────────────────────────────── locals ───────────────────────────────╮           │
         │ │ CampaignRun = <class 'module.campaign.run.CampaignRun'>              │           │
         │ │        self = <alas.AzurLaneAutoScript object at 0x0000024840458C88> │           │
         │ ╰──────────────────────────────────────────────────────────────────────╯           │
         │                                                                                    │
         │ D:\Automation-scripts\ALAS\module\campaign\run.py:387 in run                       │
         │                                                                                    │
         │   385 │   │   │   self.device.click_record_clear()                                 │
         │   386 │   │   │   try:                                                             │
         │ ❱ 387 │   │   │   │   self.campaign.run()                                          │
         │   388 │   │   │   except ScriptEnd as e:                                           │
         │   389 │   │   │   │   logger.hr('Script end')                                      │
         │                                                                                    │
         │ ╭──────────────────────────────── locals ─────────────────────────────────╮        │
         │ │ folder = 'campaign_main'                                                │        │
         │ │   mode = 'normal'                                                       │        │
         │ │   name = 'campaign_8_3'                                                 │        │
         │ │   self = <module.campaign.run.CampaignRun object at 0x0000024858A66BC8> │        │
         │ │  total = 0                                                              │        │
         │ ╰─────────────────────────────────────────────────────────────────────────╯        │
         │                                                                                    │
         │ D:\Automation-scripts\ALAS\module\campaign\campaign_base.py:141 in run             │
         │                                                                                    │
         │   139 │   │   │   try:                                                             │
         │   140 │   │   │   │   if not self.map_is_auto_search:                              │
         │ ❱ 141 │   │   │   │   │   self.execute_a_battle()                                  │
         │   142 │   │   │   │   else:                                                        │
         │   143 │   │   │   │   │   self.auto_search_execute_a_battle()                      │
         │                                                                                    │
         │ ╭──────────────────────────────────── locals ────────────────────────────────────╮ │
         │ │    _ = 6                                                                       │ │
         │ │ self = <campaign.campaign_main.campaign_8_3.Campaign object at                 │ │
         │ │        0x00000248588A88C8>                                                     │ │
         │ ╰────────────────────────────────────────────────────────────────────────────────╯ │
         │                                                                                    │
         │ D:\Automation-scripts\ALAS\module\campaign\campaign_base.py:100 in                 │
         │ execute_a_battle                                                                   │
         │                                                                                    │
         │    98 │   │   for _ in range(10):                                                  │
         │    99 │   │   │   try:                                                             │
         │ ❱ 100 │   │   │   │   result = self.battle_function()                              │
         │   101 │   │   │   │   break                                                        │
         │   102 │   │   │   except MapEnemyMoved:                                            │
         │                                                                                    │
         │ ╭──────────────────────────────────── locals ────────────────────────────────────╮ │
         │ │      _ = 0                                                                     │ │
         │ │   prev = 6                                                                     │ │
         │ │ result = False                                                                 │ │
         │ │   self = <campaign.campaign_main.campaign_8_3.Campaign object at               │ │
         │ │          0x00000248588A88C8>                                                   │ │
         │ ╰────────────────────────────────────────────────────────────────────────────────╯ │
         │                                                                                    │
         │ D:\Automation-scripts\ALAS\module\base\decorator.py:70 in wrapper                  │
         │                                                                                    │
         │    68 │   │   │   │   │   │   continue                                             │
         │    69 │   │   │   │   │                                                            │
         │ ❱  70 │   │   │   │   │   return record['func'](self, *args, **kwargs)             │
         │    71 │   │   │   │                                                                │
         │    72 │   │   │   │   logger.warning(f'No option fits for {name}, using the last d │
         │       func.')                                                                      │
         │                                                                                    │
         │ ╭──────────────────────────────────── locals ────────────────────────────────────╮ │
         │ │   args = ()                                                                    │ │
         │ │    cls = <class 'module.base.decorator.Config'>                                │ │
         │ │   flag = [True]                                                                │ │
         │ │   func = <function CampaignBase.battle_function at 0x0000024859336168>         │ │
         │ │ kwargs = {}                                                                    │ │
         │ │ logger = <Logger alas (INFO)>                                                  │ │
         │ │   name = 'battle_function'                                                     │ │
         │ │ record = {                                                                     │ │
         │ │          │   'options': {'MAP_CLEAR_ALL_THIS_TIME': True},                     │ │
         │ │          │   'func': <function CampaignBase.battle_function at                 │ │
         │ │          0x0000024850780EE8>                                                   │ │
         │ │          }                                                                     │ │
         │ │   self = <campaign.campaign_main.campaign_8_3.Campaign object at               │ │
         │ │          0x00000248588A88C8>                                                   │ │
         │ ╰────────────────────────────────────────────────────────────────────────────────╯ │
         │                                                                                    │
         │ D:\Automation-scripts\ALAS\module\campaign\campaign_base.py:74 in battle_function  │
         │                                                                                    │
         │    72 │   │   │   │   │   return True                                              │
         │    73 │   │   │   │   self.clear_mechanism()                                       │
         │ ❱  74 │   │   │   │   return self.battle_default()                                 │
         │    75 │   │   else:                                                                │
         │    76 │   │   │   result = self.battle_boss()                                      │
         │                                                                                    │
         │ ╭──────────────────────────────────── locals ────────────────────────────────────╮ │
         │ │ remain = <module.map.map_grids.SelectedGrids object at 0x0000024842021B48>     │ │
         │ │   self = <campaign.campaign_main.campaign_8_3.Campaign object at               │ │
         │ │          0x00000248588A88C8>                                                   │ │
         │ ╰────────────────────────────────────────────────────────────────────────────────╯ │
         │                                                                                    │
         │ D:\Automation-scripts\ALAS\module\campaign\campaign_base.py:15 in battle_default   │
         │                                                                                    │
         │    13 │                                                                            │
         │    14 │   def battle_default(self):                                                │
         │ ❱  15 │   │   if self.clear_enemy():                                               │
         │    16 │   │   │   return True                                                      │
         │    17                                                                              │
         │                                                                                    │
         │ ╭──────────────────────────────────── locals ────────────────────────────────────╮ │
         │ │ self = <campaign.campaign_main.campaign_8_3.Campaign object at                 │ │
         │ │        0x00000248588A88C8>                                                     │ │
         │ ╰────────────────────────────────────────────────────────────────────────────────╯ │
         │                                                                                    │
         │ D:\Automation-scripts\ALAS\module\map\map.py:211 in clear_enemy                    │
         │                                                                                    │
         │   209 │   │   │   logger.hr('Clear enemy')                                         │
         │   210 │   │   │   self.show_select_grids(grids, **kwargs)                          │
         │ ❱ 211 │   │   │   self.clear_chosen_enemy(grids[0])                                │
         │   212 │   │   │   return True                                                      │
         │   213                                                                              │
         │                                                                                    │
         │ ╭──────────────────────────────────── locals ────────────────────────────────────╮ │
         │ │  grids = <module.map.map_grids.SelectedGrids object at 0x0000024842032388>     │ │
         │ │ kwargs = {'strongest': True}                                                   │ │
         │ │   self = <campaign.campaign_main.campaign_8_3.Campaign object at               │ │
         │ │          0x00000248588A88C8>                                                   │ │
         │ │ target = 'default_mode'                                                        │ │
         │ ╰────────────────────────────────────────────────────────────────────────────────╯ │
         │                                                                                    │
         │ D:\Automation-scripts\ALAS\module\map\map.py:33 in clear_chosen_enemy              │
         │                                                                                    │
         │    31 │   │   self.goto(grid, expected=expected)                                   │
         │    32 │   │                                                                        │
         │ ❱  33 │   │   self.full_scan()                                                     │
         │    34 │   │   self.find_path_initial()                                             │
         │    35 │   │   self.map.show_cost()                                                 │
         │                                                                                    │
         │ ╭──────────────────────────────────── locals ────────────────────────────────────╮ │
         │ │ battle_count = 6                                                               │ │
         │ │     expected = 'combat'                                                        │ │
         │ │         grid = G5                                                              │ │
         │ │         self = <campaign.campaign_main.campaign_8_3.Campaign object at         │ │
         │ │                0x00000248588A88C8>                                             │ │
         │ ╰────────────────────────────────────────────────────────────────────────────────╯ │
         │                                                                                    │
         │ D:\Automation-scripts\ALAS\module\map\fleet.py:546 in full_scan                    │
         │                                                                                    │
         │    544 │   │   super().full_scan(                                                  │
         │    545 │   │   │   queue=queue, must_scan=must_scan, battle_count=self.battle_coun │
         │        mystery_count=self.mystery_count,                                           │
         │ ❱  546 │   │   │   siren_count=self.siren_count, carrier_count=self.carrier_count, │
         │    547 │   │                                                                       │
         │    548 │   │   if self.config.FLEET_2 and not self.fleet_2_location:               │
         │                                                                                    │
         │ ╭──────────────────────────────────── locals ────────────────────────────────────╮ │
         │ │ __class__ = <class 'module.map.fleet.Fleet'>                                   │ │
         │ │      mode = 'normal'                                                           │ │
         │ │ must_scan = None                                                               │ │
         │ │     queue = None                                                               │ │
         │ │      self = <campaign.campaign_main.campaign_8_3.Campaign object at            │ │
         │ │             0x00000248588A88C8>                                                │ │
         │ ╰────────────────────────────────────────────────────────────────────────────────╯ │
         │                                                                                    │
         │ D:\Automation-scripts\ALAS\module\map\camera.py:439 in full_scan                   │
         │                                                                                    │
         │   437 │   │   │                                                                    │
         │   438 │   │   │   queue = queue.sort_by_camera_distance(self.camera)               │
         │ ❱ 439 │   │   │   self.focus_to(queue[0])                                          │
         │   440 │   │   │   self.focus_to_grid_center(0.25)                                  │
         │   441 │   │   │   success = self.map.update(grids=self.view, camera=self.camera, m │
         │                                                                                    │
         │ ╭──────────────────────────────────── locals ────────────────────────────────────╮ │
         │ │  battle_count = 7                                                              │ │
         │ │ carrier_count = 0                                                              │ │
         │ │          mode = 'normal'                                                       │ │
         │ │     must_scan = None                                                           │ │
         │ │ mystery_count = 1                                                              │ │
         │ │         queue = <module.map.map_grids.SelectedGrids object at                  │ │
         │ │                 0x000002485081BB48>                                            │ │
         │ │          self = <campaign.campaign_main.campaign_8_3.Campaign object at        │ │
         │ │                 0x00000248588A88C8>                                            │ │
         │ │   siren_count = 0                                                              │ │
         │ │       success = True                                                           │ │
         │ ╰────────────────────────────────────────────────────────────────────────────────╯ │
         │                                                                                    │
         │ D:\Automation-scripts\ALAS\module\map\camera.py:403 in focus_to                    │
         │                                                                                    │
         │   401 │   │   │   vector = np.array(location) - self.camera                        │
         │   402 │   │   │   swipe = tuple(np.min([np.abs(vector), swipe_limit], axis=0) *    │
         │       np.sign(vector))                                                             │
         │ ❱ 403 │   │   │   has_swiped = self.map_swipe(swipe)                               │
         │   404 │   │   │                                                                    │
         │   405 │   │   │   if not has_swiped:                                               │
         │                                                                                    │
         │ ╭──────────────────────────────────── locals ────────────────────────────────────╮ │
         │ │  has_swiped = True                                                             │ │
         │ │    location = (4, 2)                                                           │ │
         │ │        self = <campaign.campaign_main.campaign_8_3.Campaign object at          │ │
         │ │               0x00000248588A88C8>                                              │ │
         │ │       swipe = (0, -1)                                                          │ │
         │ │ swipe_limit = (4, 3)                                                           │ │
         │ │      vector = array([ 0, -1])                                                  │ │
         │ ╰────────────────────────────────────────────────────────────────────────────────╯ │
         │                                                                                    │
         │ D:\Automation-scripts\ALAS\module\map\camera.py:85 in map_swipe                    │
         │                                                                                    │
         │    83 │   │   vector = np.array(vector)                                            │
         │    84 │   │   vector = np.array([0.5, 0.5]) - self.view.center_offset + vector     │
         │ ❱  85 │   │   return self._map_swipe(vector)                                       │
         │    86 │                                                                            │
         │    87 │   def focus_to_grid_center(self, tolerance=None):                          │
         │                                                                                    │
         │ ╭──────────────────────────────────── locals ────────────────────────────────────╮ │
         │ │   self = <campaign.campaign_main.campaign_8_3.Campaign object at               │ │
         │ │          0x00000248588A88C8>                                                   │ │
         │ │ vector = array([ 0.02100291, -0.9419674 ])                                     │ │
         │ ╰────────────────────────────────────────────────────────────────────────────────╯ │
         │                                                                                    │
         │ D:\Automation-scripts\ALAS\module\map\camera.py:62 in _map_swipe                   │
         │                                                                                    │
         │    60 │   │   │   # Donno why initial commit have a sleep here                     │
         │    61 │   │   │   # self.device.sleep(0.3)                                         │
         │ ❱  62 │   │   │   self.update(wait_swipe=True)                                     │
         │    63 │   │   │   return True                                                      │
         │    64 │   │   else:                                                                │
         │                                                                                    │
         │ ╭──────────────────────────────────── locals ────────────────────────────────────╮ │
         │ │ blacklist = [                                                                  │ │
         │ │             │   (574, 232, 711, 325),                                          │ │
         │ │             │   (448, 232, 587, 325),                                          │ │
         │ │             │   (707, 508, 867, 629),                                          │ │
         │ │             │   (569, 310, 711, 412),                                          │ │
         │ │             │   (437, 310, 582, 412),                                          │ │
         │ │             │   (707, 613, 875, 745)                                           │ │
         │ │             ]                                                                  │ │
         │ │       box = (123, 159, 1175, 628)                                              │ │
         │ │  distance = array([137.89520456,  97.36371604])                                │ │
         │ │      name = 'MAP_SWIPE_0_-1'                                                   │ │
         │ │      self = <campaign.campaign_main.campaign_8_3.Campaign object at            │ │
         │ │             0x00000248588A88C8>                                                │ │
         │ │    vector = array([-2.89620071, 91.71344604])                                  │ │
         │ │ whitelist = [                                                                  │ │
         │ │             │   (595, 532, 684, 593),                                          │ │
         │ │             │   (734, 432, 813, 482),                                          │ │
         │ │             │   (737, 532, 823, 593),                                          │ │
         │ │             │   (476, 340, 549, 382),                                          │ │
         │ │             │   (873, 432, 945, 482),                                          │ │
         │ │             │   (335, 432, 407, 482),                                          │ │
         │ │             │   (605, 257, 676, 290),                                          │ │
         │ │             │   (883, 532, 961, 593),                                          │ │
         │ │             │   (484, 257, 552, 290),                                          │ │
         │ │             │   (350, 340, 417, 382),                                          │ │
         │ │             │   ... +1                                                         │ │
         │ │             ]                                                                  │ │
         │ ╰────────────────────────────────────────────────────────────────────────────────╯ │
         │                                                                                    │
         │ D:\Automation-scripts\ALAS\module\map\camera.py:301 in update                      │
         │                                                                                    │
         │   299 │   │   │   # _update_view()                                                 │
         │   300 │   │   │   try:                                                             │
         │ ❱ 301 │   │   │   │   success = self._update_view()                                │
         │   302 │   │   │   │   if not success:                                              │
         │   303 │   │   │   │   │   continue                                                 │
         │                                                                                    │
         │ ╭──────────────────────────────────── locals ────────────────────────────────────╮ │
         │ │        allow_error = False                                                     │ │
         │ │             camera = True                                                      │ │
         │ │      error_confirm = Timer(limit=5.438/5, count=14/10)                         │ │
         │ │     is_grid_center = <function Camera.update.<locals>.is_grid_center at        │ │
         │ │                      0x00000248592B19D8>                                       │ │
         │ │      is_still_prev = <function Camera.update.<locals>.is_still_prev at         │ │
         │ │                      0x00000248592B1A68>                                       │ │
         │ │ prev_center_offset = array([0.47899709, 0.4419674 ])                           │ │
         │ │               self = <campaign.campaign_main.campaign_8_3.Campaign object at   │ │
         │ │                      0x00000248588A88C8>                                       │ │
         │ │ swipe_wait_timeout = Timer(limit=5.438/0.35, count=14/1)                       │ │
         │ │             swiped = True                                                      │ │
         │ │         wait_swipe = True                                                      │ │
         │ ╰────────────────────────────────────────────────────────────────────────────────╯ │
         │                                                                                    │
         │ D:\Automation-scripts\ALAS\module\map\camera.py:199 in _update_view                │
         │                                                                                    │
         │   197 │   │   │   │   │   return False                                             │
         │   198 │   │   │   │   else:                                                        │
         │ ❱ 199 │   │   │   │   │   raise e                                                  │
         │   200 │   │   │   elif 'Camera outside map' in str(e):                             │
         │   201 │   │   │   │   string = str(e)                                              │
         │                                                                                    │
         │ ╭──────────────────────────────────── locals ────────────────────────────────────╮ │
         │ │ self = <campaign.campaign_main.campaign_8_3.Campaign object at                 │ │
         │ │        0x00000248588A88C8>                                                     │ │
         │ ╰────────────────────────────────────────────────────────────────────────────────╯ │
         │                                                                                    │
         │ D:\Automation-scripts\ALAS\module\map\camera.py:119 in _update_view                │
         │                                                                                    │
         │   117 │   │   │   │   │   and not self.is_in_strategy_mob_move():                  │
         │   118 │   │   │   │   logger.warning('Image to detect is not in_map')              │
         │ ❱ 119 │   │   │   │   raise MapDetectionError('Image to detect is not in_map')     │
         │   120 │   │   │   self.view.load(self.device.image)                                │
         │   121 │   │   except MapDetectionError as e:                                       │
         │                                                                                    │
         │ ╭──────────────────────────────────── locals ────────────────────────────────────╮ │
         │ │ self = <campaign.campaign_main.campaign_8_3.Campaign object at                 │ │
         │ │        0x00000248588A88C8>                                                     │ │
         │ ╰────────────────────────────────────────────────────────────────────────────────╯ │
         ╰────────────────────────────────────────────────────────────────────────────────────╯
         MapDetectionError: Image to detect is not in_map                                      
WARNING  11:24:19.771 │ Saving error: ./log/error/1717129459771                                
WARNING  11:24:28.481 │ Push notify failed!                                                    
WARNING  11:24:28.488 │ HTTP Code:204

Screenshots

2024-05-31_11-24-15-274649

Anything else?

Farm > Main > Evade Ambush(es)

@Luiso9 Luiso9 added the bug / 缺陷 Something isn't working label May 31, 2024
@LmeSzinc
Copy link
Owner

send ./log/error/1717129459771

@Luiso9
Copy link
Author

Luiso9 commented Jun 21, 2024

send ./log/error/1717129459771

Sorry i've lost it, had to reinstall my Windows...

@Luiso9 Luiso9 closed this as completed Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug / 缺陷 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants