原創腳本,轉載請注明出處!!
//獲取當前腳本的id var current_e_id = engines.myEngine().id; setTimeout(function() { //根據當前腳本id,獲取當前腳本 let to_terminate_e = engines.all().filter(e => current_e_id === e.id)[0]; // console.log("都結束了!!"); setTimeout(function() { to_terminate_e.forceStop(); //結束當前腳本 }, 2000); }, 35000); //判斷屏幕是否亮屏,若未亮則解鎖 if (!device.isScreenOn()) { let mima = "1234"; //密碼 let mmArr = mima.replace(/(.)(?=[^$])/g, "$1,").split(","); //字符串轉字符數組 device.wakeUp(); setTimeout(function() { //console.show(); swipe(device.width * 0.6, device.height * 0.78, device.width * 0.6, device.height * 0.3, 500); }, 1500); setTimeout(function() { for (let i = 0; i < mmArr.length; i++) { let m2 = text(mmArr[i]).findOne(); sleep(100); click(m2.bounds().centerX(), m2.bounds().centerY()); } sleep(800);
app.launchApp("Auto.js"); dddk(); }, 3000); } else { dddk(); } function dddk() { var zxc = threads.start(function() { // console.log("我們開始吧!!!"); app.launchApp("釘釘"); let arrLC = ["home_bottom_tab_button_work", "員工健康", "今天", "獲取", "提交"];//先判斷流程,不同學校的控件文字或許有所不同,一般是"員工健康",若不同改為對應學校的text即可 let theClick = ""; //獲取控件 for (let i = 0; i < arrLC.length; i++) { if(i == 0){ theClick = id(arrLC[i]).findOne(); //獲取控件 }else if(i == arrLC.length - 1){//此處不同學校的打卡流程可能不同,此處為先獲取位置再下滑。若是先下滑再獲取位置,則改為,arrLC.length - 2即可 sleep(1000); for (let i = 0; i < 6; i++) { swipe(device.width * 0.8, device.height * 0.75, device.width * 0.8, device.height * 0.043, 150); //滾動 } theClick = text(arrLC[i]).findOne(); //獲取控件 }else{ theClick = text(arrLC[i]).findOne(); //獲取控件 } sleep(500);//防止刷新延遲過程中出現未刷新完成的控件 click(theClick.bounds().centerX(), theClick.bounds().centerY()); //點擊sias } }); }