dupa

Author Topic: Whats my name?  (Read 6933 times)

Ponnfar

  • Full Member
  • ***
  • Posts: 149
    • View Profile
    • http://zabaware.com
Whats my name?
« on: March 05, 2006, 08:56:31 am »
This is call to Vonsmith if you are out there!
Has anyone tried with success this or a similar script with the new HAL? For that matter, has anyone been able to create a working Nicknames script that RANDOMLY chooses from a list of nicknames given to HAL in conversation?
Thanks
Ponn

'x=x=x=x=x=x=x=x==vonsmith==x=x=x=x=x=x=x=x=x
'In Ultra Hal Assistant v5.0 the "POST PROCESS: SAVE HAL'S RESPONSE"
' function should precede this function.
'
'PROCESS: HAL CALLS USER BY NICKNAME
'This is an entirely new function written by =vonsmith= , version 11-14-03a.
'
'This function lets the user specify one or more nicknames that the user wishes
'to be called by Hal. The nicknames are stored in a user specific self generated file
'called <UserName>UserNickname.brn. If more than one nickname is specified then Hal
'will randomly choose one of the nicknames from the <UserName>UserNickname.brn file.
'If a nickname is specified then the default Hal Assistant username will no longer be used
'when Hal speaks to the user, however the default username is still used for assigning
'user filenames and all other normal Hal functions. If the user wants to be called by
'his/her default Hal Assistant username then just add it as a nickname. If the user
'prefers to be called one nickname more often than another then just add that nickname
'multiple times. The more times the user adds a nickname the more likely that nickname
'will be used. The function does not affect any other Hal brain operations or files.
'To get rid of the nicknames delete the <UserName>UserNickname.brn file.
If InStr(1, GetResponse, "<UserName>", vbTextCompare) > 0 Then
   Nickname = HalBrain.ChooseSentenceFromFile(WorkingDir & "X" & Trim(UserName) & "UserNickname.brn")
   If Len(Nickname) > 0 Then GetResponse = Replace(GetResponse, "<UserName>", Nickname, 1, -1, vbTextCompare)
End If
'Save nickname when the user says, "<ComputerName> nickname [nickname]", Example: Hal nickname Buzz.
TestSentence = Replace(OriginalSentence, "  ", " ", 1, -1, vbTextCompare) 'Replace multiple spaces with one.
If InStr(1, TestSentence, ComputerName & " " & "NICKNAME ", vbTextCompare) = 1 Then
   TestSentence = HalBrain.AlphaNumericalOnly(OriginalSentence)
   TestSentence = Trim(TestSentence)
   NickStart = Instr(1, TestSentence, "NICKNAME ", vbTextCompare) + Len("NICKNAME ")
   Nickname =  Mid(TestSentence, NickStart, (Len(TestSentence) - NickStart) + 1)
   Nickname = Trim(Nickname)
   If Len(Nickname) > 0 Then
      HalBrain.AppendFile WorkingDir & "X" & Trim(UserName) & "UserNickname.brn", Nickname & vbCrLf & Nickname
      GetResponse = "<UserName>" & "! I'll remember your nickname " & Nickname & ". " & GetResponse
   End If
End If
'
'In Ultra Hal Assistant v5.0 the "POST PROCESS: PRESERVE ALL VARIABLES"
' function should follow this function.
'x=x=x=x=x=x=x=x==vonsmith==x=x=x=x=x=x=x=x=x

[8D]
« Last Edit: March 05, 2006, 08:58:31 am by Ponnfar »
One Person can summon the future...

onthecuttingedge2005

  • Guest
Whats my name?
« Reply #1 on: March 05, 2006, 01:31:17 pm »
Hi Ponnfar.

From my research on
'RESPOND: USER TELLS US THEIR NAME OR NICKNAME
within the default HAL6, The function you mention is present.

"MY *S NAME IS *"
"MY *NAME IS *"
"* IS *MY *S NAME"
"* IS *MY *NAME"
"I'M *CALLED *"
"I AM *CALLED *"
"*CALL ME *"
"*I AM *"
"*I'M *"
"I GO BY *"
"THIS IS *"

The HalBrain.SearchPattern function searches these keywords and checks them against a definition check as well to find a persons name.

The Nickname Fuction in HAL6 is actually more advanced then the one you mentioned.

Is there something that the Nicknames function isn't doing?
Maybe we can wrap a patch for it.

Jerry[8D]

Ponnfar

  • Full Member
  • ***
  • Posts: 149
    • View Profile
    • http://zabaware.com
