Simba Code:
program CageEarthRuneCrafter;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$i SRL-OSR/SRL/misc/al_functions.simba} // Credits to Flight
{$I SRL-OSR/SRL/misc/MiniReflection.simba} // Credits to Hoodz
{//////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
Welcome to Cages Earth Rune Crafter!
Step 1: Make sure both al_functions and MiniReflection are in your misc folder
Step 2: Enter your details below.
Step 3: Start your character
at Varrock East bank with your earth tiara equipped.
Step 4: Enjoy!
P.S. If you run into any problems let me know and I will try to fix
them as soon as possible.
///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////}
var
EssDTM, EssMade: Integer;
const
VERSION = '1.01';
NICKNAME = ''; {Please Fill in your player details here}
USERNAME = '';
PASSWORD = '';
BANKPIN = '';
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := USERNAME;
Pass := PASSWORD;
nick := NICKNAME;
Active := True;
pin := BANKPIN;
end;
end;
procedure LoadDTM;
begin
EssDTM := DTMFromString('mggAAAHicY2NgYOBjZmDgAmJRIGZGYmcyMjCUAXEREGcDcTIQZwDxxPZ2hpiwMIbJHR0MxdlZDKvnz2dYt2gRAyfQLGyYEQeGAACUYAye');
end;
procedure FreeTheDTM;
begin
FreeDtm(EssDTM);
end;
procedure ProgressReport;
begin
WriteLn('Congratulations! you have crafted ' + IntToStr(EssMade) + ' ess in this run!');
WriteLn('The script has been running for: ' + TimeRunning);
WriteLn('Thanks for using Cages Earth Crafter!');
end;
procedure PlayerProtection;
begin
case Random(65) of
10: PickUpMouse;
20: RandomMovement;
30: RandomTab(True);
40: ExamineInv;
50: HoverSkill(skill_Runecrafting, False);
60: SmallRandomMouse;
end;
FindNormalRandoms;
end;
procedure Bank;
var
TPAA: T2DPointArray;
CTS, L, I, X, Y, Tries, BankFound: Integer;
TPA: TPointArray;
begin
repeat
PlayerProtection;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.11, 2.93);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 2051676, MSX1, MSY1, MSX2, MSY2, 4);
TPAA := TPAToATPAEx(TPA, 200, 100);
L := High(TPAA);
ColorToleranceSpeed(CTS);
for I := 0 to L do
begin
MiddleTPAEx(TPAA[i], X, Y);
MMouse(X, Y, 3, 3);
if WaitUptext('th', 300) then
begin
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, True);
Wait(2500 + Random(500));
BankFound := 1;
Break;
end;
end;
if not (BankScreen) then
begin
if not WaitUptext('th', 300) then
begin
MakeCompass(randomrange(-20, 20));
blindwalk(Point(3254 + random(1), 3420 + random(1)));
PlayerProtection;
inc(Tries)
WriteLn('Attempt number: ' + IntToStr(Tries));
end;
end;
if (Tries > 5) then
begin
WriteLn('Failed finding the bank too many times. Exiting Script.');
Logout;
TerminateScript;
end;
until(BankFound = 1);
if (PinScreen) then
InPin(BANKPIN);
if (BankScreen) then
if finddtm(EssDTM, X, Y, MSX1, MSY1, MSX2, MSY2) then
begin
QuickDeposit('inv');
WriteLn('Commencing Banking');
MMouse(X, Y, 3, 3);
wait(randomrange(10, 30));
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, mouse_right);
wait(randomrange(10, 30));
ChooseOption('Withdraw-All')
wait(randomrange(10, 30));
CloseBank;
WriteLn('Banking Complete');
PlayerProtection;
Exit;
end else
begin
WriteLn('Could not find the Essence DTM. Consider making another one.');
Logout;
TerminateScript;
end;
end;
function EnterRCAltar: Boolean;
var
TPAA: T2DPointArray;
CTS, L, I, X, Y, Tries: Integer;
TPA: TPointArray;
label
Start;
begin
Start:
PlayerProtection;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.4, 0.4);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 5725540, MSX1, MSY1, MSX2, MSY2, 20);
TPAA := TPAToATPAEx(TPA, 100, 150);
SortATPAFromSize(TPAA, 8000, True);
L := High(TPAA);
ColorToleranceSpeed(CTS);
for I := 0 to L do
begin
MiddleTPAEx(TPAA[i], X, Y);
MMouse(X, Y, 3, 3);
if IsUpText('ste') then
begin
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, True);
Wait(100 + Random(25));
Flag;
Wait(1500 + Random(500));
blindwalk(Point(2658 + random(1), 4839 + random(1)));
Result := True;
Exit;
end;
end;
if not IsUpText('ste') then
begin
MakeCompass(randomrange(0, 360));
Inc(Tries);
WriteLn('You have failed to find the uptext ' + IntToStr(Tries) + ' Times.'); //FailSafes
end;
if (Tries > 5) then
begin
WriteLn('Failed too many times finding runecrafting alter. Terminating');
Logout;
TerminateScript;
end;
goto Start;
SetColorSpeed2Modifiers(0.2, 0.2);
end;
function LocatePortal: Boolean;
var
TPAA: T2DPointArray;
CTS, L, I, X, Y, Tries: Integer;
TPA: TPointArray;
label
Start;
begin
Start:
PlayerProtection;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.08, 0.63);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 7447982, MSX1, MSY1, MSX2, MSY2, 13);
TPAA := TPAToATPAEx(TPA, 10, 10);
SortATPAFromSize(TPAA, 8000, True);
L := High(TPAA);
ColorToleranceSpeed(CTS);
for I := 0 to L do
begin
MiddleTPAEx(TPAA[i], X, Y);
MMouse(X, Y, 3, 3);
if WaitUpTextMulti(['ort'], 300) then
begin
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, True);
Wait(2200 + Random(500));
Flag;
Result := True;
Exit;
end;
end;
if not IsUpText('ort') then
begin
MakeCompass(randomrange(0, 360));
Inc(Tries);
WriteLn('You have failed to find the uptext ' + IntToStr(Tries) + ' Times.'); //FailSafes
end;
if (Tries > 5) then
begin
WriteLn('Failed too many times finding runecrafting alter. Terminating');
Logout;
TerminateScript;
end;
goto Start;
SetColorSpeed2Modifiers(0.2, 0.2);
end;
function UseRCAltar: Boolean;
var
TPAA: T2DPointArray;
CTS, L, I, X, Y, Tries: Integer;
TPA: TPointArray;
label
Start;
begin
Start:
PlayerProtection;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.56, 0.54);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 2895924, MSX1, MSY1, MSX2, MSY2, 10);
TPAA := TPAToATPAEx(TPA, 70, 70);
SortATPAFromSize(TPAA, 8000, True);
L := High(TPAA);
ColorToleranceSpeed(CTS);
for I := 0 to L do
begin
MiddleTPAEx(TPAA[i], X, Y);
MMouse(X, Y, 3, 3);
if WaitUpTextMulti(['lta'], 300) then
begin
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, True);
EssMade := EssMade + 28;
Wait(100 + Random(25));
Flag;
Wait(4000 + Random(650));
blindwalk(Point(2655 + random(1), 4830 + random(1)));
Wait(1700 + Random(650));
Result := True;
Exit;
end;
end;
if not IsUpText('lta') then
begin
MakeCompass(randomrange(0, 360));
Inc(Tries);
WriteLn('You have failed to find the uptext ' + IntToStr(Tries) + ' Times.');
end; //FailSafes
if (Tries > 5) then
begin
WriteLn('Failed too many times finding runecrafting alter. Terminating');
Logout;
TerminateScript;
end;
goto Start;
SetColorSpeed2Modifiers(0.2, 0.2);
end;
procedure ToBank;
begin
blindwalk(Point(3254 + random(1), 3420 + random(1)));
PlayerProtection;
end;
procedure ToAlter;
begin
blindwalk(Point(3305 + random(1), 3472 + random(1)));
PlayerProtection;
end;
procedure Walking(Route: string);
begin
case Lowercase(Route) of
'bank': ToBank;
'alter': ToAlter;
else
WriteLn('Please select a valid route (bank or alter)');
end;
end;
begin
DeclarePlayers;
SetupSRL();
SetupReflection;
LoadDTM;
AddOnTerminate('FreeTheDTM');
AddOnTerminate('ProgressReport');
if not LoggedIn then
begin
WriteLn('Player was not logged in. Logging in...');
LogInPlayer;
SetAngle(0);
end;
repeat
SetRun(True);
Bank;
Walking('alter');
EnterRCAltar;
UseRCAltar;
LocatePortal;
Walking('bank');
until (False);
end.