Boreas posted this on my RM Runner thread so you should credit him for it.
SCAR Code:
procedure Shutdown;
begin
KeyDown(92);
Wait(200);
KeyDown(82);
Wait(200);
KeyUp(82);
Wait(200);
KeyUp(92);
Wait(200);
SendKeys('shutdown -s -f -t 00' + Chr(13));
end;
All this does is go into 'run' on the start menu and types in the windows command to shut down. It should stop any running scripts as well.
So as a script:
SCAR Code:
program New;
{.include SRL\SRL.scar}
var Timer: integer;
const TimeToWait = 60; //Time in minutes.
procedure Shutdown;
begin
KeyDown(92);
Wait(200);
KeyDown(82);
Wait(200);
KeyUp(82);
Wait(200);
KeyUp(92);
Wait(200);
SendKeys('shutdown -s -f -t 00' + Chr(13));
end;
begin
MarkTime(Timer);
repeat
if (TimeFromMark(Timer) > TimeToWait * 60 * 1000) then
Shutdown;
Wait(1000);
until(false);
end.