|
发表于 2019-12-1 17:13:53
|
显示全部楼层
搬运其他论坛的, 本来想等一下的, 但是一直没有人发...
auto.js 软件下载: https://www.lanzouu.com/i7rl8eh
活动在首页, 集图赢大金条
代码:
- var height = device.height;
- var width = device.width;
-
- if (text("签到").exists()) {
- text("签到").findOne().click();
- sleep(1600);
- toast("签到成功")
- }
- sleep(1500);
-
- while (textContains("去浏览").exists()) {
- toast("存在去浏览");
- textContains("去浏览").find().forEach(function(o) {
- text_str = o.text()
- text_str = text_str.match(/\d+\/\d+/g).join()
- click_cnt = parseInt(text_str.match(/\d+/g));
- goal_cnt = parseInt(text_str.match(/\/\d+/g).join().replace("/", ""));
- log(click_cnt, goal_cnt)
- if (click_cnt != goal_cnt) {
- toast("找到了");
- o.click();
- sleep(1500);
- swipe(width / 2, height - 500, width / 2, 0, 500);
- sleep(2500);
- swipe(width / 2, height - 500, width / 2, 0, 500);
- sleep(10000);
- swipe(width / 2, height - 500, width / 2, 0, 500);
- sleep(8000);
- back();
- sleep(1500);
- }
- })
- }
-
- while (textContains("去搜索").exists()) {
- toast("存在去浏览");
- textContains("去搜索").find().forEach(function(o) {
- text_str = o.text()
- text_str = text_str.match(/\d+\/\d+/g).join()
- click_cnt = parseInt(text_str.match(/\d+/g));
- goal_cnt = parseInt(text_str.match(/\/\d+/g).join().replace("/", ""));
- log(click_cnt, goal_cnt)
- if (click_cnt != goal_cnt) {
- toast("找到了");
- o.click();
- sleep(1500);
- swipe(width / 2, height - 500, width / 2, 0, 500);
- sleep(2500);
- swipe(width / 2, height - 500, width / 2, 0, 500);
- sleep(10000);
- swipe(width / 2, height - 500, width / 2, 0, 500);
- sleep(8000);
- back();
- sleep(1500);
- }
- })
- }
- toast("请在能量中心开始运行,需要自行开始和停止脚本");
复制代码 如果发现上面代码不好用, 可以用下面这个:
- auto.waitFor();
- var height = device.height;
- var width = device.width;
- var model = device.model;
- var android = device.release;
- var i;
- toast("手机型号:" + model + "\n安卓版本:" + android + "\n屏幕宽:" + width + "\n" + "屏幕高:" + height + "\nBy:Summerlotus" + "\n")
- sleep(2000);
- //设置脚本坐标点击所适合的屏幕宽高;请根据自己屏幕来决定
- if (width == 1080)
- {
- setScreenMetrics(1080, height);
- toast("你的设备屏幕参数设定为:" + height + "*" + width);
- jintiao()
- }
- //如不能执行成功,请更改上述脚本为如下脚本
- //并修改成你手机屏幕的对应参数
- /*
- if (height == 1920)//替换1920->你手机屏幕参数
- {
- setScreenMetrics(1080, 1920);//替换分辨率你手机屏幕参数
- toast("你的设备屏幕参数设定为:" + height + "*" + width);
- miaomiao()
- }
- */
-
- function jintiao()
- {
- sleep(1600);
- click(960,1630);
-
- sleep(1500);
- if(textEndsWith("签到").exists())
- {
- textEndsWith("签到").click();
- sleep(1600);
- toast("签到成功")
- }
- sleep(1500);
- //循环判断是否有新任务
- while(textEndsWith("去浏览").exists())
- {
- //toast("in");
- toast("任务-去浏览-");
- sleep(1500);
- textEndsWith("去浏览").click();
- sleep(1500);
- swipe(width / 2, height - 500, width / 2, 0, 500);
- sleep(2500);
- swipe(width / 2, height - 500, width / 2, 0, 500);
- sleep(10000);
- swipe(width / 2, height - 500, width / 2, 0, 500);
- sleep(5000);
- back();
- sleep(1600);
- }
- sleep(1000);
- toast("如发现仍有新任务请重新运行脚本~");
- sleep(3000);
- toast("本次运行结束~");
- }
复制代码 使用方法:
打开auto.js.apk, 会提示设置无障碍, 直接去把无障碍开启就好
然后点击右下角的 + 号, 选择文件, 新建一个文件, 把代码复制进去.
点击左上角的侧边栏, 确定无障碍服务以及悬浮窗为开启状态.
打开淘宝全民寻宝活动界面, 运行脚本
到充能量中心运行脚本
|
上一篇:【酷Q】QQ一键签到机器人插件V1.1下一篇:百度网盘提取直链突破限速
|