Take a look in the config/consoles.cfg file. In amongst the commands are these:
Code:
Commands
{
CMD 1 shutdown Shutdown in 6 minutes
CMD 2 shutdown Shutdown in 12 minutes
CMD 3 shutdown Shutdown in 18 minutes
CMD 4 shutdown Shutdown in 24 minutes
CMD 5 shutdown Shutdown in 30 minutes
CMD 6 shutdown Shutdown in 36 minutes
CMD 7 shutdown Shutdown in 42 minutes
CMD 8 shutdown Shutdown in 48 minutes
CMD 9 shutdown Shutdown in 54 minutes
CMD 0 shutdown Shutdown in 60 minutes
}
Then write a script in scripts/console to do the shutdown called shutdown.src. The following is an example and doesn't do exactly what you want but it's a good start. (This is either from an old distro or the WorldOfDreams scripts, not sure which:)
Code:
use uo;
use os;
use util;
include "include/clock";
program console_shutdown(cmd)
cmd := CInt(cmd);
var basetime;
var nexttime;
var i;
case ( cmd )
0: basetime := 60;
1: basetime := 6;
2: basetime := 12;
3: basetime := 18;
4: basetime := 24;
5: basetime := 30;
6: basetime := 36;
7: basetime := 42;
8: basetime := 48;
9: basetime := 54;
endcase
for ( i := 1; i <= 3; i += 1 )
nexttime := basetime - (( basetime / 3) * (i - 1));
print("System Message: " + nexttime + " minutes to shutdown!");
foreach onlinechr in EnumerateOnlineCharacters()
SendSysMessage(onlinechr, "System Message: " + nexttime + " minutes to shutdown!", 3, 38);
endforeach
sleep(60 * basetime / 3);
endfor
Shutdown();
endprogram
I find I don't use the console though. For admin purposes I find it more convenient to use the internal pol webserver and manage it from there.