首页
JAVA笔记
数据库笔记
混乱记忆
小站记
您现在的位置
最新全民飞机大战自动攻击刷金币教程
简介: 全民飞机大战是个个坑爹的游戏,网络上流传的刷金币方法太过落后,而且稍有不慎就被封号。自动脚本程序模拟人点击才是王道(虽然刷一个回合才200 多金币但是不需要人为干预)

最近在玩这个小游戏,金币太难搞了。作为一个码农写一个傻瓜的自动打飞机程序还是没什么问题的,由于时间有限只做了一个简单的脚本存在较多BUG,欢迎大家扩充一起学习一起进步。

为了获得好的体验效果,需要满足下面的要求

  1. 网络状态要稳定,不能出现掉线情况(实际上是我没有判断掉线)
  2. 每周第一次刷之前要先手动玩一个较高的分数(对我来说10万就比较高了)。
  3. 有一个闲置的电脑(因为脚本是用电脑运行的)

如果你满足这些条件恭喜你,你可以完美体验自动刷金币的乐趣了

 

由于本人是码农,各种软件配置对我来说都不是问题,由于时间关系没有做详细的脚本运行脚本环境测试,所以就需要各位网友配置下运行软件

  1. 安装java jdk  1.6 为宜
  2. 安装 android sdk
  3. 上面两个步骤实际上是安装android 开发环境,如不会请百度搜索 "android开发环境搭建"

如果各位网友上面的问题都不是问题下面进行核心内容

 

步骤一、进入 android sdk 的安装目录下的 tools 目录中,创建text文档,讲下面的内容粘贴进去,并另存为feiji.py

文件内容如下:

from com.android.monkeyrunner import MonkeyRunner,MonkeyDevice,MonkeyImage
device=MonkeyRunner.waitForConnection()
#device.startActivity(component="com.example.android.apis/.ApiDemos")
#MonkeyRunner.sleep(3)
#result = device.takeSnapshot()
#result.writeToFile('d:\\aaabbbccc','png')


class MyImg:
    def __init__(self,device,rect):
        self.device = device
        self.rect = rect
        result = device.takeSnapshot()
        self.image = result.getSubImage(rect)
    def getImage(self):
        return self.image
    def compare(self,percent):
        result = device.takeSnapshot()
        result = result.getSubImage(self.rect)
        return self.image.sameAs(result,percent)
    def compareAtrect(self,des,percent):
        result = self.device.takeSnapshot()
        result = result.getSubImage(des)
        return self.image.sameAs(result,percent)   
    def writeToFile(self,des,type):
        self.image.writeToFile(des,type)

flag = True
step = 0
step1 =None
step2 =None
step3 =None
step4 =None
step5 =None
count =1

while True:
    if step ==0:
        device.shell("am force-stop com.tencent.feiji")
        MonkeyRunner.sleep(1)
        device.shell("am start -n com.tencent.feiji/.MainActivity")
        MonkeyRunner.sleep(20)
        step = 1
    if step ==1:
        print "at the step1"
        if step1 is None:
            step1 = MyImg(device,(160,690,72,72))
            step1.writeToFile('d:\\feiji\step_1.png','png')
        if step1.compare(0.6):
            device.touch(350,850,MonkeyDevice.DOWN_AND_UP)
            step =2
            MonkeyRunner.sleep(3)
        else:
            flag = False
               
    if step ==2:
        print "at the step2"
        if step2 is None:
            step2 = MyImg(device,(230,750,30,25))
            step2.writeToFile('d:\\feiji\step_2.png','png')
        if step2.compare(0.6):
            device.touch(350,850,MonkeyDevice.DOWN_AND_UP)
            step =3
            MonkeyRunner.sleep(3)
        else:
            flag = False
    if step ==3:
        print "at the step3"
        if step3 is None:
            step3 = MyImg(device,(132,809,40,40))
            step3.writeToFile('d:\\feiji\step_3.png','png')
        if step3.compare(0.6):
            device.touch(350,850,MonkeyDevice.DOWN_AND_UP)
            step =4
            MonkeyRunner.sleep(10)
        else:
            flag = False
    if step ==4:
        print "at the step4"
        MonkeyRunner.sleep(5)
        if step4 is None:
            step4 = MyImg(device,(500,90,5,10))
            step4.writeToFile('d:\\feiji\step_4.png','png')
        if step4.compare(0.6):
            count = 1
            device.drag((500,40),(40,920),0.1,83)
 
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)
            device.drag((40,40),(500,40),0.1,83)
            device.drag((500,40),(40,40),0.1,83)

            device.drag((40,920),(210,850),0.1,83)
            while step4.compare(0.6):
                MonkeyRunner.sleep(3)
            step = 5
            MonkeyRunner.sleep(15)
        else:
            flag = False
    if step ==5:
        print "at the step5"
        if step5 is None:
            step5 = MyImg(device,(30,808,40,40))
            step5.writeToFile('d:\\feiji\step_5.png','png')
        if step5.compare(0.6):
            device.touch(60,850,MonkeyDevice.DOWN_AND_UP)
            step = 1
            MonkeyRunner.sleep(3)
        else:
            flag = False
    if flag == False:
        step=0
        MonkeyRunner.sleep(60)
       

 

步骤二、进入手机系统设置,设置开启USB调试,设置保持唤醒状态(手机不能黑屏,黑屏打个毛线),手机连接pc。电脑开启cmd 命令终端输入 adb devices 后回车,如出现如下的类似内容即为正常,如不正常需自己百度查找原因

adb devices

List of devices attached
×××××××××        device

 

步骤三、手机运行 全民飞机大战并登录成功来到成绩排名界面(我一般是第一名)

步骤四、电脑开启cmd 命令终端 cd 到  android sdk 的安装目录下的 tools 目录中

步骤五、输入命令 monkeyrunner feiji.py 后回车,如脚本正常则会出现如下内容并且自动打飞机

E:\android-sdk-windows\tools>monkeyrunner feiji.py
at the step1
at the step2
at the step3
at the step4

步骤六、享受自动打金币

友情提示:如使用中遇到问题请发邮件至 admin@xiaoyunduo.org

在刷之前先设置一个最高血,最高攻击的飞机以便获得更多金币。

如需开发脚本请查看 http://www.xiaoyunduo.org/article/140/

 

 

最近更新