旅行青蛙

今天才知道旅行青蛙的时间是取的客户端时间,没有做服务器校验。

也就是说,如果我把手机时间调到 3 个小时以后,再打开旅行青蛙,那么就可以领取满满的三叶草了!

然后我就手动操作

  1. 删掉游戏
  2. 再从 AppStore 下载下来 (这一步之前先不要改时间,否则下载不下来)
  3. 把手机时间调到很久以前(如 2016.1.1)
  4. 打开游戏,跑教学,领叶子
  5. 调手机时间到下一天(往后调 3 个小时也可以,为了方便直接调一整天了)
  6. 打开游戏领叶子
  7. 回到 5

如此操作一番,领了 1500 多个叶子,累死了。打开电脑开始写脚本,让脚本自动改时间领叶子,很快写出了勉强可用的代码

import time
import wda

c = wda.Client('http://localhost:8200')

def main():

    while True:
        s = c.session('jp.co.hit-point.tabikaeru')
        time.sleep(3)
        s.tap(200, 350)
        s.swipe(2, 200, 342, 200, 0.5)

        s.swipe(2, 7/12.1 * 736, 402, 7/12.1 * 736, 1)
        s.swipe(2, 7.5/12.1 * 736, 402, 7.5/12.1 * 736, 1)
        s.swipe(2, 8/12.1 * 736, 402, 8/12.1 * 736, 1)
        s.swipe(2, 8.5/12.1 * 736, 402, 8.5/12.1 * 736, 1)

        s = c.session('com.apple.Preferences')
        s.tap(200, 4.8/12.1 * 736)
        s.swipe(150, 7/12.1 * 736, 150, 6.5/12.1 * 736, 1)



if __name__ == '__main__':
    main()


要用到这两个东西
WebDriverAgent
facebook-wda

原文地址:https://www.cnblogs.com/hangj/p/8363975.html