SRL Archive - RS3 Help

System time function?


Incurable

2014-10-12 23:38:13

Hi,

I want to get the current system time in a format that can be used to take a break when the system time is equal to a certain time to simulate realistic human sleep in an extended script run. For example, the current system time is 10:00pm so the script takes a 6-8 hour sleeping break, then adds an additional period of time (say 30-60 minutes) for the usual morning routine of most humans.

I know that you can simulate sleep via a long break after a long amount of time, but I'd like to simulate it based on the users time-zone, not just how long the script has been running. Realistically, a player isn't going to play for 8 hours at 2:00am before taking a 6 hour break and coming back online at 4:00pm.

A brief forum search didn't return anything that I found useful, though I may have been searching for the wrong things.

Cheers.

TomTuff

2014-10-12 23:46:48

function theTime(): string;

in time.simba in SRL

Olly

2014-10-12 23:47:10

Writeln(FormatDateTime('tt', Time)); 

Incurable

2014-10-13 00:21:06

From: TomTuff
function theTime(): string;

in time.simba in SRL

From: Olly
Writeln(FormatDateTime('tt', Time)); 


Oops. I don't know why I didn't think to search the documentation before posting, lol.

Perfect, thanks guys!