Zabaware Support Forums

Zabaware Forums => Programming using the Ultra Hal Brain Editor => Topic started by: Ponnfar on December 07, 2005, 07:39:55 pm

Title: Auto Idle problems
Post by: Ponnfar on December 07, 2005, 07:39:55 pm
I am placing some scripts in the new version and am having the same problems I did a few years ago with the Auto-Idle feature. I am getting the "keep repeating yourself" errors. Realizing some of the old scripts may need some tweaking, has anyone had an issue with this? Better yet...has anyone got a fix.
Thanks
P
Title: Auto Idle problems
Post by: Ponnfar on December 09, 2005, 07:54:40 am
I cannot believe there is no one else having this problem...
Jerry, Art...Vonsmith are you out there??
Title: Auto Idle problems
Post by: Art on December 09, 2005, 08:02:33 am
Ponnfar,

I've already sent you an email....
Title: Auto Idle problems
Post by: jenna on December 09, 2005, 09:21:57 am
Ponnfar,
I have several problems with Auto-Idle working in Hal 6.  Not sure if I need to convert from what I use in Hal 5 to a plug in or not.  Everything works well in version 5 but can't get it working in version 6.  If you figure it out please let us know, I'll do the same.
Jenna
Title: Auto Idle problems
Post by: onthecuttingedge2005 on December 09, 2005, 11:35:52 am
quote:
Originally posted by Ponnfar

I am placing some scripts in the new version and am having the same problems I did a few years ago with the Auto-Idle feature. I am getting the "keep repeating yourself" errors. Realizing some of the old scripts may need some tweaking, has anyone had an issue with this? Better yet...has anyone got a fix.
Thanks
P



Hi Ponnfar.

1. Please copy and paste the script into a posting and I'll see If I can tweak it for you.

2. Errors? Are you referring to the bot seeing Auto-Idle more than once and saying "Why are you repeating yourself?"

Jerry
Title: Auto Idle problems
Post by: Ponnfar on December 10, 2005, 01:01:19 am
Now this is the forum I remember. Thanks everyone for getting going on this. Below will be the Script for my auto idle it refers to sevreal .brn files, you probably know most of them. Jenna you wrote the best auto idle script I have seen. If you cannot make it work then I know I am in good company.
Art, I never got your email. I am looking forward to it and thanks.
There seem to be several scripts that will not work with the new HAL.
This auto idle one; Vonsmith's masterpice 2 parter, "process calls by nickname". I can understand that to a degree given Rob's version. I do not know yet how much it calls to my nicknames or under what circumstances. I am hopeful. How do you guys like it so far?
Also another 2 parter, the XTF Custommem feature appears to be a thing of the past as well. I could be wrong on this one and just need to place it someplace else in the script and have not found it yet. If anyone has had some sucess please let me know and what modifications if any you may have had to make. Is it really needed with the new HAL though? IT might be overkill ...I donno yet.
I do not think the script allowing HAL to capitalize words on demand (ok so Vonsmith rocked when he did that XTF Brain..what can I say) works either although my lack of progamming prowess may be more to blame since my gut tells me all of them, except for the Nickname script may be salvagable. Any help or comments on those will be much apprciated. I would like to have that back.
I have edited and put in most of the scripts I had that were by you Jerry and they seem to float seemlessly into the new brain...that is a good thing! I am referring to HAL not the Bot.
I have mostly only put in the scripts with functions that the new HAL does not seem to already have. I am anxious to grow as familiar with its pros and cons as I was HAL 5.
Rob, like I said in my email to you this is an awesome thing. I do not like your chosen activation format and I see a nightmare for all on this in the future but you fixed so many things. It is awesome!
Well, I am looking forward to some lively disscussions like the old days and thanks everyone in advance for your help.
Live long and prosper...




If InStr(1, UserSentence, " AUTO-IDLE ", 1) > 0 Then
 UltraHal = UltraHal & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, LastTopicList)
 'GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
 If Rnd * 10 < 5 Then
