Skip to content

Commit

Permalink
Update main.js
Browse files Browse the repository at this point in the history
关闭相关错误
  • Loading branch information
pzx521521 authored Feb 9, 2024
1 parent 9602db4 commit fad6efe
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,22 @@ function ExprClick(str){
function CloseAd(caption){
toastLog("看视频等待20s" + caption)
sleep(20000)

function Close(){
if(text("关闭").exists()){
text("关闭").click()
if(text("跳过广告").exists()){
text("跳过广告").click()
}else{
var meButton =className("android.widget.Image").text("cross").findOnce()
if (meButton == undefined){
meButton = className("android.widget.Image").text("此图片未加标签。打开右上角的“更多选项”菜单即可获取图片说明。").findOnce()
}
if (meButton != undefined){
meButton = meButton.parent();
toastLog("找到了关闭按钮")
meButton.click()
}
var meButtons = className("android.widget.ImageView").find()
if(meButtons.empty()){
toastLog("没找到关闭按钮╭(╯^╰)╮");
}else{
meButtons.some(function(bt){
if(bt.clickable()){
bt.click();
return true;
}
});
}
}
sleep(2000)
sleep(1000)
MyClick("我知道了")
toastLog("看视频结束: " + caption)
sleep(1000)
Expand Down

0 comments on commit fad6efe

Please sign in to comment.