Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions osrs/antiban/antiban.simba
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,24 @@ begin
Result := FormatMilliseconds(Max(0, Round(task.Next - GetTimeRunning())), fmt);
end;


(*
## Antiban.MsUntilBreak
```pascal
function TAntiban.MsUntilBreak(): Double;
```
Returns the number of milliseconds until the next scheduled break.
If no breaks are scheduled, returns `High(Int32) / (2,147,483,647)`.
*)
function TAntiban.MsUntilBreak(): Double;
begin
if Length(Self.Breaks) > 0 then
Result := Self.Breaks[0].Next - GetTimeRunning()
else
Result := High(Int32);
end;


(*
## Antiban.TimeUntilSleep
```pascal
Expand All @@ -536,6 +554,24 @@ begin
Result := FormatMilliseconds(Max(0, Round(task.Next - GetTimeRunning())), fmt);
end;


(*
## Antiban.MsUntilSleep
```pascal
function TAntiban.MsUntilSleep(): Double;
```
Returns the number of milliseconds until the next scheduled sleep.
If no sleeps are scheduled, returns `High(Int32) / (2,147,483,647)`.
*)
function TAntiban.MsUntilSleep(): Double;
begin
if Length(Self.Sleeps) > 0 then
Result := Self.Sleeps[0].Next - GetTimeRunning()
else
Result := High(Int32);
end;


(*
## Antiban.SimulateBreaks
```pascal
Expand Down