Skip to content

Commit

Permalink
Merge pull request #323 from Fuynkio/dev_shawn
Browse files Browse the repository at this point in the history
MAA读仓库
  • Loading branch information
ZhaoZuohong authored Oct 3, 2023
2 parents c1a91f3 + eed877d commit b64a3cb
Show file tree
Hide file tree
Showing 780 changed files with 1,562 additions and 77 deletions.
9 changes: 7 additions & 2 deletions arknights_mower/solvers/base_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from ..utils.recognize import RecognizeError, Recognizer, Scene
from ..utils.solver import BaseSolver
from ..utils.datetime import get_server_weekday, the_same_time
from ..utils.depot import process_itemlist
from arknights_mower.utils.news import get_update_time
import arknights_mower.utils.paddleocr
import cv2
Expand Down Expand Up @@ -2182,6 +2183,10 @@ def log_maa(msg, details, arg):
elif "what" in d and d["what"] == "RecruitSpecialTag":
global recruit_special_tags
recruit_special_tags["tags"].append(d["details"]["tags"])
elif d.get("what") == "DepotInfo" and d["details"].get("done") is True:
itemlist_filename = "tmp\itemlist.csv"
logger.debug(f"开始扫描仓库(MAA)")
process_itemlist(d, itemlist_filename)

def initialize_maa(self):
path = pathlib.Path(self.maa_config['maa_path'])
Expand Down Expand Up @@ -2218,7 +2223,7 @@ def initialize_maa(self):
raise Exception("MAA 连接失败")

def append_maa_task(self, type):
if type in ['StartUp', 'Visit', 'Award']:
if type in ['StartUp', 'Visit', 'Award','Depot']:
self.MAA.append_task(type)
elif type == 'Fight':
_plan = self.maa_config['weekly_plan'][get_server_weekday()]
Expand Down Expand Up @@ -2269,7 +2274,7 @@ def maa_plan_solver(self, tasks='All', one_time=False):
# 任务及参数请参考 docs/集成文档.md
self.initialize_maa()
if tasks == 'All':
tasks = ['StartUp', 'Fight', 'Visit', 'Mall', 'Award']
tasks = ['StartUp', 'Fight', 'Visit', 'Mall', 'Award','Depot']
# tasks = ['StartUp', 'Fight', 'Recruit', 'Visit', 'Mall', 'Award']
for maa_task in tasks:
if maa_task == 'Recruit':
Expand Down
32 changes: 32 additions & 0 deletions arknights_mower/templates/conf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ maa_weekly_plan1:
周五: 1
周六: 0
周日: 1
- stage: [PR-A-1]
周一: 1
周二: 0
周三: 0
周四: 1
周五: 1
周六: 0
周日: 1
- stage: [PR-B-2]
周一: 1
周二: 1
Expand All @@ -136,6 +144,14 @@ maa_weekly_plan1:
周五: 1
周六: 1
周日: 0
- stage: [PR-B-1]
周一: 1
周二: 1
周三: 0
周四: 0
周五: 1
周六: 1
周日: 0
- stage: [PR-C-2]
周一: 0
周二: 0
Expand All @@ -144,6 +160,14 @@ maa_weekly_plan1:
周五: 0
周六: 1
周日: 1
- stage: [PR-C-1]
周一: 0
周二: 0
周三: 1
周四: 1
周五: 0
周六: 1
周日: 1
- stage: [PR-D-2]
周一: 1
周二: 1
Expand All @@ -152,6 +176,14 @@ maa_weekly_plan1:
周五: 1
周六: 1
周日: 0
- stage: [PR-D-1]
周一: 1
周二: 1
周三: 0
周四: 0
周五: 1
周六: 1
周日: 0
mail_enable: 0
account: ''
pass_code: ''
Expand Down
Loading

0 comments on commit b64a3cb

Please sign in to comment.