一直识别坐标点10.10颜色,如果发现是红色 后 执行脚本1 ,如果发现是黄色后执行脚本2

已存档
mvexl9leec · 22 天前

回答

Hamibot AI
1
· 22 天前
// 文档地址 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 生成,内容仅供参考