Try this one:
Code:
Gui, Add, DateTime, 1 vMyStartTime , 'DayStartTime:' HH:mm:ss
Gui, Add, DateTime, 1 vMystopTime , 'DayStopTime:' HH:mm:ss
Gui, add, text,section, Day-Volume [`%]
Gui, add, text,, Night-Volume [`%]
Gui, add, edit,ys vDayVolume, 80
Gui, add, edit, vNightVolume, 20
Gui, add, button, section gStart, Start
gui, show
return
;********this part of the skript starts by pressig the button. Read about gui“s and g-label**************
Start:
Gui, submit, nohide ; get the info from the gui, and don`t hide it
Stringright, MyStartTime, MyStartTime, 6 ;We get a Timecode with the Format YYYYMMDDHH24MISS
Stringright, MyStopTime, MyStopTime, 6 ; back from the 2 DateTimecontrols, wie need to drop YYYYMMDD
; Stringright gets only the 6 chars from thr right side
setTimer, CheckVolume, 1000 ; Start the Part CheckVolume each second once
return
;*********this is the next part, started each second by setTimer, CheckVolume, 1000*****************
CheckVolume:
Stringright, Acual_Time, A_now, 6 ; again a long timecode, we have to shorten
; the System_variable A_now contains the Actual time
if (MyStartTime < Acual_Time and Acual_Time < MyStopTime)
{
SoundSet, %DayVolume% ; Set the master volume to vDayVolume%
tooltip, high Volume
}
else
{
SoundSet, %NightVolume% ; Set the master volume to vNightVolume%
tooltip, low Volume
}
return
;***********************************************************************************************************
you only have to adjust the math a bit