Of course! The system I had in place decides to do some random things. It was working perfectly, and would only break after waiting a certain amount of time. However, all of a sudden, it decides to bug up on me and just goes to sleep once it logs in! I have no clue what's going on, and have tried many things once again. I can't seem to find the issue!
Simba Code:
program DPP;
{$DEFINE SMART}
{$i srl\srl.scar}
{$i reflection\reflection.simba}
{$i srl/srl/misc/PaintSmart.scar}
const
WORLD = 32;
MEMBERS = false;
SIGNED = true;
var
Break: Integer;
MyStatus: String;
Location: TStringArray;
//Proggy Vars
var
Item, ExpGain: Integer;
procedure DeclarePlayers;
begin
HowManyPlayers := 1; //How many players in the script.
CurrentPlayer := 0; //Current player in the Players array.
NumberOfPlayers(HowManyPlayers); //Don't change.
with Players[0] do
begin
Name := ''; {Username}
Pass := ''; {Password}
Active := True; {Use This Player?}
Integers[0] := 40; //How long until you sleep (in minutes)
Strings[0] := ''; //What skill do you want it to check?
Booleans[0] := False; //Using -?
end;
end;
Procedure AntiBan;
var
c: Integer;
begin
MyStatus := 'Antiban';
c := random(500);
if (c = 100) or (c = 500) then
case random(3) of
0:
RandomMovement;
1:
PickUpMouse;
2:
HoverSkill(Players, False);
end;
end;
Procedure Randoms;
begin
r_FindRandoms;
Writeln('Scanned for randoms.');
end;
Function DetectBank: Boolean;
var
Booth: TRSObject;
begin
if not(LoggedIn) then
Exit;
Booth := GetObjectByID(20325, 0, 10);
Result := (Booth = NULL_RSOBJECT);
if (Result) then
Writeln('FAILED TO FIND BANK BOOTH!')
else
begin
Writeln('Found bank booth!');
end;
end;
Function DetectLocation: Boolean;
begin
if not(LoggedIn) then
Exit;
if (DistanceFrom(Tile(3288, 2802)) <= 5) then
Location := ['Pyramid', 'Entering Pyramid'];
if ((DistanceFrom(Tile(2800, 5168)) <= 5) and (DetectBank)) then
Location := ['Bank', 'Walking to pyramid'];
Result := (Length(Location) > 0);
end;
procedure ClearSmart;
var
drawing : TBitmap;
begin
drawing := TBitmap.Create;
drawing.canvas.handle := SmartGetDebugDC;
ClearRSCanvas(drawing.canvas);
try
FreeBitmap(drawing);
except end;
end;
Procedure ScriptSetup;
var
Lvl: Integer;
begin
Writeln('Setting script up!');
Lvl := R_GetSkillLevel('Thieving');
if (Lvl > 20) then
begin
Writeln('Checking current location..');
if (DetectLocation) then
Writeln('Checked location!');
end;
end;
procedure SMARTProggy;
begin
ClearSmart;
SMART_DrawText(95, 460, 'FriendChars', 'Our Script', clRed);
SMART_DrawText(400, 305, 'CharsNPC', MyStatus, clGreen);
end;
Procedure Proggy;
var
Time: Integer;
begin
Writeln('Our Script.');
Writeln('We get ' + ToStr((GetTimeRunning/3600000) * ExpGain) + ' xp per hour');
end;
Procedure TakeBreak;
var
c: Integer;
begin
MyStatus := 'Sleeping';
SMARTProggy;
Writeln('Sleeping...');
case random(2) of
0:
LogOut;
1:
ExitToLobby;
end;
c := RandomRange(60000, 7200000); //1 minute to 120 minutes
Writeln('Sleeping for ' + IntToStr(c/60000) + ' minutes.');
Wait(c);
Writeln('Sleep over! Logging in.');
MyStatus := 'Logging in';
SMARTProggy;
LogInPlayer;
end;
begin
AddOnTerminate('Proggy');
Smart_Members := MEMBERS;
Smart_Server := WORLD;
Smart_Signed := SIGNED;
SetupSRL;
SetupReflectionEx(true);
DeclarePlayers;
LoginPlayer;
ScriptSetup;
MarkTime(Break);
ClearDebug;
SMARTProggy;
ExpGain := 20;//only a test
repeat
if TimeFromMark(Break) > (Players[CurrentPlayer].Integers[0]+random(20) * 60000) then
TakeBreak;
until(AllPlayersInActive);
end.