Skip to content

Commit

Permalink
fix: bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Shawnsdaddy committed May 30, 2023
1 parent 8be705f commit c2c249a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions arknights_mower/solvers/base_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def overtake_room(self):
current_high,
current_low)
if len(_plan.items()) > 0:
self.tasks.append(SchedulerTask(datetime.now(), plan=_plan))
self.tasks.append(SchedulerTask(datetime.now(), task_plan=_plan))
else:
# 如果不满足,则找到并且执行最近一个type 包含 超过数量的high free 和low free 的 任务并且 干员没有 exaust_require 词条
task_index = -1
Expand Down Expand Up @@ -614,7 +614,7 @@ def plan_solver(self):
self.enter_room(op.current_room)
result = self.get_agent_from_room(op.current_room, [op.current_index])
_time = datetime.now()
if result[op.current_index]['time'] is not None and result[op.current_index]['time']>datetime.now():
if result[op.current_index]['time'] is not None and result[op.current_index]['time']>_time:
_time = result[op.current_index]['time'] - timedelta(minutes=10)
elif op.current_mood() != 0.0:
_time = datetime.now() + timedelta(
Expand Down Expand Up @@ -1204,7 +1204,7 @@ def drone(self, room: str, not_customize=False, not_return=False):
logger.info('基建:无人机加速')
all_in = 0
if not not_customize:
all_in = len(self.check_in_and_out())
all_in = len(self.run_order_rooms)
# 点击进入该房间
self.enter_room(room)
# 进入房间详情
Expand Down
8 changes: 6 additions & 2 deletions arknights_mower/utils/datetime.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
from datetime import datetime
import pytz


def the_same_day(a: datetime = None, b: datetime = None) -> bool:
if a is None or b is None:
return False
return a.year == b.year and a.month == b.month and a.day == b.day


def the_same_time(a: datetime = None, b: datetime = None) -> bool:
if a is None or b is None:
return False
return a.year == b.year and a.month == b.month and a.day == b.day and a.hour ==b.hour and a.minute==b.minute
return abs(a - b).total_seconds() < 1.5


def get_server_weekday():
return datetime.now(pytz.timezone('Asia/Dubai')).weekday()
return datetime.now(pytz.timezone('Asia/Dubai')).weekday()

0 comments on commit c2c249a

Please sign in to comment.