dupa

Author Topic: RUNPROG tag response string  (Read 4440 times)

Cefwyn

  • Newbie
  • *
  • Posts: 45
    • View Profile
RUNPROG tag response string
« on: March 22, 2009, 01:37:04 pm »
Anyone know where the response string is stored when you tell hall to run a program? The only reference I can find to it is in the halCommands table which simply checks for the words telling hal to call the RUNPROG command, and even in the main brain script itself it doesn't appear to ever tell hal to respond. I either want to remove the response or change it so that it doesn't tag on one of the random responses because I don't like running a program and getting a response like :"I am executing this program for you. Isn't it better to stay open to new ideas?"
"I've just decided to lobotomist my hal..."

EULA: By reading this you agree not to take offense to anything contained in post above. If you do choose to take offense, you forfeit all rights to criticize same post unless said criticism contains important corrections and helpful information.

onthecuttingedge2005

  • Guest
RUNPROG tag response string
« Reply #1 on: March 22, 2009, 05:02:38 pm »
Hi Cefwyn.

that would be the shortcut.dat file located in the Ultra Hal Assistant folder.

Jerry[8D]

jasondude7116

  • Sr. Member
  • ****
  • Posts: 475
    • View Profile
RUNPROG tag response string
« Reply #2 on: March 22, 2009, 05:47:24 pm »
i think he might be talking about the getresponse function

i.e. Hal:  "ok i will now open this program for you"  ect.

 

Cefwyn

  • Newbie
  • *
  • Posts: 45
    • View Profile
RUNPROG tag response string
« Reply #3 on: March 22, 2009, 06:44:36 pm »
OTCE: Thanks for directing me to that file as I didn't even think to open it with a text editor even though I checked every other file in that directory. Knowing that the program shortcuts are indexed in there allows me to fix another problem I was having with certain programs not being run because they use weird characters in their name that I can't type easily. Unfortunately, that's not what I was after.

jasondude7116 is right. I'm looking for where the strings that hal responds with are stored. In my example of "I am executing this program for you. Isn't it better to stay open to new ideas?" which was the result of my typing "open firefox" I would like to either remove the strings saying it's running the program or better yet leave those strings in and stop it from making a topical response using the word "open" since that's a command word so the end would result would either be "Isn't it better to stay open to new ideas?" which isn't ideal as hal shouldn't respond to it as part of conversation or just respond with "I am executing this program for you". I also just thought that perhaps it could be fun to add the name of the program to be run in that string as well so the response would be "I am executing firefox for you at your command", but any of those changes would require finding where that string comes from in the database, script source, or even if it's embedded into hal's source code itself. If it's embedded into hal's source code though I don't really feel like disassembling the program just to rearrange some strings.
"I've just decided to lobotomist my hal..."

EULA: By reading this you agree not to take offense to anything contained in post above. If you do choose to take offense, you forfeit all rights to criticize same post unless said criticism contains important corrections and helpful information.

jasondude7116

  • Sr. Member
  • ****
  • Posts: 475
    • View Profile
RUNPROG tag response string
« Reply #4 on: March 23, 2009, 07:49:45 pm »
i could very well be wrong, but i think it is the .dll?

i found that (if writing a script) you can use something like:

    Set objWSHShell = CreateObject("WScript.Shell")
    objWSHShell.Run("""C:\Program Files\myfile.exe""")

you can use it to open a program...ect.  and make your own response.
Pay attention to the amount of quotes.
this runs the windows command line, the outer quotes (1 each side) are used to denote the line as text instead of a variable. the inner double quotes (2 each side) are used to produce single quotation marks on the windows command line. quotes are used in windows command line if the command has spaces in it.
i.e. Program(space)Files
the above line would produce "C:\Program Files\myfile.exe" on the windows command line.
the quotes really screwed me up the first time.[:I]

hope that helps....try researching : CreateObject("WScript.Shell")
-the dude
« Last Edit: March 23, 2009, 08:01:41 pm by jasondude7116 »
 

Cefwyn

  • Newbie
  • *
  • Posts: 45
    • View Profile
RUNPROG tag response string
« Reply #5 on: March 23, 2009, 08:00:07 pm »
I looked briefly into each of the dlls and the executable for another topic and nothing in particular popped out at me. I'll have another look some other time, but if it's anywhere I'm going to wager its in the executable which will take a while to search through and even longer to disassemble, rewrite the command, and reassemble. I could just replace the string constants if they exist in the binary, but I would like to have a RUNPROG tag that responds but without hal tagging on extra topic related stuff, and a version where hal doesn't say anything at all.

EDIT: Thanks for that jasondude. I may end up trying to rewrite all the scripts so that everything is run like that and the hidden RUNPROG tag is never used. At least that way I will have all the control I could possibly want, though I would expect that RUNPROG may have some additional security and exception handling beyond what the script might provide. When I've got time between work projects and I'm in the mood I'll have a go at seeing if I can use the script to reference the shortcut.dat file the same way RUNPROG does as I don't want to write a rule for every program on my computer. I must be crazy though, I'm working two projects, one of which is writing a fuzzy inference system and the other doing research on some fast methods of transparency rendering in a deferred shading engine, and then with all my free time I'm working on hal :D
« Last Edit: March 23, 2009, 08:28:54 pm by Cefwyn »
"I've just decided to lobotomist my hal..."

EULA: By reading this you agree not to take offense to anything contained in post above. If you do choose to take offense, you forfeit all rights to criticize same post unless said criticism contains important corrections and helpful information.

jasondude7116

  • Sr. Member
  • ****
  • Posts: 475
    • View Profile
RUNPROG tag response string
« Reply #6 on: March 31, 2009, 08:35:51 pm »
I just found out that putting the plugin in the PLUGINAREA7 will eliminate the default response string, if there is another response given in the plugin.
of course this only works if the rest of the plugin can be in area7.

-the dude