Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Shawnsdaddy committed Oct 6, 2023
1 parent f4efb5e commit 813b7f4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions arknights_mower/solvers/base_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ def plan_metadata(self):
if x in low_priority:
continue
__room = self.op_data.operators[x].room
if __room not in base_room_list: continue
if __room not in _plan.keys():
_plan[__room] = ['Current'] * len(self.op_data.plan[__room])
_plan[__room][self.op_data.operators[x].index] = x
Expand Down Expand Up @@ -445,7 +446,7 @@ def infra_main(self):
elif self.task.type == TaskTypes.CLUE_PARTY:
self.party_time = None
self.skip(['planned', 'collect_notification'])
if self.tasks[0].type in [TaskTypes.SHIFT_ON, TaskTypes.SHIFT_OFF]:
if self.tasks[0].type in [TaskTypes.SHIFT_ON]:
self.backup_plan_solver()
del self.tasks[0]
except Exception as e:
Expand Down Expand Up @@ -719,7 +720,7 @@ def plan_solver(self):
_time = result[op.current_index]['time'] - timedelta(minutes=10)
elif op.current_mood() > 0.25 and op.depletion_rate != 0:
_time = datetime.now() + timedelta(
hours=(op.current_mood() - 0.25) / op.depletion_rate) - timedelta(minutes=10)
hours=(op.current_mood() - op.lower_limit- 0.25) / op.depletion_rate) - timedelta(minutes=10)
self.back()
# plan 是空的是因为得动态生成
exhaust_type = op.name
Expand Down Expand Up @@ -755,7 +756,8 @@ def plan_solver(self):
if find_next_task(self.tasks, datetime.now() + timedelta(seconds=300)) is not None:
logger.info("5分钟内有其他任务,跳过宿舍纠错")
return
self.agent_get_mood()
if self.agent_get_mood() is not None:
self.backup_plan_solver()

def backup_plan_solver(self):
try:
Expand Down Expand Up @@ -2145,7 +2147,9 @@ def reload(self):
try:
logger.info(f"开始搓玉补货:{room}")
self.enter_room(room)
self.tap((self.recog.w * 0.05, self.recog.h * 0.95), interval=0.5)
self.tap((self.recog.w * 0.05, self.recog.h * 0.95), interval=0.25)
self.tap((self.recog.w * 0.05, self.recog.h * 0.95), interval=0.25)
self.tap((self.recog.w * 0.05, self.recog.h * 0.95), interval=0.25)
# 补货
self.tap((self.recog.w * 0.75, self.recog.h * 0.3), interval=0.5)
self.tap((self.recog.w * 0.75, self.recog.h * 0.9), interval=0.5)
Expand Down

0 comments on commit 813b7f4

Please sign in to comment.