import pyautogui
import random
def movePushCaptch(xPixel,yPixel):
'''
xPixel x轴需要移动的像素
0,像素补偿
minNum拖动随机最大值
maxNum 拖动随机最小值
'''
minNum=0.005
maxNum=0.05
xPixel += 20 + 0
v0 = 0
a_list = [3, 4, 5]
t = 0.2
s = 0
front = []
back = [-1, -1, -2, -3, -2, -3, -2, -2, -3, -1]
mid = xPixel * 3/ 5
while s < xPixel:
if s < mid:
a = a_list[random.randint(0, 2)]
else:
a = -a_list[random.randint(0, 2)]
v = v0
stack = v * t + 0.5 * a * t ** 2
stack = round(stack)
s += stack
v0 = v + a * t
front.append(stack)
pyautogui.PAUSE = 2
pyautogui.PAUSE = 0.2
pyautogui.mouseDown()
pyautogui.PAUSE = 1
for value in front:
pyautogui.moveRel(value, 0)
aa = random.uniform(minNum, maxNum)
pyautogui.PAUSE = aa
pyautogui.PAUSE = 1.2
pyautogui.mouseUp()
pyautogui.PAUSE = 0.3
movePushCaptch(300,3)