!t:: AlarmTimeStamp=99990909001000 CountDown_start: IfWinExist,Hoe Timer! { Return } DateTimeStamp=99990909000000 Flag_SoundPlaying:=0 Gui 73: -SysMenu +ToolWindow +AlwaysOnTop Gui 73: Margin, 5, 5 Gui 73: Font, s20 Gui 73: Add, Text, w154 h50 0x6 ; This adds a white back ground for the next control Gui 73: Add, Text, cred xp yp wp hp 0x201 vTime +BackGroundTrans +Border, 00:00:00 ; 0x201 center text horizontally as well as vetically Gui 73: Font, s8 Normal Gui 73: Add, Button, y+5 w75 h23 vStartStop gStartStop, Start Gui 73: Add, Button, x+2 wp hp vReset gReset, Reset Gui 73: Show, x1000 y350, % " Hoe Timer! " GuiControl 73:, StartStop, Stop SetTimer, Count,990 return StartStop: GuiControlGet, StartStop If ( StartStop = "Start" ) { GuiControl 73:, StartStop, Stop SetTimer, Count,990 } Else { GuiControl 73:, StartStop, Start SetTimer, Count, Off SetTimer, playsound, Off GuiControl 73:, PauseResume, Pause DateTimeStamp = 99990909000000 SoundPlay,nonono Flag_SoundPlaying:=0 } Return Reset: GuiControl 73:, Time, 00:00:00 DateTimeStamp = 99990909000000 SetTimer, playsound, Off SoundPlay,nonono Flag_SoundPlaying:=0 Return Count: DateTimeStamp += 1, Seconds FormatTime, nTime, %DateTimeStamp%, HH:mm:ss GuiControlGet, Time If ( Time nTime ) ; Update the control only when needed GuiControl 73:, Time, %nTime% ; this avoids flicker If (DateTimeStamp >= AlarmTimeStamp And Flag_SoundPlaying=0) { Flag_SoundPlaying:=1 Soundplay C:WindoWSsystem32LoopyMusic.wav SetTimer,playsound,5000 } Return 73GuiEscape: 73GuiClose: SetTimer, Count, Off SetTimer, playsound, Off SoundPlay,nonono Gui 73:Destroy Return playsound: Soundplay Z:KinizzzkitAlarm.wav Return