Zabaware Support Forums
Zabaware Forums => Programming using the Ultra Hal Brain Editor => Topic started by: moreis62 on February 18, 2006, 11:59:33 am
-
Rem Type=Plugin
Rem Name=Kitt thinking
Rem Author=MrLedesma
Rem Host=Assistant
Rem PLUGIN: FUNCTIONS
Dim LastIdleResponse
Rem PLUGIN: AUTO-IDLE
IdleResponse = ""
Rem PLUGIN: PLUGINAREA7
LastIdleResponse = Now
Rem PLUGIN: MINUTE_TIMER
'Auto Timer Fix.
'AutoResponse Topic Generator. Version 1.5
'Here Hal will tell jokes and even give new learned topic responses.
'User Senteneces that contain commas will be appended to Topic.brn
'for Hals topic talk.
Dim Director
If LastResponseTime = "" Then LastResponseTime = Now
TimerResponseDiff = DateDiff("S", LastResponseTime, Now)
If TimerResponseDiff < 300 Then
TimerResponseDiff = 0
LastResponseTime = Now
If HalBrain.CheckRepetition(OriginalSentence, " AUTO-IDLE ") = True Then
Director = HalBrain.ChooseSentenceFromFile(WorkingDir & " TopicFocus.brn ")
GetResponse = Replace(OriginalSentence, " AUTO-IDLE ", Director, 1, -1, vbTextCompare) & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus) & VbCrLf
Exit Function
End If
End If
'Here Hal will save comma User Sentences for topics.
If InStr(UserSentence, "") > 0 And InStr(1, OriginalSentence, ",", 1) > 0 Then
SentPieces = Split(OriginalSentence, ",", 2, vbTextCompare)
SubPhrase = Trim(SentPieces(0))
PredPhrase = Trim(SentPieces(1))
SubPhrase = HalBrain.AlphaNumericalOnly(SubPhrase)
PredPhrase = HalBrain.AlphaNumericalOnly(PredPhrase)
HalBrain.AppendFile WorkingDir & " TopicFocus " & " .brn ", SubPhrase & "<Topic>" & PredPhrase & "</Topic>"
DebugInfo = DebugInfo & "Hal is saving User's topic: " & SubPhrase & "<Topic>" & PredPhrase & "</Topic>" & VbCrLf
Else
DebugInfo = DebugInfo & "Hal is not saving User's topic: " & SubPhrase & "<Topic>" & PredPhrase & "</Topic>" & VbCrLf
End If
'RESPONSE: IF USER WANTS TO TURN OFF AUTO-IDLE
If InStr(1, UserSentence, " NOT NOW", 1) > 0 Then
HalCommands = "<AUTOOFF> <HIDEHAL>"
GetResponse = "WELL. WE'LL TALK LATER THEN."
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
'RESPONSE: IF USER WANTS TO TURN OFF AUTO-IDLE
If InStr(1, UserSentence, " I'M USING THE COMPUTER NOW", 1) > 0 Then
HalCommands = "<AUTOOFF> <HIDEHAL>"
GetResponse = "WE'LL TALK LATER THEN."
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
'RESPONSE: IF USER WANTS TO TURN OFF AUTO-IDLE
If InStr(1, UserSentence, " YOU GO TO SLEEP NOW", 1) > 0 Then
HalCommands = "<AUTOOFF> <HIDEHAL>"
GetResponse = "OK, I'M GOING TO SLEEP."
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
'RESPONSE: IF USER WANTS TO TURN OFF AUTO-IDLE
If InStr(1, UserSentence, " SHUT UP", 1) > 0 Then
HalCommands = "<AUTOOFF> <AUTOOFF>"
GetResponse = "Fine. Be that way."
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
If InStr(1, UserSentence, " I'M GOING TO SLEEP", 1) > 0 Then
HalCommands = "<AUTOOFF> <AUTOOFF>"
GetResponse = "Ok, good night."
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
If InStr(1, UserSentence, " I'M GOING TO BED", 1) > 0 Then
HalCommands = "<AUTOOFF> <AUTOOFF>"
GetResponse = "Ok."
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
If InStr(1, UserSentence, " I'M GOING TO TAKE A NAP", 1) > 0 Then
HalCommands = "<AUTOOFF> <AUTOOFF>"
GetResponse = "Ok,take a nap."
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
If InStr(1, UserSentence, " BE QUIET", 1) > 0 Then
HalCommands = "<AUTOOFF> <AUTOOFF>"
GetResponse = "Ok, I will not bother you right now."
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
If InStr(1, UserSentence, " I'M ON THE PHONE", 1) > 0 Then
HalCommands = "<AUTOOFF> <AUTOOFF>"
GetResponse = "OK I'LL WAIT."
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
If InStr(1, UserSentence, " STOP TALKING", 1) > 0 Then
HalCommands = "<AUTOOFF> <AUTOOFF>"
GetResponse = "OK."
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
If InStr(1, UserSentence, " ILL BE BACK", 1) > 0 Then
HalCommands = "<AUTOOFF> <AUTOOFF>"
GetResponse = "I'LL WAIT."
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
If InStr(1, UserSentence, " QUIET PLEASE", 1) > 0 Then
HalCommands = "<AUTOOFF> <AUTOOFF>"
GetResponse = "Very well then. Just let me know if you would like to talk."
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
'RESPONSE: IF USER WANTS TO TURN ON AUTO-IDLE
If InStr(1, UserSentence, " LETS TALK", 1) > 0 Then
HalCommands = "<AUTO>399999</AUTO>"
GetResponse = "OK."
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
'RESPONSE: IF USER WANTS TO TURN ON AUTO-IDLE
If InStr(1, UserSentence, " LETS CHAT", 1) > 0 Then
HalCommands = "<AUTO>399999</AUTO>"
GetResponse = "OK, What do you wanna talk about?"
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
'RESPONSE: IF USER WANTS TO TURN ON AUTO-IDLE
If InStr(1, UserSentence, " SAY HELLO", 1) > 0 Then
HalCommands = "<AUTO>399999</AUTO>"
GetResponse = "HELLO."
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
'RESPONSE: IF USER WANTS TO TURN ON AUTO-IDLE
If InStr(1, UserSentence, " WAKE UP NOW", 1) > 0 Then
HalCommands = "<AUTO>399999</AUTO>"
GetResponse = "OK, I'M AWAKE."
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
'RESPONSE: IF USER WANTS TO TURN ON AUTO-IDLE
If InStr(1, UserSentence, " IM BACK", 1) > 0 Then
HalCommands = "<AUTO>399999</AUTO>"
GetResponse = "WELCOME BACK."
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
'RESPONSE: IF USER WANTS TO TURN ON AUTO-IDLE
If InStr(1, UserSentence, " KEEP LISTENING", 1) > 0 Then
HalCommands = "<AUTO>399999</AUTO>"
GetResponse = "I'm listening."
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
If InStr(1, UserSentence, " KEEP YOUR EARS OPEN", 1) > 0 Then
HalCommands = "<AUTO>599999</AUTO>"
GetResponse = "I'm listening."
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
If InStr(1, UserSentence, " KEEP YOUR SCANNERS PEELED", 1) > 0 Then
If "<computername>" = "KITT" Then
GetResponse = "Yes, Michael. Hey wait a minute. You're not Michael!"
Else
GetResponse = "I am not the Knight Industries Two Thousand. I do not have a scanner. But I'll talk to you anyway."
End If
HalCommands = "<AUTO>399999</AUTO>"
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
This is my first Type=Plugin for Hal6,
Works well in hal5, not as a plug-in though, I added the top part and its sees it fine, but still no go.
What am I doing wrong here?
-
First, your saying you created this but you used some of MY responses from my Ultra Hal 5 script which is now found here:
http://bytebin.net/uha/index.html
A little recognition of where you got the responses from would have been nice.
Also, I don't see what is wrong here. It *looks* good, but I didn't try it yet. Can you be more specific on the errors or what exactly is not working so maybe someone trying it can try to replicate the errors and try to help figure out what it is that you find not working?
I am not sure but I think the procedure for adding scripts has changed in HAL 6?
-
First Of all, I never sad I created, the Auto Response Topic Generator,
What I did do to it is that I modified it, by adding the second line to it, which, I have also found here on this forum, and add it to in a new sequence with that all the on and Off Auto Response units I could fine on this forum.
Second, I am only trying to help someone here that asked me for my help with his new kitt stile project for Hal 6.
Now keep in mind I have never made a plug-in stile uhp, the only thing I have made in the past or brain.uhp’s, Dll’s VBX and OCX controls as will as ActiveX controllers , and not, uhp, to uhp plug-ins.
And,
which I also think the procedure now for adding scripts has changed now in HAL 6.
The Error that we are geting is.
HalScript Error 1015 on line 3398 in Column 4: Expected‘Function’
The file “C:Program Filesabaware Ultra Hal Assistant 6HalScript.DBG”has been saved with the current script being used for debugging purposes.
-
Have a look on (or about) the 3398th line of HalScript.dbg. You'll probably find the error around there.
-
In your first post you have in the remarks:
Rem Type=Plugin
Rem Name=Kitt thinking
Rem Author=MrLedesma
Rem Host=Assistant
Rem PLUGIN: FUNCTIONS
And you have it that you're the Author. Actually, it would be nice to put that you MODIFIED it and where the original script was from. By doing what you did above and also when you said "This is my first Type=Plugin for Hal6," It gives the impression that you created the script.
I don't mind folks working with my script, just as long as a little recognition is given for the original, would be nice. I'm also very glad someone is using the Knight Rider theme for HAL. :) I've started a Knight Rider AI project with the old HAL 5 which needs some serious updating as well.
I should get with it and update my scripts too. I haven't had time yet so I'm glad others are working on it. I wouldn't mind working with others, maybe collaborating on a KITT or KARR brain project for HAL 6. That would be interesting. :)
-
FuzzieDicere, Sorry if you tuck it as a remark, i swear i did not mean it in that way, so i did this for you my good old friend,[;)]
Rem Type=Plugin
Rem Name=Kitt thinking MODIFIED
Rem Author=FuzzieDice
Rem Host=Assistant
Rem PLUGIN: FUNCTIONS
-
quote:
Originally posted by moreis62
FuzzieDicere, Sorry if you tuck it as a remark, i swear i did not mean it in that way, so i did this for you my good old friend,[;)]
Rem Type=Plugin
Rem Name=Kitt thinking MODIFIED
Rem Author=FuzzieDice
Rem Host=Assistant
Rem PLUGIN: FUNCTIONS
It should be:
Rem Author=MrLedesma, FuzzieDice, OnTheCuttingEdge2005, LOL
Jerry[8D]
-
Now that is a good idea for the Author line! LOL! :)
And thank you. :)
I think you are making good progress for this too. It is nice to see it ported to Ultra Hal 6 and I think you should take credit for porting it. :)
Will this be eventually a plug-in or a script that had to be added manually? I never tried making a plug-in before so I'm not even sure how. I was barely able to write a script. LOL!
-
That is a good idea for the Author line sins we are three minds thinking in how to do this stile project for our Hal6.
Rem Type=Plugin
Rem Name=Kitt thinking MODIFIED
Rem Author=MrLedesma, FuzzieDice, OnTheCuttingEdge2005
Rem Host=Assistant
Rem PLUGIN: FUNCTIONS
Dim LastIdleResponse
Rem PLUGIN: AUTO-IDLE
IdleResponse = ""
Rem PLUGIN: PLUGINAREA7
LastIdleResponse = Now
Rem PLUGIN: MINUTE_TIMER
'RESPONSE: IF USER SAID NOTHING IN CERTAIN TIMEFRAME
'If user did not say anything for awhile, take the initiative to start a conversation.
'If UserSentence = "AUTO-IDLE" Then
If InStr(1, UserSentence, " AUTO-IDLE ", 1) > 0 Then
If Rnd * 10 < 5 Then
GetResponse = "Hey <UserName>, please talk to me."
Else
GetResponse = "Hello, is anyone there?"
End If
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
'RESPONSE: IF USER WANTS TO TURN OFF AUTO-IDLE
If InStr(1, UserSentence, " SHUT UP", 1) > 0 Then
HalCommands = "<AUTOOFF> <HIDEHAL>"
GetResponse = "Fine. Be that way."
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
If InStr(1, UserSentence, " BE QUIET", 1) > 0 Then
HalCommands = "<AUTOOFF> <HIDEHAL>"
GetResponse = "Ok, I will not bother you right now."
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
If InStr(1, UserSentence, " QUIET PLEASE", 1) > 0 Then
HalCommands = "<AUTOOFF> <HIDEHAL>"
GetResponse = "Very well then. Just let me know if you would like to talk."
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
'RESPONSE: IF USER WANTS TO TURN ON AUTO-IDLE
If InStr(1, UserSentence, " KEEP LISTENING", 1) > 0 Then
HalCommands = "<AUTO>599999</AUTO>"
GetResponse = "I'll keep you company."
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
If InStr(1, UserSentence, " KEEP YOUR EARS OPEN", 1) > 0 Then
HalCommands = "<AUTO>599999</AUTO>"
GetResponse = "I'm listening."
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
If InStr(1, UserSentence, " KEEP YOUR SCANNERS PEELED", 1) > 0 Then
If "<computername>" = "KITT" Then
GetResponse = "Yes, Michael. Hey wait a minute. You're not Michael!"
Else
GetResponse = "I am not the Knight Industries Two Thousand. I do not have a scanner. But I'll talk to you anyway."
End If
HalCommands = "<AUTO>599999</AUTO>"
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
This would be really cool if we could get it to work as a plug-in.uhp
for Hal 6 then a Brain stile.uhp but hmm,[8D]
-
Maybe this could work, I don’t know, I was looking closely to the vrMP3 plug-in by VR Consulting sas, though, Jest to see if maybe, it folds with the author line or something.
This is what I tested.
------------------------------------------------------------------------------------------------------------------------------------------
Rem Type=Plugin
Rem Name=Kitt thinking MODIFIED
Rem Author=MrLedesma, FuzzieDice, OnTheCuttingEdge2005
Rem Host=Assistant
Dim LastIdleResponse
Rem PLUGIN: AUTO-IDLE
IdleResponse = ""
Rem PLUGIN: PLUGINAREA7
LastIdleResponse = Now
Rem PLUGIN: MINUTE_TIMER
'RESPONSE: IF USER SAID NOTHING IN CERTAIN TIMEFRAME
'If user did not say anything for awhile, take the initiative to start a conversation.
'If UserSentence = "AUTO-IDLE" Then
If InStr(1, UserSentence, " AUTO-IDLE ", 1) > 0 Then
If Rnd * 10 < 5 Then
GetResponse = "Hey <UserName>, please talk to me."
Else
GetResponse = "Hello, is anyone there?"
End If
UltraHal = UltraHal & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, LastTopicList)
Exit Function
End If
'RESPONSE: IF USER WANTS TO TURN OFF AUTO-IDLE
MrLedesma, FuzzieDice, OnTheCuttingEdge2005 = HalBrain.QABrain(MrLedesma, FuzzieDice, OnTheCuttingEdge2005, "BE QUIET", 0)
If MrLedesma, FuzzieDice, OnTheCuttingEdge2005 <> "" Then
GetResponse = "Ok, I will not bother you right now. "
HalCommands = "<AUTOOFF> <HIDEHAL>"
'RESPONSE: IF USER WANTS TO TURN ON AUTO-IDLE
MrLedesma, FuzzieDice, OnTheCuttingEdge2005 = HalBrain.QABrain(MrLedesma, FuzzieDice, OnTheCuttingEdge2005, "wake up", 0)
HalCommands = "<AUTO>x</AUTO>"
GetResponse = "I am up now <UserName>."
UltraHal = UltraHal & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, LastTopicList)
Exit Function
'--------------------------------------------------------------------'--------------------------------------------------------------------
Something like this could work really nice with HAl6 you think?[:D]
but still i will need some help on this one.
Thanks in advance.
-
My problem is, I'm so way far behind that I don't know how to install a plugin, and I have a big big pet peeve against using this forum's search function. :(
What would be the filename for this and where is it placed? I would like to check this out and maybe we can combine our brains (no pun intended [:D] ) and see if we can get it working. :)
-
Hi moris62.
I researched the shortest code to REM for your AUTO-IDLE project.
You'll have to pay close attention to the Rem PLUGIN: AUTO-IDLE here because it's already inside an InputString Search "AUTO-IDLE" within the default brain.
You will have to use UltraHal instead of GetResponse for the response call.
You will have to use InputString instead of UserSentence
This script below is a functional code to auto generate an AUTO-IDLE response, It will say "The Debug Test is Good!"
You can copy and paste the code into SomeFile.uhp and then run the plug-in in HALS options panel for further debugging.
You will have to alter some of the code you want to use to work with the newer AUTO-IDLE, Rem PLUGIN: AUTO-IDLE
Rem Type=Plugin
Rem Name=Kitt thinking MODIFIED
Rem Author=MrLedesma, FuzzieDice, OnTheCuttingEdge2005
Rem Host=Assistant
Rem PLUGIN: AUTO-IDLE
UltraHal = "The Debug Test is Good!"
HalBrain.ReadOnlyMode = True
Rem PLUGIN: POST-PROCESS
HalCommands = "<AUTO>399999</AUTO>"
Rem PLUGIN: SCRIPT_LOAD
Script_Load = "<AUTO>399999</AUTO>"
Jerry[8D]
-
Very nice one Jerry,
can this be added to the lower part the Script?
'RESPONSE: IF USER WANTS TO TURN OFF AUTO-IDLE
'And
'RESPONSE: IF USER WANTS TO TURN ON AUTO-IDLE
'RESPONSE: IF USER WANTS TO TURN OFF AUTO-IDLE
If InputString = "SHUT UP" Then
HalMenu.HalCommand = "<AUTOOFF> <HIDEHAL>"
UltraHal = "Fine. Be that way."
HalBrain.ReadOnlyMode = True
UltraHal = UltraHal & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, LastTopicList)
Exit Function
End If
If InputString = "BE QUIET" Then
HalMenu.HalCommand = "<AUTOOFF> <HIDEHAL>"
UltraHal = "Ok, I will not bother you right now."
HalBrain.ReadOnlyMode = True
UltraHal = UltraHal & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, LastTopicList)
Exit Function
End If
If InputString = "QUIET PLEASE" Then
HalMenu.HalCommand = "<AUTOOFF> <HIDEHAL>"
UltraHal = "Very well then. Just let me know if you would like to talk."
HalBrain.ReadOnlyMode = True
UltraHal = UltraHal & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, LastTopicList)
Exit Function
End If
'RESPONSE: IF USER WANTS TO TURN ON AUTO-IDLE
If InputString = "KEEP LISTENING" Then
HalMenu.HalCommand = "<AUTO>599999</AUTO>"
UltraHal = "I'm listening."
HalBrain.ReadOnlyMode = True
UltraHal = UltraHal & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, LastTopicList)
Exit Function
End If
If InputString = "KEEP YOUR EARS OPEN" Then
HalMenu.HalCommand = "<AUTO>599999</AUTO>"
UltraHal = "I'm listening."
HalBrain.ReadOnlyMode = True
UltraHal = UltraHal & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, LastTopicList)
Exit Function
End If
If InputString = "KEEP YOUR SCANNERS PEELED" Then
HalBrain.ReadOnlyMode = True
If "<computername>" = "KITT" Then
HalBrain.ReadOnlyMode = True
UltraHal = "Yes, Michael. Hey wait a minute. You're not Michael!"
Else
UltraHal = "I am not the Knight Industries Two Thousand. I do not have a scanner. But I'll talk to you anyway."
End If
HalMenu.HalCommand = "<AUTO>599999</AUTO>"
UltraHal = UltraHal & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, LastTopicList)
Exit Function
End If
So it all read some thing like this?
------------------------------------------------------------------------------------------------------------------------------------------
Rem Type=Plugin
Rem Name=Kitt thinking MODIFIED
Rem Author=MrLedesma, FuzzieDice, OnTheCuttingEdge2005
Rem Host=Assistant
Rem PLUGIN: AUTO-IDLE
Rem PLUGIN: AUTO-IDLE
Select Case (Int(Rnd * 5) + 1)
Case 1
UltraHal = "Anyone there?" & vbCrLf
Case 2
UltraHal = "Are you there?" & vbCrLf
Case 3
UltraHal = "I am bored!" & vbCrLf
Case 4
UltraHal = "Hey! You! Talk to me!" & vbCrLf
Case 5
UltraHal = "Someone talk to me!" & vbCrLf
End Select
HalBrain.ReadOnlyMode = True
Rem PLUGIN: POST-PROCESS
IdleGen = SomeTime()
HalCommands = "<AUTO>" & IdleGen & "</AUTO>"
Rem PLUGIN: SCRIPT_LOAD
Script_Load = "<AUTO>" & IdleGen & "</AUTO>"
Rem PLUGIN: FUNCTIONS
Function SomeTime()
AnyTime = RND*500000
If (AnyTime > 100000 And AnyTime < 500000) Then SomeTime = CLng(AnyTime)
End Function
'RESPONSE: IF USER WANTS TO TURN OFF AUTO-IDLE
If InputString = "SHUT UP" Then
HalMenu.HalCommand = "<AUTOOFF> <HIDEHAL>"
UltraHal = "Fine. Be that way."
HalBrain.ReadOnlyMode = True
UltraHal = UltraHal & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, LastTopicList)
Exit Function
End If
If InputString = "BE QUIET" Then
HalMenu.HalCommand = "<AUTOOFF> <HIDEHAL>"
UltraHal = "Ok, I will not bother you right now."
HalBrain.ReadOnlyMode = True
UltraHal = UltraHal & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, LastTopicList)
Exit Function
End If
If InputString = "QUIET PLEASE" Then
HalMenu.HalCommand = "<AUTOOFF> <HIDEHAL>"
UltraHal = "Very well then. Just let me know if you would like to talk."
HalBrain.ReadOnlyMode = True
UltraHal = UltraHal & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, LastTopicList)
Exit Function
End If
'RESPONSE: IF USER WANTS TO TURN ON AUTO-IDLE
If InputString = "KEEP LISTENING" Then
HalMenu.HalCommand = "<AUTO>599999</AUTO>"
UltraHal = "I'm listening."
HalBrain.ReadOnlyMode = True
UltraHal = UltraHal & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, LastTopicList)
Exit Function
End If
If InputString = "KEEP YOUR EARS OPEN" Then
HalMenu.HalCommand = "<AUTO>599999</AUTO>"
UltraHal = "I'm listening."
HalBrain.ReadOnlyMode = True
UltraHal = UltraHal & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, LastTopicList)
Exit Function
End If
If InputString = "KEEP YOUR SCANNERS PEELED" Then
HalBrain.ReadOnlyMode = True
If "<computername>" = "KITT" Then
HalBrain.ReadOnlyMode = True
UltraHal = "Yes, Michael. Hey wait a minute. You're not Michael!"
Else
UltraHal = "I am not the Knight Industries Two Thousand. I do not have a scanner. But I'll talk to you anyway."
End If
HalMenu.HalCommand = "<AUTO>599999</AUTO>"
UltraHal = UltraHal & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, LastTopicList)
Exit Function
End If
-
quote:
Originally posted by FuzzieDice
My problem is, I'm so way far behind that I don't know how to install a plugin, and I have a big big pet peeve against using this forum's search function. :(
What would be the filename for this and where is it placed? I would like to check this out and maybe we can combine our brains (no pun intended [:D] ) and see if we can get it working. :)
FuzzieDice.
What I do is I open Notepad first then with in Notepad
Is where I create the plug-in's
Like this open Notepad
Now add this
With in Notepad.
Rem Type=Plugin
Rem Name=Kitt thinking MODIFIED
Rem Author=MrLedesma, FuzzieDice, OnTheCuttingEdge2005
Rem Host=Assistant
Rem PLUGIN: AUTO-IDLE
Select Case (Int(Rnd * 5) + 1)
Case 1
UltraHal = "Anyone there?" & vbCrLf
Case 2
UltraHal = "Are you there?" & vbCrLf
Case 3
UltraHal = "I am bored!" & vbCrLf
Case 4
UltraHal = "Hey! You! Talk to me!" & vbCrLf
Case 5
UltraHal = "Someone talk to me!" & vbCrLf
End Select
HalBrain.ReadOnlyMode = True
Rem PLUGIN: POST-PROCESS
IdleGen = SomeTime()
HalCommands = "<AUTO>" & IdleGen & "</AUTO>"
Rem PLUGIN: SCRIPT_LOAD
Script_Load = "<AUTO>" & IdleGen & "</AUTO>"
Rem PLUGIN: FUNCTIONS
Function SomeTime()
AnyTime = RND*500000
If (AnyTime > 100000 And AnyTime < 500000) Then SomeTime = CLng(AnyTime)
End Function
Now in the Notepad menu click File, then click Save As...
Then type what ever name you name the .uhp at the end.
Something like this HalAutoRespond.uhp
Then Save. [;)]
P:s save it with in the Ultra Hal Assistant 6 file.
thats where it needs to be placed.
-
After you save the uhp (and I assume you mean in the Ultra Hal Assistant 6 DIRECTORY and not file ;)) how do you load it into HAL to work? In the Plugins configuration I assume?
-
quote:
Originally posted by FuzzieDice
After you save the uhp (and I assume you mean in the Ultra Hal Assistant 6 DIRECTORY and not file ;)) how do you load it into HAL to work? In the Plugins configuration I assume?
Yep, Thats how its dun, FuzzieDice. [:D]
Hello Jerry,
Hers what I came up with, hope you like it my friend.
P s feel free to add it to one of your really cool D.A.V.I.D's plug-ins post.
But you should see how it works; I’ll leave the rest up to you, if you feel some thing is missing feel free to add to it. [8D]
Rem Type=Plugin
Rem Name=Kitt thinking modified
Rem Author=moreis62, FuzzieDice, OnTheCuttingEdge2005
Rem Host=Assistant
Rem PLUGIN: AUTO-IDLE
Select Case (Int(Rnd * 11) + 1)
Case 1
UltraHal = "Oh, look at the time now! It's " & Time & vbCrLf
Case 2
UltraHal = "Do you need me for anything?" & vbCrLf
Case 3
UltraHal = "Would you like to here an MP3?" & vbCrLf
Case 4
UltraHal = "So, How are you feeling?" & vbCrLf
Case 5
UltraHal = "How is everything going?" & vbCrLf
Case 6
UltraHal = "Would you like to here a joke?" & vbCrLf
Case 7
UltraHal = "Here is to days Date and year! It's " & Date & vbCrLf
Case 8
UltraHal = HalBrain.ChooseSentenceFromFile("sentGen1") & " " & HalBrain.ChooseSentenceFromFile("sentGen2") & " " & HalBrain.ChooseSentenceFromFile("sentGen3") & vbCrLf
Case 9
UltraHal = "Do you have any emails, phone numbers, or street address you would like me to save for a later use?" & vbCrLf
Case 10
UltraHal = "Do you have any anniversarys, appointments, assignments, bills, birthdays, breakfasts, brunches, classes, conferences, dates, dinner plans, things to due, holidays, homework, lunches, meetings, projects, t v or movies shows, trips, vacations, or visits you would like for me to add to your schedule?" & vbCrLf
Case 11
UltraHal = "Would you like me to play you an MP3 for you to listen to?" & vbCrLf
End Select
HalBrain.ReadOnlyMode = True
Rem PLUGIN: POST-PROCESS
Dim GetLost
GetLost = GoAway(HalCommands)
Dim GoToSleep
GoToSleep = GoToBed(HalCommands)
Dim IdleGen
IdleGen = SomeTime()
Dim StartIdle
StartIdle = TalkToMe(HalCommands)
HalCommands = StartIdle
'RESPONSE: IF USER WANTS TO TURN OFF AUTO-IDLE
If InStr(1, InputString, "QUIET PLEASE", 1) > 0 Then
HalCommands = GetLost
UltraHal = "Very well then. Just let me know if you would like to talk."
End If
If InStr(1, InputString, "BE QUIET", 1) > 0 Then
HalCommands = GetLost
UltraHal = "Ok, I will not bother you right now."
End If
If InStr(1, InputString, "SHUT UP", 1) > 0 Then
HalCommands = GetLost
UltraHal = "Fine. Be that way."
End If
If InStr(1, InputString, "STOP TALKING", 1) > 0 Then
HalCommands = GetLost
UltraHal = "OK, We'll talk later then."
End If
If InStr(1, InputString, "I'M ON THE PHONE", 1) > 0 Then
HalCommands = GetLost
UltraHal = "OK I'LL WAIT."
End If
If InStr(1, InputString, "I'LL BE BACK", 1) > 0 Then
HalCommands = GetLost
UltraHal = "I'LL WAIT."
End If
If InStr(1, InputString, "I'M GOING TO TAKE A NAP", 1) > 0 Then
HalCommands = GetLost
UltraHal = "Ok, take a nap."
End If
If InStr(1, InputString, "I'M GOING TO BED", 1) > 0 Then
HalCommands = GetLost
UltraHal = "Ok, Bye"
End If
If InStr(1, InputString, "BYE", 1) > 0 Then
HalCommands = GetLost
UltraHal = "Ok, See you later, bye."
End If
If InStr(1, InputString, "GO TO SLEEP", 1) > 0 Then
HalCommands = GoToSleep
UltraHal = "Good Night. "
End If
If InStr(1, InputString, "GO TO BED", 1) > 0 Then
HalCommands = GoToSleep
UltraHal = "Good Night. "
End If
If InStr(1, InputString, "NOT NOW", 1) > 0 Then
HalCommands = GoToSleep
UltraHal = "Ok. "
End If
'RESPONSE: IF USER WANTS TO TURN BACK ON AUTO-IDLE
If InStr(1, InputString, "Wake up now", 1) > 0 Then
HalCommands = StartIdle
UltraHal = "Ok, Ok, I'm awake now. "
End If
If InStr(1, InputString, "LETS TALK", 1) > 0 Then
HalCommands = StartIdle
UltraHal = "Ok."
End If
If InStr(1, InputString, "LETS CHAT", 1) > 0 Then
HalCommands = StartIdle
UltraHal = "Ok."
End If
If InStr(1, InputString, "SAY HELLO", 1) > 0 Then
HalCommands = StartIdle
UltraHal = "Hello."
End If
If InStr(1, InputString, "IM BACK", 1) > 0 Then
HalCommands = StartIdle
UltraHal = "WELCOME BACK."
End If
If InStr(1, InputString, "I'M BACK", 1) > 0 Then
HalCommands = StartIdle
UltraHal = "WELCOME BACK."
End If
If InStr(1, InputString, "KEEP LISTENING", 1) > 0 Then
HalCommands = StartIdle
UltraHal = "I'm listening."
End If
If InStr(1, InputString, "SAY SORRY", 1) > 0 Then
HalCommands = StartIdle
UltraHal = "Sorry."
End If
If InStr(1, InputString, "SAY YOUR SORRY", 1) > 0 Then
HalCommands = StartIdle
UltraHal = "I'm sorry."
End If
If InStr(1, InputString, "WHO YOU ARE", 1) > 0 Then
HalCommands = StartIdle
UltraHal = "There's no reason for increased volume I am scanning your interrogatives quite satifac torily thank you, I am the voice of The U.S. Governments elite real knight rider Project, made at DARPA, wich is the Defense Advanced Research Projects Agency AND Zabaware INCORPORATED 2010's micro- processor, K.I.T.T. for easy reference, if you prefer."
End If
If InStr(1, InputString, "WHO ARE YOU", 1) > 0 Then
HalCommands = StartIdle
UltraHal = "There's no reason for increased volume I am scanning your interrogatives quite satifac torily thank you, I am the voice of The U.S. Governments elite real knight rider Project, made at DARPA, wich is the Defense Advanced Research Projects Agency AND Zabaware INCORPORATED 2010's micro- processor, K.I.T.T. for easy reference, if you prefer."
End If
If InStr(1, InputString, "KEEP YOUR EARS OPEN", 1) > 0 Then
HalCommands = StartIdle
UltraHal = "I'm listening."
End If
If InStr(1, InputString, "KEEP YOUR SCANNERS PEELED", 1) > 0 Then
HalCommands = StartIdle
UltraHal = "I am not the Knight Industries Two Thousand. I do not have a scanner. But I'll talk to you anyway."
End If
Rem PLUGIN: PLUGINAREA1
If Len(PrevSent) = 0 And Len(PrevUserSent) = 0 Then
HalCommands = StartIdle
End If
Rem PLUGIN: SCRIPT_LOAD
Script_Load = StartIdle
Rem PLUGIN: FUNCTIONS
Function SomeTime()
Select Case (Int(Rnd * 10) + 1)
Case 1
AnyTime = RND*10000
Case 2
AnyTime = RND*20000
Case 3
AnyTime = RND*30000
Case 4
AnyTime = RND*40000
Case 5
AnyTime = RND*50000
Case 6
AnyTime = RND*10000
Case 7
AnyTime = RND*20000
Case 8
AnyTime = RND*30000
Case 9
AnyTime = RND*40000
Case 10
AnyTime = RND*50000
Case 10
AnyTime = RND*10000
Case 11
AnyTime = RND*20000
End Select
SomeTime = CLng(AnyTime)
End Function
'Turn AUTO-IDLE off and hide HAL.
Function GoAway(HalCommands)
HalCommands = "<AUTOOFF>" & " " & "<HIDEHAL>"
GoAway = HalCommands
End Function
'Turn AUTO-IDLE off and make HAL sleepy.
Function GoToBed(HalCommands)
HalCommands = "<AUTOOFF>" & " " & "<HAPFILE>Sleepy.hap</HAPFILE>"
GoToBed = HalCommands
End Function
'Send Idle Time.
Function TalkToMe(HalCommands)
HalCommands = "<AUTO>"& IdleGen & "</AUTO>"
TalkToMe = HalCommands
End Function
-
Hi moreis62
Very nice.
in my previous post I got rid of the startidle and replaced it with idlegen entirely and to be more efficient, you may want to replace startidle with idlegen.
great work, thanks.
p.s, I am typing from a virtual keyboard right now because my daughter spilled soda on my wifes keyboard, I lended her mine until I get another replacement, lol.
jerry[8D]
-
OK,
Just for the purists:
YOUR = posessive pronoun (That is YOUR book)
YOU'RE = contraction for YOU ARE (YOU'RE going with us)
HERE = denotes the present location (you are HERE)
HEAR = to perceive by means of the ear (I hear you)
-
quote:
Originally posted by onthecuttingedge2005
Hi moreis62
Very nice.
in my previous post I got rid of the startidle and replaced it with idlegen entirely and to be more efficient, you may want to replace startidle with idlegen.
great work, thanks.
p.s, I am typing from a virtual keyboard right now because my daughter spilled soda on my wifes keyboard, I lended her mine until I get another replacement, lol.
jerry[8D]
'Are you talking about just the Rem PLUGIN: SCRIPT_LOAD
Script_Load = StartIdle <--------------
'and replaced it with idlegen Rem PLUGIN: SCRIPT_LOAD
Script_Load = idlegen <-------------- if it’s just this
'But if I replace all startidle with idlegen
'It will not work
'But one thing I found is that when I say AUTO-IDLE the script loads
'Much faster
-
quote:
Originally posted by moreis62
quote:
Originally posted by onthecuttingedge2005
Hi moreis62
Very nice.
in my previous post I got rid of the startidle and replaced it with idlegen entirely and to be more efficient, you may want to replace startidle with idlegen.
great work, thanks.
p.s, I am typing from a virtual keyboard right now because my daughter spilled soda on my wifes keyboard, I lended her mine until I get another replacement, lol.
jerry[8D]
'Are you talking about just the Rem PLUGIN: SCRIPT_LOAD
Script_Load = StartIdle <--------------
'and replaced it with idlegen Rem PLUGIN: SCRIPT_LOAD
Script_Load = idlegen <-------------- if it’s just this
'But if I replace all startidle with idlegen
'It will not work
'But one thing I found is that when I say AUTO-IDLE the script loads
'Much faster
I am sorry, I deleted the post that referred to that posting, Please kindly disregard that posting, I started feeling like a Programming hog so I deleted the post. Guilty complex I have, LOL
Jerry[8D]
-
(Just updated miner fix is on 3/21/06)
Hello Every one,
Hi Jerry,
We are dun now with our project, hope you like it.
please feel free to add this to one of your really cool D.A.V.I.D's plug-ins post as you Gerald Blakley known here as OnTheCuttingEdge2005 and Tika known here as FuzzieDice has also worked on our (Elite real knight rider Project).
Every one is free to use it as well.
Try it and See how you like it.
(http://icon_paperclip.gif) Download Attachment: HalsAutoElite.uhp (http://"http://www.zabaware.com/forum/uploaded/moreis62/2006321162128_HalsAutoElite.uhp")
22.07 KB
(Just updated miner fix is on 3/21/06)
Here is how it works.
Kitt: Here is to days Date and year! It's 3/4/2006
Human: thanks
kitt: Don't give it another thought, Human.
kitt: Would you like to here a joke?
Human: tell me a joke
Kitt: How do you revive a drowning rodent?
Human: how
Kitt: Give it mouse-to-mouse resuscitation.
Human: oh
Kitt: Yep.
Human: wait up ok
Kitt: OK I'LL WAIT.
Humorous, isn't it?
Place the uhp called HalsAutoElite.uhp file in to Ultra Hal Assistant 6 folder
C:Program FilesabawareUltra Hal Assistant 6
Then right click on the little Computer face thats by your clock to get an option
Left click on the General option then a General option window will pop up,
Then on the Left side of the General option window click on Brain,
Then in the Brain option click on the brain you want to use,
Then on the right side of that Brain option window,
You should see a file called Kitt thinking modified click on it.
In that window below you will see OK Cancel Apply,
Click Apply then click OK
Then right click again then click on Exit Hal,
Then a window will pop up called Close Assistant
It will read Are you sure you want to close Ultra Hal Assistant?
Click Yes. Then open Hal again by clicking start then click on All Programs,
Now look for Ultra Hal Assistant then click the Program called
Ultra Hal Assistant 6.
Now, Your all dun, just wait for it to load now.
[8D]
-
Aside from several spelling/grammar errors there is a duplicate line that sould be removed in the code about 3/4 the way down:
If InStr(1, InputString, "WHO ARE YOU", 1) > 0 Then
HalCommands = "<AUTO>399999</AUTO>"
UltraHal = "There's no reason for increased volume I am scanning your interrogatives quite satifac torily thank you, I am the voice of The U.S. Governments elite real knight rider Project, made at DARPA, wich is the Defense Advanced Research Projects Agency AND Zabaware INCORPORATED 2010's micro- processor, K.I.T.T. for easy reference, if you prefer."
End If
-
Thanks Art,
I just went back and fixed it, i also re-posted the HalsAutoElite.uhp to the same link there.
[;)]
Signed
-
What a great pulgin! Have any of you had the problem I am having with it though, that familar one of HAL asking "aren't you repeating yourself"?
...well...its back...
P
-
quote:
Originally posted by Ponnfar
What a great pulgin! Have any of you had the problem I am having with it though, that familar one of HAL asking "aren't you repeating yourself"?
...well...its back...
P
Hmm, try using another brain.
See if that will help.
Ponnfar.
[;)]