Through some clever working, myself and frement both figured out that PointInTPA is the issue, so i created a replacement functoin IsPointInTPA, which if I understand PointInTPA, should do the same thing...
SCAR Code:
Function IsPointInTPA(Point:TPoint; TPA:TPointArray):Boolean;
var I:integer;
begin
for i := 0 to high(TPA)-1 do
begin
if (TPA[i].x = Point.x) and (TPA[i].x = Point.y) then
begin
Result:= True
Exit;
end;
end;
Result := False
end;
and FindSymbolsIn also needs to be slightly modified...
SCAR Code:
{*******************************************************************************
function FindSymbolsIn(var AnsTPA: TPointArray; SymbolName: string; x1, y1, x2, y2: integer): Boolean;
By: lordsaturn
Description: Finds a symbol in multiple places within the search coords. Results
true if at least 1 symbol is found.
*******************************************************************************}
function FindSymbolsIn(var AnsTPA: TPointArray; SymbolName: string; x1, y1, x2, y2: integer): Boolean;
var
CTS, Col, Hi, i, x, y, fx, fy, L: integer;
aP: T2DPointArray;
P: TPointArray;
Pt: TPoint;
acc: Extended;
begin
Col := GetSymbolColorIn(fx, fy, SymbolName, x1, y1, x2, y2);
if Col = 0 then
Exit;
FindColorsTolerance(P, Col, x1, y1, x2, y2, 0);
aP := TPAtoATPA(P, 10);
Hi := High(aP);
LoadSymbolBitmapColor(LowerCase(SymbolName));
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
SetLength(AnsTPA, Hi+1);
for i := 0 to Hi do
begin
Pt := MiddleTPA(aP[i]);
if IsPointInTPA(Point(fx, fy), aP[i]) then
acc := 1
else
FindDeformedBitmapToleranceIn(SymbolBitmap, x, y, Pt.x-15, Pt.y-5, Pt.x+15, Pt.y+5, 70, 0, True, acc);
if (acc > SymbolAccuracy) then
begin
AnsTPA[L] := Pt;
Inc(L);
end;
end;
Result := L > 0;
SetLength(AnsTPA, L);
try
FreeBitmap(SymbolBitmap);
finally
ColorToleranceSpeed(CTS);
end;
end;
I just changed
if PointInTPA(Point(fx, fy), aP[i]) then
to
if IsPointInTPA(Point(fx, fy), aP[i]) then
which should fix the issue