mbt masai
 
Welcome !
         

                                
After experiencing a lot of down time, We decided to move this site to CrystalTech.com. CrystalTech.com is powered by only the finest Windows servers providing the best performance, reliability, and value anywhere.

 Alarm Clock

Author Message
tommyboy180

  • Total Posts : 7
  • Scores: 0
  • Reward points : 0
  • Joined: 2/23/2010
  • Status: offline
Alarm Clock Tuesday, February 23, 2010 4:50 PM (permalink)
0
This is a simple Alarm Clock
 
Uses HTA
 
 <HTML> <HEAD> 
     <TITLE>Alarm Clock</TITLE>
     <HTA:APPLICATION     
     Application ID = "Alarm"     
     APPLICATIONNAME = "Alarm"     
     BORDER = "Thick"     
     BORDERSTYLE = "Complex"     
     CAPTION = "Yes"   
     CONTEXTMENU = "no"     
     ICON = ""     
     INNERBORDER = "yes"     
     MAXIMIZEBUTTON = "no"     
     MINIMIZEBUTTON = "no"     
     NAVIGABLE = "Yes"     
     SCROLL = "No"     
     SCROLLFLAT = "Yes"     
     SELECTION = "No"     
     SHOWINTASKBAR = "Yes"     
     SINGLEINSTANCE = "Yes"     
     SYSMENU = "yes"     
     VERSION = "1.0"     
     WINDOWSTATE = "Normal"     
     /> 
     </HEAD> 
     <!-- GradientType=0 - Top to Bottom, GradientType=1 - Left to Right --> 
     <BODY STYLE="font:9pt arial; color:#000000;">
     <!--filter:progid:DXImageTransform.Microsoft.Gradient (GradientType=0, StartColorStr='#ddd7ff', EndColorStr='#7670ff')">-->
     <SCRIPT LANGUAGE="VBScript"> 
     Dim sTime
     Dim TimerID
     Dim clocktime     Sub Window_OnLoad
     'On Error Resume Next
      document.body.bgColor="lightblue"
      window.resizeTo 370,300
      myVBSClock
      iTimerID = window.setInterval("myVBSClock", 1200)
     End Sub     Sub myVBSClock
     On Error Resume Next
           'myClock.innerText = now()
      clocktime = now()
          myClock.innerText = now()
      Instructions.InnerHTML = "Enter the Time for the alarm in the form of " & FormatDateTime(clocktime,4)
     End sub     Sub SubmitTime
     'On Error Resume Next
      'sleep = 10
      sTime = document.all("inputTime").Value 
      SubmitArea.innerHTML = "<br>Alarm is Set for <b>" & sTime & "</b>"
      
      TimerID = window.setInterval("TimeLoop",5000)
     End Sub     Sub TimeLoop
      alarmtime = FormatDateTime(clocktime,4)
      
      window.ClearInterval(TimerID) 
      
      If alarmtime = sTime Then
       Alarm
      Else 
       SubmitTime
      End If
     End Sub     Sub Alarm
     On Error Resume Next
      'MsgBox "Alarm Ran at " & FormatDateTime(clocktime,4)
      strSoundFile = "C:\Windows\Media\Notify.wav"
       Set objShell = CreateObject("Wscript.Shell")
       strCommand = "sndrec /play /close " & chr(34) & strSoundFile & chr(34)
        objShell.Run strCommand, 0, True
      MainArea.InnerHTML = "<center><h1>" & stime & "<br><br>Alarm!</h1>" & "<input type=button value=Exit onClick=btn_exit>"
      VarArea.InnerHTML = ""
      SubmitArea.InnerHTML = ""
      myClock.innerText = ""
      
      AlarmVisual_red
      
     End Sub     Sub AlarmVisual_red
      strComputer = "."
             Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
             Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor")
             For Each objItem in colItems
                 intHorizontal = objItem.ScreenWidth
                 intVertical = objItem.ScreenHeight
             Next
             intLeft = (intHorizontal - 800) / 2
             intTop = (intVertical - 600) / 2
             window.resizeTo 800,600
             window.moveTo intLeft, intTop
      
      document.body.bgColor="red"
      window.ClearInterval(TimerID)
      TimerID = window.setInterval("AlarmVisual_white",1200)
     End Sub     Sub AlarmVisual_white
      document.body.bgColor="white"
      window.ClearInterval(TimerID)
      TimerID = window.setInterval("AlarmVisual_yellow",1200)
     End Sub     Sub AlarmVisual_yellow
      document.body.bgColor="yellow"
      window.ClearInterval(TimerID)
      TimerID = window.setInterval("AlarmVisual_orange",1200)
     End Sub     Sub AlarmVisual_orange
      document.body.bgColor="orange"
      window.ClearInterval(TimerID)
      TimerID = window.setInterval("AlarmVisual_red",1200)
     End Sub     Sub btn_exit
      Window.close()
     End Sub             
     </SCRIPT> 
     <HTML><HEAD><TITLE>New Page</TITLE>
     <META http-equiv=Content-Type content="text/html; charset=windows-1252">
     <META content="MSHTML 6.00.6002.18071" name=GENERATOR></HEAD>
     <BODY>
     <P align=center>Alarm Clock - SrA Schaefer 2/23/2010</P>
     <Span Id = "MainArea">
     <P align=left><PRE ID=myClock>  </PRE></P>
     <P align=left>     <INPUT style="WIDTH: 49px; HEIGHT: 22px" maxLength=5 value="" name=inputTime> <Span Id = "instructions"></Span>
     <br/><br/>
     <INPUT type=submit value=Submit name=tsubmit onClick=SubmitTime>     </P>
     </Span>
     <Span Id = "VarArea"></Span>
     <Span Id = "SubmitArea"</Span>
     <br/><br/><br/><br/>
     <br/><br/><br/><br/>
     <!--
     <h1> Table - Not in-use </h1>
     <TABLE cellSpacing=1 cellPadding=1 width="100%"  border=1>
     <TBODY>
     <TR>
     <TD><INPUT maxLength=5 value="" name=time1> Time 1</TD>
     <TD><INPUT maxLength=5 value="" name=time2> Time 2</TD>
     <TD><INPUT maxLength=5 value="" name=time3> Time 3</TD>
     <TD><INPUT maxLength=4 value="" name=time4> Time 4</TD></TR>
     <TR>
     <TD><INPUT maxLength=4 value="" name=time5> Time 5</TD>
     <TD><INPUT maxLength=4 value="" name=time6> Time 6</TD>
     <TD><INPUT maxLength=4 value="" name=time7> Time 7</TD>
     <TD><INPUT maxLength=4 value="" name=time8> Time 8</TD></TR>
     </TBODY>
     </TABLE>
     </P>
     <BR>
     <INPUT type=submit value=Submit name=submit>
     -->
     </BODY></HTML> 

 
