|
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
|
02-01-2007 06:20
Hello there,
I heard the SIM reset doesn't cause our scripts reset. But I want them to reset when the SIM is reset. Is there any way how to know if the SIM was reset? Thanks.
_____________________
 Seagel Neville 
|
|
Gaius Goodliffe
Dreamsmith
Join date: 15 Jan 2006
Posts: 116
|
02-01-2007 12:49
llGetTimeOfDay() normally returns the number of seconds since sim midnight. However, after a restart, it returns the number of seconds since the restart. Now, sim midnight comes every four hours on a quite predictable schedule -- it's trivial to determine whether llGetTimeOfDay is returning normally or returning numbers that are out of sync, indicating a recent restart. Somewhat less trivial but still quite doable would be to detect any rollover in the llGetTimeOfDay value (i.e. detect that the current return value is less than the previous one). In theory, if you do both of these together and you can detect whenever the clock resets for a reason other than sim midnight, i.e., you can detect a restart.
It should be noted that this technique would fail to detect a restart that happened to occur right at sim midnight.
|
|
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
|
02-01-2007 14:51
Thank you. I got it. 
_____________________
 Seagel Neville 
|