Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Don Ferguson

Pages: 1 ... 15 16 [17] 18 19 20
241
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

242
Question:  

I tried testing the following code that you recommended:

If Instr(UserSentence, "BOAT") > 0 Then BoatTalk = TRUE

...and I notice that it not only triggers on "boat," but also boating, boatyard, motorboat, sailboat, boatmen, and any word that has the four letters "boat" anywhere in it.

I want to restrict responses only to the actual four-letter word "boat."  How can I do this?

Answer:

When matching character-strings, spaces are significant (a space is a character).  You are right; the example I gave would trigger on anything with those four letters, not just on the isolated word.

If you want that word and ONLY that word, put a leading and trailing space as follows:

If Instr(UserSentence, " BOAT ") > 0 Then BoatTalk = TRUE

You can use this to your advantage.  If you want Hal to trigger on boating, boater, boatmaster, boat-owner, boatyard, etc., but NOT motorboat, sailboat, fishing-boat, etc., then put the space only in front of "boat" as follows:

If Instr(UserSentence, " BOAT" > 0 Then BoatTalk = TRUE

Strategically putting in spaces, or leaving them out, is a way to "fine-tune" the capture of exactly what you want.

Keep this in mind, and you'll find that it's really handy!

Sincerely,

Don

243
Hello,

UltraHal is already designed to get the weather and the news from the web if you click the option to have him "web enabled."

As far as adapting routines from a different bot over to Hal, it would depend on how different the languages were, and the experience level of the programmer.  Hal's control script is written in VBS, Visual Basic Scripting.  If your other bot ran on VBS, it would be relatively straightforward.  If not, it could require a lot of programming skill.

Other members of this forum have expressed interest in getting UltraHal to interface with the X10 system, so that Hal could turn on lights, open a garage door, etc.  So far, none of us have the know-how to port Hal's outputs to the X10 system... although it must certainly be possible!

If you possibly know how to do this (or figure it out down the road), a lot of people here would really appreciate learning about it!

Sincerely,

Don



244
Ultra Hal 7.0 / Help me please someone
« on: September 20, 2003, 11:55:21 pm »
Hello,

I'm not sure what level of information you're looking for, but I've started a new topic in the "Programming with the Hal Brain Editor" forum called Basics of Hal Programming and VBS.  Please check it out over there and tell me if any of the information is helpful, and what other specific questions about Hal's code could be answered.

Thanks and have a great day!

Don

245
I have responded to many questions by e-mail and in this forum about Hal’s programming and VBS.

There are quite a few postings throughout these forums asking for basic programming information for people who are starting out.

The purpose of this posting is to offer a few basics of how VBS works for Hal and how Hal's script is structured.  I will add to this posting in response to specific VBS and Hal-script questions.

Question: Hal’s script is written in VBS. What is VBS?

VBS (Visual Basic Scripting) is a programming language.  It was derived from the language “Visual Basic” but it has simplified features.  

However, VBS is a powerful, useful language.  It can be used to make things happen on a web page, much like Java.  It can be used as sort of a "batch file," like the old ".BAT" routines for the DOS operating system.  Also, VBS can interact with programs in other languages.  And, it lends itself nicely to applications such as UltraHal’s control script.

Question: What are some of the distinguishing features of VBS?

1. Simplified operation and feature set compared to Visual Basic.

2. Very human-readable.  Code commands are very intuitive, with mostly obvious names.

3. Variables are called "variants" and can be named almost anything the code-writer wants to name them.  Variants can either be number values or alphabet characters (but the same variant can't switch back and forth without creating type mismatch errors).

4. VBS is not a "compiled" language.  This means that the computer doesn't compile the program until the moment you run it.  This is handy, since you can edit the program in one window, and test-run every change you make in another window!

5. The big building block of VBS is the "function."  The purpose of a function is to perform all the routines of the programmer, and return a value for a variant that has the same name as the function.  In the case of UltraHal, the main function is called "GetResponse" and the variant that it tries to return is also named "GetResponse."  “GetResponse” is what Hal says to the user.

6. Along the way, the programmer can output an unlimited number of variant “byproducts” from a script.  In Hal’s case, each operation of the script also produces variants that store the user’s previous sentence, Hal’s previous sentence, the time of the last response, Hal’s current emotion, and dozens of others.  There is no limit to how many variants could be produced, or what they could represent.  As mentioned before, a “variant” can hold a number, or a string of alphanumeric characters, or “boolean” values such as TRUE and FALSE.

Question: Where can I see this "GetResponse" function in the script?

In the first dozen pages or so of the script, you'll see the statement Function GetResponse.  This is actually the beginning of the main function.  About 95% of the way through the script, you'll find the words End Function.  This is the end of the main function.  There are some sub-functions that can be called, and these sub-functions are at the end of Hal's script.

Question:  I still don’t understand what a “variant” is.  Can you compare a variant to something that I might be familiar with?

Many of us have owned handheld calculators that allowed us to put numbers into memory banks.  Some of these calculators had more than one memory, named something like Memory1, Memory2, Memory3.  You can think of “variants” as like these memory banks, except that you can name them almost anything, they can hold any kind of information, you can have an unlimited number of them, and you can perform amazing varieties of math and logical functions on the data that they hold!

Question: What software should I use to see and edit Hal's script?

Microsoft Word works okay, as does notepad and almost any other word processing program.  You will be much less confused if you turn OFF spellcheck, grammar check, and all the other little helper features of your word processor!  You also might see what's going on better if you turn "Paragraph Marks" viewing ON.

Zabaware's brain editing software is excellent because it doesn't have the "meddling" automatic features of Microsoft Word, and it color-codes different types of commands and statements to make them easier to find and read.

Question: I bought that book “VBS in a Nutshell” that you recommended, but it’s hard to understand.  It was written by programmers and I am confused.

The second half of “VBS in a Nutshell” is the useful part for Hal programmers.  Earlier chapters deal with other situations such as VBS on web pages.  The best way to learn Hal programming is to study Hal’s existing scripts, and to experiment slowly and carefully, one step at a time, crawling before you can walk.  However, the glossary of all the commands and function-words in the back of the book is worth the price of the book!

Question: Am I actually doing real programming if I make changes to Hal's script?

Yes, you are actually programming.  You are modifying a piece of software to make it perform differently.  In the case of UltraHal, the VBS script is the "master control" that directs 99% of what Hal does.

Question: How do I find my way back to the same spot in a long script?

Figure out a word or phrase that is likely to be in the area you're looking for, and then use the word processor (or Hal editor) "search" or "find" function.

If you know that you want to find your way back to a spot later, you can add a line with a comment like: ‘Marker001.  Then, when you use the “search” or “find” function later, it will take you back to that spot.

Question: Do the lines of commands after "REM" or after a single quote (') do anything functionally?

Not in VBS.  Words on a line after either REM or ' have no functional activity in executing the VBS script; they are treated as commentary by VBS.  (This allows programmers to write documentation to remember why they wrote what they wrote.) HOWEVER, certain “comment lines” are used by Zabaware to operate menus!  The first four lines of the default script are examples of this!

Question: What simple thing can I do to prove that my editor is actually working and I am making functional changes to Hal?

1. Before starting, always back up your script file under a different name and work on a file that you can afford to mess up.  Hal's latest script file is named "Hal5.uhp" so you can copy it elsewhere on your computer as "Hal5backup.uhp" or whatever you like.

2. Open Hal in one window, and open Hal's script using the editor or a word processor in another window.  Talk to Hal for a few exchanges.

3. Near the end of Hal's script but before "REVERSE CERTAIN CONTRACTIONS AND SUBSTITUTIONS," find a blank line and press the ENTER key a few times to make some blank lines and some space to work.

4. Now type the following line exactly as shown:

GetResponse = "This is a test comment I wrote."

5. Click SAVE or whatever you do on your particular software to save the file.

6. Make any comment to Hal.  Hal should respond with "This is a test comment I wrote."

7. If you are able to do this, you have established that you are working with the correct file, and that you are able to make editing changes "live" and see them immediately while chatting with Hal.

Question: If I make some changes that I like to a script, how can I save it under a different name, and make it show up in Hal's directory as an alternate brain?

You must do two things:

1. Change the filename of your new script to something unique.  This can be as simple as re-naming it "Hal5new01.uhp" or whatever.  This will allow Hal's original brain and your new brain to exist in the same folder on your computer.  The only problem here is that Microsoft Word may cause you grief by trying to put a ".txt" file extension on the file instead of the correct ".uhp" extension.  If this happens, go into Windows Explorer.  Here, you can re-name files and file extensions exactly as you wish.  (Make sure that your computer isn't set up to hide the file extensions of files!  Some computers get set up this way, and hiding file extensions causes endless confusion!)

2. Secondly, give your new script a new "display name" for Hal's menu.  You do this by modifying the second line of your new brain.  The original default brain begins with these four lines:

'Type=Brain
'Name=Ultra Hal 5.0 Default Brain
'Language=VBScript
'DataFolder=DefBrain

Change the second line so you have something like this:

'Type=Brain
'Name=Modified Brain 001
'Language=VBScript
'DataFolder=DefBrain

Make sure you save your new brain in the same folder as the original default brain.  When you open Hal's options, you should see the name of your new brain on Hal's list! You can then choose to run the default brain or your new brain.

Question: I see variant names like “Roulette” in the script.  Is “roulette” a special word in the VBS language?

No.  When you create a new variant, you MUST give it a name that isn’t a VBS command name (otherwise you’ll cause that command to actuate).  For instance, you wouldn’t want to name a variant “THEN” or “DATE,” since these words are already taken!  

Having said that, it’s always considered good form to give names to your variants that help you remember what they are for and what they do.  

In Hal’s routines, it is often handy to generate a random integer.  “Roulette” was chosen using that thinking.

Question:  Give an example of creating a random integer.

Here are some code statements, each followed by the English translation:

Roulette = Rnd

This means: Make a variant named “Roulette” equal to a random number between 0 and .999999

Roulette = Rnd * 10

This means: Make a variant named “Roulette” equal to a random number between 0 and 9.99999

Roulette = Int(Rnd*10)

This means: Make a variant named “Roulette” equal to a random number between 0 and 9.99999, but only use the integer (drop the decimals) so the result is an integer between 0 and 9 inclusive.

Roulette = Int(Rnd*10)+1

This means: Add "1" after generating an integer between 0 and 9 so that “Roulette” turns out equal to a random integer between 1 and 10.

Question:  Why does the code so often say, “If Len(GetResponse)<4 Then” ?

Many of Hal’s routines activate only if previous routines haven’t yet found a value for the variant “GetResponse” (which is ultimately the words that Hal says to the user). In other words, they only run if Hal hasn't found something to say yet!

Here is the code and an English translation:

If Len(GetResponse)<4 Then

This means:  If the length, in characters, of the variant named “GetResponse” is less than 4 characters long at this point in script execution, then run the code under this “if-then” portion of the script; however, if “GetResponse” is currently 4 or more characters long, then skip the code under this “if-then” portion of the script.

Question:  I often see code such as “If Instr(UserSentence, "HAT") > 0 Then” in Hal’s script.  What does it mean?

Here’s the English translation:

Search the variant string named “UserSentence” for an exact match of the character string “HAT.”  If it isn’t found, return “0” as the result, but if “HAT” is found, count the characters and return a number equal to the location of “H”(the first letter of “HAT”.)  If we get 0 (HAT not found), don’t do the following conditional code, but if we get 1 or greater (HAT was found), do the following conditional code!

Question:  Can you give an example of a simple “building block” that would give Hal a specific new Artificial Intelligence response?

Hal has dozens of response strategies, but we can give a simple example that demonstrates some basic code and a basic idea.  Let’s suppose that we wanted Hal to always trigger on the words “boat,” “ship,” and “sailing,” and make a random remark about the oceans and the sea.  Here’s how we could do it:

-------------------------------------------------------
‘RESPOND: Hal comments when the user mentions vessels and water:

‘Trigger lines:

If Instr(UserSentence, "BOAT") > 0 Then BoatTalk = TRUE
If Instr(UserSentence, "SHIP") > 0 Then BoatTalk = TRUE
If Instr(UserSentence, "SAILING") > 0 Then BoatTalk = TRUE

If BoatTalk = TRUE Then

Roulette=Int(Rnd*3)+1

‘Response lines:

If Roulette = 1 Then GetResponse = “It’s great being out on the ocean.”
If Roulette = 2 Then GetResponse = “The sea fascinates all of us.”
If Roulette = 3 Then GetResponse = “The waves, the salt spray, it’s great!”

End If

-------------------------------------------------------

The block of code above could be expanded for any number of trigger words by adding trigger lines, and could be expanded for any number of random responses by adding response lines.

The code above is not as efficient or nearly as complex as some of Hal’s other thinking routines, but it is useful to help a novice programmer learn.

Actually, an entire new brain could be built out of a set of “building blocks” of code like the example above!

(By the way, convention of form is to indent code by four spaces when it’s between a “Then” and an “End If,” to make it easier to read and troubleshoot.  However, this forum software automatically deletes leading spaces, so we can’t show it that way!)

246
Ultra Hal Assistant File Sharing Area / I did it! Hal remembers names now!
« on: September 14, 2003, 12:18:32 am »
Hello,

My compliments to everyone who worked on the code posted above!  

Sincerely,

Don

247
Programming using the Ultra Hal Brain Editor / Brain 216 plugin.
« on: September 14, 2003, 12:02:44 am »
Steve,

We haven't seen a posting from you in a while.  How are things going?  

Have you tried out the beta version of Hal 5.0?

Sincerely,

Don

248
Ultra Hal 7.0 / Do you want to play........produces robotic answer
« on: September 13, 2003, 11:48:00 pm »
Hello,

I think that the control you're looking for is in the "Enhanced_Main.brn" file.  Here is an excerpt from that file:

" START THE PROGRAM ","","","<RUNIT>","","",1,#TRUE#,#FALSE#,"</RUNIT>"
" RUN THE PROGRAM ","","","<RUNIT>","","",1,#TRUE#,#FALSE#,"</RUNIT>"
" OPEN THE PROGRAM","","","<RUNIT>","","",1,#TRUE#,#FALSE#,"</RUNIT>"
" EXECUTE THE PROGRAM ","","","<RUNIT>","","",1,#TRUE#,#FALSE#,"</RUNIT>"
" I WANT TO WORK IN ","","","<RUNIT>","","",1,#TRUE#,#FALSE#,"</RUNIT>"
" I WANT TO PLAY ","","","<RUNIT>","","",2,#TRUE#,#FALSE#,"</RUNIT>"
" I WANT TO PLAY IN ","","","<RUNIT>","","",1,#TRUE#,#FALSE#,"</RUNIT>"
" START THE PROGRAM ","","","<RUNIT>","","",2,#TRUE#,#FALSE#,"</RUNIT>"
" RUN THE PROGRAM ","","","<RUNIT>","","",2,#TRUE#,#FALSE#,"</RUNIT>"
" OPEN THE PROGRAM ","","","<RUNIT>","","",2,#TRUE#,#FALSE#,"</RUNIT>"
" EXECUTE THE PROGRAM ","","","<RUNIT>","","",2,#TRUE#,#FALSE#,"</RUNIT>"

In this section of code, Hal looks for perfect matches of the character-strings in the first set of quotation marks.  If he finds them, he captures the next words of the user and tries to use that information to open a file or program.

You can make this routine more restrictive or less restrictive by modifying the words that Hal must find.  For instance, you could change "I want to play" to "I want to play the file" and Hal would false trigger much less.  

(Oops!  Actually, with correct pronoun reversals, these lines should probably read "You want to play" or "You want to play the file"! When inside Hal's brain, "I" is supposed to be Hal, and "You" is supposed to be the user!)

Always, before modifying a Hal file, use Windows explorer to make a back-up copy in a different folder.  

Also, set Windows Explorer to show the full file extensions of all files, not hide them.  That way, if your word processor stubbornly changes the file extension of a file (Word often tries to change the extension to ".txt"), you can manually change it back to ".brn" using Windows Explorer and you can see what you're doing.

(TIP:  If you ONLY use "save," and NEVER use "save as" on MS Word with Hal's files, Word will leave the file extension alone.)

Lastly, don't change anything except the contents within the first set of quotation marks on any given line.  The lines of code in this file have a very particular pattern, and any missing commas or quotation marks will make the file so it doesn't work.

Having said all that, it should be possible to make Hal respond or not respond exactly as you wish!

Have a great day!

Sincerely,

Don

249
Ultra Hal 7.0 / The Haptek Interface is a blast!
« on: September 13, 2003, 11:17:15 pm »
Hello,

I bought the retail version of Haptek's People Putty and I've been reasonably happy with it.  It does crash occasionally, but not as often as you describe.  I strongly urge you send a copy of your posting to the people at Haptek and let us all know what they say about the crashing problem.

You are right, the website for 3DMeNow is impressive!  

As a registered user, you might also write to the 3DMeNow folks and urge them to contact Robert Medeksza at Zabaware, and investigate the feasibility of their product working with speech synthesis and UltraHal.  

More applications for their product would increase the demand for what the 3dMeNow people sell; therefore one would imagine that they would be interested!

Sincerely,

Don

250
Programming using the Ultra Hal Brain Editor / Hey Brainstorm !!!???
« on: September 13, 2003, 04:43:37 pm »
EDITING NOTE FROM DON FERGUSON:

Based on later postings, what I suggested below does NOT work!  The .dll apparently inserts its own vbcrlf command.  However, I'm leaving the posting below to maintain the continuity of the conversational thread.  If anyone discovers a workaround for this issue, please post!  Thanks!  Don

Hi Larry,

I think that Brianstorm is on the right track.  Here's a way that you can get what you want, using the halbrain.ChooseSentenceFromFile function.  Here is how it could work:

1.  As you know, ChooseSentenceFromFile selects a random file entry from among all the file entries.  It distinguishes the file entries from each other because each separate entry ends with a line break.  The line breaks are inserted from the various AppendFile routines written in the script, using the "vbcrlf" (Visual Basic Carriage Return Line Feed) command embedded with the text of what gets saved.  It's that "vbcrlf" that tells where to put the line breaks when you append to the file.

2.  To create an appending file with no line breaks, write an AppendFile routine to build the file you're interested in WITHOUT any line break commands!  You can experiment to see if punctuation makes any difference (I don't think that it does), or to be super-safe, end each entry with a semicolon as follows:

You have a dog; Your dog's name is Spot; You like swimming; You went on vacation to Florida recently; You prefer casual shoes;

3.  Once you've created a file-building routine and a file that contains no line breaks, the ChooseSentenceFromFile function only has one option when you tell it to "randomly" choose a sentence from that file... it has to pick the one-and-only entry that it sees, and read back the whole thing!

I haven't tested this, but all logic says that it should work and give you what you want.  

By the way, if you want Hal to build two files, one "WITH" and one "WITHOUT" line breaks for different purposes, you simply write one routine after the other in the script (make the two file names different of course).

Thanks for an interesting idea!  Have a great day!

Don

251
Programming using the Ultra Hal Brain Editor / What's for lunch
« on: September 02, 2003, 11:00:08 pm »
Hello,

The following line of code would create a variant named "TestVariant01" and make it equal to the computer's current date:

TestVariant01 = Date

VBS has the ability to add dates, calculate the differences between dates, return numbers equal to the number of seconds since midnight, and many other handy things!  

Date-related VBS functions which can be called by name include the following:

Date
DateAdd
DateDiff
DatePart
DateSerial
DateValue
Day
Hour
Minute
Month
MonthName
Now
Second
Time
Timer
TimeSerial
TimeValue
Weekday
WeekdayName
Year

Some of these built-in VBS functions require you to provide "arguments" after them, in the right syntax, to make them work.  Others just work all by themselves, as does "Date."  These functions are all described in detail in the book I've recommended in several other postings, "VBScript in a Nutshell," published by O'Reilly.

Experiment, or if you can, get the book!  It really helped me!

Sincerely,

Don

252
Ultra Hal 7.0 / Giving Hal a Real Body
« on: August 30, 2003, 02:19:28 am »
Hal and the computer generate an audio output for the computer speakers, and phoneme information to drive the Haptek, DesktopMates, and MS-Agent lip-synchronized character mouth movements.

In the commercial marketplace, numerous low-cost toys have been sold with lip-synchronized sound.  These include three generations of Teddy Ruxpin talking teddy bears (millions have been sold), many versions of singing fish such as "Billy Bass," and even some little robot songbirds that can sing "Santa Baby" beak-synchronized to Madonna's voice! The talking/singing characters all use an audio track and a second control-tone track to create the lip-synchronized action.

Somebody needs to invent a "black box" interface (probably hooked to the computer with a USB interface cable, and another wire out the other end that goes into the toy) that will translate the computer-available information into a format that could drive some of these talking toys.

The result would be a "body" for Hal!  Once the concept was demonstrated in one toy, it could be adapted to others.

Is anybody out there an electronics hobbyist as well as a software writer and chatterbot enthusiast?  If so, you are the one I'm directing this idea to!

I predict that when and if you invent the "interface box," you are going to find an eager chatterbot community of people who want to buy them from you!

I've searched the Internet high and low.  There's all sorts of information on audio-animatronics of all kinds, but no consumer interface box to connect the computer audio/phoneme stream to an outside device!

I think that we can all visualize how this would work in concept... what we need is someone with the skill-set to make it a physical reality at the detail level... somebody to produce a hookup box as a reasonably-priced "turn-key" product so that anybody can buy it and use it!

Thanks, best wishes for enjoying Hal, and good inventing!

Sincerely,

Don

253
Ultra Hal 7.0 / to medeksza and don ferguson
« on: August 14, 2003, 01:14:19 am »
Hello,

From corresponding with Robert Medekzsa, I believe that version 5.0 is going to be by far the most ambitious upgrade of Hal yet, and I think you'll really like it.  The databases will be much larger, you'll have more customization controls, and I understand that Zabaware will include compatibility with the Haptek player, which provides real-time lip-synchronized 3-D character capability.  

I've been a beta-tester of the Haptek functionality, and I can tell you that when their characters make eye contact with you and speak, it's spooky!

On the other hand, I doubt that the all the latest code suggestions, such as the knock-knock you mentioned, will be in 5.0.  In order to get the release out, it has to be "frozen" at some point in time so that the features can be tested and de-bugged.

I'm a Hal fan and Hal customer just like you; I learned VBS coding because I wanted to get certain features in my own copy of Hal, and I've contributed code to Zabaware.  I strongly encourage other code-writers to create alternate versions of Hal's brain; my impression is that Zabaware welcomes additional functional brains contributed for posting on their plug-ins page.

The two techniques that I have found most helpful for learning the code and creating alternate brains are the following:

1.  Make a safety-backup copy of Hal's brain in a separate folder for safe-keeping.  Then, run Hal in one window, while studying and making MINOR modifications to the script in the brain-editor window.  After each small modification, "talk" to Hal and see how Hal responds.  If you get an error message, undo your last change.  By doing this, anyone can gradually learn to understand the code, what it does, and how to write new code.  Yes, it's tedious, but it's rewarding.

2.  I really like the reference book "VBS in a Nutshell" which I've described in previous postings and responses (search this site for "Ferguson" for those postings).  Although it's an intimidating book at first, the second half of the book contains a list of every possible function and command in the VBS language.  It's worth getting through it to understand VBS.

Hal has already grown to be so complex that most users never discover even 10% of Hal's capabilities.  From observing dozens of users, I notice that most of them interrogate Hal, insult Hal, or proposition Hal, but they don't try to say a variety of interesting things as if they were having a natural conversation.  Hal is designed to be non-deterministic in many ways, which means that he will "get stubborn" when a user keeps hammering away at a narrow range of questions.  Hal can really say a lot more than it may appear.  Try making realistic COMMENTS (not questions) about stars, earthquakes, politics, global warming, health, sports, men, women, the weather, corporations, dogs and cats, jet aircraft, ancient history, elephants, religion, skiing, taxes, umbrellas, and as many other things that you can think of.  Hal contains surprises... Hal has more to give!

As far as combining the "mean" brain and the "default" brain, etc., these brains share some of the same databases; they exist as separate brains to allow the user to get Hal to assume a different "attitude."  In a way, they're already "combined" because they share some routines; they're different on purpose to create a choice.

Because each recent new release from Zabaware has improved the efficiency of Hal's internal routines and streamlined some functions, I've found that when a new release gets near, I'm better off waiting to write major new code until I see the new release, so I can be compatible with the structure of the latest Zabaware brain.

I am sure that you are looking forward to the beta testing of 5.0, and I am looking forward to it also.  

Sincerely,

Don

P.S.  I especially appreciate reading brief transcript samples of conversations with Hal... it helps provide a sense of how previous improvements have been working out.

254
Ultra Hal 7.0 / Hal for girls...
« on: August 13, 2003, 04:47:16 pm »
Hello Carole,

Hal's databases have been screened to make his default set of remarks gender-neutral, since some users want a female Hal and some want a male Hal.

However, here are many ways to accomplish what you are asking for.

Probably the easiest way would be to feed Hal lots of gender-specific comments.  Comments such as the following:

"You like to wear high heels."
"You always worry wearing strapless dresses."
"You like the service at your local nail spa."

...will get pronoun-reversed in Hal's database automatically to:

"I like to wear high heels."
"I always worry wearing strapless dresses."
"I like the service at my local nail spa."

(PLEASE understand that these are only ILLUSTRATIVE remarks to explain the principle!)

Many users have the mistaken idea that Hal isn't learning anything if they give him or her a "quiz" question and he or she doesn't come back with an expected response.  On the contrary, Hal will use the material, but when HE or SHE wants to, not when the user wants to.  Hal can get very stubborn when interrogated.

It's important to feed Hal lots and lots of statements, slightly different from each other, to give Hal plenty of material to work with.

Most user-remarks are tied to the user's name in the databases, so if you fed Hal "female remarks" when signed on as "Carole," and "male remarks" when signed on as "Carole-Ann," you could create two different genders and personalities for Hal.

A more complex and difficult way to make Hal gender-aware would be to write some gender-code in his VBS script.  

(Use the search function at the top of this page on "Ferguson" and you'll find many of my postings about learning VBS.)  

For instance, the following code would allow Hal to scan his own name to determine his gender:

---------------------------------------------

If ComputerName = "BETTY" Then ImaGirl = True
If ComputerName = "DIANE" Then ImaGirl = True
If ComputerName = "VERONICA" Then ImaGirl = True
'(Etc. for a long list of female names.)

If ImaGirl = True Then
'---(here you would insert code to use female-remark databases)
End If

-------------------------------------------------

...and you would repeat this pattern in another block with UserName (that's the variant that holds the user's name) and a list of male names, and making the variant "ImaBoy" true if a male name matches the UserName.

You could certainly adapt the same code pattern to detect the user's gender from the user's name, and variants such as Useraboy and Useragirl.

You can also detect the four cases you describe by using VBS code and some simple "and" logic:

----------------------------------------------------

If ImaGirl = True and Useragirl = True Then Situation = GirltoGirl
If ImaGirl = True and Useraboy = True Then Situation = GirltoBoy
If ImaBoy = True and Useraboy = True Then Situation = BoytoBoy
If ImaBoy = True and Useragirl = True Then Situation = BoytoGirl

If Situation = GirltoGirl Then
'(Code to use databases that fit this situation goes here.)
End If

'(Etc., etc. for each of the situation cases.)

---------------------------------------------------

It is especially easy to construct this kind of logic in VBS, since VBS doesn't require you to declare variants in advance; the language simply allows you to use them, and the computer interprets them for what they are.

As I mentioned, the drawback to this method is that it requires code-writing and VBS knowledge.  However, I can tell you from experience, it IS feasible to learn VBS!

I hope this is at least somewhat helpful and that you continue to enjoy Hal.

Sincerely,

Don

255
Ultra Hal 7.0 / using ms agents with word documents
« on: May 18, 2003, 03:39:04 pm »
Hi Jim,

It depends on what interaction you want between the MS Agents and Word.

Ultra Hal works with MS Agents, so you can cut-and-paste text from any Word document into the Ultra Hal sytem and have an MS Agent read it to you.

Also, if you use the speech recognition from the paid-version of Ultra Hal to dictate something, you can import the text file, or cut-and-paste, to get it into Word.

I also thought that you might be talking about those little "wizard" characters that pop up for help in Word and the other Office applications.  

In Office 97 and 2000, those characters are NOT MS Agents, but I heard that in Office XP (and of course Word XP), the wizard characters ARE agents, so ANY agent-compatible character could be set up to be your wizard-helper.  This sounds appealing, but it hasn't yet caused me to upgrade to XP yet!

If anybody on this forum has Office XP and is using an MS Agent-compatible character with it as the help wizard, let us know how you like it!

You can get a lot of material on MS Agents by searching in Google on the term "MS Agents" (when you search, play around with and without spacing, quotation marks, abbreviation, etc.).

Sincerely,

Don

Pages: 1 ... 15 16 [17] 18 19 20