SCAR Code:
{.include SRL/SRL.scar}
{.include SRL/SRL/Misc/Trade.scar}
{.include SRL/SRL/Skill/Mining.scar}
{.include SRL/SRL/Core/Users.scar}
Const
LoadsToDo = 1;
NumberOfUsers = 1;
StartPlayer = 0;
Var
RockColor, RockTime, LastFail, Loads : Integer;
Rock : TPoint;
TimeSet : Boolean;
Function FindFastRandoms: Boolean; // By WT-Fakawi.
var
i: Integer;
begin
for i:=1 to 12 do
begin
case I of
1: If FindDead then
Result := True;
2: If FindMod then
Result := True;
3: If FindMime then
Result := True;
4: If FindMaze then
Result := True;
5: If FindQuiz then
Result := True;
6: If FindDemon then
Result := True;
7: begin
if NoGameTab then
begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
end;
8: begin
If InBlack then
begin
Result := True;
Players[CurrentPlayer].loc := 'InBlack';
Logout;
Exit;
end;
end;
9 : If RC Then Result := True;
10 : If FindFight Then
Begin
Result := True;
MakeCompass('N');
RunTo('S', True);
MakeCompass('N');
End;
11: If FindTalk Then Result := True;
12: If HandleTrade Then Result := True;
End;
Wait(3);
end;
end;
Function GassCheck(Where : TPoint) : Boolean; // beta stage gass checking
var
Gass : TPointArray;
begin
Result := False;
FindColorsSpiralTolerance(Where.X, Where.Y, Gass, 12043461, Where.x, Where.y - 20, Where.x + 80, Where.y + 20, 0);
If (Length(Gass) > 50) then
If (Length(Gass) < 200) then
Result := True;
end;
Function FindCurrentRocks(X, Y, Color : Integer) : TPointArrayArray;
var A : TPointArray;
begin
FindColorsSpiralTolerance(X, Y, A, Color, MSX1, MSY1, MSX2, MSY2, 15); //Find the Colors
Result := RemoveBigPointGroups(RemoveSmallPointGroups(FindGroups(A, 5, 0, 1), 10), 25);; //Find groups of colors and Remove groups which are too small
end;
Function ExistRock(var Rock : TPoint; Color: integer) : Boolean;
var
A, B : TPointArray;
begin
FindColorsSpiralTolerance(Rock.x, Rock.y, A, Color, Rock.x - 15, Rock.y - 15, Rock.x + 15, Rock.y + 15, 15); // For checking if the rock still contains ore
FindColorsSpiralTolerance(Rock.x, Rock.y, B, 1593697, Rock.x - 15, Rock.y - 15, Rock.x + 15, Rock.y + 15, 15);// For finding the rocks position
If Length(A) > 1 then Result := True; // The ore color check
AddTPointArray(A, B); //Adding the 2 results for better middle finding
FindMiddle(Rock.x, Rock.y, A); // Finding the new middle
end;
Function ClickNewRocks(var Rock :TPoint) : Boolean;
Var
A : TPointArray;
B : TPointArrayArray;
I, x, y : Integer;
begin
ColorToleranceSpeed(2); // better color finding
SetColorSpeed2Modifiers(0.2, 0.2); // ^
FindColorsSpiralTolerance(259, 144, A, 1593697, MSX1, MSY1, MSX2, MSY2, 11); //finding the rock color
B := FindGroups(A, 5, 0, 1); // Differentiate the rocks
B := RemoveSmallPointGroups(B, 30); // Remove all that are too small to be a rock
For I := 0 to Length(B) - 1 do // loop through the rocks
begin
Wait(3); // anti lag when there is no rock
FindMiddle(X, Y, B[I]); // finds the middle of the rock
If not FindGas(x, y - 20) then
If CountColorTolerance(RockColor, X - 10, Y - 10, X + 10, Y + 10, 11) > 12 then // checks if the color is in the rock
begin
MMouse(X, Y, 7, 7); // uptext checking(just to be sure)
Wait(50 + Random(25)); // ^
If IsUpText('ine') then // ^
Begin
Rock.x := X;
Rock.y := Y;
Result := True; // we found the rock so this function returns true
ExistRock(Rock, RockColor); // we could have been moving while searching for the rocks
If Random(10) > 0 then Mouse(Rock.x, Rock.Y, 0, 0, True) else // some anti ban
Begin // right clicks ---> click mine on popup every now and then
Mouse(X, Y, 0, 0, False);
ChooseOption('ine');
end;
Exit; // we clicked the rock succesfully so why not stop searching for new ones
end;
end;
end;
end;
Procedure MineRocks;
begin
If not LoggedIn then Exit;
RockTime := 0;
Repeat
If ClickNewRocks(Rock) then //Clicks the rock and saves its position
begin
LastFail := GetTimeRunning;
Repeat
Wait(3);
If not TimeSet then
If not FlagPresent then // we dont want the max 5 seconds while we are walking
Begin
TimeSet := True;
RockTime := GetTimeRunning;
end;
Wait(3);
If RockTime <> 0 then // after the timing started we only have 5 seconds before we try again
If GetTimeRunning - RockTime > 5000 Then Break;
Wait(3);
If FindGas(Rock.x, Rock.y - 20) then
If not ClickNewRocks(Rock) then
Mouse(643, 83, 5, 5, True);
Wait(3)
If GetTimeRunning - LastFail > 25000 then Break;
FindPick;
Wait(3);
//FindFastRandoms;
Until not(ExistRock(Rock,RockColor)); //Follows the rock and stops when the rock is mined
FindPick
FindFastRandoms;// randoms check
TimeSet := False; //reset timing values
RockTime := 0; // ^
end;
Wait(25);
Until(Invfull); // we repeat the mining until we have a full inventory
DropAll; // drops all the ores
Players[CurrentPlayer].Banked := Players[CurrentPlayer].Banked + 1;
WriteLn(IntToStr(GetTimeRunning));
end;
Procedure ProgressReport;
begin
If not LoggedIn then Exit;
end;
begin
SetupSRL;
MouseSpeed := 20;
RockColor := 2305869;
//--------------------\\<---secret function which is in next version of srl lol
ActivateClient;
Wait(1000);
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
If not Loggedin then loginplayer;
Repeat
Wait(100);
MineRocks;
ProgressReport;
If Not LoggedIn Then
begin
Loads := 0;
NextPlayer(False);
end;
If (LoggedIn) and (Players[CurrentPlayer].banked mod LoadsToDo = 0) then
begin
Loads := 0;
NextPlayer(True); <---error happens here
end;
Until(False);
end.
you wont be able to run it without my plugin