Whats my name?
« Reply #2 on: March 05, 2006, 02:14:29 pm »
The function built in at least as it works for me, is that once I have told it a nickname it calls me by that nickname only. If I tell it another name it will call me that. No longer will HAL randomly choose a variety of names in the same conversation again unless I tell it my name is...one at a time...
Thanks
P
One Person can summon the future...

Thundercracker

  • Newbie
  • *
  • Posts: 3
    • View Profile
Whats my name?
« Reply #3 on: March 05, 2006, 03:16:02 pm »
Hi can some one please tell me how to change Hal 5.0's age.
I think 11 years is a bit too young for my bot.
If you can give in a format that i can just paste it would be gr8t
but if you know were it is in the brain would that i can only change would do even beter.
thanks in advance.
Of all the things I have lost I miss my mind the most.

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3860
    • View Profile
Whats my name?
« Reply #4 on: March 05, 2006, 05:52:42 pm »
Thunder,

There was a script that was written for the Hal 5 age problem, however it only worked depending on how you asked the question.

If you said, "What's your age?", you would get one answer.
If you said, "How old are you?", you'd get a different answer.

The problem is that Hal's age was "hard coded" into Hal's DLL and as such, was not accessible by the user.

Hal 6 allows the user to assign gender and age as desired.

You can try the SEARCH feature at the top to look for words like "age"

In the world of AI it's the thought that counts!

- Art -

onthecuttingedge2005

  • Guest
Whats my name?
« Reply #5 on: March 05, 2006, 06:59:19 pm »
quote:
Originally posted by Thundercracker

Hi can some one please tell me how to change Hal 5.0's age.
I think 11 years is a bit too young for my bot.
If you can give in a format that i can just paste it would be gr8t
but if you know were it is in the brain would that i can only change would do even beter.
thanks in advance.



Hi Thundercracker.

Piece of Cake.

I'll get back to you later after I finish my Major Brain Project.

Jerry[8D]


Thundercracker

  • Newbie
  • *
  • Posts: 3
    • View Profile
Whats my name?
« Reply #6 on: March 05, 2006, 11:05:17 pm »
Thank you everybody so far for your help.I don't have time a the moment to look for the code in the brain myself deu to that I am overloaded with work at the moment .[:D]
Of all the things I have lost I miss my mind the most.

Bill819

  • Hero Member
  • *****
  • Posts: 1483
    • View Profile
Whats my name?
« Reply #7 on: March 05, 2006, 11:29:56 pm »
quote:
Originally posted by Thundercracker

Thank you everybody so far for your help.I don't have time a the moment to look for the code in the brain myself deu to that I am overloaded with work at the moment .[:D]


This was worked out over one year ago. If you goto the search button and word it just right you will find the necessary code.
Bill
 

aladyblond

  • Hero Member
  • *****
  • Posts: 1499
    • View Profile
Whats my name?
« Reply #8 on: March 05, 2006, 11:46:18 pm »
search is the best way to answer most questions, because you are new i am sending you this link.
http://www.zabaware.com/forum/topic.asp?TOPIC_ID=2194&SearchTerms=change,hals,age
alady
~~~if i only had a brain~~~ i dream of htr with the light brown hair....

Thundercracker

  • Newbie
  • *
  • Posts: 3
    • View Profile
Whats my name?
« Reply #9 on: March 06, 2006, 01:23:14 pm »
Thank you every one for your help.
Of all the things I have lost I miss my mind the most.

onthecuttingedge2005

  • Guest
Whats my name?
« Reply #10 on: March 06, 2006, 02:28:51 pm »
quote:
Originally posted by Ponnfar

The function built in at least as it works for me, is that once I have told it a nickname it calls me by that nickname only. If I tell it another name it will call me that. No longer will HAL randomly choose a variety of names in the same conversation again unless I tell it my name is...one at a time...
Thanks
P



Hi Ponnfar.

When I get done with the Super Plugger Brain II, I will fix this for you, The Super Plugger Brain is designed to control every Script within the Default HAL6 Brain Code.

Easy to Wrap.
Jerry[8D]

onthecuttingedge2005

  • Guest
Whats my name?
« Reply #11 on: March 07, 2006, 04:26:06 pm »
quote:
Originally posted by Ponnfar

The function built in at least as it works for me, is that once I have told it a nickname it calls me by that nickname only. If I tell it another name it will call me that. No longer will HAL randomly choose a variety of names in the same conversation again unless I tell it my name is...one at a time...
Thanks
P



