Read about TPAs
Read about WizzyPluggin
And look for colorfinding / object finding tuts.
You'll want to search and save two different TPAs and then you would want to use an enlarged version of MatchTPA.
I don't know where the hell MatchTPA is anymore, but it just basically checks if two TPAs are around each other.
TPAs are TPointArrays. Arrays of TPoint
TPoint = record
x, y: integer
Simba Code:
type
//To be used with CTS 2
TMultiColor = record
Color: integer;
tol: integer;
h, s: extended;
end;
TMultiColorArray: Array of TMultiColor;
function MColor(Color, tol: integer; h, s: extended): TMultiColor;
begin
Result.Color := Color;
Result.tol := tol;
Result.h := h;
Result.s := s;
end;
//to ensure correct passing of information
function MColorArray(MArray: array of TMultiColor): TMultiColorArray;
var
i, L: integer;
ThisColor: TMultiColor;
begin
L := Length(MArray);
SetLength(Result, L);
for i := 0 to L - 1 do
begin
with ThisColor do
begin
Color := MArray[i].Color;
Tol := MArray[i].Tol;
h := MArray[i].h;
s := MArray[i].s;
end;
Result[i] := ThisColor;
end;
end;
type
CTS2Mode = record
Speed: integer;
h, s: extended;
end;
var CurrentCTS, PreviousCTS, DefaultCTS: CTS2Mode;
procedure StartCTS2Mode;
begin
DefaultCTS.Speed := 2;
DefaultCTS.h := 2.00; //not sure if that's the default anymore
DefaultCTS.s := 2.00;
CurrentCTS.Speed := 2;
CurrentCTS.h := 2.00;
CurrentCTS.s := 2.00;
end;
Procedure Return2DefaultCTS;
begin
CurrentCTS.Speed := DefaultCTS.Speed;
CurrentCTS.h := DefaultCTS.h;
CurrentCTS.s := DefaultCTS.s;
end;
//Copy a CTS2Mode object
function CopyCTS(toCopy: CTS2Mode): CTS2Mode;
begin
Result.Speed := toCopy.Speed;
Result.h := toCopy.h;
Result.s := toCopy.s;
end;
//allows u to create a copy of the current CTS
function GetCurrentCTS: CTS2Mode;
begin
Result := CopyCTS(CurrentCTS);
end;
procedure mod2CTS(h, s: extended);
begin
PreviousCTS.Speed := CurrentCTS.Speed; // (do notice that this works here but not in java)
PreviousCTS.h := CurrentCTS.h;
PreviousCTS.s := CurrentCTS.s;
CurrentCTS.h := h;
CurrentCTS.s := s;
end;
procedure RecoverPreviousCTS;
var
NewCTS: CTS2Mode;
begin
NewCTS := CopyCTS(CurrentCTS);
CurrentCTS := CopyCTS(PreviousCTS);
PreviousCTS := CopyCTS(NewCTS);
end;
function Box(x1, y1, x2, y2: integer): TBox;
begin
Result.x1 := x1;
Result.y1 := y1;
Result.x2 := x2;
Result.y2 := y2;
end;
function FindDoubleColor(color1, color2, tol1, tol2: integer; Area:TBox, AreaTol: integer): TPointArray;
var
TPA1, TPA2: TPointArray;
begin
FindColorsTolerance(TPA1, color1, tol1, Area.x1, Area.y1, Area.x2, Area.y2);
FindColorsTolerance(TPA2, color2, tol2, Area.x1, Area.y1, Area.x2, Area.y2);
Result := MatchTPATolerance(TPA1, TPA2, AreaTol);
end;
function FindMultiColors(MColors: TMultiColorArray; Area: TBox; AreaTol: integer): TPointArray;
begin
end;
AreaTol being how far the points can be from each other.
The last time I think I saw MatchTPA was somewhere in MSI forums
~RM