Skip to content

Commit

Permalink
脚本适配AutoJs6、更新Tasker配置文件、更新README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
e1399579 committed Aug 17, 2023
1 parent a921f22 commit 17aed22
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

## 设备要求
1. 原生/类原生系统,Android 9.0+(需要开启无障碍服务)
2. 安装 [AutoX.js](https://github.com/kkevsekk1/AutoX/releases)
3. 安装Tasker 5.0+(可选)
2. 安装 [AutoJs6 by SuperMonster003](https://github.com/SuperMonster003/AutoJs6/releases)
3. 安装 Tasker 5.0+(可选)

## 目录结构
```
Expand All @@ -26,6 +26,7 @@
* 用途:解锁屏幕
* 加载到其他脚本运行。也可单独使用,一般不用管


### 支付宝签到
* 用途:支付宝每日签到领积分
* 要求:主页有支付宝图标
Expand All @@ -35,4 +36,11 @@
* 要求:主页有京东图标

### Tasker定时任务
* 直接导入Tasker.xml,然后根据需求修改时间、脚本路径等
* 直接导入`Tasker.xml`,然后根据需求修改时间、脚本路径等

## 相关链接
[AutoJs6 应用文档](https://docs.autojs6.com/) by [SuperMonster003](https://github.com/SuperMonster003)

[AutoJs6 VSCode插件](http://vscext-project.autojs6.com) by [SuperMonster003](https://github.com/SuperMonster003)

[蚂蚁森林脚本](https://github.com/SuperMonster003/Ant-Forest) by [SuperMonster003](https://github.com/SuperMonster003)
14 changes: 7 additions & 7 deletions Tasker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</Profile>
<Profile sr="prof5" ve="2">
<cdate>1668679485838</cdate>
<edate>1687070791089</edate>
<edate>1687071013886</edate>
<flags>8</flags>
<id>5</id>
<mid0>4</mid0>
Expand All @@ -37,10 +37,10 @@
</Project>
<Task sr="task2">
<cdate>1668622877039</cdate>
<edate>1668680364587</edate>
<edate>1692234633655</edate>
<id>2</id>
<nme>支付宝签到</nme>
<pri>6</pri>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>877</code>
<Str sr="arg0" ve="3"/>
Expand All @@ -50,17 +50,17 @@
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
<Str sr="arg6" ve="3"/>
<Str sr="arg7" ve="3">org.autojs.autoxjs.v6</Str>
<Str sr="arg7" ve="3">org.autojs.autojs6</Str>
<Str sr="arg8" ve="3">org.autojs.autojs.external.open.RunIntentActivity</Str>
<Int sr="arg9" val="1"/>
</Action>
</Task>
<Task sr="task4">
<cdate>1668622877039</cdate>
<edate>1687070791089</edate>
<edate>1692234646284</edate>
<id>4</id>
<nme>京东签到</nme>
<pri>6</pri>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>877</code>
<Str sr="arg0" ve="3"/>
Expand All @@ -70,7 +70,7 @@
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
<Str sr="arg6" ve="3"/>
<Str sr="arg7" ve="3">org.autojs.autoxjs.v6</Str>
<Str sr="arg7" ve="3">org.autojs.autojs6</Str>
<Str sr="arg8" ve="3">org.autojs.autojs.external.open.RunIntentActivity</Str>
<Int sr="arg9" val="1"/>
</Action>
Expand Down
13 changes: 6 additions & 7 deletions 支付宝签到.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,16 @@ sleep(500);
let img = images.captureScreen();
let img2 = images.clip(img, 0, 0, 1080, 1200);
toastLog("OCR开始");
let list = paddle.ocr(img2);
let list = ocr.detect(img2);
toastLog("OCR结束");
img = null;
img2 = null;
images = null;
paddle = null;
img2.recycle();
let sign = [];
let get_all = [];
for (let obj of list) {
if (obj.text.indexOf("每日签到") !== -1) {
if (obj.label.indexOf("每日签到") !== -1) {
sign = [obj.bounds.left, obj.bounds.top];
}
if (obj.text.indexOf("全部领取") !== -1) {
if (obj.label.indexOf("全部领取") !== -1) {
get_all = [obj.bounds.left, obj.bounds.top];
}
}
Expand All @@ -63,6 +60,8 @@ if (sign.length > 0) {
robot.click(sign[0], sign[1]);
toastLog("签到成功");
sleep(3000);
} else {
toastLog("签到失败");
}

// =====================控件查找start=====================
Expand Down

0 comments on commit 17aed22

Please sign in to comment.