Bramble
2007-03-01 01:57:50
program new;
{.include srl/srl.scar}
const
banker=195836;
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..182] of integer;results:array[0..59] of integer;
Coordsc:array[0..182] of Tpoint;
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 Results[n] > Results[i+1] then
n:=i
else n:=i+1;
imin:=(n*61)-1;
imax:=imin+182;
xx:=0;
yy:=0;
for xx := imin to imax do
begin
Coordsc[yy].x := coords[xx].x;
Coordsc[yy].y := coords[xx].y;
yy:=yy+1;
end;
xx:=0;
yy:=0;
i:=0;
bx1:=coordsc[0].x;
bx2:=coordsc[182].x;
by1:=coordsc[0].y;
by2:=coordsc[182].y;
for xx := bx1 to bx2 do
for yy:= by1 to by2 do
begin
colors[i]:=getcolor(xx,yy);
coords[i].x:=xx;
coords[i].y:=yy;
I:=i+1;
end;
imin:=0;
imax:=2;
yy:=0;
xx:=0;
repeat
for xx := imin to imax do
begin
if cbanker = colors[xx] then
n:=n+1;
i:=i+1;
end;
count[yy]:=n;
yy:=YY+1;
n:=0;
imin:=imin+3;
imax:=imax+3;
until (imax>180);
I:=0;
for i := 0 to 57 do
results[i]:=count[i]+count[i+1]+count[i+2];
I:=0;
n:=0;
for i := 0 to 56 do
if Results[n] > Results[i+1] then
n:=i
else n:=i+1;
imin:=(n*3)-1;
imax:=imin+8;
xx:=coords[imin].x + round((coords[imax].x-coords[imin].x)/2);
yy:=coords[imin].y + round((coords[imax].y-coords[imin].x)/y);
x:=xx;
y:=yy;
result:=true;
exit;
end;
begin
setupsrl;
wait(500);
activateclient;
wait(500);
if FindDaBankers(x,y,'s') then
mmouse(x,y,0,0);
newline:=newline;
end.need testers, wont work in lumby bank, it looks for banker dots pretty much