None of them are the smartest solutions. So, a few months back, I realised that the simplest solution was to rez a prim (in this case in the Z&A workshop), throw it on the "gadget self" and have it detect when the sim is back and IM me. The code is simple enough:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
////////////////////////////////////////////////////////////////////// | |
// Sim Restart Notifier -- By Antony Fairport | |
// | |
// IMs you when the sim it is located on restarts. Handy during | |
// rolling restarts when you've had to run away and want to be told | |
// as soon as it's back up. | |
// | |
// Revision history: | |
// ------------------------------------------------------------ | |
// | |
// 2011-05-31 | |
// First version. | |
string g_sLastRestart = ""; | |
////////////////////////////////////////////////////////////////////// | |
// Format a llGetTimestamp() | |
string FormatTime( string sTime ) | |
{ | |
list l = llParseString2List( sTime, [ "T", "." ], [] ); | |
return llList2String( l, 0 ) + " " + llList2String( l, 1 ) + " UTC"; | |
} | |
////////////////////////////////////////////////////////////////////// | |
// Sim Restart Notifier -- Antony Fairport | |
default | |
{ | |
////////////////////////////////////////////////////////////////// | |
// React to a touch. | |
touch_start( integer num_detected ) | |
{ | |
// If we don't have a last restart time... | |
if ( g_sLastRestart == "" ) | |
{ | |
// ...so say. | |
llWhisper( 0, "No restart has been recorded yet." ); | |
} | |
else | |
{ | |
// Otherwise say what the last recorded restart time is. | |
llWhisper( 0, "Last restart was " + g_sLastRestart ); | |
} | |
} | |
////////////////////////////////////////////////////////////////// | |
// React to changes. | |
changed( integer change ) | |
{ | |
// If the region has started... | |
if ( change & CHANGED_REGION_START ) | |
{ | |
// ...IM me to let me know it's back. | |
llInstantMessage( llGetOwner(), llGetRegionName() + " has restarted." ); | |
g_sLastRestart = FormatTime( llGetTimestamp() ); | |
} | |
} | |
} |
The handy thing about this is that I have offline IMs going to email so if the sim gets a restart when I'm not in-world I'll also get to know about it.
No comments:
Post a Comment