我想做一个疯狂的移动狙击机器人 . 所以我想使用 findImage 函数来查找玩家是否已售出 . 这就是我的想法 .

first image

second image

第一个图像将是我的屏幕,第二个图像将是我想要找到的图像,如果它找到它将点击它 . 这是我的脚本:

local r = findImage ( "/images/auction.bmp" ,1, 1, nil, nil); 
if r == nil then alert ( "nil" ); 
else local n = 0;
    for i, v in pairs (r) do n = n + 1; 
end if n == 0 then alert ( "false" ); 
else 
    alert ( "true" );
    end
end

它运行但总是返回false . 所以我想知道我是否正确使用 findImage 功能,如果是这样,为什么它不会返回真实?