zoukankan      html  css  js  c++  java
  • 五分钟撸一下游戏自动化

    现在微信小游戏越来越活,但大多时候通常都是需要不停点击,才能升级,又累,又费时间,在这里向大家介绍一个airtest,相对传统的appium,airtest更针对游戏自动化,现在就来简单认识一下吧!

    1  进入airtest官网 

    http://airtest.netease.com/

    2 下载airtest  

    3 安装python,并在airtest中进行配置

    4  通过airtest链接手机,安卓比较方便

    5 然后就可是copy下面的脚本稍稍改动坐标就可以自动打游戏了

    # -*- encoding=utf8 -*-
    __author__ = "wujianqinjian"
    
    from airtest.core.api import *
    
    auto_setup(__file__)
    
    #自动打怪升级第二版
    while 1<2:
        #点击商城
        touch((950,1850),duration=0.0001)
        #购买金币
        for i in range(1,10):
            touch((800,1200),duration=0.0001)
        #点击屏幕中央
        touch((500,800),duration=0.0001)
        #长按召唤英雄
        swipe((500,500),(500,501),duration=7)
        #点击英雄界面
        touch((70,1850),duration=0.0001)
        #升级英雄
        for i in range(1,3):
            touch((850,1200),duration=0.0001)
            touch((750,1200),duration=0.0001)
            touch((850,1700),duration=0.0001)
            touch((750,1700),duration=0.0001)
        touch((500,250),duration=0.0001)
        swipe((500,400),(500,900),duration=0.7)
        #封印怪兽
        touch((850,1850),duration=0.0001)
        touch((850,1550),duration=0.0001)
        #使用药水
        touch((500,1850),duration=0.0001)
        touch((80,1200),duration=0.0001)
        touch((80,1400),duration=0.0001)
        touch((80,1600),duration=0.0001)
        touch((80,1700),duration=0.0001)
        #宝物抽奖
        touch((800,1800),duration=0.0001)
        touch((150,1200),duration=0.0001)
        for i in range(1,10):
            touch((792,1202),duration=0.0001)
        touch((280,1200),duration=0.0001)
        #升级士兵页
        touch((280,1800),duration=0.0001)
        swipe((500,1200),(500,1500),duration=0.7)
        for i in range(1,3):
            swipe((500,1500),(500,1200),duration=0.7)
        touch((850,1200),duration=0.0001)
        touch((850,1400),duration=0.0001)
    

    建立了一个微信讨论群,群主最喜欢能解决问题时,出来冒泡,解决不了时,装死!     

    有问题可以添加微信群,互相讨论

    QQ 群:219537016    虽然没啥人气,群主经常装死中!

    总结,打游戏纯粹为了娱乐,但耗费太多时间也不太好,所以有空打打,没空的时候,就让电脑自动代劳,何乐而不为,写博客花了10分钟,不知道你花了几分钟呢?嘿嘿

  • 相关阅读:
    宿主机无法访问CentOS7上Jenkins服务的解决办法
    415. Add Strings
    367. Valid Perfect Square
    326. Power of Three
    258. Add Digits
    231. Power of Two
    204. Count Primes
    202. Happy Number
    172. Factorial Trailing Zeroes
    171. Excel Sheet Column Number
  • 原文地址:https://www.cnblogs.com/wujianqinjian/p/9709514.html
Copyright © 2011-2022 走看看