auto.waitFor();
var height = device.height;
var width = device.width;
toast("\n設備寬" + width + "\n" + "設備高" + height + "\n" + "手機型號" + device.model + "\n安卓版本" + device.release)
if (height == 2280) { //設定腳本坐標點擊所適合的螢屏寬高。
setScreenMetrics(1080, 2280);
toast("設備高" + height);
lingqu()
} else if (height == 2340) {
setScreenMetrics(1080, 2340);
toast("設備高" + height);
lingqu()
}
else if (height == 2160) {
setScreenMetrics(1080, 2160);
toast("設備高" + height);
lingqu();
}
function lingqu() {
app.launchApp("手機淘寶");
toast("打開淘寶")
sleep(9000);
click(800, 1540);//進入活動頁
sleep(6000);
toast("這里如果有懸浮窗請在3秒內手動關閉")
click(547, 1264);//點貓 領金幣
// //瀏覽15秒領金幣
sleep(1500);
click(911, 1716);
sleep(1500);
if (text("簽到").exists()) {
text("簽到").findOne().click();
sleep(1600);
toast("簽到成功")
}
sleep(1500);
while (text("去進店").exists()) {
//要支持的動作
toast("存在去進店");
text("去進店").findOne().click();
sleep(2500);
swipe(width / 2, height - 600, width / 2, 0, 500);
sleep(4000);
swipe(width / 2, height - 600, width / 2, 0, 500);
sleep(10000);
swipe(width / 2, height - 600, width / 2, 0, 500);
sleep(10000);
back();
sleep(2000);
}
while (text("去瀏覽").exists()) {
//要支持的動作
toast("存在去瀏覽并點擊");
text("去瀏覽").findOne().click();
sleep(1500);
toast("等待獲得貓幣");
sleep(25000);
back();
sleep(3000);
}
toast("全部結束請檢查");
}
用軟體auto.js運行
從大佬那里搞來的代碼,發表一下,再次感謝!
我的手機是vivo資料修改了,使用前具體的要根據手機螢屏大小進行修改。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/149875.html
標籤:JavaScript
上一篇:輪播圖
