Skip to content

Commit

Permalink
Merge pull request #298 from smjes3/v2.2.14
Browse files Browse the repository at this point in the history
V2.2.14
  • Loading branch information
smjes3 authored May 24, 2024
2 parents c43a8aa + 3fe0c43 commit 7c6e1d6
Show file tree
Hide file tree
Showing 7 changed files with 211 additions and 23 deletions.
7 changes: 5 additions & 2 deletions fhoe.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,12 @@ def main():
log.info(f"检测到换日,即将从头开锄")
map_instance.auto_map(start_map, start_in_mid, dev=dev)
else:
map_instance.calculated.back_to_main(delay=2.0)
now = datetime.datetime.now()
next_4am = now.replace(hour=4, minute=0, second=0, microsecond=0)
if now.hour >= 4:
refresh_hour = cfg.CONFIG.get("refresh_hour", 4)
refresh_minute = cfg.CONFIG.get("refresh_minute", 0)
next_4am = now.replace(hour=refresh_hour, minute=refresh_minute, second=0, microsecond=0)
if now.hour >= refresh_hour and now.minute >= refresh_minute:
next_4am += datetime.timedelta(days=1)
wait_time = (next_4am - now).total_seconds()
wait_time += 60
Expand Down
92 changes: 76 additions & 16 deletions map/HuangQuan/map_3-5_2.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "绥 园-2",
"author": "喵不可言,龙女姬",
"start": [
{
"map": 1
},
{
"picture\\map_3-5_point_1.png": 1.5
},
{
"picture\\transfer.png": 1.5
}
],
"start": [
{
"map": 1
},
{
"picture\\map_3-5_point_1.png": 1.5
},
{
"picture\\transfer.png": 1.5
}
],
"map": [
{
"s": 4.48
Expand Down Expand Up @@ -81,7 +81,7 @@
},
{
"s": 7.4
},
},
{
"e": 2
},
Expand All @@ -102,7 +102,7 @@
},
{
"a": 1.21
},
},
{
"e": 2
},
Expand All @@ -114,10 +114,10 @@
},
{
"d": 1.83
},
},
{
"e": 2
},
},
{
"d": 5.83
},
Expand All @@ -139,6 +139,9 @@
{
"e": 2
},
{
"d": 0.1
},
{
"e": 2
},
Expand Down Expand Up @@ -181,11 +184,68 @@
{
"e": 2
},
{
"d": 0.1
},
{
"e": 2
},
{
"d": 0.1
"e": 2
},
{
"e": 2
},
{
"a": 0.1
},
{
"e": 2
},
{
"e": 2
},
{
"e": 2
},
{
"w": 0.1
},
{
"e": 2
},
{
"e": 2
},
{
"a": 0.1
},
{
"e": 2
},
{
"e": 2
},
{
"e": 2
},
{
"e": 2
},
{
"w": 0.1
},
{
"e": 2
},
{
"a": 0.1
},
{
"e": 2
},
{
"e": 2
},
{
"e": 2
Expand Down
57 changes: 57 additions & 0 deletions map/HuangQuan/map_3-6_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,72 @@
{
"e": 2
},
{
"d": 0.1
},
{
"e": 2
},
{
"d": 0.1
},
{
"e": 2
},
{
"d": 0.1
},
{
"e": 2
},
{
"w": 0.1
},
{
"e": 2
},
{
"w": 0.1
},
{
"e": 2
},
{
"w": 0.1
},
{
"e": 2
},
{
"w": 0.1
},
{
"e": 2
},
{
"a": 0.1
},
{
"e": 2
},
{
"a": 0.1
},
{
"e": 2
},
{
"a": 0.1
},
{
"e": 2
},
{
"e": 2
},
{
"s": 3
},
{
"w": 0.88
},
Expand Down
53 changes: 52 additions & 1 deletion map/HuangQuan/map_3-7_9.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,77 @@
"e": 2
},
{
"a": 0.56
"a": 0.8
},
{
"w": 0.8
},
{
"e": 2
},
{
"w": 0.1
},
{
"e": 2
},
{
"w": 0.1
},
{
"e": 2
},
{
"w": 0.1
},
{
"e": 2
},
{
"w": 0.1
},
{
"e": 2
},
{
"w": 0.1
},
{
"e": 2
},
{
"a": 0.1
},
{
"e": 2
},
{
"a": 0.1
},
{
"e": 2
},
{
"a": 0.1
},
{
"e": 2
},
{
"a": 0.1
},
{
"e": 2
},
{
"a": 0.1
},
{
"e": 2
},
{
"s": 0.1
},
{
"e": 2
},
Expand Down
15 changes: 15 additions & 0 deletions map/HuangQuan/map_4-7_4.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,33 @@
{
"e": 2
},
{
"d": 0.1
},
{
"e": 2
},
{
"d": 0.1
},
{
"e": 2
},
{
"d": 0.1
},
{
"e": 2
},
{
"d": 0.1
},
{
"e": 2
},
{
"d": 0.1
},
{
"e": 2
},
Expand Down
2 changes: 1 addition & 1 deletion map/HuangQuan/map_4-7_8.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"d": 2
},
{
"w": 1.2
"w": 0.9
},
{
"e": 2
Expand Down
8 changes: 5 additions & 3 deletions utils/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,15 @@ def wait_and_run(self, minute=1, second=0):
log.info(f"需要等待 {wait_time:.0f} 秒")
time.sleep(wait_time)

def has_crossed_4am(self, start, end):
def has_crossed_4am(self, start:datetime.datetime, end:datetime.datetime) -> bool:
"""
检查是否从开始时间到结束时间跨越了凌晨4点
"""
refresh_hour = self.cfg.CONFIG.get("refresh_hour", 4)
refresh_minute = self.cfg.CONFIG.get("refresh_minute", 0)
# 获取开始时间的凌晨4点
start_4am = start.replace(hour=4, minute=0, second=0, microsecond=0)
if start.hour >= 4:
start_4am = start.replace(hour=refresh_hour, minute=refresh_minute, second=0, microsecond=0)
if start.hour >= refresh_hour and start.minute >= refresh_minute:
# 如果开始时间在4点之后,则4点时间应该是下一天的4点
start_4am += datetime.timedelta(days=1)

Expand Down

0 comments on commit 7c6e1d6

Please sign in to comment.