Skip to content

Commit

Permalink
Merge pull request #398 from Fuynkio/dev_shawn
Browse files Browse the repository at this point in the history
修改skland逻辑,添加一个翻译房间的函数
  • Loading branch information
ZhaoZuohong authored Nov 17, 2023
2 parents 2f01034 + dca4b14 commit a3d3f58
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 332 deletions.
7 changes: 5 additions & 2 deletions arknights_mower/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,11 @@ def simulate():
# 刷新时间以鹰历为准
if base_scheduler.daily_report:
base_scheduler.daily_report = base_scheduler.report_plan_solver()
if base_scheduler.daily_skland and base_scheduler.skland_config['skland_enable']:
base_scheduler.daily_report = base_scheduler.skland_plan_solover()
# if base_scheduler.daily_skland and base_scheduler.skland_config['skland_enable']:
# base_scheduler.daily_report = base_scheduler.skland_plan_solover()
# base_scheduler.daily_skland=False
if base_scheduler.skland_config['skland_enable']:
base_scheduler.skland_plan_solover()
if base_scheduler.daily_mail:
base_scheduler.daily_report = base_scheduler.mail_plan_solver()

Expand Down
20 changes: 17 additions & 3 deletions arknights_mower/solvers/base_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def __init__(self, device: Device = None, recog: Recognizer = None) -> None:
self.recruit_time = None
self.daily_mission = False
self.daily_report = False
self.daily_skland = False
self.daily_skland = True
self.daily_mail = False
self.check_mail_enable = True
self.report_enable = True
Expand Down Expand Up @@ -503,7 +503,19 @@ def infra_main(self):
self.collect_notification = True
else:
return self.handle_error()

def translate_room(self,room):
if "room" in room:
parts = room.split("_")
return f"B{parts[1]}0{parts[2]}"
elif "dormitory" in room:
parts = room.split("_")
return f"{parts[1]}层宿舍"
elif "contact" in room:
return "办公室"
elif "central" in room:
return "控制中枢"
else:
return "会客室"
def agent_get_mood(self, skip_dorm=False, force=False):
# 暂时规定纠错只适用于主班表
need_read = set(
Expand All @@ -514,7 +526,9 @@ def agent_get_mood(self, skip_dorm=False, force=False):
try:
self.enter_room(room)
_mood_data = self.get_agent_from_room(room)
logger.info(f'房间 {room} 心情为:{_mood_data}')
mood_info = [f"干员: {item['agent']}, 心情: {round(item['mood'], 3)}" for item in _mood_data]
logger.info(f'房间 {self.translate_room(room)} {mood_info}')
#logger.info(f'房间 {room} 心情为:{_mood_data}')
break
except Exception as e:
if error_count > 3: raise e
Expand Down
Loading

0 comments on commit a3d3f58

Please sign in to comment.