« on: September 21, 2016, 06:08:26 pm »
Art, you asked somewhere else in a posting , don't remember which one so am starting a new one so you and others can find this .
I mentioned before that i wrote and asked Robert about this problem and he sent this to me , this was a long time ago, i don't remember if it fixed it or not*that's why i put the question mark on the header. so be sure and make a back up of the brain first!!
Hope this helps , Art if you use it let me know if it works okay. by the way i have had hal give me a blank answer but it had to do with a plug in error problem , once the plug in was fixed no blank problem .
so here it is.
ATTENTION ****** THE BELOW CODE NEEDS TO BE PUT IN :
try placing the code just below this line:
Function UltraHal(ByVal InputString, ByVal UserName, ByVal ComputerName, ByVal LearningLevel, ByVal DatabaseFile, ByRef Hate, ByRef Swear, ByRef Insults, ByRef Compliment, ByRef PrevSent, ByRef LastResponseTime, ByRef PrevUserSent, ByRef CustomMem, ByRef GainControl, ByRef LastTopicList)
'RESPOND: User pressed enter, but didn't say anything lets prevent
'blank responses which sometimes occure and eliminate them by adding
'a random topic that gives the brain a chance to keep its database open
'so that a response will always be given. sometimes a user will repeatedly
'enter blanks that causes HAL's engine to give nothing but blanks, this
'code helps prevent that 100%
CheckStringQuality = Trim(Ucase(HalBrain.AlphaNumericalOnly(InputString)))
CheckStringQuality = Replace(CheckStringQuality, "'", "", 1, -1, vbTextCompare)
If CheckStringQuality = "" Then
Select Case HalBrain.RandomNum(5)
InputString = HalBrain.ChooseSentenceFromFile("love3") & vbCrLf
InputString = HalBrain.ChooseSentenceFromFile("insults") & vbCrLf
InputString = HalBrain.ChooseSentenceFromFile("sharedQuestions") & vbCrLf
InputString = HalBrain.ChooseSentenceFromFile("love2") & vbCrLf
InputString = HalBrain.ChooseSentenceFromFile("love1") & vbCrLf
InputString = InputString
HalBrain.DebugWatch InputString, "Prevent Blanks InputString response"