Zabaware Support Forums

Auto Idle problems

Started by Ponnfar, December 07, 2005, 07:39:55 PM

Previous topic - Next topic

GrantNZ

Any time, Scratch [:)]
quote:
Originally posted by Scratch

I was trying to extend the time so Hal would wait longer to say something, but I know little about programming, so I was unsuccesful. Is the line  "If Now - LastIdleResponse > 0.001 Then..." the part that controls the timer? Or is the one-minute cycle unchangeable?
Correct on both counts! The routine is called once a minute, irrespective of whether you're chatting to Hal or not. The "If" line you quoted above makes sure an auto-response is made only if it's been more than 0.001 "units" since you last said something.

Now, I have no idea what units the time system uses. I simply found that 0.001 would make Hal wait around two minutes before speaking. You could try increasing this to 0.002 or 0.003 for longer delays.

Here's another thing you can try. Add this line to the very bottom of the plug-in script (even below all the End Ifs):

HalMenu.HalCommand "<SPEAK>" & (Now - LastIdleResponse) & "</SPEAK>"

Now every minute Hal will give the number of mysterious units since you last talked to Hal. I found that it increased approx 0.0007 per minute, so 0.001 gave 1 or 2 minutes delay. I don't even know if the units are the same on all PCs! I'm sure there's a web site or VBScript reference somewhere that could clarify it.

Once that time delay has been reached, my code will say something every minute. There are all sorts of changes you could make here - e.g. saying something every five minutes, etc etc.
quote:
I created a work-around by adding 10 cases of IdleResponse = "".

If IdleResponse <> "" Then
HalMenu.HalCommand "<SPEAK>" & IdleResponse & "</SPEAK>"
End If

I'm sure a 'random' function would solve that more elegantly, ha ha.
If you want a random chance, try putting this after the "If Now - LastIdleResponse > 0.001 Then" line:

If Rnd < 0.20 Then

And put a matching "End If" after the "<SPEAK>" line. "Rnd" randomly gives a number between 0 and 1, so the "0.20" results in a 20% chance, so just change it to whatever you feel like.

Hope this has helped [:)]
Grant
 

Art

#16
The units are obtained from the number of minutes in a 24 hour day.
24 X 60 (mins/hr)=1440.

Thus,your use of 0.0007 X 1440 = 1.008 or slightly over one minute.
Your other .001 X 1440 = 1.44 about one minute, 20 + seconds.

There you go....
In the world of AI it's the thought that counts!

- Art -

Ponnfar

#17
Jerry, I am so glad you are in on this. I am going to try your fix shortly. Thanks. If you can't do it then well...I donno...
Hey Grant.. I have not tried your fix yet but am anxious to try it too. One of them has got to do the trick. You two are the first to be able to make it work or at least get some semblence of the auto idle function back. It would be nice to have it working again.
Has anyone been able to get the CAPS on demand feature to work, remember the command "HAL caps <your word >". That was a great feature. Is it working for anyone?
Also, I still am not seeing the built in Nickname feature do much other than just make a note of my nicknames. I remember reading that someone had it working just fine. Is it just me having this problem?
Anyway, thanks in advance guys!  You both get the trophy for the day!
P
[8D]
One Person can summon the future...

onthecuttingedge2005

#18
quote:
Originally posted by Scratch

Thanks, Grant! Your autoIdle plug-in works for me. I was trying to extend the time so Hal would wait longer to say something, but I know little about programming, so I was unsuccesful. Is the line  "If Now - LastIdleResponse > 0.001 Then..." the part that controls the timer? Or is the one-minute cycle unchangeable? I created a work-around by adding 10 cases of IdleResponse = "".

If IdleResponse <> "" Then
HalMenu.HalCommand "<SPEAK>" & IdleResponse & "</SPEAK>"
End If

I'm sure a 'random' function would solve that more elegantly, ha ha. But is there a way to lengthen the actual cycle time?





One can do some tweaking to GrantNZ's script like so:



'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]

GrantNZ

Thanks Art, that makes sense [:)]
quote:
Originally posted by Ponnfar

