Public feed #376797

Untitled

public text v1 · immutable
Raw Edit
·published 2007-03-01 08:46 UTC
rendered paste body
Function FindDaBankers(var x,y:integer;Direction:String):boolean;
var n,imin,imax,i,xx,yy,,bx1,by1,bx2,by2,cbanker,tol:integer;
Colors:Array[0..1890] of integer;Coords:array[0..1890] of Tpoint;
count:array[0..30] of integer;results:array[0..28] of integer;
colorsc:array[0..182] of integer;coordsc:array[0..182] of integer;
begin
  wait(250+random(+100));
  MakeCompass(Direction);
  if FindSymbol(x,y,'bank') = false then
    repeat
      SymbolAccuracy:=SymbolAccuracy-10;
    until (FindSymbol(x,y,'bank')=true) or (SymbolAccuracy=0);
  if (x<=0) and (y<=0) then
  begin
    Result:=False;
    exit;
  end;
  bx1:=x-30; by1:=y-15; bx2:=x+30; by2:=y+15;
  Tol:=10;
  X:=0;
  Y:=0;
  if cbanker = 0 then
  begin
  if FindColorTolerance(x,y,Banker,bx1,by1,bx2,by2,10) = false then
    repeat
      Tol:=Tol+5;
    until (FindColorTolerance(x,y,Banker,bx1,by1,bx2,by2,tol)=true) or (tol=50);
  if (x<=0) and (y<=0) then
  begin
    Result:=False;
    exit;
  end;
  CBanker:=GetColor(x,y);
  end;
  for YY := by1 to by2 do
    for xx:= bx1 to bx2 do
    begin
      colors[i]:=GetColor(xx,yy);
      Coords[i].x:=xx;
      Coords[i].y:=yy;
      I:=i+1
    end;
    I:= 0;
    yy:=0;
    xx:=0;
    imax:=60
  repeat
    for xx := imin to imax do
    begin
      if cbanker = colors[i] then
        n:=n+1;
        i:=i+1;
    end;
    count[yy]:=n;
    yy:=YY+1;
    n:=0;
    imin:=imin+61;
    imax:=imax+61;
  until (imax>1890);
  I:=0;
  for i := 0 to 28 do
    results[i]:=count[i]+count[i+1]+count[i+2];
  I:=0;
  n:=0;
  for i :=0 to 27 do
    if count[n] > count[i+1] then
      n:=i
    else n:=i+1;
  imin:=(n*61)-1
  imax:=imin+183;
  xx:=0;
  yy:=;
  for xx := imin to imax do
  begin
    colorsc[yy]:=colors[xx];
    coordsc[yy].x:=coords[xx].x;
    coordsc[yy].y:=coords[xx].y;
    yy:=yy+1;
  end;
  
  
  
  

  Result:=False;
  writeln('sorry couldnt find');
end;