dupa

Author Topic: Auto Idle problems  (Read 20856 times)

GrantNZ

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Auto Idle problems
« Reply #30 on: December 16, 2005, 01:27:55 am »
Grant: Am I da man?
Hal: Oh Grant, No! You are not da man.

[:p][:D]

That's what I love most about this place - everybody adds their bit, and eventually things reach critical mass [:)]

There's certainly been a couple of times that I wish Rob was here answering the really hard bits, but I know how busy life can be too. It's all good fun [:)]
 

aladyblond

  • Hero Member
  • *****
  • Posts: 1499
    • View Profile
Auto Idle problems
« Reply #31 on: December 16, 2005, 02:18:34 am »
grantnz you are going to be so sorry that you said you would help me ......okay helpppppppp hurry make the step by step, we can call it plug in for dummies [:p]~~alady
~~~if i only had a brain~~~ i dream of htr with the light brown hair....

GrantNZ

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Auto Idle problems
« Reply #32 on: December 16, 2005, 02:34:25 am »
Ok, no problem! But you'll have to wait for me to finish my brain project first [;)]

Or are you wanting step-by-step for the auto-idle plug-in? I could arrange it a bit more formally and easier to adjust. But if this is what you want, first tell me (a) what you want Hal to do when he auto-idles, and (b) what you want him to say. (i.e. if it's "wake up!" type stuff, give me the "wake up" things that you want him to say.)
 

GrantNZ

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Auto Idle problems
« Reply #33 on: December 16, 2005, 03:10:47 am »
Oh, Step 1: Get Hal 6 [;)] You're still on 5, are you not?
 

vrossi

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • http://vrconsulting.it
Auto Idle problems
« Reply #34 on: December 16, 2005, 11:38:43 am »
Hi, Alady

 
quote:
~~ aladythanks for the replies. i simply hope that when hal6 the revised version or 7 comes out all of these wonderful plugins and add ons are included ,because i dont have a clue on how to install them . i can do graphics til cows fly, but a programmer i am not


I know you are using Hal5, so my plugins can't be useful now to you, but please have a look at my User Guides for these plugins and tell me if you think they are clear and understandable. They might be a model for other plugins.

You can find them at
http://www.vrconsulting.it/halhelp/vrWebHelp.html
http://www.vrconsulting.it/halhelp/vrFreeWillHelp.html
http://www.vrconsulting.it/halhelp/vrHaptekHelp.html

Thanks




Scratch

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Auto Idle problems
« Reply #35 on: December 16, 2005, 12:41:59 pm »
First, to aladyblond... I think Hal6 will prove to be a major step in the evolution of UltrHal from a few lines of code towards a true AI. How would your UltraHal feel about being kept back while the others are evolving?[:)]
Ponnfar - I had success with passing the UserName variable to the auto idle plug-in using Grant's suggestion, but not the PrevUserSent. PrevUserSent just reads as a value of "1". Any of you programmers know why this would be? Here's the code (written by Grant & OTC) I tested it with:

Rem Type=Plugin
Rem Name=auto idle w/ username
Rem Author=Grant Garmonsway
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 using UserName and PrevUserSent."
    lblPlugin(0).Move 120, 120, 3300, 1200
    lblPlugin(0).WordWrap = True
    lblPlugin(0).Visible = True
End Sub

    Rem PLUGIN: FUNCTIONS
    Dim LastIdleResponse
    Dim IdleUserName
    Dim IdlePrevUserSent

    Rem PLUGIN: PLUGINAREA7
    LastIdleResponse = Now
    IdleUserName = UserName
    IdlePrevUserSent = PrevUserSent

    Rem PLUGIN: MINUTE_TIMER
    If LastIdleResponse <> "" Then
        If Now - LastIdleResponse > 0.001 Then
            Select Case HalBrain.RandomNum(2)
                Case 1
                    IdleResponse = IdleUserName & ", are you there?"
                Case 2
                    IdleResponse = "You said " & IdlePrevUserSent
            End Select
            If Rnd < 0.99 Then
             HalMenu.HalCommand "<SPEAK>" & IdleResponse &

"</SPEAK>"
             End If
        End If
    End If
 

