forked from Nick-Hopps/Ant-Forest-autoscript
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
35 lines (30 loc) · 815 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* @Author: NickHopps
* @Last Modified by: NickHopps
* @Last Modified time: 2019-01-31 18:40:40
* @Description: 蚂蚁森林自动收能量
*/
/***********************
* 初始化
***********************/
// 检查手机是否开启无障碍服务
auto();
// 请求截图权限
if (! requestScreenCapture()) {
toast("请求截图失败");
exit();
}
/************************
* 依赖加载
***********************/
var Automator = require("./lib/Automator.js");
var Unlock = require("./lib/Unlock.js");
var Ant_forest = require("./core/Ant_forest.js");
var automator = Automator();
var config = require("./config.js");
var unlock = Unlock(automator, config);
var ant_forest = Ant_forest(automator, unlock, config);
/************************
* 主程序
***********************/
ant_forest.exec();