当前位置:网站首页>Realization of alarm clock with AHK

Realization of alarm clock with AHK

2022-06-24 11:26:00 fqbqrr

#SingleInstance force ; Prevent multiple runs 
If A_Hour Between 22 and 24 ;22 Point to the 24 spot 
{
    
     Reminder ("222222"," sleep !") ; Set the alarm clock 
}

 Reminder ( timing , Reminder content )
  {
    
    StringLeft, The current date ,A_Now,8
    ;A_Now Format : year 4 position , month 2 position , Japan 2 position , when 2 position , branch 2 position , second 2 position , common 14 position . Take its left 8 position , The current date .
     Reminder moment  = % The current date %% timing % ; Add the date before the time above , And A_Now Uniform format 
     Reminder moment  -= %A_Now%,Seconds ; Subtract the time to run this script from the set time , Unit second 
    Sleep  Reminder moment *1000 ; Convert this time difference into milliseconds , be used for Sleep
    MsgBox % Reminder content % ; Pop up a reminder window 
    Return
  }

原网站

版权声明
本文为[fqbqrr]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/175/202206241016536449.html