回答
// 文档地址 https://docs.hamibot.com/
auto.waitFor();
if (!requestScreenCapture()) {
toastLog('没有授予 Hamibot 屏幕截图权限');
hamibot.exit();
}
sleep(1000);
while (true) {
var img = captureScreen();
var pointRed = findColor(img, '#ff0000');
var pointYellow = findColor(img, '#ffff00');
if (pointRed) {
toastLog('找到红色,执行脚本1');
// 执行脚本1的代码
break;
} else if (pointYellow) {
toastLog('找到黄色,执行脚本2');
// 执行脚本2的代码
break;
}
}
ℹ️ 本回答由 AI 生成,内容仅供参考