pcacc 2 долоо хоног өмнө
parent
commit
0faa2f28b5

+ 3 - 3
dongri_task.py

@@ -1105,8 +1105,8 @@ class task_paticipateInTeam(dongri_task):
         myTimeSleep_big()
         dragTimes = 5
         for i in range(dragTimes):
-            yys_dragAuto(check_img.move_down)
-            myTimeSleep_small()
+            yys_dragAuto(check_img.move_down, True)
+            myTimeSleep(0.02)
         
         ret = False
         for i in range(dragTimes):
@@ -1114,7 +1114,7 @@ class task_paticipateInTeam(dongri_task):
             if ret == True:
                 break
             else:
-                yys_dragAuto(check_img.move_down)
+                yys_dragAuto(check_img.move_down, True)
                 myTimeSleep_small()
         if ret == False:
             return False

+ 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)