i have an findakbuildingcolor proc. it doesnt work so good but sometimes it works(it just needs to be updated)
function FindAkBuildingColor: Integer;
var
GenericColor, a, b, TestColor, Red, Green, Blue : integer;
begin
GenericColor := 6193293;
Flag;
a := MMX1;
b := MMY1;
repeat
b := b + 1;
repeat;
a := a + 1;
if FindColorTolerance(x, y, GenericColor, a, b, MMX2, MMY2, 50) then
begin
if a = MMX1 + 1 then b := y;
a := x;
TestColor := GetColor(x, y);
red := (TestColor mod 256);
green := ((TestColor / 256) mod 256);
blue := ((TestColor / 256) / 256);
//writeln(inttostr(testcolor))
//Writeln(inttostr(red - green)+' '+ inttostr(red - blue)+' '+inttostr(green - blue))
if Red - Green >= 0 then if Red - Green <= 14 then
if Red - Blue >= 42 then if Red - Blue <= 50 then
if Green - Blue >= 30 then if Green - Blue <= 50 then
begin
if GetColor(a + 2, b + 2) = TestColor then
if GetColor(a + 1, b + 1) = TestColor then
if GetColor(a, b + 2) = TestColor then
if GetColor(a + 2, b) = TestColor then
if GetColor(a, b + 1) = TestColor then
if GetColor(a + 1, b) = TestColor then
if GetColor(a + 1, b + 2) = TestColor then
if GetColor(a + 2, b + 1) = TestColor then
begin
Result := TestColor;
AkBuildingColor := TestColor;
WriteLn('AkBuildingColor = ' +
IntToStr(TestColor));
Exit;
end;
end;
end else a := MMX2;
until a >= MMX2;
a := MMX1;
until b >= MMY2;
WriteLn('Could not find AKBuildingColor!');
Result := 0;
end;
u need akbuildingcolor as a global var.