Announcement

Collapse
No announcement yet.

Days till Xmas...... And counting

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Days till Xmas...... And counting

    It's kind of a basic script, but figured someone else might like to use it for Xmas as in my case, or possibly something else like Anniversary or the Wife's birthday.

    hmmm....note to self, maybe I should do that to know how many more days I have to procrastinate before going out and trying to find something to buy!

    Enjoy,

    Steven
    Attached Files
    Last edited by karls; November 25, 2005, 08:54 PM. Reason: Updated the script to add speech.

    #2
    Is there any way for homeseer to speak the no. of days left

    Comment


      #3
      Originally posted by rmuziani
      Is there any way for homeseer to speak the no. of days left
      RMuziani,

      You bet ya!,
      Just add the following line in just before the last line (which is "end sub")

      hs.speak DaysWaiting

      Or, just redownload the script, I added the speech in but just commented it out.
      remove the single quote ' from the hs.speak line in order to make it work.


      Steven
      Last edited by karls; November 25, 2005, 08:55 PM. Reason: Update

      Comment


        #4
        Thanks

        Comment


          #5
          RMuziani,

          I just updated the file above, we were both posting at the same time.

          Steven

          Comment


            #6
            Here's the one from last year....

            http://board.homeseer.com/showthread...ight=christmas
            💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

            Comment


              #7
              Originally posted by Rupp
              Rupp,

              You are definitely the man with that seems to know all when it comes to this board.

              Comment


                #8
                I think you'll run into a problem if you try to cross the year boundary. I did this with a script to tell me how long til a trip we were taking.

                You have to do 2 calculations - one to the end of the year, and another from Jan 1 to the final date.

                Comment


                  #9
                  Originally posted by JeffCharger
                  I think you'll run into a problem if you try to cross the year boundary. I did this with a script to tell me how long til a trip we were taking.

                  You have to do 2 calculations - one to the end of the year, and another from Jan 1 to the final date.
                  Thanks Jeff,

                  I figure this script will only be in operation for a month or so at most.
                  Trying to get into the Xmas spirit, especially now that we have snow on the ground.

                  Steven

                  Comment


                    #10
                    yeah, I know that was the intent. I was referring to the comment that it could also be used for anniversaries etc.

                    Comment


                      #11
                      Originally posted by JeffCharger
                      yeah, I know that was the intent. I was referring to the comment that it could also be used for anniversaries etc.
                      ahhh!

                      Yes, the save my back side counter for the anniversary / birthday.
                      Definite reduction in WAF if I forget
                      I will have to look into that further for sure.

                      By the way, where in Ontario are you ?

                      Steven

                      Comment


                        #12
                        Steven
                        Very elegant and simple script.

                        I made a small change and added it to my morning announcement. Now it will start counding down at 30 days and stop the day after Xmas.

                        Sub Main

                        Dim DaysWaiting ' How many days to wait till Xmas

                        ' ***** User Defined Area *****

                        DaysWaiting = DateDiff("d", Now , "24-Dec")

                        if (Dayswaiting < 30) and (Dayswaiting > 0) then
                        system.speak "Christmas is "& DaysWaiting & "days away"
                        else
                        if Dayswaiting = 0 then
                        system.speak "Merry Christmas"
                        else
                        end if
                        end if

                        End Sub

                        Comment


                          #13
                          gcyeaw,

                          Nice Idea.... and thanks

                          Steven

                          Comment


                            #14
                            Here's what I have used for a date beyond the year end


                            PHP Code:
                            sub main()
                            ' set up the constants
                            end_of_year = DateSerial(2005,12,31)  
                            beginning_of_year = DateSerial(2006,1,1) ' 
                            YYYY,MM,DD

                            ' set the dates you want to calculate the # of days between
                            dtStartDate = Date   ' 
                            Date today's date
                            dtEndDate = DateSerial(2006,3,1) '
                            YYYY,MM,DD   this puts in "Date" format

                            if dtStartDate <= end_of_year then
                            ' hs.speak "start date before end of year"
                             days_1 = datediff("d", dtStartDate, end_of_year)
                             days_2 = datediff("d", beginning_of_year, dtEndDate) +1
                             days = days_1 + days_2
                            else
                             days = datediff("d", dtStartDate, dtEndDate)
                            end if 
                            weeks = Cint(days/7)
                            hs.speak "It'
                            " & days & " days until you leave for your trip. Or it's " & weeks & " weeks."
                            end sub 

                            Comment


                              #15
                              I just posted what I am using here http://board.homeseer.com/showthread.php?t=100712. It currently tracks 7 or 8 dates and will tell you how many days until the next one.

                              Comment

                              Working...
                              X