Simba Code:
program ReadText;
{$i srl/srl.simba}
var
X, Y, ThroughDTM: Integer;
Procedure LoadDTM;
begin
ThroughDTM := DTMFromString('mbQAAAHicY2VgYFjAzMBwAogbgbgBiE8C8TwmBoZpULwEiq2TRRgYmZgZ8sJsGMrCLRguXrzIgA0wYsFgAAA+hQuY');
end;
Function OpenChest:Boolean;
Var
X, Y: Integer;
begin
X:=MSCX;
Y:=MSCY;
if FindObjTPA(X, Y, 7442344, 5, 1, 4, 9, 20, ['ract']) then
begin;
Writeln('We found the chest');
GetMousePos(X, Y);
Case Random(4) of
0: begin;
Mouse(X, Y, 5, 5, True);
Writeln('We clicked the chest');
Wait(8000+random(1000));
end;
1: begin;
Mouse(X, Y, 5, 5, True);
Writeln('We clicked the chest');
Wait(8000+random(1000));
end;
2: begin;
Mouse(X, Y, 5, 5, True);
Writeln('We clicked the chest');
Wait(8000+random(1000));
end;
3: begin;
Mouse(X, Y, 5, 5, False);
WaitOption('Open', 300);
Writeln('We clicked the chest');
Wait(8000+random(1000));
end;
end;
end;
end;
procedure GreenBox;
Var
X, Y:Integer;
begin
if FindColorSpiralTolerance(X, Y, 1137204, 220, 457, 298, 479, 20) then
begin
MMouse(x, y, 5, 5);
Mouse(x, y, 0, 0, True);
Wait(1500+random(1000));
end;
end;
function CheckFail:Boolean;
Var
X, Y: Integer;
begin
if(FindChatBoxText('fail', 8, clBlack)) then
begin;
Writeln('We failed to open the chest, trying again');
FindObjTPA(X, Y, 7442344, 5, 1, 4, 9, 20, ['ract']);
GetMousePos(X, Y);
end;
if(FindChatBoxText('fail', 8, clBlack)) then
Case Random(2) of
0: begin;
Mouse(X, Y, 5, 5, True);
Writeln('We clicked the chest');
Wait(8000+random(1000));
end;
1: begin;
Mouse(X, Y, 5, 5, False);
WaitOption('Open', 300);
Writeln('We clicked the chest');
Wait(8000+random(1000));
end;
end;
end;
begin
ActivateClient;
SetUpSRL;
repeat
OpenChest;
LoadDTM;
repeat
CheckFail;
until(FindChatBoxText('open', 7, clBlack) or FindDTM(ThroughDTM, x, y, MCX1, MCY1, MCX2, MCY2));
until(false)
FreeDTM(ThroughDTM);
end.