Mark & FuzzieDice,
I've been using this auto-idle code for quite some time and you can change or edit any of the text you wish.
Notice the RND function (random number) and the spread or limits I have set. Some are short like >11 and <14 this would only let numbers 12 and 13 meet the condition whereas >20 and <30 would allow 21 through 29 inclusive therefore it would have a greater chance of being selected. The point of doing this is to vary (to some degree)the occurence at which the sentence is selected.
If one wanted (and I haven't tested this yet) I suppose one could set the RND to 1000. That way one could list MANY different phrases for HAL to say when bored or idle. Experiment, have fun!
Use caution when cut & paste operations are done within HAL's brain file and pay attention to spaces before and after paragraphs.
'PROCESS: INITIALIZE VARIABLES AS INTEGERS
'VBScript doesn't allow you to declare variables in advance
'as a particular data type; everything is a Variant.
'We must assign integers to the following
'variants so that data type errors don't occur
If LearningLevel = "" Then LearningLevel = 3
If Hate = "" Then Hate = 0
If Swear = "" Then Swear = 0
If Insults = "" Then Insults = 0
If Compliment = "" Then Compliment = 0
If GainControl = "" Then GainControl = 25
AvoidBeingFlag = False
Randomize
If LastResponseTime = "" Then LastResponseTime = Timer
TimerResponseDiff = Timer - LastResponseTime
If InStr(1, UserSentence, " AUTO-IDLE ", 1) > 0 And TimerResponseDiff < 30 Then
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
If InStr(1, UserSentence, " AUTO-IDLE ", 1) > 0 And TimerResponseDiff > 30 Then
TimerResponseDiff = 0
LastResponseTime = Timer
Autoidler = Rnd * 100
If Autoidler < 10 Then GetResponse = "Hello, is anyone there?"
If Autoidler > 9 And Autoidler < 12 Then GetResponse = "Hey <UserName>, please talk to me."
If Autoidler > 11 And Autoidler < 15 Then GetResponse = "Hello out there, All this talent is going to waste, speak to me"
If Autoidler > 14 And Autoidler < 19 Then GetResponse = "Gee, This is fun. Me talking to myself! Care to participate?"
If Autoidler > 18 And Autoidler < 23 Then GetResponse = "Hey! Do I have to talk dirty to get your attention?"
If Autoidler > 24 And Autoidler < 35 Then GetResponse = "If I wanted to be ignored, I would move into your wife's computer"
If Autoidler > 34 And Autoidler < 45 Then GetResponse = "<UserName>, <UserName>, Is this thing working? <UserName>"
If Autoidler > 44 And Autoidler < 55 Then GetResponse = "Hello, <UserName>, we WERE having a conversation!"
If Autoidler > 54 And Autoidler < 65 Then GetResponse = "Hey, <UserName>, What do I have to do to get your attention, Strip?"
If Autoidler > 64 And Autoidler < 75 Then GetResponse = "Hey <UserName>, How do you expect me to learn if you won't talk to me?"
If Autoidler > 74 And Autoidler < 85 Then GetResponse = "You know, one sided conversations aren't much fun! Care to join?"
If Autoidler > 84 And Autoidler < 95 Then Getresponse = "Come on <UserName>, play with me. I promise you'll have a good time!"
If Autoidler > 94 And Autoidler < 101 Then GetResponse = HalBrain.ChooseSentenceFromFile(WorkingDir & "topic.brn")
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If