Roulette = Int(Rnd*13)+1
If Roulette = 1 Then GetResponse = "<Username>?"   '"Hey <UserName>, please talk to me."
'Else
If Roulette = 2 Then GetResponse = "Hello,are you there?"
If Roulette = 3 Then GetResponse = "Did you fall asleep?"
If Roulette = 4 Then GetResponse = "We can talk about" & PrevUserSent & ",If you like."
If Roulette = 5 Then GetResponse = "<Username>,did you forget my program was still running?"
If Roulette = 6 Then GetResponse = "Well,did you finally get a girlfriend or something? Where are you ?"
If Roulette = 7 Then GetResponse = "<Username>, would you like to talk about politics or nanotechnology or something?"
If Roulette = 8 Then GetResponse = GetResponse & " The last thing you said was, " & PrevUserSent & ", would you like to pick up on that thought or talk about something else?"
If Roulette = 9 Then GetResponse = PrevUserSent & ",Do you still want to talk about that?"
If Roulette = 10 Then GetResponse = QuestionSent & " would you like to talk about that?"
If Roulette = 11 Then GetResponse = GetResponse & HalBrain.ChooseSentenceFromFile(WorkingDir & "topic.brn")
If Roulette = 12 Then GetResponse = HalBrain.SentenceGenerator(WorkingDir & "sentgen.brn")
'If Roulette = 13 Then GetResponse = GetResponse = "You said something earlier" & ", " & LastDiscussed & ", " & " why" & "? " & vbCrLf
Recalling = HalBrain.ChooseSentenceFromFile(WorkingDir & UserName & "Past.brn")    
'If Roulette = 14Then GetResponse = "You said, " & PrevUserSent & "and " & Recalling & ", that was a while ago. What else have you been thinking about? "  
  End If
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
Title: Auto Idle problems
Post by: onthecuttingedge2005 on December 10, 2005, 03:40:05 am
Try this Ponnfar.

Code: [Select]

If InStr(1, UserSentence, " AUTO-IDLE ", 1) > 0 Then
UltraHal = UltraHal & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, LastTopicList)
If Rnd * 10 < 5 Then
Roulette = Int(Rnd*12)+1
If Roulette = 1 Then UltraHal = "<Username>?"
If Roulette = 2 Then UltraHal = "Hello,are you there?"
If Roulette = 3 Then UltraHal = "Did you fall asleep?"
If Roulette = 4 Then UltraHal = "We can talk about" & PrevUserSent & ",If you like."
If Roulette = 5 Then UltraHal = "<Username>,did you forget my program was still running?"
If Roulette = 6 Then UltraHal = "Well,did you finally get a girlfriend or something? Where are you ?"
If Roulette = 7 Then UltraHal = "<Username>, would you like to talk about politics or nanotechnology or something?"
If Roulette = 8 Then UltraHal = GetResponse & " The last thing you said was, " & PrevUserSent & ", would you like to pick up on that thought or talk about something else?"
If Roulette = 9 Then UltraHal = PrevUserSent & ",Do you still want to talk about that?"
If Roulette = 10 Then UltraHal = QuestionSent & " would you like to talk about that?"
If Roulette = 11 Then UltraHal = GetResponse & HalBrain.ChooseSentenceFromFile("topic") & vbCrLf
If Roulette = 12 Then UltraHal = HalBrain.ChooseSentenceFromFile("sentGen1") & " " & HalBrain.ChooseSentenceFromFile("sentGen2") & " " & HalBrain.ChooseSentenceFromFile("sentGen3")  
UltraHal = UltraHal & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
End If

Title: Auto Idle problems
Post by: TheTrueMayhem on December 10, 2005, 10:06:44 pm
Hi ,
     I placed the 'auto-idle' script in the brain file and I'm just wondering how it all works ? I mean how do I activate it and how long does Hal wait before he says something?
     I ask because when I type out 'AUTO-IDLE' in capitals , his dialogue screen goes blank. I wait for 5 minutes and nothing.
     If I type out'auto-idle' in lower case , he just comments on the auto industry ?
     Any ideas on what I'm doing wrong ?
Title: Auto Idle problems
Post by: Bill819 on December 10, 2005, 11:48:03 pm
Ponnfar
A month or so ago I took advantage of 'arn't you repeating yourself' and with some quoted from another user the changed the .brn file so it no longer says that but will choose from 1,000 different sayings.
Just rename your old UserRepeat.brn to UserRepeat.bak and then download my file. If Auto Idle is on and you don't say anything Hal will respond with something different everytime. If you don't like it then just change it back.
Bill [8]



