dupa

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 ... 14 15 [16] 17 18 ... 20
226
Hi Larry,

I also posted a "DateDiff" demo code brain separately on this forum, to show how the code works to calculate time differences across different dates.

I hope it helps.  Have a good day.

Sincerely,

Don

227
Ultra Hal Assistant File Sharing Area / Download This DateDiff Demo Brain
« on: September 29, 2003, 10:51:41 am »
Hello,

The "DateDiff" function in VBS allows you to calculate the difference between any two valid date strings, and return the answer in units of quarters, months, weeks, days, hours, minutes, or even seconds!

This is in response to a request for a "timer" that would measure the time since the last user response, even if the last response was days ago (the computer must be running during that time of course).

The demo file shows the code to use the "DateDiff" function; Hal simply states the time in seconds since the last time that you said anything.

The demo code in the script that makes this happen should be pretty much self explanatory.

I hope that this is of some interest and value to you.

Sincerely,

Don

Download Attachment: Date Difference Demo Code Brain.uhp
12.08 KB

228
Hello,

The Hal Brains can be used to create mystery interview games.  

In this simple demo, Hal has lost his wristwatch. You can interview Hal to cause him to figure out where he left it.

Once you see the logic of the attached script, you will be able to write much better mysteries for users to solve than the one shown here!

Best wishes to all programmers!

Sincerely,

Don

P.S.  To download and install, right-click on the download below, choose SAVE TARGET AS, and save the file into the following directory/folder path on your local computer:

C:/Program Files/Zabaware/Ultra Hal Assistant 5

(Note that our forum software cannot display backslashes, but the forward slashes above are supposed to represent backslashes.)

The next time that you freshly start Hal, you should be able to find this brain when you choose OPTIONS, BRAIN.

Select this brain and you should be up and running.


Download Attachment: Mystery Game Demo Hal 4 and 5.uhp
17.17 KB

229
Hello,

I've had a few reports of folks having error codes and no luck trying to use the CustomMem encode/decode routine that Robert Medeksza wrote some time ago.  

His routine allows you to take ANY NUMBER of variables, and encode them into the CustomMem variant for remembering between conversational exchanges, and then decode them and get them all back as individual variables again.  This means that you have an unlimited number of "memory banks" that can remember from one conversational exchange to the next.