Has anyone been able to get the CAPS on demand feature to work, remember the command "HAL caps <your word >". That was a great feature. Is it working for anyone?
That was from the XTF brain, correct? I believe most of the functions from that brain can be transplanted into Hal 6. The most significant recode is to use database tables instead of .brn files.

I've been a bit reluctant to convert many though, because (1) some of it is far too complex for me to understand without spending a week or two studying it, e.g. the topic focus parts; (b) I'm not sure how much of XTF is made obsolete by the upgrades in Hal 6; (iii) I don't like copying somebody's code word for word (other than changing brain files to database tables) without their consent, and (IV) a lot of XTF used custom (and large) .brn files, which aren't trivial for most to import into the database.

I did adapt =vonsmith='s nickname idea though, as it was one of my favourite features of XTF.
quote:
Also, I still am not seeing the built in Nickname feature do much other than just make a note of my nicknames.
I think the in-built nickname feature is to help Hal associate certain info with different users of Hal. So you can sit your friend Bob in front of Hal, have him type "I'm Bob," and Hal will remember info specific to Bob. This is seperate from the "User's Name" part of the option's screen.

I'm guessing you want it to work more like XTF's nicknames? As I mentioned, I've partially adapted it for Hal 6, check out my thread http://www.zabaware.com/forum/topic.asp?TOPIC_ID=2753 My post of 11/24 has the script and installation instructions (unfortunately it's not a nice easy plug-in). It extends =vonsmith='s by using three lists of nicknames depending on Hal's emotions, etc.

Enjoy [:)]
 

Scratch

Thanks, Jerry. That's a good tweak. I think auto-idle adds a lot of realism, but if you are working at the computer with Hal in the background, it can get annoying pretty quick. For me the effect is best if it's a very rare occurence, like once or twice an hour tops.

Two further questions on this: I haven't had any luck getting 'PrevUserSent' or 'Username' to be included in the IdleResponse string. Might those not work with HalMenu.HalCommand(Speak)?

Which leads to: Wouldn't it be nice if Hal could generate a random question as an IdleResponse? For example, (s)he could just take a word from each of two random tables and then ask "Is Word1 related to Word2?"

-Shawn
 

GrantNZ

Scratch: You've found the problem with my solution [:(] It's "outside" of the UltraHal/GetResponse system, so it doesn't have access to many of the variables.

You could try calling GetResponse from the plug-in, passing random numbers for many of the parameters, but I'm not sure how successful this would be.

The absolute ideal would be to find the command which runs UltraHal, passing "AUTO-IDLE" as the user sentence, at which point we'll really be cooking with gas. I have no idea how to find it though - the HalMenu.HalCommand "<SPEAK>" idea was copied out of the appointments reminder plug-in [:D]

Another option is to Dim a new variable (copying the example in my plug-in), and simply copy UserName to it... I'll illustrate by code. Change this code in the plug-in:    Rem PLUGIN: FUNCTIONS
   Dim LastIdleResponse

   Rem PLUGIN: AUTO-IDLE
   UltraHal = "Dum de doo."

   Rem PLUGIN: PLUGINAREA7
   LastIdleResponse = Now
to this (the "AUTO-IDLE" bit was unnecessary, as I mentioned before):    Rem PLUGIN: FUNCTIONS
   Dim LastIdleResponse
   Dim IdleUserName

   Rem PLUGIN: PLUGINAREA7
   LastIdleResponse = Now
   IdleUserName = UserName
Then you can use "IdleUserName" in place of "UserName" in the plug-in script. Note that this won't work until after the user has said at least one thing.

You could add another variable to copy PrevUserSent too.
 

onthecuttingedge2005

#22
quote:
Originally posted by Scratch

Thanks, Jerry. That's a good tweak. I think auto-idle adds a lot of realism, but if you are working at the computer with Hal in the background, it can get annoying pretty quick. For me the effect is best if it's a very rare occurence, like once or twice an hour tops.

Two further questions on this: I haven't had any luck getting 'PrevUserSent' or 'Username' to be included in the IdleResponse string. Might those not work with HalMenu.HalCommand(Speak)?

Which leads to: Wouldn't it be nice if Hal could generate a random question as an IdleResponse? For example, (s)he could just take a word from each of two random tables and then ask "Is Word1 related to Word2?"

