_ChArMz
2007-06-08 14:32:40
program New;
function FindLadderColor : Integer;
var
tPoints, Points : TPointArray;
tColors : TIntegerArray;
i, c : Integer;
Hue, Saturation, Luminance : Extended;
begin
Result := 0;
FindColorsTolerance(tPoints, 10837, MMX1, MMY1, MMX2, MMY2, 50);
for i := 0 to GetArrayLength(tPoints) - 1 do
if rs_OnMiniMap(tPoints[i].x, tPoints[i].y) then
begin
c := c + 1;
SetArrayLength(Points, c + 1);
Points[c] := tPoints[i];
end
tColors := GetColors(Points);
for i := 0 to GetArrayLength(tColors) - 1 do
begin
ColorToHSL(tColors[i], Hue, Saturation, Luminance);
if (Hue > 5.5) and
(Hue < 10.5) and
(Saturation > 55.0) then
begin
if CountColor(tColors[i], Points[i].x - 5, Points[i].y - 5, Points[i].x + 5, Points[i].y + 5) > 15 then
begin
Result := tColors[i];
Break;
end
end
end
if Result > 0 then
WriteLn('LadderColor = '+IntToStr(Result))
else
WriteLn('Unable to find ladder color.');
end;
begin
ClearDebug;
FindLadderColor;
end.FOR DIVI
Test Please, I Just Made This Real Fast :D