Browse Source

!2 add function yongbing

pcacc 5 tháng trước cách đây
mục cha
commit
ea6a493c0f

+ 2 - 0
app_dongri.py

@@ -194,6 +194,8 @@ def add_auto_task(isMaxCollect, isJina, isSimple = False, isAddStrengh = False):
         if not isSimple:
             if isJina == 'jina':
                 task_queue.appendleft(task_fight_jina(isAddStrengh))
+            elif isJina == 'yongbing':
+                task_queue.appendleft(task_fight_yongbing(isAddStrengh))
             elif isJina == 'monster':
                 task_queue.appendleft(task_fightMonster(isAddStrengh, False, isSimple))
             elif isJina == 'big_monster':

BIN
dongri_img/check/detect.png


BIN
dongri_img/check/store_strength.png


BIN
dongri_img/check/yongbing.png


BIN
dongri_img/check/yongbing_fight.png


+ 3 - 0
dongri_pic.py

@@ -108,6 +108,9 @@ class check_img:
     other = R'dongri_img\check\other.png'
     other2 = R'dongri_img\check\other2.png'
     jina_jiao = R'dongri_img\check\jina_jiao.png'
+    yongbing = R'dongri_img\check\yongbing.png'
+    detect = R'dongri_img\check\detect.png'
+    yongbing_fight = R'dongri_img\check\yongbing_fight.png'
 
 
 class information_img:

+ 48 - 2
dongri_task.py

@@ -203,6 +203,49 @@ class dongri_task:
     def run(self):
         print(f"Running task: {self.name}")
 
+class task_fight_yongbing(dongri_task):
+    def __init__(self, add_strengh):
+        super().__init__("战斗佣兵")
+        self.add_strengh = add_strengh
+
+    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 waitClickImg_noWait_withBool(check_img.yongbing, 2, 1) == False:
+            return False
+        if waitClickImg_noWait_withBool(check_img.detect, 2, 1) == False:
+            return False
+        
+        if waitClickImg_noWait_withBool(check_img.yongbing_fight, 2, 1) == False:
+            return False
+        
+        if waitClickImg_noWait_withBool(monster_img.line1, 2, 1) == False:
+            return False
+        if waitFindImg_withBool(monster_img.no_hero, 2, 1) == True:
+            return False
+        if waitClickImg_noWait_withBool(monster_img.all_select, 2, 1) == False:
+            return False
+        waitClickImg_noWait_withBool(monster_img.all_select, 2, 1)
+
+        maxTryTimes = 3
+        while maxTryTimes > 0:
+            maxTryTimes -= 1
+            waitClickImg_withBool([monster_img.fight, monster_img.fight2], 2, 1)
+            waitClickImg_noWait_withBool(monster_img.all_select, 2, 1)
+
+        return True
+
+        
+
+
 class task_fight_jina(dongri_task):
     def __init__(self, add_strengh):
         super().__init__("战斗吉娜")
@@ -431,6 +474,8 @@ class task_checkStoreRoom(dongri_task):
         if waitClickImg_noWait_withBool((check_img.storeroom, check_img.invite_free), 2, 1) == False:
             return False
         
+        pcacc_mouse.quickclick_current()
+
         waitClickImg_noWait_withBool(check_img.store_strength, 2, 1)
         return True
     
@@ -674,8 +719,9 @@ if __name__ == '__main__':
     #basic_operate.add_strength()
     #task_fightMonster(False, True).run()
     #task_checkHelp().run()
-    #task_checkStoreRoom().run()
-    task_collect([4,3,2,1]).run()
+    task_checkStoreRoom().run()
+    #task_fight_yongbing(True).run()
+    #task_collect([4,3,2,1]).run()
     #task_train().run()
     #task_information().run()
     #check_buildOrResearch().run()

+ 1 - 0
templates/index_dongri.html

@@ -52,6 +52,7 @@
                     <option value="None">None</option>
                     <option value="monster">monster</option>
                     <option value="big_monster">big_monster</option>
+                    <option value="yongbing">yongbing</option>
                     <option value="jina" selected>jina</option>
                 </select>
             </label>