雙十一又又又來了,領喵幣活動的瀏覽任務太耗時間,自己空閒時間網上學習整理使用autojs寫了一個指令碼用來自動完成瀏覽任務,指令碼已經打成apk安裝包,現分享給大家,下載地址:http://tool.xianxueba.com/auto
function gotoMiaoCenter() {
//搜尋雙十一,通過活動連結進入
desc("搜尋").findOne().click();
sleep(randNum(1000,2000));
id("searchEdit").findOne().setText("雙十一");
sleep(randNum(100,2000));
id("searchbtn").findOne().click();
sleep(randNum(100,2000));
let enter = desc("進入").findOne();
click(enter.bounds().centerX(), enter.bounds().centerY());
sleep(randNum(3000,5000));
text("活動連結").findOne().click();
sleep(randNum(3000,5000));
}
function execView() {
let quliulanBtn = className("android.view.View").text("去瀏覽").findOnce();
log("quliulanBtn", quliulanBtn);
while (quliulanBtn) {
quliulanBtn.click();
sleep(randNum(2000,4000));
gesture(1000, [300, device.height - 800], [300, device.height - 1200]);
//隨機等待15-20秒
sleep(randNum(15000,20000));
gesture(2000, [300, device.height - 1200], [300, device.height - 800]);
//返回上一級
back();
sleep(randNum(1000,3000));
quliulanBtn = className("android.view.View").text("去瀏覽").findOnce();
log("quliulanBtn2", quliulanBtn);
}
}
function execLuMiao() {
//隨機擼的次數
var num = randNum(20, 100);
toast("隨機擼"+num+"次");
while (num--) {
var cat=text("我的貓,點選擼貓").findOnce();
if(cat){
click(cat.bounds().centerX()+random(1,5)*5,cat.bounds().centerY()+random(1,5)*5);
sleep(200);
}
}
}
toast("檢測是否開啟無障礙模式")
auto.waitFor()
sleep(1000);
var appName = "手機淘寶";
launchApp(appName);
sleep(3000);
gotoMiaoCenter()
//開啟任務彈窗
text("賺喵幣").findOne().click();
sleep(randNum(3000,5000));
//執行瀏覽
execView();
console.log("瀏覽任務已完成")
toast("瀏覽任務已完成");
//關閉任務彈窗
indexInParent(0).text("關閉").findOne().click();
//執行擼貓
execLuMiao()
//獲取範圍內的亂數
function randNum(minnum, maxnum) {
return Math.floor(minnum + Math.random() * (maxnum - minnum));
};