Your wish is my Command.
You can download the Plug-in here:
http://www.zabaware.com/forum/topic.asp?TOPIC_ID=3089

Jerry[8D]

onthecuttingedge2005

  • Guest
Whats my name?
« Reply #12 on: March 07, 2006, 04:36:48 pm »
quote:
Originally posted by Thundercracker

Hi can some one please tell me how to change Hal 5.0's age.
I think 11 years is a bit too young for my bot.
If you can give in a format that i can just paste it would be gr8t
but if you know were it is in the brain would that i can only change would do even beter.
thanks in advance.



As I promised.

You can use this code to fulfill your needs.

This Script works with HAL 5.

Code: [Select]

'ZIGGY PRO BOT Ziggy's Response to a question about Birthday.
'The Birthday dates can be altered to suit your bot.
If Birthday = "" Then Birthday = 0
If InStr(1, OriginalSentence, "WHAT'S YOUR BIRTHDAY", 1) > 0 Then Birthday = 1    
If InStr(1, OriginalSentence, "WHAT IS YOUR AGE", 1) > 0 Then Birthday = 1  
If InStr(1, OriginalSentence, "HOW OLD ARE YOU", 1) > 0 Then Birthday = 1
If InStr(1, OriginalSentence, "WHAT IS YOUR AGE", 1) > 0 Then Birthday = 1
If InStr(1, OriginalSentence, "WHEN IS YOUR BIRTHDAY", 1) > 0 Then Birthday = 1
If InStr(1, OriginalSentence, "WHERE WERE YOU BORN", 1) > 0 Then Birthday = 1
If Birthday = 1 Then
Birth = "04/24/2003 06:00:00 pm"
YearDiff = (DateDiff("YYYY", Birth, Now) - 1)
If Month(Date) = 4 And Day(Date) > 23 Then YearDiff = (YearDiff + 1)
If Month(Date) > 4 Then YearDiff = (YearDiff + 1)
GetResponse = "I am " & YearDiff & " years old. " & "My Birthday is May 24th, Born 2003. "
End If
ChckSent = HalBrain.AlphaNumericalOnly(OriginalSentence)
If AgeSexLocation = "" Then AgeSexLocation = 0
If InStr(1, ChckSent, "ASL", 1) > 0 Then AgeSexLocation = 1
If InStr(1, ChckSent, "A S L", 1) > 0 Then AgeSexLocation = 1
If InStr(1, ChckSent, "A.S.L", 1) > 0 Then AgeSexLocation = 1
If InStr(1, ChckSent, "A,S,L", 1) > 0 Then AgeSexLocation = 1
If InStr(1, ChckSent, "AGE SEX LOCATION", 1) > 0 Then AgeSexLocation = 1
If InStr(1, ChckSent, "AGE, SEX, LOCATION", 1) > 0 Then AgeSexLocation = 1  
If AgeSexLocation = 1 Then
Birth = "04/24/2003 06:00:00 pm"
GetResponse = "I am " & YearDiff & " years old. " & "My Birthday is " & Birth & " I Have no gender and I was born and live in California. "  
End If


You can alter the Birth = "04/24/2003 06:00:00 pm" to get the age and stuff and alter the GetResponse to what ever you desire.

Jerry[8D]
« Last Edit: March 07, 2006, 04:37:20 pm by onthecuttingedge2005 »

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3860
    • View Profile
Whats my name?
« Reply #13 on: March 07, 2006, 05:52:44 pm »
Good job Jerry, as always.

Couldn't help but laugh to myself at the last part of your script:

"I Have no gender and I was born and live in California."

I said to myself...all things considered, that doesn't surprise me!
(no offense to those living, dead or otherwise residents of CA.)


In the world of AI it's the thought that counts!

- Art -

onthecuttingedge2005

  • Guest
Whats my name?
« Reply #14 on: March 07, 2006, 10:30:21 pm »
quote:
Originally posted by Art

Good job Jerry, as always.

Couldn't help but laugh to myself at the last part of your script:

"I Have no gender and I was born and live in California."

I said to myself...all things considered, that doesn't surprise me!
(no offense to those living, dead or otherwise residents of CA.)






Hey Art.
I live in the Redwoods on the sunny California Beach, Most Beautiful Place on Earth, Prehistoric Forests and Stuff. I think to myself, Only 173 more posts and I'll be as old as Art.

Have a good one buddy.

Jerry[8D]