1
Ultra Hal Assistant File Sharing Area / Scripts, addins, and extras
« on: April 10, 2005, 09:13:33 am »quote:
Originally posted by HALImprover
Check this out. Simply create a folder in the main folder (C:/Program Files/Zabaware/Ultra Hal Assistant 5) called 'read' and add in the code from the following link. Next, put any text files that you want Hal to read in the 'read' folder and say to Hal;
readfile filename
where filename is the name of the text file in the read folder (do not put the .txt entension). For example;
readfile astronomy
hi,
first i am a bit of a beginner on this.
I have tried to make Hal read using your second corrected script but no go.
I have copied the script into the new read directory. Do I need to rename it and what file extension should I use.
many thanks
Mike
and Hal will read the first paragraph of text from C:/Program Files/Zabaware/Ultra Hal Assistant 5/read/astronomy.txt
The only warning is that the code will only read from the beginning of the text file to the first line break (like when you press the Enter key), so to read a story with multiple paragraphs you would have to delete any extra line breaks. Otherwise, hope this helps, and enjoy!
P.S. If Mr. M. would implement the ability to detect when Hal is finished speaking (as I suggested previously), I could develop this code to read any format of text file (ie. multiple paragraphs, etc.).
P.P.S. Here are some text files with common knowledge to teach to Hal. I will try posting new files every week.
Happy coding []
Download Attachment: ReadingAddin.txt
962 Bytes
Download Attachment: CommonKnowledge1.txt
59.89 KB
Download Attachment: CommonKnowledge2.txt
62.67 KB