|
- printl('找图');
- var imagePath = '新图标路径'; // 替换为你的新图标路径
- var detects = auto.findImages([imagePath], 0.8, 5000, 0, [0,0,1,1]);
- if(detects != null && detects.length > 0) {
- var x = detects[0].getRect().getCenterX();
- var y = detects[0].getRect().getCenterY();
- // 百分比坐标转成真实坐标
- x = screen.percentToWidth(x);
- y = screen.percentToHeight(y);
- // 随机xy
- x = rand.randNumber(x - 10, x + 10);
- y = rand.randNumber(y - 10, y + 10);
- // 执行点击
- hid.click(x, y);
- printl('点击坐标: (' + x + ', ' + y + ')');
- } else {
- printl('未找到图标');
- }
复制代码 |
|