This commit is contained in:
wangzhengzhen
2024-12-30 19:13:11 +08:00
parent 509068cb54
commit 0822209118
2 changed files with 35 additions and 27 deletions

View File

@@ -32,37 +32,37 @@ class _Action:
# 上滑
def swipe_up(self, dist, speed):
x1 = int(self.scr_w * 0.25) + int(random.uniform(-10, 10))
x2 = x1 + int(random.uniform(-10, 10))
y1 = int(self.scr_w * 0.7) + int(random.uniform(-10, 10))
y2 = y1 - dist + int(random.uniform(-10, 10))
x1 = int(self.scr_w * 0.45) + int(random.uniform(-20, 20))
y1 = int(self.scr_h * 0.7) + int(random.uniform(-20, 20))
x2 = x1 + int(random.uniform(-20, 20))
y2 = y1 - dist + int(random.uniform(-20, 20))
time = speed - int(random.uniform(-10, 10))
self.operator.swipe(x1, y1, x2, y2, time)
# 下滑
def swipe_down(self, dist, speed):
x1 = int(self.scr_w * 0.75) + int(random.uniform(-10, 10))
x2 = x1 + int(random.uniform(-10, 10))
y1 = int(self.scr_w * 0.5) + int(random.uniform(-10, 10))
y2 = y1 + dist + int(random.uniform(-10, 10))
x1 = int(self.scr_w * 0.45) + int(random.uniform(-20, 20))
y1 = int(self.scr_h * 0.6) + int(random.uniform(-20, 20))
x2 = x1 + int(random.uniform(-20, 20))
y2 = y1 + dist + int(random.uniform(-20, 20))
time = speed + int(random.uniform(-10, 10))
self.operator.swipe(x1, y1, x2, y2, time)
# 左滑
def swipe_left(self, dist, speed):
x1 = int(self.scr_w * 0.7) + int(random.uniform(-10, 10))
x2 = x1 - dist + int(random.uniform(-10, 10))
y1 = int(self.scr_w * 0.75) + int(random.uniform(-10, 10))
y2 = y1 + int(random.uniform(-10, 10))
x1 = int(self.scr_w * 0.7) + int(random.uniform(-20, 20))
y1 = int(self.scr_h * 0.75) + int(random.uniform(-20, 20))
x2 = x1 - dist + int(random.uniform(-20, 20))
y2 = y1 + int(random.uniform(-20, 20))
time = speed + int(random.uniform(-10, 10))
self.operator.swipe(x1, y1, x2, y2, time)
# 右滑
def swipe_right(self, dist, speed):
x1 = int(self.scr_w * 0.25) + int(random.uniform(-10, 10))
x2 = x1 + dist + int(random.uniform(-10, 10))
y1 = int(self.scr_w * 0.75) + int(random.uniform(-10, 10))
y2 = y1 + int(random.uniform(-10, 10))
x1 = int(self.scr_w * 0.3) + int(random.uniform(-20, 20))
y1 = int(self.scr_h * 0.75) + int(random.uniform(-20, 20))
x2 = x1 + dist + int(random.uniform(-20, 20))
y2 = y1 + int(random.uniform(-20, 20))
time = speed + int(random.uniform(-10, 10))
self.operator.swipe(x1, y1, x2, y2, time)