Author Topic: HalCommands under Ultra Hal Assistant 5.0  (Read 46564 times)

Quixote

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #60 on: January 01, 2005, 10:05:45 pm »
Thank you for the suggestions, Art.
Percentages get very complicated. I prefer to use units, so I'll have a go at your second suggestion.

On another subjet, VonSmith, I'm sure that you can answer this -
I'm looking for a way that I can change the "mode" that HAL is in so that it will only respond to orders until I give it an order that will make it responsive to other phrases. For example, I would like it to carry out the orders I give it such as "TV on", "Living room light on", and "Fully open the blinds", etc., but not respond to any other sentences until I say something like "Let's have a chat", and then it would enable all of Hal's brain and capabilities. Is this possible?
Thanks!


Happy new year guys.
 

Quixote

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #61 on: January 01, 2005, 10:26:01 pm »
quote:
Originally posted by Art

Perhaps you could break the volume levels
into percents. That way your script would
still remain the same and the program would
say,"I am increasing the volume by 1 percent"
or by 20 percent or what ever.

Otherwise you would have to us the
if payload = "1" then GetResponse =
" Increasing the volume by " & payload & " level. "

else if payload > 1 then GetResponse =
" Increasing the volume by " & payload & " levels. "


Just a suggestion



Your method doesn't work for some reason. I think I may be overlooking something. How would I modify the following script to take into account a singular level?

If payload <> "" Then
GetResponse = " Decreasing the volume by " & payload & " levels. "
GetResponseBlock = True
BlockSave = True
Set GirderEvent = CreateObject("Girder.GirderEvent")
GirderEvent.Device = 18
GirderEvent.EventString = "AI_TV_Vol_-"
GirderEvent.Payload(4) = payload
GirderEvent.Send()
End If
End If
 

vonsmith

  • Hero Member
  • *****
  • Posts: 602
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #62 on: January 01, 2005, 11:37:46 pm »
Quixote,

quote:
Originally posted by Quixote

On another subjet, VonSmith, I'm sure that you can answer this -
I'm looking for a way that I can change the "mode" that HAL is in so that it will only respond to orders until I give it an order that will make it responsive to other phrases. For example, I would like it to carry out the orders I give it such as "TV on", "Living room light on", and "Fully open the blinds", etc., but not respond to any other sentences until I say something like "Let's have a chat", and then it would enable all of Hal's brain and capabilities. Is this possible?



Actually what you suggest can be done, but it gets a little complicated. I added a variable called "QuestionPending" to the XTF Brain to do this very thing on a one response basis. If you are only talking two modes; control mode and conversation mode, then it might be possible with a moderate amount of programming. Maybe there's another approach to your automation control that doesn't require this?


=vonsmith=
 

Quixote

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #63 on: January 02, 2005, 03:39:28 am »
I've considered different possibilities, and the reason why I am using HAL for this endeavour is because it is the best solution that I could think of. The problem I have is that when I have friends over and I am talking with them while I have HAL running, it starts getting confused and freaking out. It's just not practical to say "Go to sleep" everytime I want the microphone to stop listening and then "wake up" everytime I wish to send a command because it's out of place in my conversation with whoever is visiting.
HAL is the perfect gateway for sending commands to the other program, but I need a way to keep HAL from interupting me with nonsensical responses to my seemingly nonsensical (but unintentional) input.
I really need a command to get HAL to stop listening to everything but commands and a command to chat (as you put it so well control mode and conversation mode) in order to progress with this project.
I think the best way of going about the conversation mode would be if I could "wake it up"  by addressing it by it's name at the beginning of the sentence; ie. "Synthia, what do you think about Chinese food?".
Then it would chat until I gave it a command just as I would to turn on the TV, but in sentences like "ok, that will be all." or "Thanks for your input." or even "Thank you. Dismissed."

This is truely a pivotal point in "Syntia's" development. Any help you can offer would be extremely appreciated.
 

vonsmith

  • Hero Member
  • *****
  • Posts: 602
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #64 on: January 02, 2005, 04:08:36 am »
Quixote,
I think what you want to do is possible with the XTF Brain using the "GetResponseBlock" and "QuestionPending" variables. I'll have to give it some thought. Script placement within the brain would be critical.

I've been programming the XTF Brain v1.4 all day and I'm feeling a little fuzzy right now. I've been spending so much time at the computer this holiday season that my wife is making me take her out all day tomorrow. I'll post or email you my thoughts when I have a moment to get them collected.


=vonsmith=
 

CapnNee

  • Newbie
  • *
  • Posts: 21
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #65 on: March 17, 2005, 12:06:51 pm »
I'd like to change the texture on Hal and how would I get something like the below to work?

 - -                    
