the error in 2571 occurs with the human emotions plug-in only.
If other plugins are enabled, it is a different line
lines 2500-2580
If InStr(1, GetResponse, "i'm", vbTextCompare) = 0 And InStr(1, GetResponse, "i am", vbTextCompare) = 0 And InStr(1, GetResponse, "name", vbTextCompare) = 0 And InStr(1, GetResponse, "this is", vbTextCompare) = 0 Then
GetResponse = " " & GetResponse & " "
GetResponse = Replace(GetResponse, "Ultra Hal Assistant", " " & NewName & " ", 1, -1, vbTextCompare)
GetResponse = Replace(GetResponse, "Ultra Hal", " " & NewName & " ", 1, -1, vbTextCompare)
GetResponse = Replace(GetResponse, "Hal Assistant", " " & NewName & " ", 1, -1, vbTextCompare)
GetResponse = Replace(GetResponse, " Hal ", " " & NewName & " ", 1, -1, vbTextCompare)
GetResponse = Replace(GetResponse, " Hal,", " " & NewName & ",", 1, -1, vbTextCompare)
GetResponse = Replace(GetResponse, " Hal.", " " & NewName & ".", 1, -1, vbTextCompare)
GetResponse = Replace(GetResponse, " " & ComputerName & " ", " " & NewName & " ", 1, -1, vbTextCompare)
GetResponse = Replace(GetResponse, " " & ComputerName & ",", " " & NewName & ",", 1, -1, vbTextCompare)
GetResponse = Replace(GetResponse, " " & ComputerName & ".", " " & NewName & ".", 1, -1, vbTextCompare)
End If
'PROCESS: PRESERVE ALL VARIABLES
PrevUserSent = UserSentence
CustomMem = HalBrain.EncodeVar(NewName, "NewName") & HalBrain.EncodeVar(UserSex, "UserSex") & HalBrain.EncodeVar(SentCount, "SentCount")
Rem PLUGIN: CUSTOMMEM2
'The preceding comment is actually a plug-in directive for
'the Ultra Hal host application. It allows for code snippets
'to be inserted here on-the-fly based on user configuration.
End Function
'If the user clicks on the About/Options button for this plugin
'this sub will be called. There are no extra settings for this brain,
'so we'll display an information box
Sub AboutOptions()
HalBrain.MsgAlert "This is the Ultra Hal 6.1 Default Brain. This brain has no additional options."
End Sub
'This sub will be called when the Ultra Hal program starts up in case
'the script needs to load some modules or seperate programs. If a return
'value is given it is passed as a Hal Command to the host Hal program.
Function Script_Load()
Rem PLUGIN: SCRIPT_LOAD
'The preceding comment is actually a plug-in directive for
'the Ultra Hal host application. It allows for code snippets
'to be inserted here on-the-fly based on user configuration.
End Function
'This sub will be called before the Ultra Hal program is closed in case
'the script needs to do any cleanup work.
Sub Script_Unload()
Rem PLUGIN: SCRIPT_UNLOAD
'The preceding comment is actually a plug-in directive for
'the Ultra Hal host application. It allows for code snippets
'to be inserted here on-the-fly based on user configuration.
End Sub
'If the host application is Ultra Hal Assistant, then this sub will be
'run once a minute enabling plug-ins to do tasks such as checking for
'new emails or checking an appointment calendar.
Sub Minute_Timer(MinutesPast)
Rem PLUGIN: MINUTE_TIMER
'The preceding comment is actually a plug-in directive for
'the Ultra Hal host application. It allows for code snippets
'to be inserted here on-the-fly based on user configuration.
End Sub
Rem PLUGIN: FUNCTIONS
'SURPRISED
Function Surprise(UserName)
Set FileSys = CreateObject("Scripting.FileSystemObject")
Set FS = CreateObject("Scripting.FileSystemObject")
Set HalXBrain = CreateObject("UltraHalAsst.Brain")
TempMod = "C:Program FilesabawareUltra Hal Assistant 6Users\" & Trim(UserName) & "_Surprised_Emotion.brn"
If FileSys.FileExists(TempMod) = False Then HalXBrain.AppendFile TempMod, ">" & vbCrLf & ">" & vbCrLf & ">"
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("C:Program FilesabawareUltra Hal Assistant 6Users\" & Trim(UserName) & "_Surprised_Emotion.brn", ForReading)
strText = objTextFile.ReadAll
strText = Replace(strText, " ", "", 1, - 1, vbTextCompare)
strText = Trim(strText)
objTextFile.Close
Surprise = Len(strText) / 3
End Function
'HAPPY
Function Happiness(UserName)