牙叔教程 简单易懂
效果
源码
"ui"; // author: @Ai @神麤詭末 @抠脚本人【接定制高效】 ui.layout( <vertical gravity="center"> <button textSize="50sp">第一个界面</button> </vertical> ); let path = "./hello.js"; var rtEngines = runtime.engines; log(rtEngines); let config = {}; setTimeout(() => { config.intentFlags = Intent.FLAG_ACTIVITY_NEW_DOCUMENT | Intent.FLAG_ACTIVITY_MULTIPLE_TASK; rtEngines.execScriptFile(activity, path, fillConfig(config)); setTimeout(() => { rtEngines.execScriptFile(activity, path, fillConfig(config)); }, 2000); setTimeout(() => { rtEngines.execScriptFile(activity, path, fillConfig(config)); rtEngines.execScriptFile(activity, path, fillConfig(config)); }, 3000); }, 1000); function fillConfig(c) { var config = new com.stardust.autojs.execution.ExecutionConfig(); c = c || {}; c.path = c.path || files.cwd(); if (c.path) { config.workingDirectory = c.path; } config.delay = c.delay || 0; config.interval = c.interval || 0; config.loopTimes = c.loopTimes === undefined ? 1 : c.loopTimes; config.intentFlags = Intent.FLAG_ACTIVITY_MULTIPLE_TASK | Intent.FLAG_ACTIVITY_NEW_TASK; if (c.arguments) { var arguments = c.arguments; for (var key in arguments) { if (arguments.hasOwnProperty(key)) { let value = arguments[key]; config.setArgument(key, value, JSON.stringify(value)); } } } var myEngine = rtEngines.myEngine(); config.projectConfig = myEngine.getTag("execution.config").projectConfig; return config; }
名人名言
思路是最重要的, 其他的百度, bing, stackoverflow, github, 安卓文档, autojs文档, 最后才是群里问问
--- 牙叔教程
声明
部分内容来自网络
本教程仅用于学习, 禁止用于其他用途