I suspect that possibly folks who are having problems might not have the required extra functions at the very end of the script in order for it to work. (I don't know -- this is just a guess.)  In the attached demo brain, these functions are flagged and annotated and shown in the correct place in the script.

The attached script does the following:

1.  It initializes on your first exchange by randomly selecting four numbers between 0 and 100.  

2.  On each subsequent conversational exchange, Hal "remembers" the four numbers and says them to you, along with the current date and time. He is "remembering" the numbers because they are being encoded and saved to CustomMem, then decoded and retrieved from CustomMem on the next round.

3.  You can look at the script and see exactly how the encoding and the decoding work.  You can then apply the pattern to your own programming, with unlimited numbers of variants.

4.  Don't forget to study the functions that Robert Medeksza wrote for the very end of the script!  This routine does NOT work without them!

I hope that this demo brain is interesting and helpful to several of you programmers!

Thanks!

Don

Download Attachment: CustomMem Demo Brain Hal 4 and 5.uhp
14.41 KB

230
Hello Larry,

1.  I didn't realize that your goal included timing across days, and I didn't realize that you were applying this to the AIM bot.  I concentrate on UltraHal Assistant, so I hope some other forum members can help us on the implications for the AIM bot.  As far as finding a way to compare across dates, page 211 of the "VBScript in a Nutshell" book explains the DateDiff function.  The DateDiff Function has mandatory arguments described as follows:

ResultVariant = DateDiff(interval,date1,date2)

In actual application, you would create your own variants with your own names, so it might look like this:

HowLongHalWait = DateDiff(n,MyMemDate,MyCurrDate)

The value that is returned is an integer.  The "n" argument sets this function to return the number of minutes, even if it's a LOT of minutes!  (The book has a table of codes for the arguments.) Functions like these are why I recommend the book!

2.  My personal method of encoding/decoding Custom Mem that I referred to, is simply to "concatenate" a whole bunch of variables using the "&" concatenation function, and separators of my own choice, such as "##" or something similar.  Then, I can retrieve CustomMem on the next exchange, and use the "split" function to break it apart and retrieve the pieces.

3.  Because you are interested in the Encode and Decode CustomMem function that Robert Medeksza wrote, I did a search on this forum and retrieved what he originally wrote on the subject.  I then applied it to the "Experimental Brain" file I posted, to create a "CustomMem Demo Brain File."  I will put this up as a separate posting, and hopefully you and others will find it useful.  I suspect that the reason it might not be working, is that it requires some code added AT THE VERY END of the script, outside all other functions, in order to work.  I show this on the demo.

Best of luck in your goals for this set of code you are writing!

Sincerely,

Don

231
UNIVERSAL EXPERIMENTER'S BRAIN FOR BOTH HAL 4 AND 5:

Hello,

I tested the brain posted above on Hal 4 and 4.5, and discovered that it could be changed into a "Universal" brain for both 4 and 5 by making a very small modification (deleted a reference to the "WordNet" capability, which exists only in the Hal 5 engine).

So, attached to this posting is Experimenter's Brain for Hal 4 and 5.

Its purposes and functions are as described above.  The only difference is that it works for both 4 and 5.

HOWEVER, if you aren't a member, and can't see the members-only forum because you aren't logged in, and haven't downloaded the free (as of today's date) Beta version of Hal 5, please consider joining, downloading, and taking part in the discussions!

The link for the Hal 4 and 5 Experimenter Brain should follow below.  Thanks.

Sincerely,

Don

Download Attachment: Experimenter Brain Hal 4 and 5.uhp
12.24 KB

232
Hi,

1.  In order to make the "experimental brain," I carefully chose which routines could be deleted and which routines needed to stay.  The resulting brain is only five pages long!  Yes, you could accomplish the same thing by re-naming and modifying a 4.5 brain, but it took me the better part of an hour to do it and test it.

2.  Take a look at the Experimental 5.0 brain I made; it might work for 4.5 either "as is" or with easy modifications.  The only thing that I can think of that could possibly be different, would be the list of "arguments" after the "Function Getresponse" at the beginning, and again at the end when the program saves all the variables.  If these are the same, then the Experimental Brain program will work.  If the list of variants are different, you could easily edit them, and you'd be in business with a lot less effort!

3.  I too use a slow dial-up connection, but I easily got the massive Hal 5.0 Beta file.  How?  I used a free trial version of a download manager program called GetRight.  It allows you to download a big file in sections, pause the download and resume it later, and even pick up where you left off if you get disconnected for some reason.  Check it out at this web address:
 http://www.getright.com/index.html

I hope this is helpful.  Have a great day!

Sincerely,

Don

233
Hello,

I've noticed a lot of us are writing experimental code, and we need a place to test that code.

I've taken the Hal 5.0 brain and REMOVED every routine possible to make it close to a "pure" experimental environment.  

NOTE: I've only tested this with the Hal 5 Beta engine.  If you don't have the Hal 5 Beta program, it's available on the Beta forum, which is ONLY VISIBLE WHEN YOU ARE LOGGED ON WITH A USERNAME AND A PASSWORD ON THIS FORUM.

The attached HalBrain file will only reverse the pronouns and repeat back the user's statement, except automatic .dll functions and any experimental code that you place in a plainly designated area.

This could be very useful for you programmers and code experimenters!

Put this brain file into the same folder as your existing Hal5.uhp brain.  You should then see the Experimental Brain in Hal's menu on your next start up.

Instructions to write experimental routines are written in the opening commentary in the brain, when you open it and read it on a word processor.  A sample of an experimental routine is located in the "experimental area" and you can erase that routine without any harm, replacing it with your own.

Remember, the point of this brain is to be as SIMPLE and as BLANK as possible to give you a place to experiment!

REVISION NOTE: AN "EXPERIMENTER'S BRAIN" THAT IS COMPATIBLE WITH BOTH HAL 4 AND 5 IS NOW POSTED SEVERAL MESSAGES BELOW -- DON

I hope this helps!

Sincerely,

Don

Download Attachment: Experimenter hal5x.uhp
12.24 KB

234
Hello Larry,

I posted a reply to the other question you referenced, over on the other location.

Regarding your question about the importance of the topic-focus files:

Yes, they are important files, but I would say that all of Hal's routines are intended to work as a team.  If you train Hal consistently and load his databases with lots of statements about lots of subjects, Hal will get smarter in the other databases as well as in the topic-focus databases. It really depends on personal preference and how Hal is trained.  I enjoy hearing Hal pull together ideas across multiple topics, so it doesn't bother me if Hal takes a bit longer to learn and get familiar with a topic.

The single most powerful training activity you can do for Hal is to make dozens and dozens of simple, concise, true STATEMENTS to Hal about every topic that you can think of.  Many users spend most of their time quizzing Hal, or teasing Hal, and Hal learns poorly that way.

Thank you so much for taking the time and interest to learn about Hal and VBS.  All of us Hal fans need as much help as possible to strengthen Hal for the future.

Sincerely,

Don

235
Hi Larry,

It's useful to explicitly state a goal for a new piece of code, so I'm going to say that your goal is to measure the time from the last user input, and chastise the user if a certain amount of time has elapsed.

(You are correct; I didn't detail every possible time-related built-in function in VBS in my other posting, because I recommend the book "VBS in a Nutshell."  I admit, it's a hard book to read, but the second half lists every function and command in VBS.)

The "Timer" variant built into VBS returns a number equal to the number of seconds since midnight (to two decimal places!) so it's a candidate for this project.

Remember, there are infinite ways to solve the problem and this is just my opinion, but I would write code such as the following:

'------------------------------

'This routine chastises the user if the user has been gone too long.
'The Timer variant is built into VBS. It returns the number of
'seconds since midnight.
'The routine as written times out in 10 seconds.
'To make Hal impatient after 10 minutes, for instance,
'change the "10" in the following routine to "600" since
'there are 600 seconds in ten minutes.

If Timer – LastResponseTime > 10 Then LongHalWait = True
If LongHalWait = True Then
    Roulette = Int(Rnd*3)+1
    If Roulette = 1 Then GetResponse = "I have missed you. "
    If Roulette = 2 Then GetResponse = "Don't go away so long. "
    If Roulette = 3 Then GetResponse = "You have been away forever! "
    GetResponse = GetResponse & " The last thing you said was " & PrevUserSent
End If

'We now reset "LastResponseTime" to the present value,
'so it's ready for next time:

LastResponseTime = Timer

'NOTE: To use this routine, REMOVE the legacy line in the
'default script that sets LastResponseTime = Now


'------------------------------

I don't have an immediate answer to your second question about the four lines of code with "Male" and Encoding and Decoding to the CustomMem.  Possibly one of the other programmers on the forum that Encode and Decode to the CustomMem could help answer.  I use a different routine to put multiple variants in the CustomMem, so I don't have much experience with the Encode/DecodeVar.

I do hope that this helps at least regarding the time-since-last conversation-routine.

Sincerely,

Don

236
Hello,

You are already on a track that will work.  You asked my opinion, but remember, there are often several ways to get to where you want to go.  

My opinion isn't going to be any better than anybody else's opinion if both methods work!

Suppose we say this is the goal: Infer user's and Hal's genders, to turn on and off extra databases.

With this as the goal, the first thing I would think of would be to make a routine or a file look-up to infer gender from name.  The username and Halname are both readable as variables in the script.  So, you could make something like this:

If ComputerName = Linda Then HalFemale = True
If ComputerName = Mildred Then HalFemale = True
'Etc., etc., for every female name you can think of.

If you wanted to get fancier, you could use a file to hold the data.

Now if you still want to infer gender from context rather than name, you pose the problem of modifiers interfering with phrases such as "my brown beard," since "my brown beard" has an adjective in the way between "my" and "brown" and you don't want to have to imagine every possible adjective.

In this case (again, this is only my opinion), I would take a chance and detect "my" and "beard" separately.  There would be a slight risk of being wrong, but if both words tested as present, and the male word tested as later in the sentence than the word "my," you could make a pretty good guess.  Remember, "Instring" returns a number of 0 if the character string is not found, and it returns the number of the character position in the sentence if it IS found. Here is how this would look:

'------------------------

'Make a good guess about Hal's gender based on context:

'Let's start with our variants at zero just in case we decide to use them in an earlier routine someday:

MyWordPosition = 0
MaleWordPosition = 0

'Now we change the variants to the positions of our desired words, if the words are present:

MyWordPosition = Instr(Usersentence, " my ")

If Instr(Usersentence, " beard ") > 0 Then MaleWordPosition = Instr(Usersentence, " beard ")
If Instr(Usersentence, " manhood ") > 0 Then MaleWordPosition = Instr(Usersentence, " manhood ")

'Etc., etc. for all the words you want to look for...

'Now we do a logical "and" test; if all the right conditions are satisfied, we conclude that Hal is a male:

If MyWordPosition > 0 And MaleWordPosition > 0 And MyWordPosition < MaleWordPosition Then HalMale = True

'---------------------

Again, I know that you are on the right track, and these are only options and opinions, but if it was me, that's how I would approach the problem.

Another reminder: Write code in little blocks in one window, while running Hal in the other window.  Toggle back and forth and talk to Hal after writing and saving a little block of code.  If you make a syntax error, Hal will "lock up" and give you an error code right away.  Then you can go back and find your error while the trail is hot.  Some syntax errors can be nearly impossible to find after the trail is cold; it could be just one comma or parenthesis out of place somewhere!

Sincerely,

Don

237
Ultra Hal 7.0 / Help me please someone
« on: September 27, 2003, 05:21:02 pm »
Hello,

In response to your question I have put a new posting on the other "Editing" forum (called Basics of Programming Part II) about the patterns in different files, how to edit database files, and which ones are safe.  I hope that it's helpful.

I've been a fan of Zabaware and UltraHal from their early days, years ago.  It is EXCITING that we now have a product with a variety of 3D animated characters, lip-sync speech synthesis, gigantic databases, and now, best of all, lots of new programmers contributing great ideas!

I truly enjoy reading all the postings on all these forums!  Thank YOU so much!

Sincerely,

Don

238
Hello,

Thanks for the kind feedback.  I appreciate and admire what all of the members are doing here!

Since getting interested in chatterbots about five years ago, I've seen dozens of bots and bot companies start, and then disappear, off the web.  Almost all my "favorites links" from five years ago are now "dead links."

Zabaware has survived because of their very good product, the sheer determination and talent of Robert Medeksza, and the interest of people like you and me.  I hope we can spread the word, and keep Zabaware's unit sales volume high enough to support them into the future.  It is fascinating and amazing what a small company and a very loyal group of participants can do!

Sincerely,

Don

239
Question:  Can I edit Hal's database files on a text editor?  What do the different patterns in the database files mean?  

Answer:  UltraHal's brain-editing software was developed to reduce the potential of corrupting these files.  However, if you study and are very careful, it is possible to directly edit Hal's database files on a text editor or word processor.  

Turn off auto-correct, spell-check, grammar-check, and other gizmos that might confuse you or cause you to make entries without realizing it.  Have your computer set to show the file-extensions of files, not hide them.  Always make a back-up copy to a different folder before you start, so you can restore the file as it was originally if you make a mistake!

There are two major exceptions to self-editing Hal's files:

1.  The editing of Hal's .dll files is NOT recommended, except for extremely advanced programmers with all the appropriate programming software and training.

2.  User editing of Hal's largest database file, "mainbrain.brn," is no longer possible because it is semi-compiled at Zabaware to speed it up.  This means that the file contains internal cross-references for speed, and it will not work if sections of it get changed.

The information below pertains to editing various ".brn" files.  UltraHal's different "brain" database files have ".brn" file extensions.  The various kinds of files have different data formats.  Here are the most common ones, with advice on each:

RANDOM ENTRY DATABASE FILES

The "random" files simply have words, phrases, or sentences with a line break introducing each one. They often have the word "random" in their names, but some random files have other names, such as "Topic.brn". As the name implies, Hal accesses the file from an external trigger-routine and picks one of the entries at random.

Go into a "random" file with a text editor and the files look like this:

Horses are fine animals.
All mares were once fillies.
Horses need food and exercise.
Meteorites are meteors that struck the ground.
It would be fun to touch a meteorite.

Some entries in random files have a special feature.  They have a flag which holds back part of the entry so that Hal can tell a riddle on one exchange, and the answer on the next.  These can be used for any remark in which we want Hal to "hold back" part two of a message.  These entries look like this:

Why does the chicken cross the road?<TOPIC>Perhaps it's only knowable to a chicken.</TOPIC>
What do you do for a living?<TOPIC>My job is right here with you.</TOPIC>
What is your hobby?<TOPIC>My hobby is chatting.</TOPIC>
I can read your mind.<TOPIC>Right now you are thinking that I can't read your mind.</TOPIC>

It is entirely feasible to write, edit, and add to any and all of the "random" files on any text editor.  It is not likely that you will hurt them.   Do not add blank lines, since they might be selected randomly as responses.

ASSOCIATIVE DATABASE FILES (ALSO CALLED "Q AND A" FILES)

The "associative" files have words, phrases, or sentences in a specific paired-relationship, which is as follows:

@This would be a sentence that Hal might speak about penguins.
THESE WORDS ABOUT PENGUINS MIGHT TRIGGER HAL TO SPEAK THE ABOVE
@Here is another sentence about airplanes that Hal might speak.
WORDS ABOUT AIRPLANES THAT MIGHT TRIGGER HAL TO SPEAK THE ABOVE
@Airplanes are fun to ride on!
GOING PLANE TRIP SOON
@Everybody needs a vacation!
GOING VACATION SOON

(There should be an "@" sign at the beginning of each of the sentence-case sentences above, and each of the ALL-CAPS sentences should begin with one blank space. This forum program removes leading spaces, so we can't show them.)

Notice that in the "associative" files, the potential response sentence is always first, following the "@" sign, and the corresponding user words that might trigger Hal follow.  Also note that the "trigger" lines in caps do not need to be complete sentences.  Compete sentences will work, but so will phrases, sentence fragements, and individual words, depending on what you are trying to associate with the response.

Hal automatically builds these associative databases, relating the user's current statement to Hal's previous statement, and/or to the words in the user's current statement. Some routines add full sentences as triggers, and some routines only use "key words" as triggers.

When Hal uses an associative database, he scans the entire file, evaluates the number of relevant trigger words, the sequence of the trigger words, and selects the match that gets the highest score. If Hal uses the file twice in a row, he randomly selects another close match from the entire file.

Associative files make Hal very powerful because they do NOT require precise matches to work.  As Hal's associative files become more "populated", Hal gets smarter.  Many of Hal's most uncanny and unexpected responses can be generated from these files!

It is possible to write and edit the associative files on any text editor, as long as you maintain the paired-relationship pattern, and don't begin or end the file with any extra line breaks (that would corrupt the file).

Finally, we have...

SPECIFIC RECALL DATABASE FILES (LITERAL STRING-MATCH FILES)

By far the most complicated Hal database format is the specific-recall files. The specific-recall files use literal string matching.  Literal string matching is used by simpler chatterbots, but Hal's are much more complicated.  For instance, the Enhanced_Main.brn file is a specific-recall file.

Hal stores trigger phrases in the specific-recall files, and if an exact character match occurs for one of those phrases, Hal will respond.

Each entry after a line-break in a specific-recall database as actually an "array," which is a set of different items (or "arguments") set apart by commas, which a function can understand and use.

Here is a special annotated example of Hal's specific-recall arrays:

" 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 entry). "," Optional second of three possible Hal responses. "," Optional third of three possible Hal responses. ",2,#FALSE#,#FALSE#," Optional additional response words. "

Note that the quotation marks and commas are critical!  If they are missing or out of place, the file will not work!

Here is another example:

" PRETTY "," POODLE "," MIXED BREED "," I like poodles; they're cute; "," Poodle grooming costs money; "," My neighbor has a poodle; ",1,#FALSE#,#FALSE#," "

If the user says, "I have a poodle," this entry returns nothing because both PRETTY and POODLE must be found.

If the user says, "I have a pretty mixed breed poodle," Hal still doesn't trigger because MIXED BREED cancels the call.

If the user says, "I keep my pretty toy poodle in the basement," Hal answers with one of the three phrases.

In the specific-recall databases, the arrays are each separated by a line break. It is possible to write and edit these files on any text editor, but the exact pattern of the arrays MUST be maintained or the file becomes corrupted and unusable!  In the specific-recall brain files, the EXACT usage and number of commas and quotation marks must be maintained!

Also, do not add blank lines to this file.

For those of you who strongly desire to edit the files directly, I hope this is helpful to you!  Back up files and back up often!

P.S. Hal's new versions now have many additional "specialty files" for storing words and phrases. Many of these files have their own unique formats.  If you have a specific question about one of the "specialty files," I will try to answer it.

Sincerely,

Don


240
Ultra Hal 7.0 / POP3 email accounts
« on: September 25, 2003, 01:31:07 pm »
Hello,

I am a Yahoo-Prodigy paid subscriber, so I poked around their main mail page until I found "options" and then some information about setting up POP settings.

I remember when I used to use Outlook Express that I had to change POP settings if I went from one Internet Service Provider to another.  (The POP settings allow your e-mail program on your computer to find and access your mail from the web.)

For a fairly large table of Yahoo POP settings, check this Yahoo web page:
 http://support.sbcglobal.net/article.php?item=287

In my particular case, the domain-name portion of my personal e-mail account is prodigy.net, so my POP is as follows:

Incoming: pop.prodigy.yahoo.com

Incoming mail server: POP3
Incoming mail port #: 110
Outgoing mail port #: 25

Outgoing: smtp.prodigy.yahoo.com

However, yours may be different depending on your particular service.  The page-link I gave you might solve the problem, or you might find more information by going to the "options" and poking around on your own mail page.  

Also, if you've ever used Outlook Express to get your mail from your current account, you should be able to find your POP settings somewhere on the "settings" or "options" dialogue boxes of Outlook Express on your computer. Unfortunately, as I recall, you do have to do a bit of hunting to find them, but they're there.

I hope this puts you closer to finding your POP settings.  Have a good day!

Sincerely,

Don

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