Author Topic: I need Hal to open a program without the "open" command  (Read 3416 times)

knight2000

  • Full Member
  • ***
  • Posts: 155
    • View Profile
I need Hal to open a program without the "open" command
« on: January 31, 2012, 10:13:19 am »
Is there a plugin or a piece of code I could use to have Hal open a program on the desktop without having to say "open" I'm using Hal to open a C# script that I wrote which will turn on my dash lights in my car. Its works fine but I have to say "open start up" which doesnt sound very impressive to other people watching lol. I want to be able to say "start up" and Hal will open the program. I haven't found a plugin yet for this but I was wondering if you could code it right into Hal's script. Can anyone help with this?

Thanks.

knight2000

  • Full Member
  • ***
  • Posts: 155
    • View Profile
Re: I need Hal to open a program without the "open" command
« Reply #1 on: January 31, 2012, 04:23:38 pm »
I figured it out! I just placed this sample code in Hal's HalScript.dbg around line 470 and it worked.

fileToOpen = "C:\Users\Victor\Desktop\anyfilename.lnk"
   If InStr(1, UserSentence, "activate", 1) > 0  Then
        GetResponse = GetResponse & "I will open this for you"
      HalCommands = HalCommands & "<RUNPROG>" & fileToOpen & "</RUNPROG>"
    End If

You can use any keyword you want. I chose "activate" because it works best for me. You can also duplicate this code and assign different keywords to open different files. So you dont have to use the word open all the time. You do not have to update the shortcut.dat file either.

Just be careful not to choose a keyword that you use often when chatting with Hal or he will open the file in the middle of a conversion.

raybe

  • Hero Member
  • *****
  • Posts: 1067
    • View Profile
Re: I need Hal to open a program without the "open" command
« Reply #2 on: February 02, 2012, 03:42:27 pm »
I know we had one but don't remember if it was plugin or script for also closing programs which I believe would be just as useful. Don't believe it worked unless maybe installed incorrectly. Would you have any ideas?

Thanks,
raybe
 

ClubEntertainment

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: I need Hal to open a program without the "open" command
« Reply #3 on: February 03, 2012, 07:39:34 pm »
Raybe, I was playing around with the voice recognition in windows 7 and if it's activated you can use it to close the program, I wish there was a way for hal to do it though... you can use the windows commands to switch programs then close them.