Something like this: if you don't get it, i will explain in depth.
SCAR Code:
program New;
{.include SRL\SRL.scar}
const Shutdown = True;
function OutOfClay: Boolean;
var
x, y, bmp: Integer;
begin
Result := FindBitmap(bmp, x, y);//FindBitmap or something..
end;
procedure ShutDownPC;
begin
if ShutDown then // Set as a const.
begin
WriteLn('');
WriteLn('Shutting down your PC.');
WriteLn('To stop it once it starts counting, go to Start, Run, then type ''shutdown -a''');
Wait(2000);
KeyDown(92);
Wait(200);
KeyDown(82);
Wait(200);
KeyUp(82);
Wait(200);
KeyUp(92);
Wait(2000);
SendKeys('shutdown -s -f -t 60 -c "Shutting down PC '+TimeRunning+'"');
Wait(2000);
KeyDown(13);
Wait(200);
KeyUp(13);
Wait(160000);
TerminateScript;
end;
end;
procedure DoClay;
begin
//procedures etc..
if OutOfClay then
ShutDownPC;
end;
begin
SetupSRL;
DoClay;
end.