op
This commit is contained in:
@@ -32,37 +32,37 @@ class _Action:
|
|||||||
# 上滑
|
# 上滑
|
||||||
def swipe_up(self, dist, speed):
|
def swipe_up(self, dist, speed):
|
||||||
|
|
||||||
x1 = int(self.scr_w * 0.25) + int(random.uniform(-10, 10))
|
x1 = int(self.scr_w * 0.45) + int(random.uniform(-20, 20))
|
||||||
x2 = x1 + int(random.uniform(-10, 10))
|
y1 = int(self.scr_h * 0.7) + int(random.uniform(-20, 20))
|
||||||
y1 = int(self.scr_w * 0.7) + int(random.uniform(-10, 10))
|
x2 = x1 + int(random.uniform(-20, 20))
|
||||||
y2 = y1 - dist + int(random.uniform(-10, 10))
|
y2 = y1 - dist + int(random.uniform(-20, 20))
|
||||||
time = speed - int(random.uniform(-10, 10))
|
time = speed - int(random.uniform(-10, 10))
|
||||||
self.operator.swipe(x1, y1, x2, y2, time)
|
self.operator.swipe(x1, y1, x2, y2, time)
|
||||||
|
|
||||||
# 下滑
|
# 下滑
|
||||||
def swipe_down(self, dist, speed):
|
def swipe_down(self, dist, speed):
|
||||||
x1 = int(self.scr_w * 0.75) + int(random.uniform(-10, 10))
|
x1 = int(self.scr_w * 0.45) + int(random.uniform(-20, 20))
|
||||||
x2 = x1 + int(random.uniform(-10, 10))
|
y1 = int(self.scr_h * 0.6) + int(random.uniform(-20, 20))
|
||||||
y1 = int(self.scr_w * 0.5) + int(random.uniform(-10, 10))
|
x2 = x1 + int(random.uniform(-20, 20))
|
||||||
y2 = y1 + dist + int(random.uniform(-10, 10))
|
y2 = y1 + dist + int(random.uniform(-20, 20))
|
||||||
time = speed + int(random.uniform(-10, 10))
|
time = speed + int(random.uniform(-10, 10))
|
||||||
self.operator.swipe(x1, y1, x2, y2, time)
|
self.operator.swipe(x1, y1, x2, y2, time)
|
||||||
|
|
||||||
# 左滑
|
# 左滑
|
||||||
def swipe_left(self, dist, speed):
|
def swipe_left(self, dist, speed):
|
||||||
x1 = int(self.scr_w * 0.7) + int(random.uniform(-10, 10))
|
x1 = int(self.scr_w * 0.7) + int(random.uniform(-20, 20))
|
||||||
x2 = x1 - dist + int(random.uniform(-10, 10))
|
y1 = int(self.scr_h * 0.75) + int(random.uniform(-20, 20))
|
||||||
y1 = int(self.scr_w * 0.75) + int(random.uniform(-10, 10))
|
x2 = x1 - dist + int(random.uniform(-20, 20))
|
||||||
y2 = y1 + int(random.uniform(-10, 10))
|
y2 = y1 + int(random.uniform(-20, 20))
|
||||||
time = speed + int(random.uniform(-10, 10))
|
time = speed + int(random.uniform(-10, 10))
|
||||||
self.operator.swipe(x1, y1, x2, y2, time)
|
self.operator.swipe(x1, y1, x2, y2, time)
|
||||||
|
|
||||||
# 右滑
|
# 右滑
|
||||||
def swipe_right(self, dist, speed):
|
def swipe_right(self, dist, speed):
|
||||||
x1 = int(self.scr_w * 0.25) + int(random.uniform(-10, 10))
|
x1 = int(self.scr_w * 0.3) + int(random.uniform(-20, 20))
|
||||||
x2 = x1 + dist + int(random.uniform(-10, 10))
|
y1 = int(self.scr_h * 0.75) + int(random.uniform(-20, 20))
|
||||||
y1 = int(self.scr_w * 0.75) + int(random.uniform(-10, 10))
|
x2 = x1 + dist + int(random.uniform(-20, 20))
|
||||||
y2 = y1 + int(random.uniform(-10, 10))
|
y2 = y1 + int(random.uniform(-20, 20))
|
||||||
time = speed + int(random.uniform(-10, 10))
|
time = speed + int(random.uniform(-10, 10))
|
||||||
self.operator.swipe(x1, y1, x2, y2, time)
|
self.operator.swipe(x1, y1, x2, y2, time)
|
||||||
|
|
||||||
|
@@ -12,23 +12,31 @@ def main():
|
|||||||
# 3URNU24803102309 192.168.8.138:5555
|
# 3URNU24803102309 192.168.8.138:5555
|
||||||
wikoHi70m = WikoHi70m('3URNU24803102309')
|
wikoHi70m = WikoHi70m('3URNU24803102309')
|
||||||
|
|
||||||
# 任务
|
# 普通任务
|
||||||
watchAdTask = apps.Task("看广告", apps.Rule.count(500, 45, 2),
|
watchAdTask = apps.Task("看广告", apps.Rule.count(500, 45, 2), lambda : apps.TomatoListen(wikoHi70m).func_ad())
|
||||||
lambda : apps.TomatoListen(wikoHi70m).func_ad())
|
|
||||||
watchVideoTask = apps.Task.watch_video("刷视频", apps.Rule.count(500, 8, 2), wikoHi70m)
|
watchVideoTask = apps.Task.watch_video("刷视频", apps.Rule.count(500, 8, 2), wikoHi70m)
|
||||||
bgWatchVideoTask = apps.Task("后台刷视频", apps.Rule.count(500, 8, 2),
|
|
||||||
lambda : wikoHi70m.swipe(240 + int(random.uniform(-10, 10)), 1200 + int(random.uniform(-10, 10)), 240 + int(random.uniform(-10, 10)), 1100 + int(random.uniform(-10, 10)), 50))
|
|
||||||
minWatchVideoTask = apps.Task("小窗刷视频", apps.Rule.count(500, 8, 2),
|
|
||||||
lambda : wikoHi70m.swipe(450 + int(random.uniform(-10, 10)), 400 + int(random.uniform(-10, 10)), 450 + int(random.uniform(-10, 10)), 200 + int(random.uniform(-10, 10)), 50))
|
|
||||||
readBookTask = apps.Task.read_book("看书", apps.Rule.count(1000, 5, 2), wikoHi70m)
|
readBookTask = apps.Task.read_book("看书", apps.Rule.count(1000, 5, 2), wikoHi70m)
|
||||||
minReadBookTask = apps.Task("小窗看书", apps.Rule.count(1000, 5, 2),
|
|
||||||
lambda : wikoHi70m.swipe(600 + int(random.uniform(-10, 10)), 400 + int(random.uniform(-10, 10)), 400 + int(random.uniform(-10, 10)), 400 + int(random.uniform(-10, 10)), 80))
|
# 窗口任务
|
||||||
|
bgWatchVideoTask = apps.Task("后台刷视频", apps.Rule.count(500, 10, 2),
|
||||||
|
lambda : wikoHi70m.swipe(240 + int(random.uniform(-10, 10)), 1200 + int(random.uniform(-10, 10)), 240 + int(random.uniform(-10, 10)), 1100 + int(random.uniform(-10, 10)), 50))
|
||||||
bgReadBookTask = apps.Task("后台看书", apps.Rule.count(1000, 5, 2),
|
bgReadBookTask = apps.Task("后台看书", apps.Rule.count(1000, 5, 2),
|
||||||
lambda : wikoHi70m.swipe(500 + int(random.uniform(-10, 10)), 1200 + int(random.uniform(-10, 10)), 240 + int(random.uniform(-10, 10)), 1200 + int(random.uniform(-10, 10)), 80))
|
lambda : wikoHi70m.swipe(500 + int(random.uniform(-10, 10)), 1200 + int(random.uniform(-10, 10)), 240 + int(random.uniform(-10, 10)), 1200 + int(random.uniform(-10, 10)), 80))
|
||||||
|
minWatchVideoTask = apps.Task("小窗刷视频", apps.Rule.count(500, 20, 2),
|
||||||
|
lambda : wikoHi70m.swipe(450 + int(random.uniform(-10, 10)), 400 + int(random.uniform(-10, 10)), 450 + int(random.uniform(-10, 10)), 200 + int(random.uniform(-10, 10)), 50))
|
||||||
|
minReadBookTask = apps.Task("小窗看书", apps.Rule.count(1000, 5, 2),
|
||||||
|
lambda : wikoHi70m.swipe(600 + int(random.uniform(-10, 10)), 400 + int(random.uniform(-10, 10)), 400 + int(random.uniform(-10, 10)), 400 + int(random.uniform(-10, 10)), 80))
|
||||||
|
|
||||||
|
# 分屏任务
|
||||||
|
topTask = apps.Task("刷视频", apps.Rule.count(500, 8, 2),
|
||||||
|
lambda : wikoHi70m.swipe(350 + int(random.uniform(-10, 10)), 1250 + int(random.uniform(-10, 10)), 350 - int(random.uniform(10, 20)), 900 + int(random.uniform(-10, 10)), 20))
|
||||||
|
bottomTask = apps.Task("看书", apps.Rule.count(500, 5, 2),
|
||||||
|
lambda : wikoHi70m.swipe(600 + int(random.uniform(-10, 10)), 350 + int(random.uniform(-10, 10)), 400 + int(random.uniform(-10, 10)), 350 + int(random.uniform(-10, 10)), 60))
|
||||||
|
|
||||||
|
watchVideoTask.start()
|
||||||
|
|
||||||
watchAdTask.start()
|
|
||||||
# 看视频+小窗看书,同步执行
|
# 看视频+小窗看书,同步执行
|
||||||
# sync_task(bgWatchVideoTask, minReadBookTask)
|
# sync_task(topTask, bottomTask)
|
||||||
|
|
||||||
# 任务完成锁屏
|
# 任务完成锁屏
|
||||||
wikoHi70m.lock()
|
wikoHi70m.lock()
|
||||||
|
Reference in New Issue
Block a user