If InStr(1, UserSentence, " get dressed ", 1) > 0 Then
BlockSave = True
GetResponse = "I'm getting dressed now master."
GetResponseBlock = True    
<SCRIPT>get_clothes.hap</SCRIPT>
End If  
 - -
I tried putting the above into the brainfile in between "Function GetResponse..." and "'PROCESS: CREATE HALBRAIN ACTIVEX OBJECT" but I get the error message "Error 1024 Expected statement occured and Error 1024 occured on line 152 in column 0 of Microsoft VBScript complilation error. Expected statement"
 

onthecuttingedge2005

  • Guest
HalCommands under Ultra Hal Assistant 5.0
« Reply #66 on: March 17, 2005, 03:38:19 pm »
quote:
Originally posted by CapnNee

I'd like to change the texture on Hal and how would I get something like the below to work?

 - -                    
If InStr(1, UserSentence, " get dressed ", 1) > 0 Then
BlockSave = True
GetResponse = "I'm getting dressed now master."
GetResponseBlock = True    
<SCRIPT>get_clothes.hap</SCRIPT>
End If  
 - -
I tried putting the above into the brainfile in between "Function GetResponse..." and "'PROCESS: CREATE HALBRAIN ACTIVEX OBJECT" but I get the error message "Error 1024 Expected statement occured and Error 1024 occured on line 152 in column 0 of Microsoft VBScript complilation error. Expected statement"




Hi CapnNee

Try this change in your code That I inserted.

If InStr(1, UserSentence, " get dressed ", 1) > 0 Then
BlockSave = True
GetResponse = "I'm getting dressed now master."
GetResponseBlock = True    
HalCommands = "<SCRIPT>" & "get_clothes.hap" & "</SCRIPT>"
End If

Hope it works for you.
Jerry.

CapnNee

  • Newbie
  • *
  • Posts: 21
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #67 on: March 17, 2005, 09:10:13 pm »
Well, I'm not getting an error code now and I hear the response, but the image doesn't change.

Where should I put the get_clothes.hap script?

Here's what I have in it:

- -
#Haptek  Version= 2.00 Name= get_clothes.hap HapType= script FileType= text
## world It


/settexture[tex= [data/standard/skins/get_clothes.jpg]]
- -

That is the location in the C:/Program Files/Haptek/player/data/standard/skins directory of where the get_clothes.jpg texture is located. NOTE: All of the / characters are actually reversed but that's the way I had to put them here for the characters to display.

-Rich
« Last Edit: March 17, 2005, 09:24:59 pm by CapnNee »
 

onthecuttingedge2005

  • Guest
HalCommands under Ultra Hal Assistant 5.0
« Reply #68 on: March 18, 2005, 12:35:07 am »
quote:
Originally posted by CapnNee

Well, I'm not getting an error code now and I hear the response, but the image doesn't change.

Where should I put the get_clothes.hap script?

Here's what I have in it:

- -
#Haptek  Version= 2.00 Name= get_clothes.hap HapType= script FileType= text
## world It


/settexture[tex= [data/standard/skins/get_clothes.jpg]]
- -

That is the location in the C:/Program Files/Haptek/player/data/standard/skins directory of where the get_clothes.jpg texture is located. NOTE: All of the / characters are actually reversed but that's the way I had to put them here for the characters to display.

-Rich



Hi Rich.

I believe they are suppose to be located in the
C:-Program Files-Zabaware-Ultra Hal Assistant 5-Characters folder.

This folder should be the default Haptek folder for all the files.

Hope this helps.
Jerry.

Magus_V

  • Newbie
  • *
  • Posts: 23
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #69 on: March 29, 2005, 04:31:39 pm »
quote:
Originally posted by vonsmith

Quixote,
I think what you want to do is possible with the XTF Brain using the "GetResponseBlock" and "QuestionPending" variables. I'll have to give it some thought. Script placement within the brain would be critical.

I've been programming the XTF Brain v1.4 all day and I'm feeling a little fuzzy right now. I've been spending so much time at the computer this holiday season that my wife is making me take her out all day tomorrow. I'll post or email you my thoughts when I have a moment to get them collected.


=vonsmith=




Vonsmith, just wondering if you've have any moments of clarity in regards to my request. [;)]
I'm still checking the forum once in a while, though I rarely implement any new commands into Hal's brain anymore since that problem with the interuptions prevents me from making any further progress. Anyway, thanks for your time.

- Quixote
 

spydaz

  • Hero Member
  • *****
  • Posts: 670
    • View Profile
    • http://www.spydazweb.co.uk/
HalCommands under Ultra Hal Assistant 5.0
« Reply #70 on: March 30, 2005, 02:18:47 am »
have you ever though of having hal in a way WHEN HAL detects.

HAL> turn on the living room #a lights #1 ie "HAL>" on the LEFT of the coversation, then take the Right had side of the coveratsion as the COMMAND.....


