TPAToATPA splits the points in circles of 'Radius'. Whilst TPAToATPAEx makes a box of 'w' and 'h'. Since Runescape's rocks are on tiles of 17*14, it would be wise to make a box of 17 width (w) and 14 height ( h), and find the middle.
Practical:
SCAR Code:
Var TPA : TPointArray;
ATPA : Array Of TPoint;
I, x, y : Integer;
Begin
FindColorsSpiralTolerance(MSCX, MSCY,TPA, CoalColor, MSX1, MSY1, MSX2, MSY2, 10); //Getting points from the coal rock nearest to you (MSCX, MSCY)
ATPA := TPAToATPAEx(TPA, 17, 14); // Splits the points into boxes of 17 and 14
For I := 0 to High(ATPA) Do //For all the split boxes
If MiddleTPAEx(ATPA[I], x, y) Then //looping through, finding the middle
Begin
MMouse(x, y, 6, 6); //Moving the mouse to the middle of the box (rock) with randomness
GetMousePos(x, y); //Gets the position of the random move and stores it to x and y.
If WaitUpText('oal', 1000) Then //Waits for the UpText. See Timing.scar
Mouse(x, y, 0, 0, True) //Clicks it
Else //otherwise if not the uptext then
Continue; //Carry on looping through the points
End;
End;
Hope that helps you, feel free to add my MSN for more queries