Selaa lähdekoodia

!2 add function check research

pcacc 2 kuukautta sitten
vanhempi
sitoutus
a17cef5d07

+ 1 - 1
app_dongri.py

@@ -331,7 +331,7 @@ def add_auto_task(isMaxCollect, isJina, isSimple = False, isAddStrengh = False,
 
         
         
-        #task_queue.appendleft(check_buildOrResearch())
+        task_queue.appendleft(task_check_Research())
         task_queue.appendleft(task_checkStoreRoom())
         if not isSimple:
             if isJina == 'jina':

BIN
dongri_img/check/pannel_research.png


BIN
dongri_img/check/research_speedup.png


+ 5 - 0
dongri_pic.py

@@ -194,6 +194,11 @@ class check_img:
     # strength
     pet_btn = R'dongri_img\check\pet_btn.png'
 
+    # research
+    pannel_research = R'dongri_img\check\pannel_research.png'
+    research_speedup = R'dongri_img\check\research_speedup.png'
+
+
 
 
 

+ 47 - 1
dongri_task.py

@@ -811,6 +811,51 @@ class task_waitTime(dongri_task):
     def run(self):
         myTimeSleep(300)
 
+class task_check_Research(dongri_task):
+    def __init__(self):
+        super().__init__(f"检查研究")
+    def run(self):
+        basic_operate.go_town()
+        if waitClickImg_noWait_withBool(train_img.quick_panel, 2, 1) == False:
+            return False
+        
+        if waitClickImg_noWait_withBool(check_img.pannel_research, 2, 1) == False:
+            return False
+        
+        handRet, handPos = waitFindImg(check_img.hand, 2, 1)
+        if not handRet:
+            return False
+        
+        detailRet, detailPos = waitFindImg((check_img.detail,check_img.detail2), 2, 1)
+        dstPos = [0, 0]
+        if not detailRet:
+            # 如果找不到详细信息,兵营之类的,需点中间
+            dstPos = [handPos[0] - 70, handPos[1] + 120]
+        else:
+            dstPos = [detailPos[0] + 70, detailPos[1] - 100]
+
+        tryTimes = 3
+            
+        while tryTimes > 0:
+            tryTimes -= 1
+            myTimeSleep_big()
+            pcacc_mouse.click(dst_x=dstPos[0], dst_y=dstPos[1])
+            
+            if waitClickImg_noWait_withBool(check_img.research, 2, 1):
+                break
+        
+        if waitFindImg_withBool(check_img.research_speedup, 2, 1) == True:
+            return False
+
+        if waitClickImg_withBool([check_img.research_type1, check_img.research_type2], 2, 1) == False:
+            return False
+        if basic_operate.enter_auto_supply_resource(check_img.research_done) == False:
+            return False
+            
+        waitClickImg_withBool([check_img.help, check_img.help2, check_img.help3], 2, 2)
+        
+
+
 class check_buildOrResearch(dongri_task):
     def __init__(self):
         super().__init__(f"检查建筑或研究")
@@ -1408,6 +1453,7 @@ class check_safe_collect(dongri_task):
 
 if __name__ == '__main__':
     print(get_todo_time("巨熊行动"))
+    task_check_Research().run()
     #save_game_screen()
     #basic_operate.get_line_num()
     #task_cure(True, 85).run()
@@ -1416,7 +1462,7 @@ if __name__ == '__main__':
     #task_gotoTree().run()
     #task_fight_jina_only().run()
     #task_checkConfilits().run()
-    task_getStrength().run()
+    #task_getStrength().run()
     #task_checkActivities().run()
     #task_checkMaster().run()
     #basic_operate.get_line_num()