/** 亚瑟输入法 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); } } }