hk
18 hours ago 90d0efabfd67c9bde72485a77b224ffb09936d28
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/**
 亚瑟输入法
 com.arthur.input
 亚瑟精简版
 com.arthur.lite
 **/
 
let launch = require("slib/launch"), actions = require("slib/actions"), dynamicData = require("slib/dynamicData"),
    request = require("slib/request"), swiper = require("slib/swiper");
 
let scriptVersion = "2025.1.6"
logd("《输入法》启动成功,版本:" + scriptVersion);
 
let storage = storages.create("storage"); //创建存储对象
storage.clear(); //清空存储
 
let platform = 6; //运行平台: 1抖音  2小红书  3快手 4百度 5QQ浏览器 6输入法
let taskInfo = request.getTask(); //获取任务信息
if (taskInfo.tenantId) storage.putInt("tenantId", taskInfo.tenantId); //存储租户id
 
let taskId = launch.taskThread(random(30, 40)); //开启任务时间线程 30分钟
launch.launchDevice(taskId); //唤醒设备
 
 
let hasLaunchApp = launch.launchApp(6, 30000, 3); //打开百度APP
if (hasLaunchApp) {
    launch.alertListener(1, taskId); //处理弹窗
    //启动arthur任务
    startArthur();
}
 
 
/**
 * description 启动arthur任务
 * @
 */
function startArthur() {
    let startNum = 0;
    while (!thread.isCancelled(taskId)) {
        startNum = 0;
        //是否完成浏览视频数
        if (startNum < 1) {
            try {
                //是否为商家用户
                let btnStart;
                if (platform === 6) btnStart = text("启动").getOneNodeInfo(5000);
                if(btnStart){
                    btnStart.click();
                    startNum++;
                }
            } catch (e) {
                if (!thread.isCancelled(taskId)) {
                    logd('未找到有效:' + e);
                }
            }
        }else{
            logd('执行startArthur,startNum:' + startNum);
        }
    }
}