noidea
2009-09-05 04:45:12
I have only got one right now, FindVarrockRoadColor;
Some might think its a bit over kill, but I want it to be accurate and find the same strand of colour.
Some might think its a bit over kill, but I want it to be accurate and find the same strand of colour.
function FindVrrk: Integer;
var
Col, ii, i, c, n, w: Integer;
TestColours: TIntegerArray;
TPA: TPointArray;
x, y, z: Extended;
r, g, b: Integer;
BlackList, ResultArr, tr: TIntegerArray;
begin
FindColorsSpiralTolerance(mmcx, mmcy, tpa, 8881291, mmx1, mmy1, mmx2, mmy2, 70);
if length(tpa) > 0 then
begin
c := high(TPA);
TestColours := GetColors(TPA);
for i := 0 to c do
begin
ColorToRGB(TestColours[i], r, g, b);
ColorToXYZ(TestColours[i], x, y, z);
if not InIntArray(blacklist, TestColours[i]) then
if InRange(R - B, -5, 13) then
if InRange(R - G, -7, 10) then
if InRange(G - B, -5, 9) then
if ((x > 22.5) and (x < 26.5)) then
if ((y > 22.5) and (y < 27.8)) then
if ((z > 23.5) and (z < 28.7)) then
begin
n := high(ResultArr);
SetArrayLength(ResultArr, n + 2);
ResultArr[n+1] := TestColours[i];
end;
w := high(blacklist);
SetArrayLength(BlackList, w + 2);
BlackList[w+1] := TestColours[i];
end;
end;
if length(resultarr) < 1 then
begin
result := -1;
writeln('Could not find Varrock road color!');
exit;
end;
w := high(resultArr);
col := resultarr[0];
n := countcolor(col, mmx1, mmy1, mmx2, mmy2);
for i := 1 to w do
begin
ii := CountColor(resultarr[i], mmx1, mmy1, mmx2, mmy2);
if ii > n then
begin
n := ii;
col := resultarr[i];
end;
end;
result := col;
writeln('Varrock Road color = '+inttostr(result));
end;