This was from a few years ago, before DDTMs, but the general idea of FindYellows(hx,hy,16,5,590,30,700,120); should still work, will need tweaking if the banker dots moved though.
Code:
type ybox = record
x1,y1,x2,y2,cx,cy:integer;
active:boolean;
end;
type tehpoint = record
x,y :integer;
active : boolean;
end;
type combo = record
point1,point2,x1,y1,x2,y2,dist:integer;
active:boolean;
end;
var hx,hy,gx,gy,bankfindtries:integer;
findyellowdone,foundbooth:boolean;
procedure findyellows (var fx, fy:integer; PointsToFind,width,basex,basey,endx,endy:integer);
var
box :array of ybox;
ypoint : array of tehpoint;
com:array [1..300] of combo;
x,d,e,f,i,g,nob,fyx,fyy,currentpoint,row,prow,col,nor,noc:integer;
begin
noc:=(( (endx-basex) - (width mod (endx-basex)))/width)+1;
nor:=(( (endy-basey) - (width mod (endy-basey)))/width)+1;
nob:=nor*noc;
setarraylength(box, ((nob)+2));
repeat
x:=x+1;
if ((x+noc) mod noc)>0 then
col:=((x+noc) mod noc);
if ((x+noc) mod noc) =0then
col:=noc;
prow:=0;
repeat
prow:=prow+1;
until ( x<=(noc*prow));
row:=prow;
box[x].x1:=(basex+ ((col-1)*width) );
box[x].x2:=(basex+(col*width));
box[x].y1:=(basey+ ((row-1)*width) );
box[x].y2:=(basey+(row*width));
box[x].cx:=round((box[x].x2+box[x].x1)/2);
box[x].cy:=round((box[x].y2+box[x].y1)/2);
box[x].active:=true;
{
//draws the boxes on paint
movemouse(box[x].x1,box[x].y1);
holdmouse(box[x].x1,box[x].y1,true);
movemouse(box[x].x2,box[x].y2);
releasemouse(box[x].x2,box[x].y2,true);
}
until x>=nob;
currentpoint:=1;
d:=0;
setarraylength(ypoint, pointstofind+1);
repeat
d:=d+1;
if (box[d].active) then
begin
if findcolor(fyx,fyy,195836,box[d].x1,box[d].y1,box[d].x2,box[d].y2) then
begin
ypoint[currentpoint].x :=fyx;
ypoint[currentpoint].y :=fyy;
currentpoint:=currentpoint+1;
box[d].active:=false;
end;
end;
until (( currentpoint= pointstofind)or (d=nob));
{
e:=0;
repeat
e:=e+1;
writeln(inttostr(ypoint[e].x)+' '+inttostr(ypoint[e].y));
if not((ypoint[e].x = 0) and (ypoint[e].y = 0)) then ypoint[e].active:=true;
until e=16;
writeln(' all points');}
e:=0;
repeat
f:=f+1;
g:=0;
repeat
g:=g+1;
e:=e+1;
//writeln(inttostr(f)+' '+inttostr(g)+' '+inttostr(e));
com[e].point1:=f;
com[e].point2:=g;
com[e].x1:=ypoint[f].x;
com[e].y1:=ypoint[f].y;
com[e].x2:=ypoint[g].x;
com[e].y2:=ypoint[g].y;
if not((com[e].x1=0) or (com[e].y1=0) or (com[e].x2=0) or (com[e].y2=0)) then com[e].active:=true;
until( (g=16) or (e=256));
until ((f=16) or (e=256));
/////////--------------------analysis------------------------------
{ port phasmatys/draynor banker configuration
port phasmatys:
x-random people outside bank
x...x......x...x - bankers
pair 1 pair 2
first eliminates dots more than 20 away (random people outside)
then finds 2 dots close (6) together, (pair 1 or 2)
then finds a dot more than 7 away (a banker in the other pair)
the last step is so that 2 people outside walking close together
won't be mistaken for a pair of bankers
draynor is the same except that the one pair is a single and
its vertical, but that doesn't matter
}
e:=0;
repeat
e:=e+1;
com[e].dist:=Round(Sqrt(Sqr(com[e].x1 - com[e].x2) + Sqr(com[e].y1 - com[e].y2)))
if ((com[e].dist=0) or (com[e].dist>20)) then com[e].active:=false;
i:=0;
repeat
i:=i+1;
if ((com[e].active) and (com[i].active))then
begin
if ((com[e].point1=com[i].point2)and (com[e].point2=com[i].point1)) then com[i].active:=false;
end;
until i=256;
if com[e].dist=1 then com[e].active:=false;
//if com[e].active then writeln(inttostr(com[e].point1)+' '+inttostr(com[e].point2)+' '+inttostr(com[e].dist));
until e=256;
e:=0;
repeat
e:=e+1;
if com[e].active then
begin
if (com[e].dist <5 ) then
begin
i:=0;
repeat
i:=i+1;
if ((com[i].point1=com[e].point1) or (com[i].point1=com[e].point2) or (com[i].point2=com[e].point1) or (com[i].point2=com[e].point2))then
begin
if com[i].dist>6 then
begin
if (((com[e].x1=com[i].x1) and (com[e].y1=com[i].y1)) or ((com[e].x1=com[i].x2) and (com[e].y1=com[i].y2))) then
begin
fx:=com[e].x1;
fy:=com[e].y1;
findyellowdone:=true;
end;
if (((com[e].x2=com[i].x1) and (com[e].y2=com[i].y1)) or ((com[e].x2=com[i].x2) and (com[e].y2=com[i].y2))) then
begin
fx:=com[e].x2;
fy:=com[e].y2;
findyellowdone:=true;
end;
end;
end;
until i=256;
end;
end;
until e=256;
/////////--------------------analysis end--------------------------
end;
Edit: whipped this up based on your picture using more modern functions. If the bank symbol covers up the banker dots you'll have to add something.
Code:
program New;
{.include SRL\SRL.scar}
//Should give you the 3rd banker dot
function PPBankDots: tpoint;
var YellowPoints, NPCPoints: TPointArray;
NPCTPAs, NPCGroups: T2DPointArray;
GroupBox: Tbox;
i: integer;
begin
FindColors(YellowPoints, 195836, MMX1, MMY1, MMX2, MMY2);
NPCTPAs := TPAtoATPA(YellowPoints, 2);
//writeln(length(NPCTPAs));
SetArrayLength(NPCPoints, length(NPCTPAs));
for i:= 0 to High(NPCTPAs) do
begin
NPCPoints[i]:= NPCTPAs[i][0];
end;
NPCGroups := TPAtoATPA(NPCPoints, 4);
// WritelN(length(NPCGroups));
SortATPASize(NPCGroups, true);
i := 0;
repeat
inc(i);
until length(NPCGroups[i])=1;
SetLength(NPCGroups, i);
NPCPoints := MergeATPA(NPCGroups);
NPCGroups := TPAtoATPA(NPCPoints, 15);
for i:=0 to High(NPCGroups) do
begin
//writeln(length(NPCGroups[i]));
if length(NPCGroups[i])>3 then
begin
GroupBox:= GetTPABounds(NPCGroups[i]);
//writeln(inttostr(GroupBox.x2 - GroupBox.x1)+' '+inttostr(GroupBox.y2 - GroupBox.y1));
if (GroupBox.x2 - GroupBox.x1) > (4 * (GroupBox.y2 - GroupBox.y1)) then
begin
SortTPAFrom(NPCGroups[i], Point(MMX2, MMCY));
result:= NPCGroups[i][1];
end;
end;
end;
end;
var MyPoint: tpoint;
begin
setupsrl;
MyPoint := PPBankDots;
writeln(inttostr(MyPoint.x)+' '+inttostr(MyPoint.y));
end.
Edit: here's another one using doors if the symbol messes with the NPC dots, though DoorProfiles.scar needs to be updated and it needs north. It takes 6 times longer than the NPC dot one, but that's still only 18ms.
Code:
function PPBankDotsDoors: Tpoint;
var MyDoors: array of DoorProfile;
i:integer;
DoorPoints: TPointarray;
begin
ClickNorth(true);
MyDoors:= GetDoors;
SetLength(DoorPoints,length(GetDoors));
for i:=0 to high(Mydoors) do
DoorPoints[i]:= MyDoors[i].Midpoint;
SortTPAFrom(DoorPoints, Point(MMCX,MMY1));
SetArrayLength(DoorPoints, 2);
SortTPAFrom(DoorPoints, Point(MMX1,MMCY));
result := Point(DoorPoints[1].x+22, DoorPoints[1].y+47)
end;