PDA

View Full Version : Finding color in a box on MM?



hlstriker
12-20-2006, 04:12 AM
Hey everyone,

I'm trying to find a certain color in a box on the minimap. I am using the ScanMMAreaColorExactTolerance function, but it doesn't seem to be working for me.

Here is the code I'm using to test for the color...

if(ScanMMAreaColorExactTolerance(xm, ym, 565, 60, 729, 146, 247, 7)) then
begin
mouse(xm, ym, 0, 0, true);
end else
begin
writeln('Could not find that color, grrr!');
end

Here is the function...

function ScanMMAreaColorExactTolerance(var x, y: Integer; x1, y1, x2, y2, color, tolerance: Integer): Boolean;

x1, y1, x2, y2 = Left, Top, Right, Bottom? Is that correct?

Boreas
12-20-2006, 04:20 AM
x1, y1, x2, y2 = Left, Top, Right, Bottom? Is that correct?
Yes.

Can you manually verify (with color picker) that the color is in the box?

hlstriker
12-20-2006, 04:22 AM
Yeah, the color is around 600, 96.

Boreas
12-20-2006, 04:29 AM
Does findmmcolortol work?

hlstriker
12-20-2006, 04:39 AM
Yes that does work, but I need to specify a box somehow.

Boreas
12-20-2006, 04:45 AM
How about findcolortolerance?

hlstriker
12-20-2006, 04:56 AM
Yes, that works thank you :)! I wonder why ScanMMAreaColorExactTolerance didn't work though.

Boreas
12-20-2006, 05:04 AM
Well it uses ScanExactMMAreaD, and that looks just the same, I don't understand either.