diff --git a/app/src/main/assets/sample/QQ与微信/QQ空间点赞(没卵用).js b/app/src/main/assets/sample/QQ与微信/QQ空间点赞(没卵用).js deleted file mode 100644 index 41483d0e..00000000 --- a/app/src/main/assets/sample/QQ与微信/QQ空间点赞(没卵用).js +++ /dev/null @@ -1,49 +0,0 @@ -"auto"; - -var 延迟 = 0; - -function 点赞(){ - className("AbsListView").findOne() - .children().each(function(ss){ - try{ - var 一行 = 找到图标那一行(ss); - if(一行){ - 一行.child(1).click(); - if(延迟 > 0){ - sleep(延迟); - } - } - }catch(e){} - }); -} - - -function 找到图标那一行(s){ - for(let i = 0; i < s.getChildCount(); i++){ - var child = s.child(i); - if(child && child.className() - .endsWith("RelativeLayout") && - child.getChildCount() >= 4){ - if(是图片(child.child(1)) && - 是图片(child.child(2)) && - 是图片(child.child(3))){ - return child; - } - } - } -} - -function 是图片(item){ - return item && - item.className().endsWith("ImageView"); -} - -function 下滑(){ - className("AbsListView").findOne() - .scrollForward(); -} - -while(true){ - 点赞(); - 下滑(); -} \ No newline at end of file diff --git a/app/src/main/assets/sample/QQ与微信/QQ空间点赞.js b/app/src/main/assets/sample/QQ与微信/QQ空间点赞.js new file mode 100644 index 00000000..b212a203 --- /dev/null +++ b/app/src/main/assets/sample/QQ与微信/QQ空间点赞.js @@ -0,0 +1,71 @@ +"auto"; + +var 延迟 = 0; + +if(!requestScreenCapture()){ + toast("请求截图失败"); + stop(); +} + +var capture; + +function like(){ + capture = captureScreen(); + className("AbsListView").findOne() + .children().each(function(ss){ + try{ + var iconLine = findIconLine(ss); + if(iconLine){ + var likeIcon = iconLine.child(1).child(0); + if(notLiked(likeIcon)){ + likeIcon.click(); + } + if(延迟 > 0){ + sleep(延迟); + } + } + }catch(e){ + log(e) + } + }); +} + + +function findIconLine(s){ + for(let i = 0; i < s.getChildCount(); i++){ + var child = s.child(i); + if(child && child.className() + .endsWith("RelativeLayout") && + child.getChildCount() >= 4){ + if(isImage(child.child(1)) && + isImage(child.child(2)) && + isImage(child.child(3))){ + return child; + } + } + } +} + +function isImage(item){ + if(!item){ + return false; + } + if(item.className().endsWith("ImageView")){ + return true; + } + if(item.childCount() == 1){ + return isImage(item.child(0)); + } + return false; +} + +function notLiked(likeIcon){ + var x = likeIcon.bounds().centerX(); + var y = likeIcon.bounds().centerY(); + return images.detectsColor(capture, x, y, 0x767886); +} + +toast("请打开QQ空间并慢慢下滑"); +while(true){ + like(); +} \ No newline at end of file