level 1
"auto";
setScreenMetrics(1080, 1920);
function run() {
for (var t = 1; true; t++) {
var emm =find()
if (emm == null) {
toast("done");
sleep(3000);
back();
break;
}
emm.click()
toast("find one")
sleep(3000)
view();
toast("已经逛了" + t + "次")
sleep(3000)
}
}
function find() {
return text("去进店").findOne(1) ||
text("去浏览").findOne(1) ||
text ("去围观").findOne(1)||
text("去逛逛").findOne(1)||
null;
}
function view() {
for (var i = 0; i < 6; i++) {
swipe(device.width / 2, 4 * device.height / 5, device.width / 2, device.height / 5, 1000);
sleep(3000)
}
back();
}
var w = floaty.window(
<frame gravity="center">
<button id="btn">关闭脚本</button>
</frame>
);
w.btn.click(()=>{
toast("手动结束运行脚本")
w.exitOnClose()
w.close()
})
toast("loading")
sleep(1000)
run()
2020年10月21日 02点10分
11
这是618的,我今天试了一下,也可以
2020年10月21日 02点10分
level 2
转载于某大佬
auto.waitFor();
var height = device.height;
var width = device.width;
toast("\n设备宽" + width + "\n" + "设备高" + height + "\n" + "手机型号" + device.model + "\n安卓版本" + device.release)
setScreenMetrics(width, height);
lingqu();
function lingqu() {
app.launchApp("手机淘宝");
toast("打开淘宝")
sleep(6000);
click(600, 1235);//进入活动页
sleep(6000);
click(900, 1320);
toast("领金币")
//id("_KivZw5").findOne().click();//点猫 领金币
// //浏览15秒领金币
sleep(1500);
while (text("去喂猫 赚更多喵币").exists()) {
text("去喂猫 赚更多喵币").findOne().click();
}
click(920, 2100);
toast("赚喵币")
sleep(1500);
if (text("签到").exists()) {
text("签到").findOne().click();
sleep(1600);
toast("签到成功")
}
sleep(1500);
while (text("去浏览").exists()) {
toast("存在去浏览");
text("去浏览").findOne().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(1600);
}
while (text("去完成").exists()) {
//要支持的动作
toast("存在去完成");
text("去完成").findOne().click();
sleep(2500);
swipe(width / 2, height - 600, width / 2, 0, 500);
sleep(3500);
swipe(width / 2, height - 600, width / 2, 0, 500);
sleep(10000);
swipe(width / 2, height - 600, width / 2, 0, 500);
sleep(9000);
back();
sleep(1000);
}
toast("结束");
}
2020年10月21日 06点10分
13