This thread is filled with the weirdest TPA code I've ever seen...
Two main ways of the finding, may be a little different for different scripters but the idea remains same:
SCAR Code:
Function FindAllRocks(Color, Tol: Integer): TPointArray;
Var
CTS: Integer;
Begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, Result, Color, MSX1, MSY1, MSX2, MSY2, Tol);
ColorToleranceSpeed(CTS);
RAaSTPAEx(Result, 22, 22);
End;
Function FindAllRocks2(Color, Tol, MinPix: Integer): TPointArray;
Var
X, Y, Z, CTS, S: Integer;
TPAA: TPointArray;
TPA: TPointArray;
Begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Color, MSX1, MSY1, MSX2, MSY2, Tol);
ColorToleranceSpeed(CTS);
TPAA := TPAToATPAEx(TPA);
SetArrayLength(Result, GetArrayLength(TPAA));
For z := 0 To High(TPAA) Do
If GetArrayLength(TPAA[z]) >= MinPix Then
Begin
Result[s] := MiddleTPA(TPAA[z]);
s := s + 1;
End;
SetArrayLength(TPAA, S);
End;
and then, the finding of a good one
SCAR Code:
Function FindRock(Var X, Y: Integer; Color, Tol: Integer): Boolean;
Var
TPA: TPointArray;
I: Integer;
Begin
TPA := FindAllRocks2(Color, Tol, 5);
// Or TPA := FindAllRocks(Color, Tol);
For I := 0 To High(TPA) Do
If Not w_GasCheck(TPA[i].x, TPA[i].y) Then
Begin
MMouse(TPA[i].x, TPA[i].y, 3, 3);
If IsUpText('ine') Then
Begin
GetMousePos(X, Y);
Result := True;
Break;
End;
End;
End;