Code:
function FindUniqueMMSymbolColor(Name:string):boolean;
var x1,y1,x2,y2,TestColor,x,y,L,i,Symbol:integer;
var Points:array of TPoint;
var UniqueColor:boolean;
begin
if not(LoggedIn) then Exit;
SymbolAccuracy:=0.6;
if FindSymbol(x,y,'churn') then
begin
Writeln('Churn symbol found at '+IntToStr(x)+','+IntToStr(y));
Symbol := BitmapFromString(15, 15, 'z78DA3330C00B0CF142' +
'5201925E4753470B27134C255071E26DC16B1A2E80620B95CC24C' +
'A7CF2C20D574852C9B514853F056960289A4C9370A65DDAA0757A' +
'A65D1EA475B941D5B20E00B5A601F8');
if x-20<MMX1 then x:=MMX1+20;
if y-20<MMY1 then y:=MMY1+20;
if x+20>MMX2 then x:=MMX2-20;
if y+20>MMY2 then y:=MMY2-20;
if FindBitmapToleranceIn(Symbol,x1,y1,x-20,y-20,x+20,y+20,100) then
begin
Writeln('Found BMP at '+IntToStr(x1)+','+IntToStr(y1));
x:=x1+7;
y:=y1+7;
x2:=x1+14;
y2:=y1+14;
end else
begin
Writeln('No BMP found');
x1:=x-8;
y1:=y-8;
x2:=x+15;
y2:=y+15;
end;
FreeBitmap(Symbol);
Result:=True;
if (lowercase(Name)='churn') then
begin
Writeln('Searching '+IntToStr(x1)+','+IntToStr(y1)+' '+IntToStr(x2)+','+IntToStr(y2));
FindColorsSpiralTolerance(x,y,Points,1588313,X1,Y1,X2,Y2,60);
UniqueColor:=True;
L:=GetArrayLength(Points);
for i:= 0 to L-1 do
begin
Wait(1);
UniqueColor:=True;
TestColor:=GetColor(Points[i].x,Points[i].y);
if Findcolor(tmpx,tmpy,TestColor,MMX1,MMY1,x1-1,MMY2) then UniqueColor:=False else
if Findcolor(tmpx,tmpy,TestColor,x2+1,MMY1,MMX2,MMY2) then UniqueColor:=False else
if Findcolor(tmpx,tmpy,TestColor,x1,MMY1,x2,y1-1) then UniqueColor:=False else
if Findcolor(tmpx,tmpy,TestColor,x1,y2+1,x2,MMY2) then UniqueColor:=False;
if (UniqueColor) then
begin
ChurnColor:=Testcolor;
Writeln('Unique Symbol Color '+inttostr(TestColor)+' found at '+inttostr(x)+', '+inttostr(y));
ChurnX:=x;
ChurnY:=y;
Exit;
end;
end;
Writeln('No unique symbol colors found!?');
ChurnColor:=0;
end;
end else
begin
Writeln('No symbol detected on Minimap!');
Result:=False;
end;
end;