I'm totally new to UltraHal, so I've been digging through some of the Brain help documentation. I found this. Maybe this will help someone??
STOP SCOLDING CODE
Many users are put off by Hal's scolding of them when they swear. As a result, a common request is to prevent Hal from admonishing them on their manners - or lack thereof. There are actually several ways to accomplish this goal that - while being specific to this one issue - should also illustrate to you how to solve many other similar issues where you would like to control what Hal does or doesn't say.
The first thing you would do is to locate the offending code. In this case, the code is a call to the Insult function and looks like the following (slightly formatted for better viewing in Help file format):
'RESPOND: CALL INSULT HATE SWEAR FUNCTION
'This function will check for insults and swearing
'and respond to them. It is built into this script,
'so you can edit it.
CheckInsult = Trim(Insult(UserSentence, Insults, Hate, Swear, WorkingDir))
If Len(CheckInsult) > 4 Then
GetResponse = GetResponse & CheckInsult & VbCrLf
AvoidBeingFlag = True
DebugInfo = DebugInfo & "The user has insulted Hal " _
"and Hal has responded to it: " & CheckInsult & VbCrLf
End If
Once the code has been located, there are three general ways to prevent Hal from scolding a swearing user with each method being a slightly better than the previous:
Remove the function call - The easiest method is to simply remove the call to the function that is producing the undesirable results - as well as the code that interprets the results of that function call. You can also simply comment the code out by placing apostrophes at the beginning of each line that you do not wish to execute. While being the easiest, this is the least desirable means of accomplishing the goal as the Insult function also performs other duties besides scolding that are being lost with its removal (or commenting out).
Remove the problematic part of the function - This is a little more work, but preserves much of the functionality that shouldn't be affected by removing the scolding. In the case of the Insult function, you would simply read through the code looking for where the function determines if scolding is necessary. Doing so would result in locating the following code snippet, which could be removed or commented out: (some of the code has been truncated for formatting purposes)
If Naughty = True Then
Swear = Swear + 1
If Swear = 1 Then Insult = "Please don't swear. " & VbCrLf
If Swear = 2 Then Insult = "Damn it, I don't ...
If Swear = 3 Then Insult = "You're ticking me off, ...
If Swear > 3 And Swear < 16 Then Insult = GenerateInsult & VbCrLf
If Swear = 16 Then Insult = Insult + "I'm tired of your swearing...
If Swear > 16 Then Insult = Insult + "..
End If
Modify the function or how its return value is interpreted - While the previous method accomplished the job, it's not always wise to change generic functions that can be called from other client code. A much better method would be to change how the function's return values are interpreted. Finally, here's a better way of handling the scolding issue:
'RESPOND: CALL INSULT HATE SWEAR FUNCTION WITH HIGHER
'TOLERANCE ONLY IF YOU'RE OR YOU ARE IS DETECTED.
'This function will check for insults and swearing
'and respond to them. It is built into this script,
'so you can edit it.
If InStr(1, OriginalSentence, "YOU'RE ", 1) > 0 _
Or InStr(1, OriginalSentence, "YOU ARE ", 1) > 0 Then
CheckInsult = Trim(Insult(UserSentence, Insults,
Hate, Swear, WorkingDir))
If Len(CheckInsult) > 4 Then
GetResponse = GetResponse & CheckInsult & vbCrLf
AvoidBeingFlag = True
DebugInfo = DebugInfo & "The user has insulted Hal and "_
"Hal has responded to it: " & CheckInsult & vbCrLf
End If
End If