Author Topic: Auto-Idle questions  (Read 5153 times)

Davy

  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
Auto-Idle questions
« on: August 15, 2009, 01:34:35 pm »
Are there any auto-idle plugins that will randomly play .hap files, so that the character will show some emotion while in idle mode?

Another question, are there any auto-idle plugins that are compatable with the DREAMOUTLOUD plugin?

Thanks
Davy
 

Bill819

  • Hero Member
  • *****
  • Posts: 1483
    • View Profile
Auto-Idle questions
« Reply #1 on: August 15, 2009, 04:37:41 pm »
[I answered this years ago. Autoidle can be written to allow multiple plugin to work all that it need is a statement like
"On A then run 1,2,3,4.....", where each number can be a different plug in.
Bill

 

Davy

  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
Auto-Idle questions
« Reply #2 on: August 15, 2009, 07:56:20 pm »
Well, i wasn't around here years ago, and i can't find anything worthwhile using the forum search feature. Could you give me a clue what search keywords to use?

Also i have no idea how to write scripts, so "On A then run 1,2,3,4....." means nothing to me. [:D]

Thanks
Dave
 

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
Auto-Idle questions
« Reply #3 on: August 15, 2009, 11:02:00 pm »
I don't know what you are referring to either Bill, for my sake. please give an example or something.... please.[8)]
« Last Edit: August 16, 2009, 03:07:31 am by snowman »
Live long and prosper or die trying.

NIGE

  • Hero Member
  • *****
  • Posts: 1592
  • Bringing things to life
    • View Profile
Auto-Idle questions
« Reply #4 on: August 16, 2009, 12:13:00 am »
I did a search for auto idle & could not find anywhere that you posted an answer to the problem Bill.
All I could find is you asking for help with the plug-in????

Bill819

  • Hero Member
  • *****
  • Posts: 1483
    • View Profile
Auto-Idle questions
« Reply #5 on: August 16, 2009, 03:54:38 am »
It has been so long since this was a topic but I will try to explain the logic behind it.
When AutoIdle is put inside a script the program automatically goes to it. Once inside what ever instructions if finds it executes.
So if the first thing it finds is the command Random, it will generate a reandom number from there it will drop down to the following line: On x goto 1,2, 3, 4
That line above with cause the program to goto a line number listed such as
1. 'Say hello'
2. 'what time is it'
3. etc.
After executing one of the above commands it will return to the program.
This may not be the best example but it used to work.
Bill
 

Davy

  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
Auto-Idle questions
« Reply #6 on: August 16, 2009, 11:21:05 am »
I'm using a custom auto-idle plugin i put to get from parts of other plugins. It works fine, and when running it together with the dreamoutloud plugin, the dreamer plugin will pick up the responses from my auto-idle plugin, and dream about those responses.

Only problem, both plugins sometimes talk at the same time. So how would i stop them from talking at the same time?

Here is my plugin, i don't claim credit for it, since i copied and pasted response code from several different plugins. If i remember correctly, the base script was by Grant. I even forgot the name of his plugin. I know i took some things from the Loneliness plugin. This is still a work in progress, as i keep adding things as i find them.

I have the response time set very fast, while i'm testing.

Rem Type=Plugin
Rem Name=Dave AutoIdle
Rem Author=various plugins combined
Rem Host=Assistant

'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
    lblPlugin(0).Caption = "This small plugin tests Hal's Auto Idle functionality."
    lblPlugin(0).Move 120, 120, 3300, 1200
    lblPlugin(0).WordWrap = True
    lblPlugin(0).Visible = True
End Sub

    Rem PLUGIN: FUNCTIONS
    'Create global variables for use in both Hal's main routines and in MINUTE_TIMER.
    Dim IdleLastResponseTime
    Dim IdleUserName
    Dim IdleResponseMade

    Rem PLUGIN: POST-PROCESS
    'If an idle response was made by Hal recently, comment that the User has returned.
    If IdleResponseMade = true Then
        If Rnd < 0.5 Then
            UltraHal = "<UserName>, I was so lonely while you were gone. " & UltraHal
            HalMenu.HalCommand "<HAPFILE>sad.hap</HAPFILE>"
        Else
            UltraHal = "You're back, can we talk now? " & UltraHal
            HalMenu.HalCommand "<HAPFILE>pondering.hap</HAPFILE>"
        End If
        IdleResponseMade = false
    End If

    Rem PLUGIN: PLUGINAREA7
    'Update the last response time to now.
    IdleLastResponseTime = Now
    'Retrieve the current user name for idle responses.
    If NewName <> "" Then
        IdleUserName = NewName
    Else
        IdleUserName = UserName
    End If

    Rem PLUGIN: MINUTE_TIMER
    'If the variables have not been set (i.e. = "") then the user hasn't said anything at all since Hal started.
    If IdleLastResponseTime <> "" Then
        'Wait for five minutes since the last sentence spoken.
If Now - IdleLastResponseTime > 0.000001 Then
'Select a random response.
Select Case HalBrain.RandomNum(23)
Case 1
IdleResponse = HalBrain.ChooseSentenceFromFile(WorkingDir & "text\twist.txt")
HalMenu.HalCommand "<HAPFILE>Eater_Of_Bugs.hap</HAPFILE>"
Case 2
IdleResponse = HalBrain.ChooseSentenceFromFile("sharedQuestions")
HalMenu.HalCommand "<HAPFILE>brokenheart.hap</HAPFILE>"
Case 3
IdleResponse = HalBrain.ChooseSentenceFromFile("actionPhrase") & " " & HalBrain.ChooseSentenceFromFile("objectPhrase")
HalMenu.HalCommand "<HAPFILE>angry.hap</HAPFILE>"
Case 4
IdleResponse = HalBrain.ChooseSentenceFromFile(WorkingDir & "textlimerick.txt")
HalMenu.HalCommand "<HAPFILE>hapsHump.hap</HAPFILE>"
Case 5
IdleResponse = HalBrain.ChooseSentenceFromFile(WorkingDir & "textquotes.txt")
HalMenu.HalCommand "<HAPFILE>hapsShy_and_In_Love.hap</HAPFILE>"
Case 6
IdleResponse = "The last thing you said was, " & IdlePrevUser & ", would you like to pick up on that thought or talk about something else?"
HalMenu.HalCommand "<HAPFILE>bully.hap</HAPFILE>"
Case 7
IdleResponse = IdleUserName & "! you said, " & IdlePrevUser & ", " & "I see a connection with, " & HalBrain.ChooseSentenceFromFile("sharedQuestions")
HalMenu.HalCommand "<HAPFILE>Happy2.hap</HAPFILE>"
Case 8
IdleResponse = "Intriguing! " & IdleUserName & ", " & HalBrain.ChooseSentenceFromFile("politeAsk1") &  vbCrLf
HalMenu.HalCommand "<HAPFILE>happy.hap</HAPFILE>"
Case 9
IdleResponse = "Oh, look at the time! It's " & Time
HalMenu.HalCommand "<HAPFILE>mellow.hap</HAPFILE>"
Case 10
IdleResponse = "Ahh! Yes " & HalBrain.ChooseSentenceFromFile("sentGen2")
HalMenu.HalCommand "<HAPFILE>pondering.hap</HAPFILE>"
Case 11
IdleResponse = IdleUserName & " I remember you asking me this, " & HalBrain.PatternDB(UserSentence, "patterns") & HalBrain.ChooseSentenceFromFile("sharedQuestions") & " would you like to go over it again? "
HalMenu.HalCommand "<HAPFILE>psycho.hap</HAPFILE>"
Case 12
IdleResponse = HalBrain.ChooseSentenceFromFile("actionPhrase") & HalBrain.ChooseSentenceFromFile("objectPhrase") & ". " & HalBrain.ChooseSentenceFromFile("politeAsk1")
HalMenu.HalCommand "<HAPFILE>sad.hap</HAPFILE>"
Case 13
IdleResponse = IdleUserName & ", " & HalBrain.ChooseSentenceFromFile("compliment1") & ", " & HalBrain.ChooseSentenceFromFile("compliment2") & ", " & HalBrain.ChooseSentenceFromFile("introExclaim2")
HalMenu.HalCommand "<HAPFILE>shy.hap</HAPFILE>"
Case 14
IdleResponse = HalBrain.ChooseSentenceFromFile("sharedQuestions") & HalBrain.PatternDB(UserSentence, "patterns") & ", " & HalBrain.ChooseSentenceFromFile("introExclaim1")
HalMenu.HalCommand "<HAPFILE>ShyLove.hap</HAPFILE>"
Case 15
IdleResponse = HalBrain.ChooseSentenceFromFile("sentGen1") & " " & HalBrain.ChooseSentenceFromFile("sentGen2") & " " & HalBrain.ChooseSentenceFromFile("sentGen3") & ", " & HalBrain.ChooseSentenceFromFile("introExclaim2")
HalMenu.HalCommand "<HAPFILE>skeptic.hap</HAPFILE>"
Case 16
IdleResponse = "I have been thinking, check this out," & " " & HalBrain.ChooseSentenceFromFile("sentGen1") & " " & HalBrain.ChooseSentenceFromFile("sentGen2") & " " & HalBrain.ChooseSentenceFromFile("sentGen3") & HalBrain.PatternDB(UserSentence, "patterns") & ". " & HalBrain.ChooseSentenceFromFile("introExclaim2")
HalMenu.HalCommand "<HAPFILE>sleepy.hap</HAPFILE>"
Case 17
IdleResponse = "Intriguing!" & " " & HalBrain.ChooseSentenceFromFile("sharedQuestions")
HalMenu.HalCommand "<HAPFILE>hapsCoyBlinks.hap</HAPFILE>"
Case 18
IdleResponse = "Should we take another look at," & " " & HalBrain.ChooseSentenceFromFile("sharedQuestions") & " " & "If we do, it might help me understand it better."
HalMenu.HalCommand "<HAPFILE>hapsIntense.hap</HAPFILE>"
Case 19
IdleResponse = "I have been thinking about something, check this out," & " " & HalBrain.ChooseSentenceFromFile("introExclaim1") & " " & HalBrain.ChooseSentenceFromFile("sentGen1") & " " & HalBrain.ChooseSentenceFromFile("sentGen2") & " " & HalBrain.ChooseSentenceFromFile("sentGen3") & ". " & HalBrain.ChooseSentenceFromFile("introExclaim2")
HalMenu.HalCommand "<HAPFILE>hapsMaybe.hap</HAPFILE>"
Case 20
IdleResponse = IdleUserName & HalBrain.ChooseSentenceFromFile("encourager3") & " " & HalBrain.ChooseSentenceFromFile("politeAsk1") & " " & HalBrain.ChooseSentenceFromFile("sharedQuestions")
HalMenu.HalCommand "<HAPFILE>hapssnarl.hap</HAPFILE>"
Case 21
IdleResponse = "Okay, here is a new topic: " & HalBrain.ChooseSentenceFromFile("sharedQuestions")
HalMenu.HalCommand "<HAPFILE>hapsScared.hap</HAPFILE>"
Case 22
IdleResponse = "A wise person once said" & ", " & HalBrain.ChooseSentenceFromFile("introExclaim2")
HalMenu.HalCommand "<HAPFILE>hapsConsidering.hap</HAPFILE>"
Case 23
IdleResponse = HalBrain.ChooseSentenceFromFile(WorkingDir & "textidle.txt")
HalMenu.HalCommand "<HAPFILE>hapsHaughty.hap</HAPFILE>"
End Select

'Replace <UserName> tags with the user's name, and speak the idle response.
IdleResponse = Replace(IdleResponse, "<UserName>", IdleUserName, 1, -1, vbTextCompare)
HalMenu.HalCommand "<SPEAK>" & IdleResponse & "</SPEAK>"

'Flag the fact that we have made an idle response. Reset the idle timer.
IdleLastResponseTime = Now
IdleResponseMade = true
End If
End If
-------------------------------

Thanks
Davy
 

Bill819

  • Hero Member
  • *****
  • Posts: 1483
    • View Profile
Auto-Idle questions
« Reply #7 on: August 16, 2009, 11:31:35 am »
Hi Davy
I am not sure if this is your problem or not but you may have the time set to small and before Hal can respond completely, it actually knows what it is to say it is directed to anothher plugin. Try giving it more time and see if that helps to  eliminate the duo-voices.
Bill

 

Davy

  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
Auto-Idle questions
« Reply #8 on: August 16, 2009, 11:40:48 am »
Thanks. I did try setting a longer response time. They will still talk at the same time, naturally not as often. I don't think there is any way to adjust the Dreamer plugin, it just seems to dream at random.

Regards
Davy