游戏淘宝湾

 找回密码
 立即注册
开启左侧

[手机] 某东看一看自动领京豆脚本

  [复制链接]
--M_g-- 发表于 2021-1-18 04:11:43 | 显示全部楼层 |阅读模式
使用说明
  • 京东版本:V9.3.4
  • 系统要求:Android 7.0及以上
  • 安装Auto.js 并导入js脚本
  • 开启无障碍服务并授权给Auto.js后,点击运行脚本即可
  • 脚本执行过程中请勿手动点击屏幕,否则脚本执行可能会错乱,导致任务失败
  • 在Auto.js App中提前设置音量上键停止所有脚本,以便脚本运行出错时可按音量+键终止
下载链接脚本源代码:
  1. /**
  2. * 淘宝京东双十二活动脚本
  3. *
  4. * Author: YBQ789
  5. * Date: 2020/12/31
  6. * Versions: 1.0.0
  7. * Github: https://github.com/YBQ789/taobao-1212
  8. */

  9. //全局参数
  10. h=device.height;
  11. w=device.width;

  12. //无障碍判定
  13. try {
  14.     auto();
  15. } catch (error) {
  16.     toast("请手动开启无障碍并授权给Auto.js");
  17.     sleep(2000);
  18.     exit();
  19. }

  20. launchApp("京东");
  21. toastLog("等待界面加载完成");
  22. sleep(3000);
  23. text("领京豆").waitFor();
  24. sleep(1500);
  25. clickButton(className("android.widget.FrameLayout").depth(7).drawingOrder(3).findOne());
  26. text("看一看").waitFor();
  27. sleep(2500);
  28. clickButton(text("看一看").findOne());
  29. sleep(4000);
  30. var n = className("android.widget.ImageView").boundsInside(0,h/4,w,h).indexInParent(0).depth(15).clickable(true).findOnce();
  31. if(n!=null){
  32.     clickButton(n);
  33.     textContains("/40").waitFor();
  34.     num = textContains("/40").findOne().text().split("/")[0].split("(")[1];
  35.     if(num==40){
  36.         try{
  37.             var taskBtn = text("浏览精选内容").findOnce().parent().child(4);
  38.             clickButton(taskBtn);
  39.         }catch(err){
  40.             toastLog("已经领取过了")
  41.         }finally{
  42.             toastLog("任务已完成,退出脚本");
  43.             exit();
  44.         }  
  45.     }else{
  46.         var taskBtn = text("浏览精选内容").findOnce().parent().child(4);
  47.         clickButton(taskBtn);
  48.         sleep(4000);
  49.     }
  50. }else{
  51.     toastLog("任务按钮不存在,退出脚本");
  52.     exit();
  53. }

  54. //上边框
  55. var t = text("看一看").findOne().parent().bounds().bottom;
  56. log("上边框"+t);
  57. //下边框
  58. var b = className("android.widget.FrameLayout").depth(7).drawingOrder(3).findOne().bounds().top-20;
  59. log("下边框"+b);
  60. var i = 1;
  61. while(true){
  62.     if(className("android.widget.TextView").drawingOrder(2).depth(19).indexInParent(1).boundsInside(0,t,w,b).findOnce(i)!=null){
  63.         var video = className("android.widget.TextView").drawingOrder(2).depth(19).indexInParent(1).boundsInside(0,t,w,b).findOnce(i);
  64.         clickButton(video);
  65.         sleep(2000);
  66.         if(textContains("领京豆").exists()){
  67.             textContains("/40").waitFor();
  68.             sleep(500);
  69.             num++;
  70.             toastLog("看完第"+num+"个视频");
  71.             back();
  72.         }else{
  73.             back();
  74.         }
  75.         if(num<40){
  76.             sleep(2000);
  77.             i++;
  78.         }else{
  79.             sleep(2000)
  80.             getJD();
  81.         }   
  82.     }else{
  83.         i = 1;
  84.         scrollDown();
  85.         sleep(2000);
  86.     }
  87. }

  88. /**
  89. * 坐标点击
  90. */
  91. function clickButton(button){
  92.     var l = button.bounds().left;
  93.     var t = button.bounds().top;
  94.     var r = button.bounds().right;
  95.     var b = button.bounds().bottom
  96.     var x = (r-l)/2+l;
  97.     var y = (b-t)/2+t;
  98.     click(x,y);
  99. }

  100. /**
  101. * 领京豆
  102. */
  103. function getJD(){
  104.     var m = className("android.widget.ImageView").boundsInside(0,h/4,w,h).indexInParent(0).depth(15).clickable(true).findOnce();
  105.     if(m!=null){
  106.         clickButton(m);
  107.         textContains("/40").waitFor();
  108.         num = textContains("/40").findOne().text().split("/")[0].split("(")[1];
  109.         if(num==40){
  110.             var taskBtn = text("浏览精选内容").findOnce().parent().child(4);
  111.             clickButton(taskBtn);
  112.             toastLog("任务已完成,退出脚本");
  113.             exit();
  114.         }else{
  115.             click(w/2,h/2);
  116.             toastLog("继续任务");
  117.         }
  118.     }else{
  119.         toastLog("任务按钮不存在,退出脚本");
  120.         exit();
  121.     }
  122. };
复制代码


运行实测


181144ntqygn7hhwqifv1q.png

本楼点评(0) 收起
rrssttrst 发表于 2021-1-18 04:53:03 | 显示全部楼层
真是被感动的痛哭流涕……
本楼点评(0) 收起
回复

使用道具 举报

djjunlao 发表于 2021-1-19 06:12:24 | 显示全部楼层
我只是路过打酱油的。
本楼点评(0) 收起
回复

使用道具 举报

boolay 发表于 2021-1-19 07:29:19 | 显示全部楼层
感恩无私的分享与奉献
本楼点评(0) 收起
回复

使用道具 举报

luckyboy123 发表于 2021-1-20 02:03:19 | 显示全部楼层
真是难得给力的帖子啊。
本楼点评(0) 收起
回复

使用道具 举报

websky20110101 发表于 2021-1-20 03:52:09 | 显示全部楼层
激动人心,无法言表!
本楼点评(0) 收起
回复

使用道具 举报

ismiao 发表于 2021-1-20 13:19:34 | 显示全部楼层
太生气了,无法HOLD啦 >_<......
本楼点评(0) 收起
回复

使用道具 举报

hdsj6268 发表于 2021-1-20 16:31:42 | 显示全部楼层
强烈支持楼主ing……
本楼点评(0) 收起
回复

使用道具 举报

q774505813 发表于 2021-1-21 05:44:19 | 显示全部楼层
真是难得给力的帖子啊。
本楼点评(0) 收起
回复

使用道具 举报

510328133 发表于 2021-1-21 17:14:19 | 显示全部楼层
真是被感动的痛哭流涕……
本楼点评(0) 收起
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|游戏淘宝湾

GMT+8, 2024-5-16 18:28 , Processed in 0.093834 second(s), 95 queries .

Powered by 游戏淘宝湾 X3.4

Copyright © 2001-2023, Oddpp Cloud.

快速回复 返回顶部 返回列表