逛街任务

This commit is contained in:
wangzhengzhen
2024-12-30 19:23:17 +08:00
parent 0822209118
commit 182f66216a
2 changed files with 10 additions and 4 deletions

View File

@@ -43,11 +43,15 @@ class Task:
@classmethod
def watch_video(cls, name, rule, device):
return cls(name, rule, lambda : device.swipe_up(150, 50))
return cls(name, rule, lambda : device.swipe_up(150, 40))
@classmethod
def read_book(cls, name, rule, device):
return cls(name, rule, lambda : device.swipe_left(300, 100))
return cls(name, rule, lambda : device.swipe_left(200, 60))
@classmethod
def browse(cls, name, rule, device):
return cls(name, rule, lambda : device.swipe_up(300, 300))
def start(self):
print("开始执行任务:{}".format(self.name))

View File

@@ -16,6 +16,7 @@ def main():
watchAdTask = apps.Task("看广告", apps.Rule.count(500, 45, 2), lambda : apps.TomatoListen(wikoHi70m).func_ad())
watchVideoTask = apps.Task.watch_video("刷视频", apps.Rule.count(500, 8, 2), wikoHi70m)
readBookTask = apps.Task.read_book("看书", apps.Rule.count(1000, 5, 2), wikoHi70m)
browseTask = apps.Task.browse("逛街", apps.Rule.count(1000, 6, 2), wikoHi70m)
# 窗口任务
bgWatchVideoTask = apps.Task("后台刷视频", apps.Rule.count(500, 10, 2),
@@ -33,8 +34,9 @@ def main():
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()
# watchVideoTask.start()
browseTask.start()
# 看视频+小窗看书,同步执行
# sync_task(topTask, bottomTask)