Author Topic: Running VBScript by Comand  (Read 4955 times)

Joe Londa

  • Newbie
  • *
  • Posts: 5
    • View Profile
Running VBScript by Comand
« on: August 20, 2002, 12:50:39 am »
I am still making my way around the Brain Editor but don't quite see how to run a VBScript upon entering/speaking a phrase.  I have a simple VBS file that I would like to launch. The help on the brain editor is not very.  

I enter "Run my favorite VBScript"

Next thing I know, my favorite VBScript is running.

Any help would be appreciated.

Joe
Just Me

Joe Londa

  • Newbie
  • *
  • Posts: 5
    • View Profile
Running VBScript by Comand
« Reply #1 on: August 20, 2002, 10:49:26 pm »
Some progress....

I ran across the Programs.dat file and edited to include my VBScript file. That worked well enough, until I exited HAL and returned to the Programs file to find that my edits no longer exsisted.  

If this file rebuilt each time HAL starts? If so what are the defaults on what directories it looks in and what file types? No help for Brain editor is killing me.

I also tried to create a new entry in the Main Keywords and Priority file. It allowed me to create "Turn on" with a <RUNIT> response but it did not have the same affect as "Run". In short it did not work. Is the execute phrases hard coded in against the Program.dat file?  

This product looks promising but I really need to understand what it can and can't do, or rather, what I can't do.

More Help or Self Help Please.

Joe
Just Me

Joe Londa

  • Newbie
  • *
  • Posts: 5
    • View Profile
Running VBScript by Comand
« Reply #2 on: August 21, 2002, 12:14:51 am »
Ok, my AI is very superficial.

If you put a shortcut in the program file it will pick it up in the Programs.dat file upon restarting HAL. The shortcut I created was a .exe file type. I will experiment to see if it will find any file type. I think it will.

I was using the wrong brain when I was editing the Main Keywords. Once I did discover this my "Turn On" worked just fine excpt for one thing.  The "Repeat Users Sentence after the first search text" must be checked on. Is this what generates the response "I will run.....".  In some cases I would like to have that turned off. I wonder?

Joe
Just Me

Don Ferguson

  • Sr. Member
  • ****
  • Posts: 303
    • View Profile
    • http://www.cortrapar.com
Running VBScript by Comand
« Reply #3 on: August 21, 2002, 12:59:35 pm »
Hi Joe,

I think that some of my responses to other postings, especially the posting about the Enhanced 216 brain, may be helpful to you.  

Depending on how you have this forum set up, it might not appear on your list, but you can search on "Ferguson" to find my postings easily.

You are right, Hal searches your computer for likely program files each time that he opens, and updates the .DAT file.  So, if you inserted something manually, I would expect it to get "wiped out" on the next cycle.

I don't think that Zabaware programmed the functions that pertain to this, to search for .vbs scripts.

An explanation of the arguments in the arrays in the "main" database is in my posting on the 216 brain.  In essence, the program tries to "trap" the name of a program between the <runit>  </runit> flags, but this won't work unless the name that gets found matches exactly to a program-name choice that Hal can find.  For instance, if you said, "Open the program Doom Fighter," but that program's executable file was named dofi2.exe, I don't think that Hal could find it.

In essence, the effect of successfully finding a program name, and launching it via Hal, is the same as if you had located the program's file-name under Windows Explorer, and double-clicked it to open it.

In some of my postings I recommend a book on VBS called Visual Basic Scripting in a Nutshell.  If you are a really determined programmer, you might be able to find some ideas to work your way around what you are trying to do in trying to launch a separate script.

Sincerely,

Don



Don Ferguson
traininginc@cortrapar.com
www.cortrapar.com
Don Ferguson
E-mail: fergusonrkfd@prodigy.net
Website: www.cortrapar.com
Don's other forum posts: http://www.zabaware.com/forum/search.asp?mode=DoIt&MEMBER_ID=274

Joe Londa

  • Newbie
  • *
  • Posts: 5
    • View Profile
Running VBScript by Comand
« Reply #4 on: August 21, 2002, 10:40:37 pm »
Don
     I did a deep scan of the forums last night and found most of your input quite helpful.  I have used short cuts in the "Programs" directory that Hal reads in at startup.  I drop the file extension on the name and that makes for a good title that HAL reads. So that problem is solved.  

I am trying to get Hal to run the file/program without sending back an acknowledgment of "I will now run...." . No combination of True/False flags in the <RUNIT> syntax line will give me that effect and run the program.  A False/False combination prevents the executable from running.  Any input on this?

I am about half way done with my VBScript book and starting to see how I can do some work around.  I have a variety of things that I would like to do pertaining to Home Automation.    


Joe
Just Me

Don Ferguson

  • Sr. Member
  • ****
  • Posts: 303
    • View Profile
    • http://www.cortrapar.com
Running VBScript by Comand
« Reply #5 on: August 26, 2002, 12:00:48 am »
Hi Joe,

I think that the phrase, "I will now run..." is coming from the .dll.  If it is, it can't be changed except by Zabaware (or somebody who knows C++ who writes their own version of the .dll file).

For purposes of discussion, I'm re-printing below the syntax in the main.brn database:

(Each line in the main.brn database is an "array," a set of items, or "arguments," set apart by commas, which the function understands and uses.)

" 1ST TRIGGER PHRASE (REQUIRED) "," OPTIONAL SECOND TRIGGER PHRASE (IF USED, BOTH TRIGGER PHRASES MUST BE FOUND) "," OPTIONAL PHRASE TO CANCEL TRIGGER "," First of three possible Hal responses (required). "," Second of three possible Hal responses (optional). "," Third of three possible Hal responses (optional). ",2,#FALSE#,#FALSE#," Additional response words (optional). "

If both true/false flags are FALSE, the array works as described above. If the first flag is TRUE, Hal's comments will include the user's words immediately following the words in the first trigger string, and include the optional additional response words last.

(Adding <RUNIT> and </RUNIT> in the appropriate places with the first flag TRUE allows the system to "trap" a file name.)

If the words "I will now run..." don't appear in this database, then the .dll is apparently adding the words.  It would certainly be feasible to remove those words from the .dll and put them into the database where they are controllable and deletable by you.  You might try sending an e-mail directly to Robert Medeksza, explaining that you're trying to make some automation things happen during the dialogue, and you don't want Hal to keep saying that phrase every time Hal operates various automations.  Possibly, this alteration-of-approach could be incorporated into a future version of Hal.

If you can operate various external actuators via dialogue, then you've got the essentials of an A.I. robot.  Wow!

Sincerely,

Don



Don Ferguson
traininginc@cortrapar.com
www.cortrapar.com
Don Ferguson
E-mail: fergusonrkfd@prodigy.net
Website: www.cortrapar.com
Don's other forum posts: http://www.zabaware.com/forum/search.asp?mode=DoIt&MEMBER_ID=274