Well here is what I have right now:
SCAR Code:
{==============================================================================\
| MSI Group Scripting Include |
| Mining.scar |
|==============================================================================|
| For all mining routines. |
| |
| * procedure MSI_WaitWhileMining(); * by NCDS |
| * function MSI_MineRock(); * by NCDS |
| * function MSI_MineInvFull(); * by NCDS & marpis |
\ _____________________________________________________________________________}
{******************************************************************************}
{ Procedure MSI_WaitWhileMining(RockInfo: TMSObject); }
{ By: NCDS }
{ Date: 11 July 2010 }
{ Description: Wait's until an Ore has been mined. }
{******************************************************************************}
Procedure MSI_WaitWhileMining(RockInfo: TMSObject);
var
cts, OldInvCount, t, i, RockColorCount: Integer;
MDAr: T2DPointArray;
Arr: array of TPoint;
SearchBox: TBox;
begin
Flag;
Wait(RandomRange(285, 450));
if InvFull then
Exit;
cts := GetColorToleranceSpeed;
SetToleranceSpeed2Modifiers(RockInfo.Hue, RockInfo.Sat);
t := GetSystemTime + 60000;
SearchBox := IntToBox(
MSCx - Round(RockInfo.W * 1.50),
MSCy - Round(RockInfo.H * 1.50),
MSCx + Round(RockInfo.W * 1.50),
MSCy + Round(RockInfo.H * 1.50));
OldInvCount := InvCount;
repeat
for i := 0 to High(RockInfo.Colors) do
begin
FindColorsTolerance(MDAr[i], RockInfo.Colors[i], SearchBox.x1,
SearchBox.y1, SearchBox.x2, SearchBox.y2, RockInfo.Tol);
if (Length(MDAr[i]) > RockInfo.Accuracy) then
Arr := CombineTPA(MDAr[i], Arr);
end;
if Length(Arr) < 1 then
Break;
RockColorCount := Length(Arr);
if (Length(Arr) < Round(RockColorCount * 0.50)) then
Break;
MSI_FindRandoms;
MSI_AntiBan(RandomRange(0, 3000), ANTI_BAN_CHANCE);
if (OldInvCount < InvCount) then
Break;
Wait(RandomRange(200, 500));
until(t > GetSystemTime) or (Length(Arr) < Round(RockColorCount * 0.50));
SetColorToleranceSpeed(cts);
end;
{******************************************************************************}
{ function MSI_MineRock(Which: TIntegerArray): Boolean; }
{ By: NCDS }
{ Date: 11 July 2010 }
{ Description: Mines Rock }
{******************************************************************************}
function MSI_MineRock(Which: TIntegerArray): Boolean;
var
Rocks: TMSObjectArray;
SearchBox: TBox;
Index: Integer;
begin
Rocks := MSI_GetObjects(Which);
SearchBox := IntToBox(MSx1, MSy1, MSx2, MSy2);
if MSI_FindObjectsIn(Rocks, Index, SearchBox, ClickLeft) then
begin
Result := True;
MSI_WaitWhileMining(Rocks[Index]);
end;
end;
{******************************************************************************}
{ function MSI_MineInvFull(Which: TIntegerArray): Boolean; }
{ By: NCDS & mapris }
{ Date: 11 July 2010 }
{ Description: Mines Rock's until Inventory is full. }
{******************************************************************************}
function MSI_MineInvFull(Which: TIntegerArray): Boolean;
var
t: Integer;
begin
t := (GetSystemTime + (5 * 60000));
while (not(InvFull)) and LoggedIn and (GetSystemTime < t) do
begin
if MSI_MineRock(Which) then
t := (GetSystemTime + (5000 * 60000));
Wait(RandomRange(300, 600));
end;
Result := InvFull;
end;
I keep getting an Invalid Number of parameters error on line 78, which is one of the function headers...not sur what's up with that.
I'll keep messing with it though.
Also, if that's not what you meant tell me and I'll change it to whatever.