Skip to content

Commit

Permalink
[JDTB]小优化
Browse files Browse the repository at this point in the history
  • Loading branch information
czj2369 committed Oct 26, 2021
1 parent 716887e commit ae2996c
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 14 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@

# 更新

2021年10月26日

1.[22:22:09]【JDTB】 没大改,旧版依旧可用,进行小优化;去掉JD的参与城城活动(搞不定);TB加入一些过渡操作(比如”我知道了“这类控件)

------

2021年10月25日

1.[21:53:25]【JDTB】添加音量上键停止脚本,优化部分逻辑;添加apk到release中(发现小服务器顶不住下载的数量。。没想到这么多人)
Expand Down
29 changes: 25 additions & 4 deletions auto_20211111/jd/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
* Author: czj
* Date: 2021/10/20
* Time: 23:02:50
* Versions: 1.6.0
* Versions: 1.7.0
* Github: https://github.com/czj2369/jd_tb_auto
*/

// 需要完成的任务列表
var TASK_LIST = ["浏览并关注", "浏览8s", "累计浏览", "参与城城", "浏览可得", "去首页浮层进入"];

var TASK_LIST = ["浏览并关注", "浏览8s", "累计浏览", "浏览可得", "去首页浮层进入"];
// 过渡操作
var PASS_LIST = ['请选择要使用的应用','我知道了'];
// 判断停留时间
var JUDGE_TIME = 0;
// 定时器
Expand Down Expand Up @@ -58,6 +59,9 @@ function init() {
});

while (true) {

transitioPperation();

enterActivity();

recoverApp();
Expand Down Expand Up @@ -118,7 +122,7 @@ function enterActivity() {

} else {
huodong_indexInParent_num = huodong_indexInParent_num + 1;
if (huodong_indexInParent_num == 16) {
if (huodong_indexInParent_num == 10) {
console.info("无法自动进入做任务界面,请手动进入!");
huodong_indexInParent_num = 9;

Expand Down Expand Up @@ -405,6 +409,23 @@ function recoverApp() {
}
}

/**
* 过渡操作
*/
function transitioPperation() {
for (let index = 0; index < PASS_LIST.length; index++) {
if (text(PASS_LIST[index]).exists()) {
if (PASS_LIST[index].indexOf("请选择要使用的应用") >= 0) {
back();
}else{
text(PASS_LIST[index]).click();
console.info("过渡操作:", PASS_LIST[index]);
}
sleep(500);
}
}
}

/**
* 点击
* @param {横坐标} x
Expand Down
2 changes: 1 addition & 1 deletion auto_20211111/jd/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"build"
],
"packageName": "com.anjian.jd1111",
"versionName": "1.6.0",
"versionName": "1.7.0",
"versionCode": 1
}
27 changes: 19 additions & 8 deletions auto_20211111/tb/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,24 @@
*
* Author: czj
* Date: 2021/10/21 13:01:32
* Versions: 1.3.0
* Versions: 1.4.0
* Github: https://github.com/czj2369/jd_tb_auto
*/

// 需要忽略的任务中包含的关键字
var IGNORE_LIST = ['农场', '芭芭农场', '下单', '蚂蚁森林', '淘特', '点淘', '充话费', '参与合伙', '喂小鸡', '斗地主', '续卡', '88VIP'];
// 过渡操作
var PASS_LIST = ['我再想想', '我知道了', '开心收下'];

var app_package = "com.taobao.taobao";
var app_name = "淘宝";

// 点击之后返回的任务
const BACK_LIST = [];
const GO_View = '去浏览';
const GO_FINISH = '去完成';
const GO_SEARCH = '去搜索';
// 需要做的任务
// 返回标记
const FINISHED_TASK = ['任务完成', '全部完成啦', '喵糖已发放', '任务已完成'];
const VIEW_MOST = '去逛逛';
// 判定是否进入到喵糖总动员
Expand Down Expand Up @@ -102,11 +108,11 @@ function init() {
*/
function start() {
auto.waitFor()
var appName = "com.taobao.taobao";
if (launch(appName)) {
console.info("启动淘宝APP");

if (launch(app_package)) {
console.info("启动" + app_name + "APP");
} else {
console.info("请手动启动淘宝APP")
console.info("请手动启动" + app_name + "APP")
}

console.show();
Expand Down Expand Up @@ -299,6 +305,7 @@ function isFinshed(uiName) {
if (textContains(uiName[i]).exists() || descContains(uiName[i]).exists()) {
back();
sleep(500);
break;
}
}

Expand Down Expand Up @@ -350,8 +357,12 @@ function recoverApp() {
* 过渡操作
*/
function transitioPperation() {
if (text("我知道了").exists()) {
text("我知道了").click();
for (let index = 0; index < PASS_LIST.length; index++) {
if (text(PASS_LIST[index]).exists()) {
text(PASS_LIST[index]).click();
console.info("过渡操作:", PASS_LIST[index]);
sleep(500);
}
}
}
/**
Expand Down
2 changes: 1 addition & 1 deletion auto_20211111/tb/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"build"
],
"packageName": "com.anjian.tb1111",
"versionName": "1.3.0",
"versionName": "1.4.0",
"versionCode": 1
}

0 comments on commit ae2996c

Please sign in to comment.