Try this to read through your knowledge files
note that i inserted this in the XTF1.2 brain directly after the line
'PROCESS: CONTROL TOPICFOCUS
'=vonsmith= Entirely replaced with new XTF topic function.
after adding the code and
befor setting the "autoidle on" command
enter "autoidle read"
this will create the idlethought.txt file from the file you enter
(it is best to put the knowladge files in the working directory befor hand)
'==== MORE FREDFISH STUFF========
' auto- idle set and reset
'Turn off auto idle feature by entering in the line autoidle off
If InStr((UCase(UserSentence)), "AUTOIDLE OFF") > 0 Then
HalCommands = "<AUTOOFF>"
GetResponse = "Autoidle turned off."
End If
'Turn on auto feature by entering the line autoidle on
If InStr((UCase(UserSentence)), "AUTOIDLE ON") > 0 Then
HalCommands = "<AUTO>400000</AUTO>"
GetResponse = "Autoidle turned on."
End If
' set up file to read at idle times by entering the line autoidle read {file to read}
If InStr((UCase(UserSentence)), "AUTOIDLE READ") > 0 Then
UserSentence = Replace(UCase(UserSentence),"AUTOIDLE READ","",1,-1,vbTextCompare)
If UserSentence <>"" Then
If InStr(1,UserSentence,"\")=0 And InStr(1,UserSentence,":")=0 Then
UserSentence = WorkingDir & Trim(UserSentence)
End If
GetResponse = GetResponse & "reading file " & UserSentence
Dim ofso, ofil, ir, iis
Set ofso = CreateObject("Scripting.FileSystemObject")
' this is the file to read line from
Set ofil = ofso.OpenTextFile(UserSentence, 1)
iis = ofil.ReadAll
ofil.Close
Set ofil = Nothing
UserSentence = " AUTO-IDLE"
' we make a copy of the file to a temperary location
' so we can also clean up the file For processing here
ir = (WorkingDir & "idlethought.txt")
Set ofil = ofso.CreateTextFile(ir)
ofil.Write iis
ofil.Close
Set ofil = Nothing
' we set the start location file to save ware we start reading from
ir = (WorkingDir & "idlethought1.txt")
Set ofil = ofso.CreateTextFile(ir)
ofil.Write "0"
ofil.Close
Set ofil = Nothing
End If
End If
' when the auto-idle string is incountered read a line from the idlethought file
If InStr(1,(UCase(UserSentence))," AUTO-IDLE",1) > 0 Then
Usentence = ""
Dim fil, r, s, s1, s2, s3, s4
r = (WorkingDir & "idlethought.txt")
Set fso = CreateObject("Scripting.FileSystemObject")
' this is the file to read line from
Set fil = fso.OpenTextFile(r, 1)
s = fil.ReadAll
fil.Close
Set fil = Nothing
' this is the location in the file to start reading
s4 = WorkingDir & "idlethought1.txt"
Set fil = fso.OpenTextFile(s4, 1)
s1 = fil.ReadAll
fil.Close
Set fil = Nothing
' find next sentence by line feed
If s1 <> "" Then
s2 = (s1)+1
s3 = InStr(s2,s,Chr(10))
If S3 = 0 Then
S3= Len(s)
End If
USentence = Mid(s,s2,s3-s2)
Else
s2 = 1
s3 = InStr(s2,s,Chr(10))
USentence = Mid(s,s2,s3-s2)
End If
If s3=>Len(s)-1 Then
s3 = 0
End If
' next string search will begin at s3 location so we make a file with this number in it
Set fil = fso.CreateTextFile(s4)
fil.Write s3
fil.Close
Set fil = Nothing
DebugInfo = DebugInfo & "this auto-idle sentence location is from " & s2 & " to " & s3
If USentence <>"" Then
UserSentence = USentence
End If
If UserSentence = " " Then
UserSentence = ""
Else
GetResponse = GetResponse & "," & UserSentence
End If
' end of auto-idle response
End If
'========END OF FREDFISH STUFF=====