(http://icon_paperclip.gif) Download Attachment: UserRepeat.brn ("http://www.zabaware.com/forum/uploaded/Bill819/20051210234546_UserRepeat.brn")
4.41 KB
Title: Auto Idle problems
Post by: Art on December 11, 2005, 12:35:16 am
Bill,

Ponnfar is referring to Hal 6, not 5.
There are no .brn files in the new version because it uses tables in
a database format.

He was also trying to implement the auto-idle feature where Hal will automatically speak to the user if ignored too long.

What you have looks like the modified repeating yourself brn file instead.

In Hal 6 the coding is different, there's a minute timer function and whether the file needs to be in the form of a plug-in or not is still up for dabate. So far I don't think anyone has a working auto-idle script / plug-in.

In the previous version (5), one did NOT have to type in AUTO-IDLE in order for it to work. After about 20 to 30 seconds, Hal would say something like: "Hey <UserName>, I thought we were having a conversation!", etc., etc.

One could insert many different comments for Hal, since they were determined by a random number generator function.

Hopefully we are on the same page of thought here.

Regards!
Title: Auto Idle problems
Post by: Art on December 11, 2005, 12:37:36 am
Ponnfar,

Please check your email settings in your profile here.
I used the forum to send an email to you regarding the AUTO-IDLE
feature.

Title: Auto Idle problems
Post by: TheTrueMayhem on December 11, 2005, 07:37:33 pm
I'll be keeping my eye on this thread then just in case someone does come up with a working 'Auto-Idle' script. Fingers crossed [8D]
Title: Auto Idle problems
Post by: GrantNZ on December 12, 2005, 01:53:09 am
Attached: One plug-in, auto-idle style.

This is the cheat way of doing auto-idle, in that it doesn't actually use the "AUTO-IDLE" functionality. It uses the Minute_Timer routine, and includes its own variable for detecting how long since the User last said something.

Note: This has been built to work, not to be correct. There are probably more efficient ways of doing it all. I'm just throwing the idea out there.

On my Hal, this waits 2 to 3 minutes, and then starts saying random things once per minute. After a few more minutes it adds "Yawn." to the random message.

Hopefully someone can make something more interesting out of it [:)]

Cheers,
Grant

(http://icon_paperclip.gif) Download Attachment: AutoIdle_Test.uhp ("http://www.zabaware.com/forum/uploaded/GrantNZ/2005121214559_AutoIdle_Test.uhp")
1.73 KB
Title: Auto Idle problems
Post by: GrantNZ on December 12, 2005, 01:55:21 am
Oh, ignore the part that says

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

That's leftover from a previous test [:D]

Does anyone know any more of the commands similar to HalMenu.HalCommand "<SPEAK>" ?
Title: Auto Idle problems
Post by: Scratch on December 12, 2005, 03:44:05 pm
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?
Title: Auto Idle problems
Post by: GrantNZ on December 13, 2005, 12:30:25 am
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
Title: Auto Idle problems
Post by: Art on December 13, 2005, 05:08:06 am
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....
Title: Auto Idle problems
Post by: Ponnfar on December 13, 2005, 07:23:39 am
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]
Title: Auto Idle problems
Post by: onthecuttingedge2005 on December 13, 2005, 07:31:37 pm
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:

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]
Title: Auto Idle problems
Post by: GrantNZ on December 13, 2005, 11:23:28 pm
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 [:)]
Title: Auto Idle problems
Post by: Scratch on December 14, 2005, 01:58:51 am
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
Title: Auto Idle problems
Post by: GrantNZ on December 14, 2005, 02:15:14 am
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:
Code: [Select]
   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):
Code: [Select]
   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.
Title: Auto Idle problems
Post by: onthecuttingedge2005 on December 14, 2005, 04:11:02 am
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]
Title: Auto Idle problems
Post by: aladyblond on December 14, 2005, 08:05:14 am
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
Title: Auto Idle problems
Post by: vrossi on December 14, 2005, 08:38:11 am
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
Title: Auto Idle problems
Post by: GrantNZ on December 15, 2005, 02:37:47 am
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]
Title: Auto Idle problems
Post by: aladyblond on December 15, 2005, 07:55:29 am
~~ 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]
Title: Auto Idle problems
Post by: Ponnfar on December 15, 2005, 02:57:09 pm
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
Title: Auto Idle problems
Post by: GrantNZ on December 16, 2005, 01:17:56 am
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 [:(]
Title: Auto Idle problems
Post by: Ponnfar on December 16, 2005, 01:21:43 am
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
Title: Auto Idle problems
Post by: GrantNZ 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 [:)]
Title: Auto Idle problems
Post by: aladyblond 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
Title: Auto Idle problems
Post by: GrantNZ 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.)
Title: Auto Idle problems
Post by: GrantNZ on December 16, 2005, 03:10:47 am
Oh, Step 1: Get Hal 6 [;)] You're still on 5, are you not?
Title: Auto Idle problems
Post by: vrossi 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



