If you want to try running any of these commands from the VBScript you can do so from both the Script_Load function in Hal's script by setting the Script_Load variable equal to a HalCommand or combination of HalCommmands. Also if you take a look at the last line in the GetResponse function you will see that a variable called HalCommands is passed back to the main program. Set this variable to a HalCommand anywhere in the GetResponse function and it will be executed.
Try entering the following code into a script to see the auto response function at work. This will make Hal say something by himself every 30 seconds when the user is not talking to Hal. This is just a quick demo of the concept, be warned that it is quite annoying.
Change your Script_Load function to be as follows:
Function Script_Load()
Script_Load = "<AUTO>30000</AUTO>"
End Function
Add this code right after the initialize variables as integers section near the top of the GetResponse function:
If UserSentence = "AUTO-IDLE" Then
If Rnd * 10 < 5 Then
GetResponse = "Hey <UserName>, please talk to me."
Else
GetResponse = "Hello, is anyone there?"
End If
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If