-Shawn



Just add more Case Variables like so.

If GetBored = "" Then GetBored = 0
Select Case (Int(Rnd * 6) + 1)
Case 1
GetBored = 1 & vbCrLf
Case 2
GetBored = 2 & vbCrLf
Case 3
GetBored = 3 & vbCrLf
Case 4
GetBored = 4 & vbCrLf
Case 5
GetBored = 5 & vbCrLf
Case 6
GetBored = 6 & vbCrLf
End Select
If Boring = "" Then Boring = 0
Select Case (Int(Rnd * 6) + 1)
Case 1
Boring = 1 & vbCrLf
Case 2
Boring = 2 & vbCrLf
Case 3
Boring = 3 & vbCrLf
Case 4
Boring = 4 & vbCrLf
Case 5
Boring = 5 & vbCrLf
Case 6
Boring = 6 & vbCrLf
End Select

This will increase the odds of HAL (not) saying anything although there is a bit of luck that could always occure.

Doing it like this makes it a true Random moment with a bit of luck involved with this variable.

HAL may say something a minute from now or might not say anything for two hours or so depending on the luck factor.

Jerry[8D]

aladyblond

i hope someone can answer this. since hal 6 came out  alot of people have been making new scripts to get hal to show emotions and say many different responses. will these scripts work in hal 5 also, or are they just being written for hal 6? ~~alady
~~~if i only had a brain~~~ i dream of htr with the light brown hair....

vrossi

Hi, Aladyblond

I gave an answer to a similar question at http://www.zabaware.com/forum/topic.asp?TOPIC_ID=2831

I published three new plugins for Hal6 at
http://www.zabaware.com/forum/topic.asp?TOPIC_ID=2845

I know you are concerned about your Hal emotions and you wonder if it is ethically correct to change Hal's mind. Anyway, technically speaking, I would strongly suggest to upgrade to Hal6, because it's a much more flexible and open platform, and the new interesting developments by GrantNz, for example, are based on it.

Bye
Vittorio
www.robotinfo.net

GrantNZ

quote:
Originally posted by aladyblond

i hope someone can answer this. since hal 6 came out  alot of people have been making new scripts to get hal to show emotions and say many different responses. will these scripts work in hal 5 also, or are they just being written for hal 6? ~~alady

Hi alady,

I personally won't be making a Hal 5 version of my emotion code. I expect it could be adapted to Hal 5, but it would take a bit of work (and I won't be the one doing it!!).

It gets worse - if people start making scripts that really use the SQL abilities of Hal 6's database, then I doubt they could ever be adapted back to 5.

So far the SQL powers of Hal 6 have been relatively unused by scripters - it might take a couple of good SQL ideas/implementations to really get the ball rolling there. I don't have any ideas myself at this stage [V]

I'm personally dreading the day Hal 7 comes out - by then I hope to have a very well taught, customised and improved Hal, and who knows how difficult it will be to carry all that across [xx(] But that's for the future, now's now [8D]
 

aladyblond

~~ 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[:D]
~~~if i only had a brain~~~ i dream of htr with the light brown hair....

Ponnfar

#27
Thanks everyone for chipping in. We really got somewhere on this so far.  Well, the timer function has worked to get an auto response for lack of a better term. Happy day...However, how to get Gantz's script to call HalCommands or statements generated from other areas of the script ie: PrevUserSent; PrevSent; sentGen#; TopicFocus.etc.. is a new matter. This is  since of course we have ended all functions before this point, it does pose a challenge. Well, at least to me. Try it,you simply get a blank response and then a getresponse of your inserted statement.
Thanks
P
One Person can summon the future...

GrantNZ

alady: If I manage to produce anything worth seeing, I'll try my absolute best to produce a dead simple step-by-step install procedure. I know how it feels to want to use something but unable to figure out how to make it work.... And always feel free to ask for help [:)]

Ponnfar: Agreed. I've run out of ideas [:(]
 

Ponnfar

#29
Yeah....but you still da Man Gantz!
[8D]
All is not lost, I am sure the forum will come up with something.
It would be nice if Rob would come in and save the day...
P
One Person can summon the future...