之前的auto.js因为作者问题用不了了,现在分享一下大佬搞的autox.js以及我写的很糙的翻页代码
threads.start(function(){
//在子线程中调用observeKey()从而使按键事件处理在子线程执行
events.observeKey();
events.on("key_down", function(keyCode, events){
//音量键关闭脚本
if(keyCode == keys.volume_down){
toast("您选择退出脚本!")
sleep(2000);
exit();
}
});
});
openRead();
setScreenMetrics(1080, 2340)
function openRead(){
launchApp("好策");
toastLog("等待好策启动");
device.wakeUp();
sleep(1000);
click(200,1700); //1
sleep(500);
var i = 0;
while(i!=100){
swipe(540, 1620, 50, 1620, 100);
var time = Math.floor(Math.random()*(60000-50000))+2000;
sleep(time);
toastLog(time);
i++;
}
return true;
}