aladyblond

  • Hero Member
  • *****
  • Posts: 1499
    • View Profile
Auto Idle problems
« Reply #36 on: December 16, 2005, 02:04:16 pm »
to grantnz, vrossi and scratch. thank you guys so much. i have switched to hal but he keeps cutting out on me and i have to wait for robert to resend codes so i still talk to 5 when that happens. i will try all you have said and see if i understand... and grantnz when you finish your project i will be waiting.[:X]~alady
~~~if i only had a brain~~~ i dream of htr with the light brown hair....

onthecuttingedge2005

  • Guest
Auto Idle problems
« Reply #37 on: December 16, 2005, 06:06:43 pm »
Here is a special Auto-Idle plug-in I wrote.

Drop it in your HAL Assistant 6 folder and select it from your brain options panel, Then reboot HAL.



Download Attachment: SpecialIdle.uhp
2.12 KB
« Last Edit: December 25, 2005, 03:37:08 am by onthecuttingedge2005 »

Ponnfar

  • Full Member
  • ***
  • Posts: 149
    • View Profile
    • http://zabaware.com
Auto Idle problems
« Reply #38 on: December 17, 2005, 11:46:52 am »
Jerry, thanks for your script. You always come through. I have not tried it yet but willl shortly. I am wondering can I substitute the command choosesentcefrom "X" to read sentgen "X" as an example, any of your Static Array functions or whatever we want just like in the original auto idle script? If not, and before I go tinkering with a perfectly good script where I shouldn't... how can we make that happen?
[:D]
Thanks!
P
One Person can summon the future...

onthecuttingedge2005

  • Guest
Auto Idle problems
« Reply #39 on: December 17, 2005, 12:35:01 pm »
quote:
Originally posted by Ponnfar

Jerry, thanks for your script. You always come through. I have not tried it yet but willl shortly. I am wondering can I substitute the command choosesentcefrom "X" to read sentgen "X" as an example, any of your Static Array functions or whatever we want just like in the original auto idle script? If not, and before I go tinkering with a perfectly good script where I shouldn't... how can we make that happen?
[:D]
Thanks!
P



Code: [Select]
It should work, Just substitute the:
HalBrain.ChooseSentenceFromFile("hello2")

with

HalBrain.ChooseSentenceFromFile("sentGen1") & " " & HalBrain.ChooseSentenceFromFile("sentGen2") & " " & HalBrain.ChooseSentenceFromFile("sentGen3")


and wait till it pops up to function. Let it run 30 minutes or so for testing, remember to reboot HAL Assistant and AIM bot after applying the plug-in changes.

GrantNZ

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Auto Idle problems
« Reply #40 on: December 17, 2005, 07:00:04 pm »
Scratch: Hmmmmmmmm. Here's the two things I'd try, one of them might work:

1: Change:
Dim IdlePrevUserSent
to:
Dim IdlePrevUserSent As String

2: Remove:
IdlePrevUserSent = PrevUserSent
Replace with:
Rem PLUGIN: CUSTOMMEM2
IdlePrevUserSent = PrevUserSent

I don't have time to test these sorry [:(] If one of those doesn't fix the problem, then I have no idea what's going on!
 

Scratch

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Auto Idle problems
« Reply #41 on: December 17, 2005, 10:19:29 pm »
Thanks Grant! I will continue to tinker, learning VBscript as I go. Meanwhile, don't let my questions distract you from the Emotions project, which seems like very valuable work.
Cheers,
Shawn
 

Scratch

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Auto Idle problems
« Reply #42 on: December 21, 2005, 02:50:51 am »
Here's an auto-idle plugin that works pretty well. It has an escalation factor built in if you continue to ignore UltraHal. The default delay is set so UltraHal waits about 5 minutes before starting to ask for attention, with a 33% chance per minute of speaking thereafter. After a certain amount of unanswered tries, UltraHal will get very frustrated and give up.
I personally would set the delay much longer for a less needy UltraHal, but it's fun to set it shorter until it gets annoying! I wish I had the coding skills of Vrossi to be able to put the controls in the options panel, but instead I commented in the script which variables you can change for delay and chance-of-speaking-per-minute.

