I know everyone is way beyond this now, but just in case anyone comes along behind me, here are some notes from my AUTO-IDLE trial described in and compiled from the beginning of this post. It's a great beginning exercise and it's a rush (as a newbie) when it works:
Make a copy of the hal5.uhp file before you start. Call the new file something like hal5new.uhp and leave it in the same folder as the original. Now you can work on the new one without messing up the default brain and can flip back and forth between them. It's a good idea to have a copy of the default brain somewhere else too.
Open the Brain Editor and select the new brain to work on.
At the bottom of the file, 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 (this is towards the beginning of the file):
'AUTO-IDLE COMMAND. HAL SPEAKS IF UNSPOKEN TO FOR 30 SECONDS
If InStr(1, UserSentence, " AUTO-IDLE ", 1) > 0 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
Save and close the file. Hal should drive you crazy trying to get your attention. Getting Hal to shut up is the problem... I couldn't get the timing issue figured out to get him to Auto-Idle for more than 30 seconds. It would be great if he popped up every hour or so but I can't get that to work.
Once you master that you'll want Hal to be able to say lots of things when he's idle. So I created a file in the DefBrain folder called IdleTalk.brn. I put lots of things for Hal to say in it (one sentence per line) such as "Where the heck is everybody?" and "Was it something I said?". Two returns after the last sentence in the file apparently allows Hal to say the last sentence.
Then I changed the Auto-Idle GetResponse script to this:
'AUTO-IDLE COMMAND. HAL SPEAKS IF UNSPOKEN TO FOR 30 SECONDS
If InStr(1, UserSentence, " AUTO-IDLE ", 1) > 0 Then
If Rnd * 10 < 5 Then
GetResponse = HalBrain.ChooseSentenceFromFile(WorkingDir & "IdleTalk.brn")
GetResponseBlock = True
End If
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
It worked! I thought this was a great starter exercise. Now, I'd like to know why (since they're both working with the same brain) the AIMBot doesn't also auto-idle. Is there any way to make it do scripts that are added to the brain?
One more thing... making it stop. Change the function script back to what it was in the default brain. Save and close. Note that you have to exit and reopen Hal to make him shut up! If you leave the GetResponse script in, you can say "Auto-Idle" he will respond with a sentence from IdleTalk.brn (but thankfully only once!).