SCAR Code:
{ Instructions: ]
[1. First find the ore you ]
[ would like to mine. ]
[ Then click on the color ]
[ picker on your top bar. ]
[ Use the color picker to get]
[ your ore color. ]
[ ]
[2. When you have the ore color]
[ copy and paste it into ]
[ orecolor1 using ctrl+alt+c ]
[ to copy. ]
[ ]
[3. Specifie the RS window ]
[ using the Crosshairs on ]
[ your top bar. Drag them to ]
[ the runescape screen. ]
[ ]
[4. Start the script. Watch as ]
[ SCAR automatically mines ]
[ your ore for you. ]
[ HAPPY CHEATING! ]
[______________________________}
program Autominer;
//{.Include srl/srl/misc/smart.Scar}
{.Include SRL/SRL.Scar}
{.include SRL\srl/Skill\Mining.scar}
const
Whatore = 'Iron';
rockwait = 10000; //Max time it takes you to mine 1 rock (in ms)
dir = 'N'; //where to run when infight
loadsforplayer = 2;
maxtimeforplayer= 15; //in minutes
MouseSpeeed = 35;
autotalk = true;
oretol = 5;
waitit = 25; //@@@ DON'T TOUCH @@@
{!*==============NOW EDIT YOUR PLAYER==============*!}
procedure DeclarePlayers;
begin
HowManyPlayers := 2;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; //place your username here
Players[0].Pass := ''; //place your password here
Players[0].Nick := 'ou3'; //3 - 4 letters of YOUR username, example: sern - from username
Players[0].Active := True;
Players[1].Name := ''; //place your username here
Players[1].Pass := ''; //place your password here
Players[1].Nick := 'Am L'; //3 - 4 letters of YOUR username, example: sern - from username
Players[1].Active := True;
{ Players[2].Name := 'Username'; //place your username here
Players[2].Pass := 'Password'; //place your password here
Players[2].Nick := '0bo'; //3 - 4 letters of YOUR username, example: sern - from username
Players[2].Active := false; }
end;
{!*================NO TOUCHING!====================*!}
var
x, y, a, b, loads, oredtm, oremined,
orecolor1, orecolor2, orecolor3, orenotfound,
loadsdone, playertime, invspot, gasavoided,
starttime, oremask : Integer;
var comment : string;
var minestart, i, slot : integer;
breakout : boolean;
time1 : longint;
procedure WorkUntilMined; forward;
Function FollowColor(Var a, b: Integer; Color, Tol: Integer): Boolean; forward;
procedure load;
begin
oredtm := DTMFromString('78DA633CC4C4C0F0940105F4343532FC07D28' +
'C40FC1F08183702D53C6340038C48249006A9794340CD5EA09A4F' +
'04D41C04AA794740CD69A09AE704D49C07AAB94F40CD51A09A1B0' +
'4D4EC04AAB9875F0D00E1B81584');
OreMask := BitmapFromString(11, 11, 'z78DA73730301033070436' +
'2238B60024C35B84CC0A5923C13F0BB937813F0EB22DE04CC5022' +
'CF04CADD404CC890EA0BFCE2F85D4E4C6A212FF470998FCC0600F' +
'B599CC1');
end;
procedure SelectOre;
begin
case whatore of
'Tin' : begin
orecolor1 := 9606046;
orecolor2 := 9935011;
orecolor3 := 7895426;
end;
'Copper' : begin
orecolor1 := 4813471;
orecolor2 := 4417938;
orecolor3 := 3890304;
end;
'Iron' : begin
orecolor1 := 2701146;
orecolor2 := 2767197;
orecolor3 := 2239818;
end;
end;
end;
//by Tarajunky
Procedure WriteStatus(word:string);
var Sec,rate:integer;
begin
Sec:= (1+((Getsystemtime-starttime)/1000));
Rate:=(3600*(oremined))/(Sec);
Status('Mining rate - '+IntToStr(rate)+'/hr --- '+comment+', '+word);
end;
function FindTheRandoms : boolean;
begin
if FindNormalRandoms then result:= true;
wait(50);
if (FindFight) then
begin
result:= true;
MakeCompass('N');
RunTo(dir, True);
Wait(17000 + Random(3000));
RunBack;
end;
end;
function gas : boolean;
begin
if GasFound(a, b - 20) or findgas( a, b - 20) then
begin
result:= true;
mouse(mmcx, mmcy -3,2,1,true);
repeat
FollowColor(a, b, orecolor1 , oretol)
wait(100);
writestatus('Gas Found');
until (not GasFound(a, b- 20)) and (not findgas(a,b - 20));
gasavoided:= gasavoided +1;
end;
end;
procedure AntiBan;
begin
if (not (LoggedIn)) then Exit;
Dwarfitem;
case Random(8) of
0: RandomRClick;
1: HoverSkill('Mining', False);
2: RandomMovement;
3: BoredHuman;
4: PickUpMouse;
5: Wait2(5000+random(5000),true);
6: begin
GameTab(1 + Random(12));
wait(2000 + Random(1000));
GameTab(4);
end;
7: setrun(true);
end;
end;
procedure talk;
begin
if inchat('lvl') then saycurrentlevels('mining');
wait(1);
if inchat('Hi') then typesend('yo');
wait(1);
if inchat('macro') or inchat('auto') then typesend('lmao');
wait(1);
if inchat('free') then typesend('nah...');
wait(1);
end;
procedure drop;
var
bx, by: Integer;
begin
if (InvFull) then
begin
GameTab(4);
oremined := oremined + CountItemBmpMaskTol(OreMask,5,15);;
Players[CurrentPlayer].Integers[0] := Players[CurrentPlayer].Integers[0] + CountItemBmpMaskTol(OreMask,5,15);
repeat
if (FindDTM(oredtm, bx, by, MIX1, MIY1, MIX2, MIY2)) then
Mouse(bx, by, 10, 10, false)
ChooseOption('Drop')
ftwait(3);
until (not (FindDTM(oredtm, bx, by, MIX1, MIY1, MIX2, MIY2)))
findnormalrandoms;
arrangeinv;
end;
end;
function welostpick : boolean;
begin
if FindBitmapMaskTolerance(BrokenPick, x, y, MIX1, MIY1, MIX2, MIY2, 10, 10) or
FindBitmapMaskTolerance(PickAxeHandle, x, y, MIX1, MIY1, MIX2, MIY2, 10, 10) then
if not findpick then
begin
writeln('We lost our pickaxe');
result:= true;
logout;
end;
end;
//=== Idea from Sumilion ===//
function Getfreeinvspot : integer;
begin
for InvSpot := 1 to 28 do
if not(ExistsItem(InvSpot))then
begin
result := invspot;
exit;
end;
end;
//By Jukka
Function FollowColor(Var a, b: Integer; Color, Tol: Integer): Boolean;
Var
NoFlag, Fail: Integer;
Begin
MarkTime ( Fail );
If(FlagPresent)Then
Begin
Repeat
If(TimeFromMark( Fail ) > 5000 )Then
Begin
Result:= False;
Break;
End;
Wait(20);
Result:= FindColorSpiralTolerance(a, b, Color, a-20, b-20, a+20, b+20, Tol);
mmouse(a,b,0,0);//optional for testing
Until(Not FlagPresent) Or (Not Loggedin) Or (Not Result);
If(Result)Then
Begin
MarkTime( NoFlag );
Repeat
Wait(20);
Result:= FindColorSpiralTolerance(a, b, Color, a-20, b-20, a+20, b+20, Tol);
mmouse(a,b,0,0);//optional. used for testing
Until(TimeFromMark(NoFlag)>750) Or (Not Loggedin) Or (Not Result);
End;
End Else Result:= True;
End;
function RockGone(rx, ry: Integer): Boolean;
begin
Result := not FindColorSpiralTolerance(rx, ry, OreColor1, rx - 10, ry - 10, rx + 10, ry + 10, oretol);
end;
//=======================================//
procedure WorkUntilMined;
begin
while (LoggedIn) and (not BreakOut) do
begin
time1:= getsystemtime;
for i := 1 to 14 do
begin
case i of
1 : if (timefrommark(minestart) > 500) then
if FindTheRandoms then
begin
comment:='Random Event found';
breakout:= true;
Break;
end;
2 : wait(waitit);
3 : if (timefrommark(minestart) > 500) then
if Gas then
begin
breakout:= true;
Break;
end;
4 : wait(waitit);
5 : if(ExistsItem(slot))then
begin
comment:='New item Exists';
breakout:= true;
Break;
end;
6 : wait(waitit);
7 : FindPick;
8 : wait(waitit);
9 : if(TimeFromMark(MineStart) > Rockwait) then
begin
comment:='Rockwait over';
breakout:= true;
Break;
end;
10 : wait(waitit);
11 : if not flagpresent then
if (timefrommark(minestart) > 1500) then
if (FindBlackChatMessage('manage')) or (FindBlackChatMessage('no ore')) then
begin
comment:='Text returned';
breakout:= true;
Break;
end;
12 : wait(waitit);
13 : if autotalk then Talk;
14 : wait(waitit);
end;
end;
writestatus('WorkUntilMined took '+inttostr(Getsystemtime - time1));
end;
end;
procedure Mining;
var following , flaggone : integer;
begin
repeat
if (orenotfound = 20) then begin logout; exit; end;
if welostpick then exit;
if not loggedin then exit;
if random(10) = 5 then Antiban;
slot := getfreeinvspot;
breakout:= false;
minestart:= 0;
//flag;
if (findobjcustom(a, b,['ine'], [orecolor1,orecolor2,orecolor3], oretol)) and (not(Gas)) then
begin
mouse(a, b, 0, 0, true);
marktime(minestart);
orenotfound := 0;
wait(50);
findtalk;
repeat
FollowColor(a, b, orecolor1 , oretol);
WorkUntilMined;
if BreakOut then Break;
if rockgone(a,b) then break; //this should return true when colors are gone from ms, and exit from loop, what it won't...(it works sometimes when i remove workuntilmined(workuntilmined takes aproch 500 - 1500 ms)
wait(50);
until(false);
end else
begin
orenotfound:= orenotfound + 1;
end;
gametab(4);
until (InvFull);
drop;
loads:= loads + 1;
loadsdone := loadsdone + 1;
end;
//By Wizzup?
Procedure PlayerReport;
Var
Active, rand: string;
I: Integer;
Begin
For I := 0 To HowManyPlayers - 1 Do
Begin
If Players[i].Active = True Then
Active := 'T'
Else
Active := 'F';
If Players[i].rand <> '' Then
rand := '; Rand: ' + Players[i].rand
else rand := '';
WriteLn((IntToStr(I)) + ' : ' + Players[I].nick + ' = ' +
Active + ' ' + Players[I].Loc + rand + '; Mined: ' + IntToStr(Players[I].Integers[0])
+ ' Ores;'+ ' M Lvl: ' + IntToStr(Players[I].Level[0]));
End;
End;
procedure proggy;
begin
cleardebug;
srlrandomsreport;
writeln('==================================');
writeln(' Scar + SRL autominer - hardC0re or Neg...whatever ');
writeln('Worked : '+timerunning);
writeln('Loads made :'+inttostr(loads));
writeln('Ore mined :'+inttostr(oremined));
writeln('Gasses avoided :'+inttostr(gasavoided));
writeln('==================================');
writeln('');
playerreport;
writeln('');
writeln('==================================');
end;
procedure Playersetup;
begin
MouseSpeed:=MouseSpeeed+random(2);
orenotfound := 0;
//FTWait(3);
loginplayer;
repeat
wait(100);
until(tabexists(11)) and (tabexists(4)) ;
wait(2000);
Players[CurrentPlayer].Level[0] := GetSkillLevel('mining');
FTWait(1);
HighestAngle;
MakeCompass('n');
SetChat('on', 1);
SetRun(true);
SetRun(true);
SetBar('Brightness',4);
gametab(4);
findpickheadcolor;
playertime:= 0;
orenotfound := 0;
loadsdone :=0;
marktime(playertime);
end;
function SwitchPlayers: boolean;
begin
if(TimeFromMark(playertime) / 60 / 1000 > (maxtimeforplayer * 1000 * 60)) or
(loadsdone xor loadsforplayer = 0)then
begin
Result := True;
WriteLn('Time is up');
end else
Result := False;
end;
begin
SetupSRL;
setupmining;
LoadMiningBitMaps;
Load;
SelectOre;
DeclarePlayers;
ActivateClient;
marktime(starttime);
wait(1000);
loginplayer;
repeat
wait(100);
until tabexists(4);
repeat
playersetup;
repeat
FindTheRandoms;
arrangeinv;
proggy;
Mining;
proggy;
until (not loggedin) or (switchplayers);
if (not(loggedin)) then nextplayer(false);
if loggedin and switchplayers then nextplayer(true);
until not(Players[CurrentPlayer].Active);
freeDTM(ore);
end.