Simba Code:
program ThievingGuildChests;
{$DEFINE SMART}
{$i srl/srl.simba}
Function OpenChest:Boolean;
Var
X, Y, t: Integer;
begin
MarkTime(t);
repeat
X:=MSCX;
Y:=MSCY;
if FindObjTPA(X, Y, 7376552, 15, 1, 4, 9, 20, ['ract']) then
begin;
Writeln('We found the chest');
GetMousePos(X, Y);
Case Random(4) of
0..2: begin;
Mouse(X, Y, 5, 5, True);
Writeln('We clicked the chest');
end;
3: begin;
Mouse(X, Y, 5, 5, False);
WaitOption('Open', 300);
Writeln('We clicked the chest');
end;
end;
Wait(1500+random(1000));
Writeln('We are waiting to complete the thieving');
end;
begin;
repeat
Wait(200+random(200));
until FindChatBoxText('fail', 8, clBlack) or FindChatBoxText('open', 8, clBlack) or FindChatBoxText('reach', 8, clBlack) or (TimeFromMark(t) >= 10000);
end;
begin;
if FindChatBoxText('fail', 8, clBlack) then
Wait(300+random(200));
end;
begin;
if FindChatBoxText('open', 8, clBlack) then
Wait(2000+random(500));
end;
begin
if FindChatBoxText('reach', 8, clBlack) then
WriteLn('Time to open the doors');
Wait(300+random(200));
end;
until FindChatBoxText('reach', 8, clBlack) or (TimeFromMark(t) >= 15000);
end;
function OpenGate:Boolean;
var
X, Y, a, t, z: Integer;
begin
z:=0
t:=0
a:=0
MarkTime(t);
repeat
X:=MSCX;
Y:=MSCY;
z:=0
if FindObjTPA(X, Y, 1252637, 5, 1, 3, 3, 6, ['pen']) then
begin;
Writeln('We found the chest');
GetMousePos(X, Y);
Case Random(4) of
0..2: begin;
Mouse(X, Y, 2, 2, True);
Writeln('We clicked the gate');
end;
3: begin;
Mouse(X, Y, 2, 2, False);
WaitOption('Open', 300);
Writeln('We clicked the gate');
end;
end;
Writeln('We are waiting to open the gate');
Wait(2000+random(1000));
end;
begin;
repeat
Wait(200+random(200));
until FindChatBoxText('swings', 8, clBlack) or FindChatBoxText('bornly', 8, clBlack) or (TimeFromMark(t) >= 10000);
end;
begin;
if FindChatBoxText('bornly', 8, clBlack) then
WriteLn('We failed to open the gate');
Wait(200+random(200));
end;
begin;
if FindChatBoxText('swings', 8, clBlack) then
a:=a+1
end;
begin;
if (TimeFromMark(z) >= 10000) then
WriteLn('Time exceeded');
end;
until FindChatBoxText('swings', 8, clBlack) or (TimeFromMark(t) >= 20000);
end;
begin
SetUpSRL;
ActivateClient;
repeat
repeat OpenChest;
until(FindChatBoxText('reach', 8, clBlack));
OpenGate;
until(False);
end.