Announcement

Collapse
No announcement yet.

[VBScript] bjd_random_quote Script

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

    [VBScript] bjd_random_quote Script

    <HR style="COLOR: #d1d1e1" SIZE=1><!-- / icon and title --><!-- message -->
    This script is used to count text lines in a input file and then randomly speak one of the lines of text.

    Installations:
    • Unzip bjd_random_quote.zip into your Homeseer 2 directory.
    • Setup an event in Homeseer that executes the script: bjd_random_quote.vb("Main","deep_thoughts.txt")
    • Execute the event and listen to a random Deep Thought... by Jack Handey.
    • Setup an event in Homeseer that executes the script: bjd_random_quote.vb("Main","random_quotes.txt")
    • Execute the event and listen to a random quote.
    • Create your own quote text files for random speech.
    An example event is included in the event_example.jpg file.


    Files included in the bjd_random_quote.zip are:
    • \Homeseer 2\Scripts\bjd_random_quotes.vb
    • \Homeseer 2\Scripts\bjd_random_quotes\deep_thoughts.txt
    • \Homeseer 2\Scripts\bjd_random_quotes\random_quotes.txt
    • \Homeseer 2\Scripts\bjd_random_quotes\scene_goodnight.txt
    Let me know if anyone thinks this script is useful and I'll place it in the scripts library.
    Attached Files
    Billy Draper

    #2
    I just gave this script a try and received the following error in the log:

    Script compile error: Argument not specified for parameter 'st' of 'Public Sub SetDeviceString(dev As String, st As String, [reset As Boolean = False])'.on line 107

    I've setup the event per the instructions. I'm running HS version 2.2.0.11.

    Any thoughts?

    Thanks in advance!

    Brian

    Comment


      #3
      Oops, nevermind. I goofed up and posted before I should have.

      Brian

      Comment


        #4
        Brian did you get it working? I use it all the time for random speak...

        Let me know if you think it is useful and I will place it in the script library.

        I also have one that randomly plays wave files, kinda neat, got the whole StarTrek beep thing going on over here...
        Billy Draper

        Comment


          #5
          Thanks for checking - I did get it working. I forgot I had made a change to it and that's what wasn't working. I did a little more work, and it works perfectly.

          It's funny how timing goes. I decided I wanted to pull a daily quote or random thought into my main ML scene, but didn't know where to start. Lo and behold, you had posted a script that did that very thing just a little before I started digging into this. The change I had made was to output a random thought to a device string, which I can then pull into a scene.

          It is working spot on now.

          Thanks again for checking!

          Brian

          Comment


            #6
            No problem, glad I could give a little help back now and then.

            Work has been so hectic lately, and I have an 8 year old that has played on 4 different ball teams this year. I helped coach 2 of them, I must be a glutton for punishment . It's been a lot of fun but now he is on a travel team and it is wearing the wife and I out. I also started back to school to attempt my 4 year degree after being in IT for 17+ years... I've been away from the HA board for to long, glad I checked in...

            I'll post the script to the script library where it should be. I'll also post the random wave file player, it's kinda cool.

            Thanks again.
            Billy Draper

            Comment

            Working...
            X