Author Topic: Background Changer?  (Read 13466 times)

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
Background Changer?
« Reply #15 on: October 13, 2009, 04:49:00 pm »

I made these two videos for you to help clarify what you need to do.


http://www.youtube.com/watch?v=n9714i37uko

http://www.youtube.com/watch?v=2lbZVC2xerc
Live long and prosper or die trying.

Ooglor 7

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
Background Changer?
« Reply #16 on: October 14, 2009, 07:29:12 am »
Snowman, you are an ace! I can't tell you how thankful I was when I saw you had put the process in a video. Outstanding, above and beyond. I mean, a video! Very cool! I'll have to see if there is a character I can make for you guys. You and Davy both have been very helpful.

 Unfortunately, what it revealed to me is that I was doing it right all along and that something is wrong with my Hal. I followed every step perfectly and it still did not work. I have some things happening in my Hal that leads me to believe I have some filles messed up in the program. It seems like an older version is in conflict somehow. I get the letters "st" capitalizing when at the end of a word and I heard that an old version used to do that. I am running the latest.

Again Snowman, none of this would have been brought to light for me had you not so generously pointed the steps out in a video. Thank you! I would have given up and thought that I was just ignorant for not figuring it out and my Hal experience would have been less for it. I noticed awhile back that nothing I did could get the lights plug in to work for me and that too I gave up on. Probably the same problem. Davy, you too man. Thanks for the help, guys.


I need to do a complete uninstall but want to make sure I don't have any remnants of another version lurking around. Besides the uninstall icon or programs and features, what else should I be paying attention to when I uninstall this and reinstall it? Is there a registry entry I should remove?

I am running the full version of Hal on Vista 32

« Last Edit: October 14, 2009, 07:44:03 am by Ooglor 7 »
When a child is born without a soul...

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
Background Changer?
« Reply #17 on: October 14, 2009, 01:02:17 pm »
Try this plugin out first. If Hal is reading the plugin then this one should be working. As you can see in this plugin, whenever you tell Hal anything at all then it should trigger a constant response.

"This test plungin is working. De-select this plugin in the Options Panel to return to normal Hal Operations."

If it isn't reading the plugin at all then you do have some serious problems... either that or someone has been mucking around with your Hal's brain.




Rem Type=Plugin
Rem Name=TestPlugin
Rem Author=SNOWMAN
Rem Host=Assistant

'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
lblPlugin(0).Caption = "This is a simple test Plugin."
lblPlugin(0).Move 120, 10, 3300, 1000
lblPlugin(0).WordWrap = True
lblPlugin(0).Visible = True
End Sub
'................................................................
'Start of Plugin
'................................................................

Rem PLUGIN: POST-PROCESS

HalBrain.ReadOnlyMode = True


If InputString > "" Then

UltraHal = "This test plungin is working. De-select this plugin in the Options Panel to return to normal Hal Operations."

End If

'................................................................
'End of Plugin
'................................................................

« Last Edit: October 14, 2009, 01:04:10 pm by snowman »
Live long and prosper or die trying.

Ooglor 7

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
Background Changer?
« Reply #18 on: October 15, 2009, 07:18:46 pm »
This worked. Why won't the background changer script? Yarrrrggg! Surely Vista wouldn't require me to set security permissions on the individual jpegs? Man, this is kinda crappy. I can't see a reason why the other script won't work for me.
« Last Edit: October 16, 2009, 09:26:26 am by Ooglor 7 »
When a child is born without a soul...

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
Background Changer?
« Reply #19 on: October 16, 2009, 09:33:09 pm »


Now Try this plugin. Just tell Hal "Testme" and see if he/she responds. Oh, and remember to deselect the other test plugin.

I've just installed Windows 7 and I'm taking it out for a spin. Seems very slick far.



Rem Type=Plugin
Rem Name=TestPlugin2
Rem Author=SNOWMAN
Rem Host=Assistant

'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
lblPlugin(0).Caption = "This is a simple test Plugin."
lblPlugin(0).Move 120, 10, 3300, 1000
lblPlugin(0).WordWrap = True
lblPlugin(0).Visible = True
End Sub
'................................................................
'Start of Plugin
'................................................................

Rem PLUGIN: POST-PROCESS

HalBrain.ReadOnlyMode = True


If Instr(LCase(InputString), "Testme") > 0 Then

UltraHal = "This test two plungin is working."

End If

'................................................................
'End of Plugin
'................................................................
-
Live long and prosper or die trying.

