茶兔的自動關機很好用啊,如果時間到了沒反應可能是你茶兔的設定里沒有把自動關機打開吧,去yaya_variable.cfg里看看shutdowntimeswitch的值是0的話就會無視自動關機的預約了。
茶兔的自動關機除了包括設定關機時間的函式OnSetShutdown和OnSetShutdownComplete(在aya_etc.dic里)外,還包括OnMinuteChange函式中的一部分(在aya_aitalk.dic里)
if shutdowntime[0] == hour && shutdowntime[1] == minute
{
if shutdowntimeswitch == "1"
{
SAVEVAR();
"\0\s[2]30秒後將進行關機。如果要取消的話,請雙擊對話框。\_w[30000]"
--
_i = FUNCTIONEX("saori\KI.dll","ExitWindows","ShutDown");
}
}
-------------------------
如果還是要用windows內建的功能的話,可以寫一個執行console命令的函式
ConsoleEx
{
_file = "test.bat";
if FOPEN(_file,"w") {
FWRITE(_file,"@echo off");
FWRITE(_file,_argv[0]);
}
FCLOSE(_file);
"\![open,file,%(_file)]"
}
使用時可以在自己寫的函式里這樣呼叫
ConsoleEx("shutdown.exe -i")
ConsoleEx("shutdown.exe -a")
或者
_sec = 3600
ConsoleEx("shutdown.exe -s -t %(_sec)")
之類的
[ 本帖最後由 forjanezz 於 2009-9-14 12:53 編輯 ]