微趣看自动刷新闻示列:必要的延时很关键,找图和坐标需要自己根据实际情况修改。核心代码如下:
//打开微趣看
function runWQK(device){
print("打开微趣看");
var r = device.runApp("com.qudu.weiqukan");
device.delay(25000);
}
//核心代码
function runWQKMoneyCoin(device){
print("已在 微趣看执行时间:"+ totalTimeWQK);
//判断是否在主页
var index = device.seekImage(0,1628,300,1919,userPath+"\\Documents\\Scripts\\qutoutiao\\wqk_index.bmp",0.7);
print("判断是否在主页:"+index);
if(index != null){
changeTitle(device);
//先刷新,滑动一下
device.click(index.x,index.y,sigmaConst.STATE_PRESS);
device.delay(5000);
//device.swipe ([[505,1111,1],[505,950,100],[505,850,30]]);//和click有冲突
//device.swipe ([[505,1111,1],[505,961,100],[505,761,30]]);
device.swipe ([[505,1111,30],[505,1001,100],[505,961,30]]);
device.delay(5000);
print("发送坐标点击[看文章]事件");
device.click(538,463,sigmaConst.STATE_PRESS);
device.delay(4000);
//是不是广告
var ads = device.seekImage(0,1683,1079,1919,userPath+"\\Documents\\Scripts\\qutoutiao\\wqk_star.bmp",0.7)
print("判断是不是广告:"+ads);
if(ads == null){
print("fuck广告,发送坐标点击[关闭]事件");
device.send(sigmaConst.KEY_BACK);
device.delay(2000);
device.send(sigmaConst.KEY_BACK);
}else{
//上滑动
//device.swipe ([[505,761,30],[505,961,100],[505,1111,1]]);
var countTime = 0;
//控制1分钟阅读时间
var isAllClick = false;
for(var i=0;i<20;i++){
//下滑动
//device.swipe ([[505,1111,1],[505,961,100],[505,761,30]]);
//device.swipe ([[505,1111,30],[505,1001,100],[505,961,30]]);
device.shift(sigmaConst.KEY_UP);
device.delay(3000);
countTime++;
print("计算时间:"+ countTime)
if(isAllClick==false){
var all = device.seekImage(userPath+"\\Documents\\Scripts\\qutoutiao\\wqk_all.bmp",0.7)
if(all != null){
print("点击展开全文:"+all);
isAllClick = true;
device.click(all.x,all.y,sigmaConst.STATE_PRESS);
device.delay(3000);
}
}
}
totalTimeWQK = totalTimeWQK+(20 * 1.5);
//浏览完成返回主页
print("发送坐标点击[返回]事件");
//device.click(63,116,sigmaConst.STATE_PRESS);
device.send(sigmaConst.KEY_BACK);
device.delay(1000);
}
}else{
print("不在主页");
device.closeApp("com.qudu.weiqukan")
runWQK(device);
}
}
如果觉得好,请点个赞吧!有问题请留言哦。