-TomSchaefer.org
 
Updated Feb 23
<message edited by tommyboy180 on Tuesday, February 23, 2010 5:55 PM>
#1
    tommyboy180

    • Total Posts : 7
    • Scores: 0
    • Reward points : 0
    • Joined: 2/23/2010
    • Status: offline
    Re:Alarm Clock Saturday, February 27, 2010 6:28 PM (permalink)
    0
    Multiple times. (not update but alternate script)
     
         <HTML> <HEAD> 
         <TITLE>Alarm Clock</TITLE>
         <HTA:APPLICATION     
         Application ID = "Alarm"     
         APPLICATIONNAME = "Alarm"     
         BORDER = "Thick"     
         BORDERSTYLE = "Complex"     
         CAPTION = "Yes"   
         CONTEXTMENU = "no"     
         ICON = ""     
         INNERBORDER = "yes"     
         MAXIMIZEBUTTON = "yes"     
         MINIMIZEBUTTON = "no"     
         NAVIGABLE = "Yes"     
         SCROLL = "no"     
         SCROLLFLAT = "Yes"     
         SELECTION = "No"     
         SHOWINTASKBAR = "Yes"     
         SINGLEINSTANCE = "no"     
         SYSMENU = "yes"     
         VERSION = "1.0"     
         WINDOWSTATE = "Normal"     
         /> 
         </HEAD> 
         <!-- GradientType=0 - Top to Bottom, GradientType=1 - Left to Right --> 
         <BODY STYLE="font:9pt arial; color:#000000;">
         <!--filter:progid:DXImageTransform.Microsoft.Gradient (GradientType=0, StartColorStr='#ddd7ff', EndColorStr='#7670ff')">-->
         <SCRIPT LANGUAGE="VBScript"> 
         Dim sTime
         Dim TimerID
         Dim clocktime
         Dim time2, time3, time4, time5, time6, time7
         Dim TimeComment, time2comment, time3comment, time4comment
         Dim time5comment, time6comment, time7comment, time1comment
         Dim alarmbit     Sub Window_OnLoad
         On Error Resume Next
          document.body.bgColor="lightblue"
          window.resizeTo 450,430
          myVBSClock
          iTimerID = window.setInterval("myVBSClock", 1200)
         End Sub     Sub myVBSClock
         On Error Resume Next
               'myClock.innerText = now()
          clocktime = now()
              myClock.innerText = now()
          Instructions.InnerHTML = "Enter the Time for the alarm in the form of " & FormatDateTime(clocktime,4)
         End sub     Sub SubmitTime
         On Error Resume Next
          'sleep = 5
          sTime = document.all("inputTime").Value
          time2 = document.all("Ttime2").Value
          time3 = document.all("Ttime3").Value
          time4 = document.all("Ttime4").Value
          time5 = document.all("Ttime5").Value
          time6 = document.all("Ttime6").Value
          time7 = document.all("Ttime7").Value
          Time1Comment = document.all("inputTimeComment").Value
          Time2Comment = document.all("Time2Comment").Value
          Time3Comment = document.all("Time3Comment").Value
          Time4Comment = document.all("Time4Comment").Value
          Time5Comment = document.all("Time5Comment").Value
          Time6Comment = document.all("Time6Comment").Value
          Time7Comment = document.all("Time7Comment").Value
           SubmitArea.innerHTML = "<br>Alarm is Set for <b>" & sTime & ", " & time2 & ", " & time3 & ", " & time4 & ", " & time5 & ", " & time6 & ", " & time7 & "</b>"
          
          TimerID = window.setInterval("TimeLoop",5000)
         End Sub     Sub TimeLoop
         On Error Resume Next
          alarmtime = FormatDateTime(clocktime,4)
          
          window.ClearInterval(TimerID) 
          
          If alarmtime = sTime Then
           TimeComment = time1comment
           sTime = ""
           alarmbit = "1"
           Alarm
            ElseIf alarmtime = time2 Then
           TimeComment = time2comment
           time2 = ""
           alarmbit = "1"
           Alarm
           ElseIf alarmtime = time3 Then
           TimeComment = time3comment
           time3 = ""
           alarmbit = "1"
           Alarm
           ElseIf alarmtime = time4 Then
           TimeComment = time4comment
           time4 = ""
           alarmbit = "1"
           Alarm
           ElseIf alarmtime = time5 Then
           TimeComment = time5comment
           time5 = ""
           alarmbit = "1"
           Alarm
           ElseIf alarmtime = time6 Then
           TimeComment = time6comment
           time6 = ""
           alarmbit = "1"
           Alarm
           ElseIf alarmtime = time7 Then
           TimeComment = time7comment
           time7 = ""
           alarmbit = "1"
           Alarm
           Else       SubmitTime
          End If
         End Sub     Sub Alarm
         On Error Resume Next
          'MsgBox "Alarm Ran at " & FormatDateTime(clocktime,4)
          strSoundFile = "C:\Windows\Media\Notify.wav"
           Set objShell = CreateObject("Wscript.Shell")
           strCommand = "sndrec /play /close " & chr(34) & strSoundFile & chr(34)
            objShell.Run strCommand, 0, True
          MainArea.InnerHTML = "<center><h1>" & clocktime & "<br><br>" & TimeComment & " Alarm!</h1>" & "<input type=button value=Acknowlege onClick=btn_ack>"
          VarArea.InnerHTML = ""
          SubmitArea.InnerHTML = ""
          myClock.innerText = ""
          
          AlarmVisual_red
          
         End Sub     Sub AlarmVisual_red
         On Error Resume Next
         If alarmbit = "1" Then
          strComputer = "."
                 Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
                 Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor")
                 For Each objItem in colItems
                     intHorizontal = objItem.ScreenWidth
                     intVertical = objItem.ScreenHeight
                 Next
                 intLeft = (intHorizontal - 800) / 2
                 intTop = (intVertical - 600) / 2
                 window.resizeTo 800,600
                 window.moveTo intLeft, intTop
          
          document.body.bgColor="red"
          window.ClearInterval(TimerID)
          TimerID = window.setInterval("AlarmVisual_white",1200)
         Else
          TimeLoop
         End If
         End Sub     Sub AlarmVisual_white
          document.body.bgColor="white"
          window.ClearInterval(TimerID)
          TimerID = window.setInterval("AlarmVisual_yellow",1200)
         End Sub     Sub AlarmVisual_yellow
          document.body.bgColor="yellow"
          window.ClearInterval(TimerID)
          TimerID = window.setInterval("AlarmVisual_orange",1200)
         End Sub     Sub AlarmVisual_orange
          document.body.bgColor="orange"
          window.ClearInterval(TimerID)
          TimerID = window.setInterval("AlarmVisual_red",1200)
         End Sub     Sub btn_exit
          Window.close()
         End Sub     Sub btn_ack
         On Error Resume Next
          alarmbit = "0"
          MainArea.InnerHTML = "Waiting for Next Alarm"
          document.body.bgColor="lightblue"
          window.resizeTo 450,430
          myClock.innerText = now()
         Instructions.InnerHTML = "Enter the Time for the alarm in the form of " & FormatDateTime(clocktime,4)
         SubmitArea.innerHTML = "<br>Alarm is Set for <b>" & sTime & ", " & time2 & ", " & time3 & ", " & time4 & ", " & time5 & ", " & time6 & ", " & time7 & "</b>"           End Sub             
         </SCRIPT> 
         <HTML><HEAD><TITLE>New Page</TITLE>
         <META http-equiv=Content-Type content="text/html; charset=windows-1252">
         <META content="MSHTML 6.00.6002.18071" name=GENERATOR></HEAD>
         <BODY>
         <P align=center>Alarm Clock - SrA Schaefer 2/27/2010</P>
         <Span Id = "MainArea">
         <P align=left><PRE ID=myClock>  </PRE></P>
         <P align=left>
         <Span Id = "instructions"></Span>
         <br><br>
         &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
         &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
         &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspComment Optional<br>
         Time1: <INPUT style="WIDTH: 49px; HEIGHT: 22px" maxLength=5 value="" name=inputTime> 
         <INPUT name=inputTimeComment>
         <br>Time2: <INPUT style="WIDTH: 49px; HEIGHT: 22px" maxLength=5 value="" name=Ttime2>
         <INPUT name=Time2Comment>
         <br>Time3: <INPUT style="WIDTH: 49px; HEIGHT: 22px" maxLength=5 value="" name=Ttime3>
         <INPUT name=Time3Comment>
         <br>Time4: <INPUT style="WIDTH: 49px; HEIGHT: 22px" maxLength=5 value="" name=Ttime4>
         <INPUT name=Time4Comment>
         <br>Time5: <INPUT style="WIDTH: 49px; HEIGHT: 22px" maxLength=5 value="" name=Ttime5>
         <INPUT name=Time5Comment>
         <br>Time6: <INPUT style="WIDTH: 49px; HEIGHT: 22px" maxLength=5 value="" name=Ttime6>
         <INPUT name=Time6Comment>
         <br>Time7: <INPUT style="WIDTH: 49px; HEIGHT: 22px" maxLength=5 value="" name=Ttime7>
         <INPUT name=Time7Comment>
         <br/><br/>
         <INPUT type=submit value=Submit name=tsubmit onClick=SubmitTime>     </P>
         </Span>
         <Span Id = "VarArea"></Span>
         <Span Id = "SubmitArea"</Span>
         <br/><br/>
         <BR>     </BODY></HTML>     

     
    -TomSchaefer.org
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.8
      mbt shoes www.wileywilson.com