SCAR Code:
program EarthRunecrafter;
{.include srl/srl.scar}
// Special thanks go to Pentti for his Varrock road color finder
// Jad for his JadSymbol
// WT-Fakawi for his FindFastRandoms
// This script will withdraw essence from bank, and bank
// the Earth Runes after crafting them at the Eart Temple
// Startup in Varrock East Bank, will switch player after the
// number of loads done. Has Antiban and findrandoms.
// Place Essence in first bankslot, supports both Tiara and tally
const //----------------- Begin Setup ----------------------------\\
Loads = 10; // Loads to do before switching player
TotalPLayers = 6; //Total number of PLAYERS. active or not.
FirstPlayer = 0; //Player to start on.
TransportDelay = 2; //Time to wait for portaltransportation in seconds
BankPin = 0000; // fill in BankPin if any
TiaraOrTally = 1; // Tiara = 0, Tally = 1
//------------------- End Setup ------------------------------\\
var
Tempcolor: Integer;
VRoad: array[0..3] of array[0..2] of Integer;
VRoadColor: Integer;
LoadNumB, LoadsNum, Runes, TimeDelay: Integer;
procedure DeclarePlayers;
begin
HowManyPlayers := TotalPLayers;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := FirstPlayer;
//---------------------- Begin of Player Setup -------------------------
// set all user names, passwords, nicks and Active correctly please.
Players[0].Name := 'UserName';
Players[0].Pass := 'Password';
Players[0].Nick := '3-4 letters of UserName';
Players[0].Active := True;
Players[1].Name := 'UserName';
Players[1].Pass := 'Password';
Players[1].Nick := '3-4 letters of UserName';
Players[1].Active := False;
Players[2].Name := 'UserName';
Players[2].Pass := 'Password';
Players[2].Nick := '3-4 letters of UserName';
Players[2].Active := False;
Players[3].Name := 'UserName';
Players[3].Pass := 'Password';
Players[3].Nick := '3-4 letters of UserName';
Players[3].Active := False;
Players[4].Name := 'UserName';
Players[4].Pass := 'Password';
Players[4].Nick := '3-4 letters of UserName';
Players[4].Active := False;
Players[5].Name := 'UserName';
Players[5].Pass := 'Password';
Players[5].Nick := '3-4 letters of UserName';
Players[5].Active := False;
// ------------------------- End of Player Setup --------------------------
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
end;
function FindFastRandoms: Boolean;
var
i: Integer;
begin
for i := 1 to 8 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;
8: RC;
end;
wait(1);
end;
end;
procedure FindRandoms;
begin
FindFastRandoms;
FindNormalRandoms;
end;
procedure AntiBan;
begin
if (not(LoggedIn)) then
exit;
case 1+random(7) of
1: MMouse(400,10,399,9);
2: GameTab(3 + Random(2));
3: RandomRClick;
4: AlmostLogout;
5: PickUpMouse;
6: BoredHuman;
7: MouseBox(MSX1, MSY1, MSX2, MSY2, 7);
end;
GameTab(4);
end;
procedure WithdrawRuneEssence;
var RuneEssence: Integer;
x1, y1: Integer;
begin
if (not (LoggedIn)) or (InvFull) then
begin
CloseBank;
Exit;
end;
RuneEssence := DTMFromString('78DA634C626060506100036608C5101F19C92' +
'007A41981F83F1030660319D2A86AA67675C1D58000630A903040' +
'55E3EEE484AA260C48281250130124B451D538DAD8A0AAC90712A' +
'AA86A1A2B2A50D400006E2C0E77');
if (FindDTM(RuneEssence, x1, y1, 45, 30, 115, 95)) then
begin
Mouse(x1, y1, 1, 1, false);
if (chooseOption(x1, y1, 'All')) then
wait(1000 + random(100));
end;
CloseBank;
end;
function BankOpen: Boolean;
var x, y, fs, fs2: Integer;
Code: string;
begin
Code := IntToStr(bankpin);
Gametab(4);
wait(100 + random(50));
if (not (LoggedIn)) then
Exit;
if not BankScreen or PinScreen then
repeat
if (FindObj3(x, y, 'Use Bank', 4481658, 10)) then
Mouse(x, y, 4, 4, False)
else
if (FindObj3(x, y, 'Use Bank', 2842230, 10)) then
Mouse(x, y, 4, 4, False)
else
if (FindObj3(x, y, 'Use Bank', 12611, 10)) then
Mouse(x, y, 4, 4, False);
Wait(250);
if (ClickOption('quickly', 1)) then
begin
Flag;
repeat
Wait(100 + random(50));
fs := fs + 1;
until (BankScreen) or (fs >= 50);
end;
fs2 := fs2 + 1;
if (PinScreen) then
begin
wait(200 + random(100));
inpin('code');
wait(100 + random(50));
end;
until (BankScreen) or (fs2 > 5);
if BankScreen then Result := True;
end;
procedure VRoadBMP;
begin
VRoad[0][0] := BitmapFromString(14, 4, 'z78DA3330A01530B73037357' +
'3A39CA4B599D40500DD144429');
VRoad[0][1] := BitmapFromString(8, 7, 'z78DA33302007985B989B9AB9' +
'E12787937AE20100B58F4573');
VRoad[0][2] := BitmapFromString(4, 9, 'z78DA3330C007CC2DCC4DCDDC' +
'20E46016C7040070AA2B83');
VRoad[1][0] := BitmapFromString(14, 4, 'z78DA3330A015B070B6B0B03' +
'0A29CA4B599D40500C39443F9');
VRoad[1][1] := BitmapFromString(8, 7, 'z78DA3330200758385B585818' +
'E12787937AE2010095AF4537');
VRoad[1][2] := BitmapFromString(4, 9, 'z78DA3330C0072C9C2D2C2C8C' +
'20E46016C70400685A2B67');
VRoad[2][0] := BitmapFromString(14, 4, 'z78DA3330A01530753235373' +
'5A29CA4B599D40500154C42F1');
VRoad[2][1] := BitmapFromString(8, 7, 'z78DA33302007983A999A9B1A' +
'E12787937AE20100BBC643ED');
VRoad[2][2] := BitmapFromString(4, 9, 'z78DA3330C0074C9D4CCD4D8D' +
'20E46016C7040026C82ACD');
VRoad[3][0] := BitmapFromString(14, 4, 'z78DA3330A0153073337331' +
'33A19CA4B599D4050070834501');
VRoad[3][1] := BitmapFromString(8, 7, 'z78DA3330200798B999B9989' +
'9E02787937AE201006DD64681');
VRoad[3][2] := BitmapFromString(4, 9, 'z78DA3330C007CCDCCC5CCC4' +
'C20E46016C70400A91A2C01');
end;
function FindDaVarrockRoadColor(MaxTol: Integer): Integer;
var TI, i1, i2, lTol, Ax, Ay: Integer;
begin
if (not (LoggedIn)) then
Exit;
for i2 := 0 to 2 do
begin
repeat
for i1 := 0 to 3 do
begin
TI := GetSystemTime;
if (FindBitmapToleranceIn(VRoad[i1][i2], Ax, Ay, MMX1 + 22, MMY1, MMX2, MMY2, lTol)) then
begin
TempColor := GetColor(Ax + 1, Ay + 1);
MoveMouse(Ax + 1, Ay + 1)
if (TempColor > 5000000) and (TempColor < 9000000) then
begin
Result := TempColor
Writeln('Varrock Road Color = ' + inttostr(Result))
Exit;
end;
end;
Writeln('VRoad[' + inttostr(i1) + '][' + inttostr(i2) + '] - Tol: ' + inttostr(lTol) + ' - ' + inttostr(GetSystemTime - TI) + 'ms')
lTol := lTol + 2;
end;
until (lTol >= MaxTol);
lTol := 0
end;
Writeln('Varrock Road Color was not found.')
end;
function JadSymbol(WhatSymbol: string; Click, Switch: Boolean): Boolean;
var I: Integer;
begin
if (not (LoggedIn)) then
Exit;
for I := 1 to 25 do
begin
if (FindSymbol(x, y, (WhatSymbol))) then
begin
if (Click) then
Mouse(x, y, 2, 2, true);
Result := True;
Exit;
end;
wait(750 + random(500));
end;
Writeln('Could NOT find symbol.');
Result := False;
if (Switch) then
LogOut;
end;
procedure WalkToRuin;
begin
if (not (LoggedIn)) then
Exit;
VRoadColor := FindDaVarrockRoadColor(18)
radialwalk(VRoadColor, 20, 90, 60, 2, 2);
flag;
wait(150 + random(50));
radialwalk(VRoadColor, 60, 120, 60, 2, 2);
wait(150 + random(50));
flag;
radialwalk(VRoadColor, 0, 40, 60, 2, 2);
flag;
wait(150 + random(50));
radialwalk(VRoadColor, 0, 40, 65, 2, 2);
AntiBan;
flag;
wait(150 + random(50));
Mouse(692, 38, 2, 2, true);
flag;
wait(150 + random(50));
JadSymbol('tree', true, false);
flag;
wait(150 + random(50));
end;
procedure CompassNorth;
var
x, y: integer;
begin
if (not (LoggedIn)) then
Exit;
if (not findcolor(x, y, 723587, 566, 13, 566, 13)) then
begin
repeat
keydown(VK_right);
wait(100 + random(50));
keyup(VK_right);
wait(100 + random(50));
until (findcolor(x, y, 723587, 566, 13, 566, 13))
end;
end;
procedure EnterEarthRuin;
var EarthTally: Integer;
x1, y1: Integer;
begin
TimeDelay := (TransportDelay * 1000);
if (not (LoggedIn)) then
Exit;
case TiaraOrTally of
0: begin
Mouse(345, 30, 5, 5, true);
flag;
wait(2000 + random(500));
end;
1: begin
EarthTally := DTMFromString('78DA63F4626260106164000166060898D6D3C' +
'D2007A441A2FF81803110A8860B554D6541015C0D08303A03D528' +
'A2AAC976E745551304542381AAC6588901558D0B508D0001BB7C8' +
'06A2409A801B95918554D5840008A1A004EBA0F6D');
gametab(4);
wait(100 + random(50));
if (FindDTM(EarthTally, x1, y1, 555, 205, 740, 460)) then
begin
Mouse(x1, y1, 2, 2, true);
wait(TimeDelay + random(100));
Writeln('clicked the DTM!');
end;
Mouse(345, 30, 5, 5, true);
flag;
wait(TimeDelay + random(500));
end;
end;
end;
procedure ToAltar;
var
ax, ay: Integer;
begin
if (not (LoggedIn)) then
Exit;
Mouse(645, 52, 2, -3, true);
flag;
wait(100 + random(50));
repeat
FindObjectMulti(ax, ay, 'raft', 'altar', 'tar', 5593184, 4276296, 1842720, 10, 100, true, true);
wait(200 + random(150));
until (IsUpTextMulti('raft', 'altar', 'tar'))
if (IsUpTextMulti('raft', 'altar', 'tar')) then
begin
Mouse(ax, ay, 1, 1, true);
FindRandoms;
flag;
wait(300 + random(100));
end;
PopUp('ontinue');
end;
procedure FindPortal;
var
px, py: Integer;
Tol: Integer;
begin
TimeDelay := (TransportDelay * 1000);
if (not (LoggedIn)) then
Exit;
Tol := 10;
MMouse(637, 120, 3, 3);
wait(100 + random(50));
Mouse(635, 120, 3, 3, true);
flag;
wait(100 + random(50));
repeat
if (FindColorSpiralTolerance(px, py, 11132385, 230, 210, 415, 325, Tol)) or
(FindColorSpiralTolerance(px, py, 9750220, 230, 210, 415, 325, Tol)) or
(FindColorSpiralTolerance(px, py, 11527656, 230, 210, 415, 325, Tol)) then
MMouse(px, py, 2, 2);
wait(200 + random(100));
Tol := Tol + 1;
until (IsUpTextMulti('ort', 'rtal', 'se Por'))
if (IsUpTextMulti('ort', 'rtal', 'se Por')) then
begin
Mouse(px, py, 0, 0, true);
flag;
wait(TimeDelay + random(500));
end;
end;
function ToBank(WhatSymbol: string; Click, Switch: Boolean): Boolean;
var I: Integer;
begin
if (not (LoggedIn)) then
Exit;
for I := 1 to 25 do
begin
if (FindSymbol(x, y, (WhatSymbol))) or
(findcolortolerance(x, y, 10131363, 615, 95, 650, 125, 30)) then
begin
if (Click) then
Mouse(x, y, 2, +10, true);
Result := True;
Exit;
end;
wait(750 + random(500));
end;
Writeln('Could NOT find Bank.');
Result := False;
if (Switch) then
LogOut;
end;
procedure WalkToBank;
begin
if (not (LoggedIn)) then
Exit;
VRoadColor := FindDaVarrockRoadColor(18);
Mouse(625, 130, 2, 2, true);
flag;
wait(100 + random(50));
radialwalk(VRoadColor, 210, 250, 60, 2, 2);
flag;
wait(100 + random(50));
RadialWalk(VRoadColor, 160, 200, 55, 2, 2);
flag;
wait(100 + random(50));
VRoadColor := FindDaVarrockRoadColor(18);
wait(100 + random(50));
RadialWalk(VRoadColor, 190, 250, 55, 2, 2);
flag;
wait(100 + random(50));
VRoadColor := FindDaVarrockRoadColor(18);
RadialWalk(VRoadColor, 250, 300, 65, 2, 2);
AntiBan;
flag;
wait(100 + random(50));
RadialWalk(VRoadColor, 260, 280, 45, 2, 2);
flag;
wait(100 + random(50));
ToBank('bank', true, false);
flag;
wait(100 + random(50));
end;
procedure DepositEarthRune;
var EarthRune: Integer;
x1, y1: Integer;
begin
if (not (LoggedIn)) then
Exit;
EarthRune := DTMFromString('78DA6314656060906600036608C5D0DDD4C82' +
'007A41981F83F1030823882A86A8EEED90D5703028CBC40421955' +
'4D4E4A0AAA1A104705B75D6035DC404204554D67433DAA1A903C1' +
'FAA9A2D2B57A0AA51021232A86A362C5982A2060038FB1253');
if (FindDTM(EarthRune, x1, y1, 555, 205, 740, 460)) then
begin
Mouse(x1, y1, 1, 1, false);
if (chooseOption(x1, y1, 'All')) then
wait(1000 + random(100));
wait(200 + random(100));
end;
Closebank;
LoadNumB := LoadNumB + 1;
LoadsNum := LoadsNum + 1
Runes := (LoadsNum * 27);
end;
procedure Report;
begin
setupSRL;
ClearDebug;
wait(12000 + random(3000));
Writeln('|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|');
Writeln('| Psychor |');
writeln('| Earth Runecrafters Progress report |');
writeln('|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|');
writeln('| Worked for ' + timerunning + ' |');
writeln('| Did ' + IntToStr(LoadsNum) + ' loads |');
writeln('| Made ' + IntToStr(Runes) + ' Runes |');
writeln('|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|');
end;
begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
VRoadBMP;
repeat
CompassNorth;
BankOpen;
FixBank;
WithdrawRuneEssence;
FindRandoms;
WalkToRuin;
EnterEarthRuin;
ToAltar;
FindRandoms;
FindPortal;
FindRandoms;
WalkToBank;
BankOpen;
FixBank;
DepositEarthRune;
FindRandoms;
if (LoadNumB = Loads) then
begin
NextPlayer(True);
LoadNumB := 0;
Writeln('Switched players successfully! :)');
end;
report;
until (False);
end.