Simba Code:
Function MineRock(WutRock:Integer):Boolean;
var I,PlusOne,tMine,J:Integer;
OrePts, RockPts:TPointArray;
RockPtsBox, BingoBox: T2DPointArray;
BingoPt: TPoint;
SearchBox: TBox;
Begin
If Not(LoggedIn) Then Exit;
StatsGuise('Searching For Rock: '+ IntToStr(InvCount));
If OreInLast Then Exit;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.04, 1.27);
FindColorsSpiralTolerance(MSCX, MSCY, RockPts, 1461093, MSX1, MSY1, MSX2, MSY2, 10);
SetColorSpeed2Modifiers(0.2,0.2);
ColorToleranceSpeed(1);
RockPtsBox:=TPAtoATPAEx(RockPts,35,35);
{DebugATPABounds(RockPtsBox);
Writeln('This is RockPtsBox');}
//Writeln('RockPts ' + IntToStr (GetArrayLength(RockPts) ) );
For I:=0 To High(RockPtsBox) Do
Begin
If Not(LoggedIn) Then Break;
//Writeln('Searching Box ' +IntToStr (i));
SearchBox:= GetTPABounds(RockPtsBox[i]);
//Writeln( IntToStr(SearchBox.x1) + ',' + IntToStr(SearchBox.y1)+ ',' + IntToStr(SearchBox.x2)+ ',' + IntToStr(SearchBox.y2) );
If (GetArrayLength(RockPtsBox[I]) > 30) Then
Begin
If YDebug Then DebugATPA(RockPtsBox,'');
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(1.39,0.11);
FindColorsSpiralTolerance(MSCX,MSCY,OrePts,2434854,SearchBox.x1,SearchBox.y1,SearchBox.x2,SearchBox.y2,10);
Writeln('OrePts ' + IntToStr (GetArrayLength(OrePts) ) );
SetColorSpeed2Modifiers(0.2,0.2);
ColorToleranceSpeed(1);
If High(OrePts) > 1 Then
Begin
BingoBox:=TPAtoATPAEx(OrePts, 10, 10);
For I:=0 To High(BingoBox) Do
Begin
//DebugTPA(OrePts,'');
//Writeln('This is BingoBox');
If GetArrayLength(BingoBox[I])>10 Then
Begin
BingoPt:= MiddleTPA(BingoBox[I]);
If CheckAndClick(BingoPt.x,BingoPt.y) Then
Begin
Result:=True;
MarkTime(tMine);
StatsGuise('Mining Rock: '+ IntToStr(InvCount));
Players[CurrentPlayer].Loc:='Mining';
PlusOne:=InvCount+1;
Repeat
If Not(LoggedIn) Then Break;
Wait(200);
If Random(2) = 0 Then
Begin
RT:=GetSystemTime;
If FindNormalRandoms Then
IncEx(WeMined,GetSystemTime - RT);
End;
If Random(50)=1 Then SleepAndMoveMouse(500+Random(100));
//If (Not(IsMoving)) Then Begin Writeln('a'); Break; End;
If InvCount=PlusOne Then
Begin
Inc(J);
TOres:=TOres + J;
Inc(Players[CurrentPlayer].Integers[81]);
End;
Until (InvCount = PlusOne) Or (TimeFromMark(tMine) > ((Players[CurrentPlayer].Integers[2]*1000) + Random(500)));
Exit;
End;
End;
End;
End Else Continue;
End;
Wait(750+Random(250));
End;
End;
TPAs/T2DPointArrays RockPts.
Then searching within the T2DPoint Array for another TPA/T2DPointArray called OrePts.
For To Do Loops though all of the T2DPointArrays called RockPts to see if any of the second T2DPointArray OrePts exists within it and has > 10 pixels found within it.
Messy as mess :/. Halp?
(Code compiles and works just fine)
HAVE FUN HAHAHAHAHA