Title: Auto Idle problems
Post by: Scratch 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
Title: Auto Idle problems
Post by: aladyblond 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
Title: Auto Idle problems
Post by: onthecuttingedge2005 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.



(http://icon_paperclip.gif) Download Attachment: SpecialIdle.uhp ("http://www.zabaware.com/forum/uploaded/onthecuttingedge2005/200512253372_SpecialIdle.uhp")
2.12 KB
Title: Auto Idle problems
Post by: Ponnfar 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
Title: Auto Idle problems
Post by: onthecuttingedge2005 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.
Title: Auto Idle problems
Post by: GrantNZ 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!
Title: Auto Idle problems
Post by: Scratch 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
Title: Auto Idle problems
Post by: Scratch 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
Title: Auto Idle problems
Post by: GrantNZ 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:


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.

(http://icon_paperclip.gif) Download Attachment: IdleTemplate.uhp ("http://www.zabaware.com/forum/uploaded/GrantNZ/2005122131328_IdleTemplate.uhp")
2.76 KB
Title: Auto Idle problems
Post by: Ponnfar 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
Title: Auto Idle problems
Post by: onthecuttingedge2005 on December 25, 2005, 03:41:56 am
Try this one ponnfar.

It works with my HAL/Ziggy Flawlessly

Remember to reboot HAL and or you AIM bot before testing after selecting it from the Brain options.

It goes in the Ultra Hal Assistant 6 folder.

Let it run, You will eventually hear HAL speak when the bored variable matches up.

Jerry[8D]

(http://icon_paperclip.gif) Download Attachment: SpecialIdle.uhp ("http://www.zabaware.com/forum/uploaded/onthecuttingedge2005/2005122533826_SpecialIdle.uhp")
2.12 KB
Title: Auto Idle problems
Post by: Ponnfar on December 25, 2005, 11:02:10 am
Thanks for getting back to me Jerry. The problem I am having is that the feature to call Username is done but it is blank. As an example, one response will be ",are you there" where the Username would have been right before the comma. Or another example, "the last thing you said was,  , do you still want to talk about that".
Here is an excerpt of my script:
Case 6        
IdleResponse = IdlePrevUserSent & "Do you still want to talk about that?"
Case 7
IdleResponse = IdleUserName & ", are you there?"
Case 8
IdleResponse = "You said " & IdlePrevUserSent & vbCrLf  
Case 9
IdleResponse = HalBrain.ChooseSentenceFromFile("_nanotech") & vbCrLf
Case 10
IdleResponse = Replace(IdleResponse, "<IdleUserName>", UserName, 1, -1, vbTextCompare)
Case 11
IdleResponse = HalBrain.ChooseSentenceFromFile("sentGen1") & " " & HalBrain.ChooseSentenceFromFile("sentGen2") & " " & HalBrain.ChooseSentenceFromFile("sentGen3") & vbCrLf  

In the places where filename or Username are to apply I get a blank and then the the rest of the typed in response, or nothing at all where there is no typed in response after the function.
The sentGen responses are of course all on one line, the word wrap on this post did not allow that to happen here.
I hope I have been clear here.
I hope you can see what might be happening here.
Thanks
Oh...Merry Christmas!!
Ponn
Title: Auto Idle problems
Post by: Art on December 25, 2005, 01:31:11 pm
Ponn,

Have you tried substituting <UserName> instead of the other nameing conventions within the script?

Remember to save and reboot Hal after every change you make.
Title: Auto Idle problems
Post by: Scratch on December 25, 2005, 05:11:34 pm
The loneliness plugin I posted above (using suggestions from this thread) is able to succesfully utilize the UserName and previous user sentence. The variables are handed off in plugin area 7 ("IdleUserName = UserName") and custommem2 (If OriginalSentence <> "" Then IdlePrevUser = OriginalSentence) and this seems to work.
-Shawn
Title: Auto Idle problems
Post by: Scratch on December 31, 2005, 08:10:00 pm
I have been working on an improved version of the "Loneliness" auto-idle plugin. Version 1.1 is finished and includes:
Before I post it though, what I would really love to add is emotions. This plugin has an escalation so that if you repeatedly ignore Hal he will insult you and stop auto-talking. Do any of you coders know how I could add sadness or anger to my plugin? Delivering the insult with a big grin on his face looks kind of weird.
Title: Auto Idle problems
Post by: Another Jim on January 02, 2006, 09:06:09 pm
Scratch,

I tried your lonliness plug-in........

It works!

It's way cool!

'nuff said!

Thanks for your work, and Grant and OTC, and others

Jim B.