; ; DelayOff ; -------- ; Set delayed power off ; Double left click icon to unload ; ;report on ;step on priority low :init setvar F,0 puttray DelayOff: idle,dodate|unload,Q,LD|RC :loop ifvar F,0,goidle suspend %E,%D poweroff quit ;msgbox DelayOff,Poweroff,0 :goidle idle :dodate wait DelayOff,1 iferror date1 close DelayOff :date1 ifvar F,0,godate msgbox,DelayOff,Currently set to turn off at %E on %D|Do you wish to cancel ?,4,C ifmsg NO,loop setvar F,0 modtray DelayOff: idle,dodate|unload,Q,LD|RC goto loop :godate getdate H gettime G parstime %G,A,B,C addvar A,2 setvar G,%A:%B:%C iflvar A,24,indate subvar A,24 setvar G,%A:%B:%C parsdate %H,A,B,C addvar A,1 setvar H,%A/%B/%C :indate DateBox DelayOff,Enter the date to turn off PC,D,%H ifmsg CANCEL,loop TimeBox DelayOff,Enter the time to turn off PC,E,%G ifmsg CANCEL,loop setvar F,1 modtray DelayOff: set for %G on %H,dodate|unload,X,LD|RC goto loop :unload msgbox DelayOff,Unload DelayOff ?,4,C ifmsg NO,loop :end