|
@@ -21,8 +21,6 @@ import socket
|
|
|
from dongri_pic import _imported
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
'''
|
|
|
基础配置说明:
|
|
|
600*800(DPI 300)
|
|
@@ -33,10 +31,20 @@ from dongri_pic import _imported
|
|
|
'''
|
|
|
|
|
|
todo_msg = ''
|
|
|
+todo_list = []
|
|
|
def get_todo_msg():
|
|
|
global todo_msg
|
|
|
return todo_msg
|
|
|
|
|
|
+def get_todo_msgList():
|
|
|
+ global todo_list
|
|
|
+ return todo_list
|
|
|
+
|
|
|
+def fing_todoList_time(taskStr):
|
|
|
+ for item in todo_list:
|
|
|
+ if item['task'] == taskStr:
|
|
|
+ return item['time']
|
|
|
+
|
|
|
def task_getComputerName():
|
|
|
return socket.gethostname()
|
|
|
|
|
@@ -816,8 +824,24 @@ class task_checkActivities(dongri_task):
|
|
|
|
|
|
def __init__(self):
|
|
|
super().__init__(f"检查各种活动时间")
|
|
|
+ def find_all_matching_events(parts, input_word):
|
|
|
+ results = []
|
|
|
+ # 查找所有包含输入关键词的项
|
|
|
+ matches = [i for i, part in enumerate(parts) if input_word in part]
|
|
|
+
|
|
|
+ for match_index in matches:
|
|
|
+ # 从匹配项开始向后查找第一个时间或状态
|
|
|
+ for i in range(match_index + 1, len(parts)):
|
|
|
+ current_part = parts[i]
|
|
|
+ # 检查是否是时间(如 19:30)或状态(如 已结束)
|
|
|
+ if re.match(r'^\d{1,2}:\d{2}$', current_part) or current_part in ["已结束"]:
|
|
|
+ dst = {"item":parts[match_index], "time":current_part}
|
|
|
+ results.append(dst)
|
|
|
+ break # 找到第一个匹配就停止
|
|
|
+
|
|
|
+ return results
|
|
|
def run(self):
|
|
|
- global todo_msg
|
|
|
+ global todo_msg, todo_list
|
|
|
basic_operate.go_outside()
|
|
|
if waitClickImg_noWait_withBool(check_img.activity_open, 2, 1) == False:
|
|
|
return False
|
|
@@ -825,8 +849,16 @@ class task_checkActivities(dongri_task):
|
|
|
return False
|
|
|
|
|
|
activityStr = yys_ocrAuto(check_img.todo_region)
|
|
|
- if not activityStr:
|
|
|
+ if activityStr:
|
|
|
todo_msg = activityStr
|
|
|
+ result = []
|
|
|
+ baoleiArr = self.find_all_matching_events(activityStr, "堡垒")
|
|
|
+ result.extend(baoleiArr)
|
|
|
+ juxiongArr = self.find_all_matching_events(activityStr, "巨熊")
|
|
|
+ result.extend(juxiongArr)
|
|
|
+ yaosaiArr = self.find_all_matching_events(activityStr, "要塞")
|
|
|
+ result.extend(yaosaiArr)
|
|
|
+ todo_list = result
|
|
|
return activityStr
|
|
|
|
|
|
|