I got it to work now, but it constantly clicks the toggle XP button, why?
Also it doesn't print either Writeln :|
Begin
Repeat
CrackSafe;
If FindChatBoxText('ilp an', 8, 0) Then
Writeln('Failed to open safe trying again');
Start := GetXPBarTotal;
Ending := GetXPBarTotal;
If Ending > Start Then
Writeln('Opened the safe');
Until(False);
End;
Here is the whole script *put together in an hour maybe?* Only intended to be a lite version as it was requested but has potential to be abused for goldfarming from what I've read.
program WallCracker;
{.include SRL\SRL.scar}
Var
x, y: Integer;
Procedure Antiban;
Begin
Case Random(255) Of
0: HoverSkill('Theieving', False);
1: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500)); End;
2: ExamineInv;
3: RandomAngle(1);
4: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv); End;
5: HoverSkill('random', False);
End;
End;
function FindSafe1(var fx, fy: Integer): Boolean;
var
arP: TPointArray;
ararP: T2DPointArray;
tmpCTS, i, arL: Integer;
P: TPoint;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.07, 0.82);
if not(FindColorsTolerance(arP, 4016989, MSX1, MSY1, MSX2, MSY2, 10)) then
begin
Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
SortTPAFrom(arP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arP, 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('rack')) 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;
Procedure FindSafe2;
Var
x, y, SafeDTM: Integer;
Begin
SafeDTM := DTMFromString('mwQAAAHic42RgYFBnZGAQAmI7ILYFYkEoBrE1gFgPiBWAmBWIWYBYF4gNgVgGiOWg4gZAPHv+IobyRH+GCB9nBi8bQ4YoTxuG1CBnhkA3OwZ/BxMGZytjhv9A+/gJYEYiMBwAAHq9DL0=');
If FindDTM(SafeDTM, x, y, MSX1, MSY1, MSX2, MSY2) Then
Writeln('Found safe DTM');
End;
Procedure CrackSafe;
Begin
If(Not(LoggedIn))Then Exit;
If (Not(FindSafe1(x, y))) Then
FindSafe2;
Mouse(x, y, 5, 5, True);
Writeln('Found Safe1');
While IsMoving Do
AntiBan;
Wait(3000+Random(250));
GetChatBoxText(8, 0);
End;
Procedure MainLoop;
Var Start, Ending: Integer;
Begin
Repeat
CrackSafe;
If FindChatBoxText('ilp an', 8, 0) Then
Writeln('Failed to open safe trying again');
Start := GetXPBarTotal;
Ending := GetXPBarTotal;
If Ending > Start Then
Writeln('Opned the safe');
Until(False);
End;
begin
SetupSRL;
MainLoop;
end.