瀏覽代碼

Merge branch 'master' of http://192.168.50.108:37829/pcacc/yys_auto

pcacc 2 周之前
父節點
當前提交
c3bceba0bd
共有 3 個文件被更改,包括 25 次插入20 次删除
  1. 18 13
      dongri_task.py
  2. 4 4
      scriptBase/comon.py
  3. 3 3
      scriptBase/mouseClick.py

+ 18 - 13
dongri_task.py

@@ -1105,26 +1105,31 @@ class task_paticipateInTeam(dongri_task):
         myTimeSleep_big()
         dragTimes = 5
         for i in range(dragTimes):
-            yys_dragAuto(check_img.move_down_big)
-            myTimeSleep_small()
+            yys_dragAuto(check_img.move_down_big, True)
+            myTimeSleep(0.02)
         
+        myTimeSleep_small()
         ret = False
         for i in range(dragTimes*2):
             ret = waitClickImg_noWait_withBool(monster_img.participate, 1, 0, True)
             if ret == True:
-                waitClickImg_noWait_withBool(self.line, 0.1, 1)
-
-                if waitFindImg_withBool(special_activity_img.power0, 0.1, 0) == False:# 实力不为0
-                    if self.checkPower:
-                        if waitFindImg_withBool(check_img.enough_soilder, 1, 0) == False:
-                            return False
-                
-                    waitClickImg_withBool([monster_img.fight, monster_img.fight2, monster_img.fight3], 1, 0)
-                    if waitFindImg_withBool(check_img.auto_confilit, 2, 0) == False:
-                        return False
+                break
             else:
-                yys_dragAuto(check_img.move_down_big)
+                yys_dragAuto(check_img.move_down_big, True)
                 myTimeSleep_small()
+        if ret == False:
+            return False
+        
+        waitClickImg_noWait_withBool(self.line, 0.1, 1)
+
+        if waitFindImg_withBool(special_activity_img.power0, 0.1, 0) == False:# 实力不为0
+            if self.checkPower:
+                if waitFindImg_withBool(check_img.enough_soilder, 1, 0) == False:
+                    return False
+        
+            waitClickImg_withBool([monster_img.fight, monster_img.fight2, monster_img.fight3], 1, 0)
+            if waitFindImg_withBool(check_img.auto_confilit, 2, 0) == False:
+                return False
         
         
         return True

+ 4 - 4
scriptBase/comon.py

@@ -253,7 +253,7 @@ def get_first_single_digit(string):
     else:
         return None
 
-def dragAuto(gamestr, positions):
+def dragAuto(gamestr, positions, isQuick=False):
     tmpRet, tmpPos = find_window_pos(gamestr)
     if tmpRet == False:
         return False
@@ -262,7 +262,7 @@ def dragAuto(gamestr, positions):
     y1 = positions[1] + tmpPos[1] + random.randint(-20, 20)
     x2 = positions[2] + tmpPos[0] + random.randint(-20, 20)
     y2 = positions[3] + tmpPos[1] + random.randint(-20, 20)
-    pcacc_mouse.drag_from(x1, y1, x2, y2)
+    pcacc_mouse.drag_from(x1, y1, x2, y2, isQuick)
     return True
 
 def ocrAuto(gamestr, positions):
@@ -285,8 +285,8 @@ def ocrAuto(gamestr, positions):
 def yys_ocrAuto(positions):
     return ocrAuto('Mumu模拟器12', positions)
 
-def yys_dragAuto(positions):
-    return dragAuto('Mumu模拟器12', positions)
+def yys_dragAuto(positions, isQuick=False):
+    return dragAuto('Mumu模拟器12', positions, isQuick)
 
 def getRegion(gamestr, region, isWidth):
     tmpRet, tmpPos = find_window_pos(gamestr)

+ 3 - 3
scriptBase/mouseClick.py

@@ -145,10 +145,10 @@ class pcacc_mouse:
         win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, src_x + random.randint(-3, 3), src_y + random.randint(-3, 3), 0, 0)
     
     @staticmethod
-    def drag_from(src_x, src_y, dst_x, dst_y):
-        pcacc_mouse.move_mouse(src_x, src_y)
+    def drag_from(src_x, src_y, dst_x, dst_y, isQuick=False):
+        pcacc_mouse.move_mouse(src_x, src_y,isQuick)
         win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, src_x, src_y, 0, 0)
-        pcacc_mouse.move_mouse(dst_x, dst_y)
+        pcacc_mouse.move_mouse(dst_x, dst_y, isQuick)
         time.sleep(1.0 / random.randint(60, 130))
         win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, dst_x, dst_y, 0, 0)