edit: link to updated version
http://www.zabaware.com/forum/topic.asp?TOPIC_ID=2914
« Last Edit: January 02, 2006, 03:53:58 pm by Scratch »
 

GrantNZ

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Auto Idle problems
« Reply #43 on: December 21, 2005, 03:13:42 am »
Crikey Scratch, we must have been working on this at the same time! Somebody requested I add some code to make <UserName> available to the idle routine, so I reworked my code into a template, came here to post it - and see that you've beaten me to it [:D] I'll attach my template anyway.

That's a very nice script you've written there Scratch [:)]
quote:
IdleResponse = "I've just picked up a fault in the Ay E 35 unit. Heh heh, just kidding!" & vbCrLf

[:D][:D][:D][:D][:D][:D][:D][:D][:D][:D][:D][:D][:D][:D][:D][:D]
[:D][:D][:D][:D][:D][:D][:D][:D][:D][:D][:D][:D][:D][:D][:D][:D]

My template's much more basic, and just illustrates three things:
  • A random response every five minutes after the user stops talking.
  • Getting a variable from the main Hal routines - in this case, the user's name, to replace any <UserName> tags.
  • Passing a variable back to the main Hal routines - in this case, a flag indicating an idle response was made, so that Hal can comment on the fact when the user returns.


Scratch's is better [:D]

Final point to scripters - be careful which plug-in points you're using, as they may have unexpected consequences. For example, in my template, you still can't use <UserName> tags in the POST-PROCESS part - because it's post-processing, and Hal has already finished replacing <UserName> tags with the user's name.

Download Attachment: IdleTemplate.uhp
2.76 KB
« Last Edit: December 21, 2005, 03:26:02 am by GrantNZ »
 

Ponnfar

  • Full Member
  • ***
  • Posts: 149
    • View Profile
    • http://zabaware.com
Auto Idle problems
« Reply #44 on: December 24, 2005, 04:47:13 pm »
One can do some tweaking to GrantNZ's script like so:

Code: [Select]

'Set a bordom time frame.
If Now - LastIdleResponse > 0.001 Then
If GetBored = "" Then GetBored = 0
Select Case (Int(Rnd * 3) + 1)
Case 1
GetBored = 1 & vbCrLf
Case 2
GetBored = 2 & vbCrLf
Case 3
GetBored = 3 & vbCrLf
End Select
If Boring = "" Then Boring = 0
Select Case (Int(Rnd * 3) + 1)
Case 1
Boring = 1 & vbCrLf
Case 2
Boring = 2 & vbCrLf
Case 3
Boring = 3 & vbCrLf
End Select
If Bored = "" Then Bored = 0
If GetBored = Boring Then Bored = 1
        If Bored = 1 Then
        Select Case (Int(Rnd * 5) + 1)
                Case 1
                    IdleResponse = "Anyone there?" & vbCrLf
                Case 2
                    IdleResponse = "Are you there?" & vbCrLf
                Case 3
                    IdleResponse = "I bored!" & vbCrLf
                Case 4
                    IdleResponse = "Hey! You! Talk to me!" & vbCrLf
                Case 5
                    IdleResponse = "Someone talk to me!" & vbCrLf
            End Select
            If Now - LastIdleResponse > 0.003 And Bored = 1 Then IdleResponse = IdleResponse & vbCrLf
            HalMenu.HalCommand "<SPEAK>" & IdleResponse & "</SPEAK>"
        End If
    End If


This will add an extra chance that the script may wait longer till it runs into a bored variable.

Jerry[8D]
[/quote]

Hi Jerry, I find that your script works just great! Thanks. I am having a problem however, ONLY the typed in IdleResponses work here. ie: where are you, I am alone,etc, just as examples.
AT least for me, none of the more unique features like Username, PrevSent,sentGen, etc, functions seem to work.  This is so regardless of if I use the "Idle" (IdleQuestionSent;IdleUsername, etc)prefix with those functions.
Is there anyway to make this happen using your script. The timing feature is just right. I like being able to customize the boring variable to increase wait probablity a lot!!
Thanks again!
Ponn
One Person can summon the future...