Sound alert for AddVerticalLine function?

aikex228

New member
Is it possible to set a sound alert for notification at 7:00 am, 9:00 am, etc. ?
Code:
script IsTime {
    input time = 0000;
    plot IsTime = SecondsFromTime(time)[1] < 0 and SecondsFromTime(time) >= 0;
}

input time1 = 0700;
input time2 = 0930;
input time3 = 1200;
input time4 = 1400;

DefineGlobalColor("Time1", GetColor(1));
DefineGlobalColor("Time2", GetColor(1));
DefineGlobalColor("Time3", GetColor(5));
DefineGlobalColor("Time4", GetColor(5));

AddVerticalLine(IsTime(time1), Floor(time1 / 100) + ":" + AsText(time1 % 100, "%02.0f"), GlobalColor("Time1"));
AddVerticalLine(IsTime(time2), Floor(time2 / 100) + ":" + AsText(time2 % 100, "%02.0f"), GlobalColor("Time2"));
AddVerticalLine(IsTime(time3), Floor(time3 / 100) + ":" + AsText(time3 % 100, "%02.0f"), GlobalColor("Time3"));
AddVerticalLine(IsTime(time4), Floor(time4 / 100) + ":" + AsText(time4 % 100, "%02.0f"), GlobalColor("Time4"));
 

XeoNoX

Well-known member
VIP
Code:
def Is1400 = SecondsFromTime(1400)[1] < 0 and SecondsFromTime(1400) >= 0;
Alert(is1400 is true, "Its 1400 Time!", Alert.Bar, Sound.Chimes);

def Is1200 = SecondsFromTime(1200)[1] < 0 and SecondsFromTime(1200) >= 0;
Alert(is1200 is true, "Its 1200 Time!", Alert.Bar, Sound.Chimes);

repeat the code for you time selection with and change the syntax accordingly
 

Similar threads

Top