微信朋友圈自动点赞
var it =className("ListView").findOne();
var i=1;while(i<5){say= desc('评论').findOne();say.click();good=text('赞').findOne();goodp=good.parent();goodp.click();sleep(1000);it.scrollDown();i++;
}home();
微信轰炸机
toast("轰炸机已准备");while(true){
setText("你好世界!");
text('发送').click();
}
swipe(500,500,500,290,1000);
1、向右滑动(0左滑。1000右滑)
2、向下滑动的距离(500标准)
3、向上滑动
4、按住的时间长久(500以上是长按)
蚂蚁偷能量
发现能量
function findGreen(){var i=0;requestScreenCapture(); //循环找色,找到红色(#ff0000)时停止并报告坐标while(i<10){var img = captureScreen();var point = findColor(img, "#1DA06D");if(point){toast("找到绿色,坐标为(" + point.x + ", " + point.y + ")");point.y= point.y+50;click(point.x,point.y);return true;}else{toast("没有找到绿色");return false;}i++;}}while(true){findGreen();sleep(3000);swipe(500,500,500,290,1000);}
收集能量
function collectGreen(){var width=device.width;var i,j;//盲点收自己的能量for(i=450;i<=800;){//y方向点击范围threads.start(function(){for(j=300;j<width-200;){//x方向点击范围click(j,i);j=j+150;}});sleep(1000);i=i+100;}toast("收集完成");}
全套代码(看设备)
function findGreen(){var i=0;requestScreenCapture(); //循环找色,找到红色(#ff0000)时停止并报告坐标while(i<10){var img = captureScreen();var point = findColor(img, "#1DA06D");if(point){toast("找到绿色,坐标为(" + point.x + ", " + point.y + ")");point.y= point.y+50;click(point.x,point.y);return true;}else{toast("没有找到绿色");return false;}i++;}}function collectGreen(){var width=device.width;var i,j;//盲点收自己的能量for(i=370;i<=800;){//y方向点击范围threads.start(function(){for(j=300;j<width-100;){//x方向点击范围click(j,i);j=j+150;}});sleep(1000);i=i+100;}toast("收集完成");}while(true){findGreen();sleep(3000);collectGreen();back();sleep(2000);swipe(500,500,500,0,1000);swipe(500,500,500,0,1000);}
打开支付宝并点击蚂蚁森林
launchApp("支付宝");
var w=text("蚂蚁森林").className("android.widget.TextView").findOne();
var b=w.bounds();
click(b.centerX(),b.centerY());
toast("点击成功");
滑动到更多好友
var i=0;
while(i<6){swipe(500,500,500,0,1000);i++;
}
点击更多
text("查看更多好友").click();
从打开支付宝开始的版本
function findGreen(){var i=0;requestScreenCapture(); //循环找色,找到红色(#ff0000)时停止并报告坐标var img = captureScreen();var point = findColor(img, "#1DA06D");if(point){toast("找到绿色,坐标为(" + point.x + ", " + point.y + ")");point.y= point.y+50;click(point.x,point.y);return true;}else{toast("没有找到绿色");return false;}}function collectGreen(){var width=device.width;var i,j;//盲点收自己的能量for(i=370;i<=800;){//y方向点击范围threads.start(function(){for(j=300;j<width-100;){//x方向点击范围click(j,i);j=j+150;}});sleep(1000);i=i+100;}toast("收集完成");}launchApp("支付宝");
sleep(2000);
var w=text("蚂蚁森林").className("android.widget.TextView").findOne();
var b=w.bounds();
click(b.centerX(),b.centerY());
toast("点击成功");
sleep(2000);
var i=0;
while(i<6){swipe(500,500,500,0,1000);i++;
}text("查看更多好友").click();
sleep(2000);while(true){var e;e=findGreen();sleep(3000);if(e){collectGreen();}else{swipe(500,500,500,0,1000);}back();sleep(2000);swipe(500,500,500,0,1000);}