SRL Archive - SRL Archives

Procedure FindArrayColorsSpiralTolerance;


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.

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?

Bobarkinator

2007-06-18 08:50:54

Good work, I can see myself using this for something :D

WhiteShadow

2007-06-18 12:08:41

Cool how you add several TPointArrays and load it back into one. :) :) :)

If (GetArrayLength(ToleranceArray) = 0) Or (GetArrayLength(ToleranceArray) = 0) Then
Exit;

I think you did that on accident though. :p

Wizzup?

2007-06-18 13:03:39

From: WhiteShadow
Cool how you add several TPointArrays and load it back into one. :) :) :)

If (GetArrayLength(ToleranceArray) = 0) Or (GetArrayLength(ToleranceArray) = 0) Then
Exit;

I think you did that on accident though. :p


Thanks, I forgot that lol, I hate to scroll horizontally.. ;)