Simba Code:
program Gilded_Altar;
{$i srl/srl/misc/smart.simba}
{$DEFINE CRASHSMART}
{$i SRL\SRL.simba}
{$i SPS\SPS.simba}
var
x, y: Integer;
procedure DeclarePlayers;
begin
HowManyPlayers := 1; // Number of Players to use
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0; // Player to start with, first one is 0
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Active := True; // TruiBox := InvBox;
Players[0].Pin := ''; // Bank Pin. Leave it if you don't have one.
Players[0].Integers[1] := 10000; // Number of loads
end;
procedure AntiRandoms;
begin
FindNormalRandoms;
LevelUp;
end;
function UseBankNPC: Boolean;
var
bx, by, Speed, ColFace, ColGrey, ColBlue, ColHair, t: Integer;
begin
Result := (LoggedIn) and (BankScreen or PinScreen);
if (Result) then exit;
Speed := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
ColFace := 7513036;
ColGrey := 4995649;
ColBlue := 4336690;
ColHair := 2506053;
if (FindObjThroughMM(bx, by, 'npc', [ColFace, ColBlue, ColGrey, ColHair], [5, 5, 5, 5],
['ounter', 'se Co', 'anke', 'to B', 'Banker', 'nker'], 2, 2)) then
begin
Mouse(bx, by, 0, 0, False);
if (WaitOptionMulti(['kly Co', 'se-qu', 'ank B', 'Bank Banker', 'ank', 'nker'], 750)) then
begin
t := (GetSystemTime + 5000);
repeat
if (BankScreen) or (PinScreen) then
begin
Result := true;
Break;
end;
Wait(50);
until(GetSystemTime > t);
if (Length(Players) > 0) then
if ((PinScreen) and (Players[CurrentPlayer].Pin <> '')) then
InPin(Players[CurrentPlayer].Pin);
Result := (BankScreen) or (PinScreen);
end;
end;
ColorToleranceSpeed(Speed);
end;
procedure TeleToBank;
var
x, y, N: Integer;
begin
if (N > 3) then
begin
Exit;
end;
ClickNorth(SRL_Angle_High);
AntiRandoms;
begin
repeat
Inc(N);
//if FindObjTPA(x, y, 6982558, 10, 2, 25, 20, w, ['mulet']) then
if FindObjCustom(X, Y, ['mulet','et Gl','lory'], [7114144,6982558], 3) then
GetMousePos(X, Y);
Mouse(x, y, 0, 0, false);
AntiRandoms;
until ChooseOption('Rub') or (N > 5);
end;
if (N > 5) then
begin
Exit;
end;
FFlag(0);
N:=0;
repeat
Inc(N);
Wait(500);
until FindNpcChatText('dgev', ClickLeft);
Wait(4912 + Random(957));
begin
SPS_Setup(RUNESCAPE_SURFACE, ['10_6']);
SPS_Continue := true;
SPS_WalkPath([Point(4214, 2686)]);
FFlag(0);
Wait(2500 + Random(200));
AntiRandoms;
N:=0;
end;
end;
Procedure OpenDoor;
var
x, y : integer;
begin
KeyUp(VK_F1);
Wait(5500 + Random(200));
begin
repeat
if FindObjCustom(X, Y, ['oor','Doo'], [4542809,3883076,9873837], 3) then
GetMousePos(X, Y);
Mouse(x, y, 10, 10, false);
AntiRandoms;
until ChooseOption('Open');
end;
end;
function LightR(var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.07, 0.13);
if not(FindColorsTolerance(arP, 2900057, MSX1, MSY1, MSX2, MSY2, 4)) then
begin
Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 5.03) and (X <= 8.15) and (Y >= 4.72) and (Y <= 7.59) and (Z >= 2.55) and (Z <= 3.96) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;
SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 25, 25);
arL := High(ararP);
for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if (IsUpText('Light')) then
begin;
Result := True;
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
begin
Writeln('FindObject could not find object.');
Exit;
end;
GetMousePos(fx, fy);
end;
function LightL(var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.09, 0.29);
if not(FindColorsTolerance(arP, 2570832, MSX1, MSY1, MSX2, MSY2, 4)) then
begin
Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 3.86) and (X <= 6.76) and (Y >= 3.64) and (Y <= 6.33) and (Z >= 2.00) and (Z <= 3.37) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;
SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 10, 10);
arL := High(ararP);
for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if (IsUpText('Light')) then
begin;
Result := True;
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
begin
Writeln('FindObject could not find object.');
Exit;
end;
GetMousePos(fx, fy);
end;
begin
SetupSRL;
ActivateClient;
DeclarePlayers;
OpenDoor;
if LightR(x,y) then // THIS or LightR(x,y);
if LightL(x,y) then // THIS or LightL(x,y);
end.