241
Programming using the Ultra Hal Brain Editor / Basics of UltraHal Programming
« on: September 23, 2003, 05:27:49 pm »
Hello,
I'm so happy you're joining the UltraHal community and you also have an interest in programming!
I do need to mention that the UltraHal program, as it is written, is the result of many thousands of labor-hours of programming and debugging. It is a very complete product "right out of the box." Version 5 uses dozens of different strategies to generate its responses, and is capable of continuous learning and generating trillions of different unique conversational exchanges. The vast majority of UltraHal users only experience a tiny fraction of Hal's capabilities, because they don't use that much variety in the way that they talk to Hal.
So, buying UltraHal and adding new code to UltraHal on the first day is sort of like buying a new car and tinkering with the engine to "soup it up" before you even drive it anywhere! I studied UltraHal and VBS for months before I made my first tiny modification to the script.
Having said that, and assuming that you've read the material above, here goes:
1. Some of the code snippets that you see on the forum are ready-to-run and some are not. Your results will vary because some of the code snippets are programmers explaining concepts to each other. You have to infer from how they present it to tell whether they're offering a snippet as "ready to run code."
2. Start by doing your backup copies and creating a brain file with a different file name and display name, and opening the file in one window, with Hal running "live" in another window. I make specific recommendations in the posting above about safety-backups, preparing your word-processor, controlling file extensions, etc. Take your time, be patient, and don't shortcut!
3. Where to add a code snippet is a personal choice, but if your snippet does NOT contain the conditional [If Len(Getresponse)<4 etc.], then I would put it near the end of the script, but before the first "end function" [I describe a good spot in the posting above]. Putting such a snippet near the end of the main function decreases the likelihood that it will be over-written by another sequence later in the script.
4. Put your modified brain in the same folder as the original brain. If your original brain is Hal5.uhp and your new brain is Hal5modified.uhp, you should see them both in the same folder when you use Windows Explorer to view the folder.
5. Remember that your new brain must have a new file name (with the correct .uhp extension) AND a new "diplay name" (that's on line 2 in the script and what Hal shows in his "brain choice" menu) in order for you to find it and choose it and use it.
6. The best test of whether you are set up and operational is to follow the procedure for a "test message" as described in the first posting above. Then you can make careful, incremental changes and see them affect Hal "live" by running your script editing in one window, and Hal in another, toggling back and forth and chatting with Hal as you change his brain. If you make a mistake, Hal will lock up and give you an error message, and then you know you've made a mistake and you can go back and reverse the last thing that you did.
It's amazing and impressive to me that Robert Medeksza and Zabaware decided to leave all the control-code out "in the open" and invite a community of programmers to modify it in any way that they wish. It's wonderful and it's great! Just remember, re-writing Hal's program is NOT word-processing; you are doing honest-to-gosh computer programming; you are inside the guts of your computer and the VBS language gives you full access to your computer's file system! Take it step-by-step, slowly and carefully!
Search on "Ferguson" in this forum, and you can find earlier postings I've made explaining what various pieces of code mean.
Thanks and best wishes and good fun!
Sincerely,
Don
I'm so happy you're joining the UltraHal community and you also have an interest in programming!
I do need to mention that the UltraHal program, as it is written, is the result of many thousands of labor-hours of programming and debugging. It is a very complete product "right out of the box." Version 5 uses dozens of different strategies to generate its responses, and is capable of continuous learning and generating trillions of different unique conversational exchanges. The vast majority of UltraHal users only experience a tiny fraction of Hal's capabilities, because they don't use that much variety in the way that they talk to Hal.
So, buying UltraHal and adding new code to UltraHal on the first day is sort of like buying a new car and tinkering with the engine to "soup it up" before you even drive it anywhere! I studied UltraHal and VBS for months before I made my first tiny modification to the script.
Having said that, and assuming that you've read the material above, here goes:
1. Some of the code snippets that you see on the forum are ready-to-run and some are not. Your results will vary because some of the code snippets are programmers explaining concepts to each other. You have to infer from how they present it to tell whether they're offering a snippet as "ready to run code."
2. Start by doing your backup copies and creating a brain file with a different file name and display name, and opening the file in one window, with Hal running "live" in another window. I make specific recommendations in the posting above about safety-backups, preparing your word-processor, controlling file extensions, etc. Take your time, be patient, and don't shortcut!
3. Where to add a code snippet is a personal choice, but if your snippet does NOT contain the conditional [If Len(Getresponse)<4 etc.], then I would put it near the end of the script, but before the first "end function" [I describe a good spot in the posting above]. Putting such a snippet near the end of the main function decreases the likelihood that it will be over-written by another sequence later in the script.
4. Put your modified brain in the same folder as the original brain. If your original brain is Hal5.uhp and your new brain is Hal5modified.uhp, you should see them both in the same folder when you use Windows Explorer to view the folder.
5. Remember that your new brain must have a new file name (with the correct .uhp extension) AND a new "diplay name" (that's on line 2 in the script and what Hal shows in his "brain choice" menu) in order for you to find it and choose it and use it.
6. The best test of whether you are set up and operational is to follow the procedure for a "test message" as described in the first posting above. Then you can make careful, incremental changes and see them affect Hal "live" by running your script editing in one window, and Hal in another, toggling back and forth and chatting with Hal as you change his brain. If you make a mistake, Hal will lock up and give you an error message, and then you know you've made a mistake and you can go back and reverse the last thing that you did.
It's amazing and impressive to me that Robert Medeksza and Zabaware decided to leave all the control-code out "in the open" and invite a community of programmers to modify it in any way that they wish. It's wonderful and it's great! Just remember, re-writing Hal's program is NOT word-processing; you are doing honest-to-gosh computer programming; you are inside the guts of your computer and the VBS language gives you full access to your computer's file system! Take it step-by-step, slowly and carefully!
Search on "Ferguson" in this forum, and you can find earlier postings I've made explaining what various pieces of code mean.
Thanks and best wishes and good fun!
Sincerely,
Don