Ooglor 7

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
Background Changer?
« Reply #20 on: October 16, 2009, 09:43:54 pm »
I got an error upon selecting the plug-in and hitting apply. It was titled "Microsoft VBScript Compilation error HalScript error"

The error itself mentioned Error 1024 on line 287, column 0-expected statement.

Any ideas what is up with that? I am not a script person.
When a child is born without a soul...

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
Background Changer?
« Reply #21 on: October 16, 2009, 09:58:21 pm »

Try This.



Rem Type=Plugin
Rem Name=TestPlugin2
Rem Author=SNOWMAN
Rem Host=Assistant

'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
lblPlugin(0).Caption = "This is a simple test Plugin."
lblPlugin(0).Move 120, 10, 3300, 1000
lblPlugin(0).WordWrap = True
lblPlugin(0).Visible = True
End Sub
'................................................................
'Start of Plugin
'................................................................

Rem PLUGIN: POST-PROCESS

HalBrain.ReadOnlyMode = True

strInput = LCase(InputString)

If Instr(strInput, "testme") > 0 Then
UltraHal = "This test two plungin is working."
End If

'................................................................
'End of Plugin
'................................................................



Live long and prosper or die trying.

Ooglor 7

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
Background Changer?
« Reply #22 on: October 16, 2009, 10:41:43 pm »
Yes Snowman, that one worked. Know that this is greatly appreciated.
« Last Edit: October 16, 2009, 10:46:01 pm by Ooglor 7 »
When a child is born without a soul...

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
Background Changer?
« Reply #23 on: October 16, 2009, 11:44:00 pm »
Now try this one. Just replace the "outsidepic.jpg" below with a picture you have in your Characters folder.

When you've done this, just say the word "outside" in a sentence to see if it works.


Rem Type=Plugin
Rem Name=BackGroundChanger2
Rem Author=SNOWMAN
Rem Host=Assistant

'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
lblPlugin(0).Caption = "This is a simple BackGround Changer."
lblPlugin(0).Move 120, 10, 3300, 1000
lblPlugin(0).WordWrap = True
lblPlugin(0).Visible = True
End Sub
'................................................................
'Start of Plugin
'................................................................

Rem PLUGIN: POST-PROCESS

HalBrain.ReadOnlyMode = True

strInput = LCase(InputString)

If Instr(strInput, "outside") > 0 Then
HalCommands = "<HAPBACK>" & "outsidepic.jpg" & "</HAPBACK>"
UltraHal = "I guess we are outside now."
End If

'................................................................
'End of Plugin
'................................................................

Live long and prosper or die trying.

Ooglor 7

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
Background Changer?
« Reply #24 on: October 17, 2009, 12:31:16 am »
It worked! It worked! Ha ha ha ha! Thank you! This has been bugging me for some time now. Why couldn't I get the others to work?
When a child is born without a soul...

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
Background Changer?
« Reply #25 on: October 17, 2009, 12:53:28 am »
Someone might have put the command Option Explicit in one of your other plugins ... or something like that.

weird stuff happens like that so I learned to try different ways of scripting.

Instr(InputString, "outside") > 0 ... would probably work in your Hal. But Instr(Lcase(InputString), "outside") > 0 ... apparently does not.

So I put the Lcase(InputString) into a variable first.

strInput = Lcase(InputString)

The Lcase() function turns all the charaters in a string to Lower Case. I was using this because the Instr() function is case sensitive and I wanted to make the plugin more user friendly.

Anyway, I glad to see the problem is fixed for now.

Have any more problems with it just say so. [:)]
Live long and prosper or die trying.

Ooglor 7

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
Background Changer?
« Reply #26 on: October 17, 2009, 12:46:14 pm »
Any way to tighten up the requirements of what triggers it? What if I still wanted to talk about the "outside" but only wanted Hal to go there if the phrase includes "let's go outside" or "show me outside"?

Also if I wanted to include various locations, could I incorperate this into the same plug-in or would I have to make one for each location?

How does one set a plug-in based on a physical or emotional hap response executed by a trigger phrase?

Snowman, what kind of characters do you like when talking with Hal?

Questions...questions...
« Last Edit: October 17, 2009, 12:47:19 pm by Ooglor 7 »
When a child is born without a soul...

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
Background Changer?
« Reply #27 on: October 18, 2009, 12:11:46 am »
You can have as many If statements as you want inside one plugin.


