Wizzup?
2007-06-18 07:59:19
Well.. I wanted to make this and use it in my essence miner, to search for bots/noobs who might be covering aubury etc.
It returns a TPointArray of the colors it has found, you put in an array of colors and the tolerancearray that you want for the color.
Enjoy, Wizzup?
It returns a TPointArray of the colors it has found, you put in an array of colors and the tolerancearray that you want for the color.
Procedure FindArrayColorsSpiralTolerance(x, y: Integer; Var TPA: TPointArray;
ColorsA: TIntegerArray; x1, y1, x2, y2: Integer; ToleranceArray: TIntegerArray);
Var
I, Count, C, E, L: Integer;
TPAArray: Array Of TPointArray;
Begin
If GetArrayLength(ToleranceArray) <> GetArrayLength(ColorsA) Then
Exit;
If (GetArrayLength(ToleranceArray) = 0) Or (GetArrayLength(ColorsA) = 0) Then
Exit;
SetArrayLength(TPAArray, GetArraylength(ColorsA));
For I:= 0 To GetArrayLength(ColorsA) - 1 Do
Begin
FindColorsSpiralTolerance(x, y, TPAArray[I], ColorsA[I], x1, y1, x2, y2, ToleranceArray[I]);
Count := Count + GetArrayLength(TPAArray[I]);
End;
TPA := TPAArray[0];
SetArrayLength(TPA, Count);
E := 0;
For I := 0 To GetArrayLength(TPAArray) - 1 Do
Begin
L := GetArrayLength(TPAArray[I]);
For C := 0 To L - 1 Do
TPA[E + C] := TPAArray[I][C];
E := E + L;
End;
End;Enjoy, Wizzup?