Prechádzať zdrojové kódy

!2 Add function add_strength()

pcacc 5 mesiacov pred
rodič
commit
2b4b0dd124

BIN
dongri_img/check/Add_strength.png


BIN
dongri_img/check/no_strength.png


+ 2 - 0
dongri_pic.py

@@ -98,6 +98,8 @@ class check_img:
     invite_free = R'dongri_img\check\invite_free.png'
     soilder_cure = R'dongri_img\check\soilder_cure.png'
     cure = R'dongri_img\check\cure.png'
+    add_strength = R'dongri_img\check\add_strength.png'
+    no_strength = R'dongri_img\check\no_strength.png'
 
 class information_img:
     # = R'dongri_img\information\.png'

+ 27 - 5
dongri_task.py

@@ -126,6 +126,22 @@ class basic_operate:
         if waitClickImg_noWait_withBool(monster_img.enter, 2, 1) == False:
             return False
         return True
+    @staticmethod
+    def add_strength():
+        basic_operate.do_back()
+        if waitClickImg_noWait_withBool(check_img.no_strength, 2, 1) == False:
+            return False
+        
+
+        if waitClickImg_noWait_withBool(check_img.add_strength, 2, 1) == False:
+            return False
+        if waitClickImg_noWait_withBool(information_img.add_strength, 2, 1) == False:
+            return False
+        if waitClickImg_noWait_withBool(information_img.add_strength, 2, 1) == False:
+            return False
+        if waitClickImg_noWait_withBool(information_img.add_strength, 2, 1) == False:
+            return False
+        return True
         
         
 
@@ -204,12 +220,17 @@ class task_fightMonster(dongri_task):
     def run(self):
         basic_operate.go_outside()
 
+        if False == waitFindImg_withBool(monster_img.enough_strengh, 2, 1):
+            if self.add_strengh:
+                basic_operate.add_strength()
+                basic_operate.go_outside()
+            else:
+                print("没有足够的体力了")
+                return False
+
         if False == basic_operate.click_outside_search():
-            return False
+            return False     
         
-        if False == waitFindImg_withBool(monster_img.enough_strengh, 2, 1):
-            print("没有足够的体力了")
-            return False
         
         if waitFindImg_withBool(monster_img.search, 2, 1):
             myTimeSleep_big()
@@ -579,13 +600,14 @@ class task_cure(dongri_task):
 
 if __name__ == '__main__':
     #basic_operate.go_town()
+    #basic_operate.add_strength()
     #task_fightMonster(False, True).run()
     #task_checkHelp().run()
     #task_checkStoreRoom().run()
     #task_collect().run()
     #task_train().run()
     #task_information().run()
-    check_buildOrResearch().run()
+    #check_buildOrResearch().run()
     #task_checkDonata().run()
     #task_collect(1).run()
     #task_collect(2).run()