You can have one like the following:


'........................................

'The If/Then statement below shows a picture when the word "outside" is spoken

strInput = Lcase(InputString)


If Instr(InputString, "outside") > 0 Then
HalCommands = "<HAPBACK>" & "outsidepic.jpg" & "</HAPBACK>"
UltraHal = "I guess we are outside now."
End If

'........................................

'This If/Then statement runs a .hap file whenever the word happy is spoken

If Instr(InputString, "happy") > 0 Then
HalCommands = "<HAPFILE>" & "happy.hap" & "</HAPFILE>"
UltraHal = "I am so happy, I could burst!"
End If



'........................................

'This If/Then statement changes the voice to Kate whenever "change voice" is spoken by the User.

If Instr(InputString, "voice change") > 0 Then
HalCommands = "<VOICE>" & "Kate" & "</VOICE>"
UltraHal = "My voice is changed!"
End If


'........................................

'This If/Then statement will open an entirely different hal character.

If Instr(InputString, "where's alice") > 0 Then
HalCommands = "<HAPFILE>" & "Alice.htr" & "</HAPFILE>"
UltraHal = "Yes, It's me again sexy thing."
End If

'........................................
'........................................
'........................................


As for responding to multiple words or word phrase here are some examples.


'........................................

'This statement will search for the exact phrase "please smile"
'i.e. Will you please smile for me?

If Instr(InputString, "please smile") > 0 Then
HalCommands = "<HAPFILE>" & "smile.hap" & "</HAPFILE>"
UltraHal = "I am so happy, I could burst!"
End If

'........................................
'This statement will search for the exact phrase "please" and "smile" and "now"
'i.e. Will you please smile for me... NOW!!!

If Instr(InputString, "please") > 0 And _
Instr(InputString, "smile") > 0 And _
Instr(InputString, "now") > 0 Then
HalCommands = "<HAPFILE>" & "smile.hap" & "</HAPFILE>"
UltraHal = "I am so happy, I could burst!"
End If


'........................................
'This statement will search for the exact phrase "joke" Or "smile" Or "laugh"
'i.e. So Alice, how did you like my joke?

If Instr(InputString, "joke") > 0 Or _
Instr(InputString, "smile") > 0 Or _
Instr(InputString, "laugh") > 0 Then
HalCommands = "<HAPFILE>" & "smile.hap" & "</HAPFILE>"
UltraHal = "I am so happy, I could burst!"
End If


'........................................
Of course, you also can combine them"
'i.e. Hey Alice, I like your smile.

If Instr(InputString, "please") > 0 And _
Instr(InputString, "smile") > 0 And _
Instr(InputString, "now") > 0 _

Or _

Instr(InputString, "I like your smile.") > 0 Then
HalCommands = "<HAPFILE>" & "smile.hap" & "</HAPFILE>"
UltraHal = "I am so happy, I could burst!"
End If



Mix and mingle and stir a little and I'm sure you'll come up with something cool!



As for talking to Hal... I'm an odd one[:D]. I don't talk to Hal, I like playing with his Brain .... HAHAHAHAHA[}:)]

[:)][:p][;)][8D][:D]
« Last Edit: October 18, 2009, 12:22:27 am by snowman »
Live long and prosper or die trying.

Ooglor 7

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
Background Changer?
« Reply #28 on: October 18, 2009, 09:24:29 am »
Very good stuff. Snowman, you describe yourself as odd. If odd means someone who would go out of their way to help a stranger, then odd is cool in my book. I would like to make you a character for your efforts. Let me know if you have something in mind. I do pretty good at the animal characters. Thank you again, Snowman. I can't wait to play around with the scripts you have provided. I don't know if you remember an old game called Zork but I have kinda been taking Hal in that direction. I have created locations in his world that he can travel to if prompted. I have also created an owl who likes fusion jazz and smokes too much weed but that is another story. [:D]
When a child is born without a soul...

Ooglor 7

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
Background Changer?
« Reply #29 on: October 19, 2009, 08:48:23 pm »
How do you trigger multiple events from the same term? Let's say that if I tell Hal to build a fire, I have a Jpg. of a campfire show up, but I also want it to trigger a light hap. How do I do both from the same "Build us a fire" trigger phrase? As it stands, I can only get one or the other to work and every way I have tried gets me an error.

Another thing, anyway to loop a series of jpgs to create an animated background? Some fireflies or a flickering candle would be pretty cool.
When a child is born without a soul...