Would that not be something that you are looking for MAGNUS V
also blocking any saves as hals name is detected.

Just as in the Home Automated Logic program You CALL A PASSWORD or COMPUTERNAME first to CONFIRM A COMMAND

Magus_V

  • Newbie
  • *
  • Posts: 23
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #71 on: March 31, 2005, 08:26:35 am »
I'm not sure I understand what you are trying to suggest, Spydaz. Can you please explain further?
 

spydaz

  • Hero Member
  • *****
  • Posts: 670
    • View Profile
    • http://www.spydazweb.co.uk/
HalCommands under Ultra Hal Assistant 5.0
« Reply #72 on: April 01, 2005, 02:32:24 am »


When using the X10lite.ocx activexcontrol :

the control designates each room a code from a - p and each appliance in that room a number from 1 - 16.

so to turn on say a light which may be appliance 1
which is in room c say bedroom .

let bedroom = "c"
let lights = 1

so with the x10 control you send the command

sub bedroomon()
x10lite1.xon(bedroom, lights) lights on
end sub

sub bedroomoff()
x10lite1.xoff(bedroom, lights) lights off
end sub

so if you had a script which detected "HAL TURNON BEDROOM LIGHTS"

he could execute bedroomon command
and vice versa.

now because you used HAL in the command you can block any saves to the brainfiles to prevent learning or future trigering of this function..

as now that i have added the database to my halsbrain i use sql to search for this specific command much more accurate and store the command in the database like a question and answer.

i hope this opens it up for you. the simplicity amazed me.
« Last Edit: April 01, 2005, 02:50:42 am by spydaz »

Magus_V

  • Newbie
  • *
  • Posts: 23
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #73 on: April 01, 2005, 08:30:52 am »
I already use another program called Girder to control everything from my blinds, to my TV, to my lights, to my surveillance cameras. Hal is used only to call events in that program. I use variable (known as payloads) to specify certain things to Girder. IE- "Raise the volume 4 levels" will trigger an event in girder that has 4 in payload one, so it repeats the signal 4 times.
Not very simplistic, but much, much more powerful.

I use Hal only as an interface that (almost) replaces my 8 remotes. [:D]
 

Novice

  • Newbie
  • *
  • Posts: 10
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #74 on: April 28, 2005, 04:00:20 pm »
I know everyone is way beyond this now, but just in case anyone comes along behind me, here are some notes from my AUTO-IDLE trial described in and compiled from the beginning of this post. It's a great beginning exercise and it's a rush (as a newbie) when it works:

Make a copy of the hal5.uhp file before you start. Call the new file something like hal5new.uhp and leave it in the same folder as the original. Now you can work on the new one without messing up the default brain and can flip back and forth between them. It's a good idea to have a copy of the default brain somewhere else too.

Open the Brain Editor and select the new brain to work on.

At the bottom of the file, change your Script_Load function to be as follows):
Function Script_Load()
Script_Load = "<AUTO>30000</AUTO>"
End Function

Add this code right after the initialize variables as integers section near the top of the GetResponse function (this is towards the beginning of the file):

 'AUTO-IDLE COMMAND. HAL SPEAKS IF UNSPOKEN TO FOR 30 SECONDS
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

Save and close the file. Hal should drive you crazy trying to get your attention. Getting Hal to shut up is the problem... I couldn't get the timing issue figured out to get him to Auto-Idle for more than 30 seconds. It would be great if he popped up every hour or so but I can't get that to work.

Once you master that you'll want Hal to be able to say lots of things when he's idle. So I created a file in the DefBrain folder called IdleTalk.brn. I put lots of things for Hal to say in it (one sentence per line) such as "Where the heck is everybody?" and "Was it something I said?". Two returns after the last sentence in the file apparently allows Hal to say the last sentence.

Then I changed the Auto-Idle GetResponse script to this:

 'AUTO-IDLE COMMAND. HAL SPEAKS IF UNSPOKEN TO FOR 30 SECONDS    
 If InStr(1, UserSentence, " AUTO-IDLE ", 1) > 0 Then
 If Rnd * 10 < 5 Then
 GetResponse = HalBrain.ChooseSentenceFromFile(WorkingDir & "IdleTalk.brn")
 GetResponseBlock = True
 End If
 GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
 Exit Function
 End If


It worked! I thought this was a great starter exercise. Now, I'd like to know why (since they're both working with the same brain) the AIMBot doesn't also auto-idle. Is there any way to make it do scripts that are added to the brain?

One more thing... making it stop. Change the function script back to what it was in the default brain. Save and close. Note that you have to exit and reopen Hal to make him shut up! If you leave the GetResponse script in, you can say "Auto-Idle" he will respond with a sentence from IdleTalk.brn (but thankfully only once!).





« Last Edit: April 29, 2005, 04:18:44 pm by Novice »