dupa

Author Topic: grabbing hals output  (Read 3868 times)

peace

  • Newbie
  • *
  • Posts: 42
    • View Profile
grabbing hals output
« on: February 01, 2016, 12:29:33 am »
i am trying to get an additional messagebox to pop up as hal responds
i actually want to pipe hals output to another program the only piece im missing is how to get hals output into a message box i had a rough start that worked a few times with no errors but it only worked once and when i restarted hal it no longer worked.... can you guys help? heres a plugi that outputs a message box but only at the time you check the plugin box thats as far as i can get without seeing the source code

Rem Type=Plugin
Rem Name=grab hals output
Rem Author= Peace
Rem Host=Assistant

'-----------------------------------------------------------------
'This sub sets up the plug-ins option panel in Hal's options dialog
'-----------------------------------------------------------------

Sub OptionsPanel()
lblPlugin(0).Caption = "This plugin will output hals responce to a messagebox"
lblPlugin(0).Move 120, 120, 3300, 1200
lblPlugin(0).WordWrap = True
lblPlugin(0).Visible = True
End Sub


If UltraHal  = "" Then
MsgBox ("123")
Exit Function
End If



once i can get this far i can use hals output for different voices

peace

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: grabbing hals output
« Reply #1 on: February 01, 2016, 12:36:02 am »
sorry i forgot to remove Exit Function it should look like this

Rem Type=Plugin
Rem Name= are you sure
Rem Author= Peace
Rem Host=Assistant

'-----------------------------------------------------------------
'This sub sets up the plug-ins option panel in Hal's options dialog
'-----------------------------------------------------------------

Sub OptionsPanel()
lblPlugin(0).Caption = "This plugin will output hals responce to a messagebox"
lblPlugin(0).Move 120, 120, 3300, 1200
lblPlugin(0).WordWrap = True
lblPlugin(0).Visible = True
End Sub


If UltraHal  = "" Then
MsgBox ("123")
End If


this outputs 123 in a message box at the instant you check it on the plugin selection in general options

peace

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: grabbing hals output
« Reply #2 on: February 01, 2016, 08:37:40 pm »
mission accomplished sort of
its not including user name and other variables but i inserted in default brain the following

    'PROCESS: REVERSE CERTAIN CONTRACTIONS AND OTHER SUBSTITUTIONS
    'Standardizing on contractions can make Hal sound conversational.
    'However, certain sentence constructions don't work well
    'if expressed as contractions.  For example:
    '"I don't know where it is" becomes "I don't know where it's."
    'For another example, "That's how he is" becomes "That's how he's."
    'To solve these types of cases
    'we attempt to modify certain contractions, words, and phrases
    'at the end of this function, now that Hal's thinking is done.
    GetResponse = HalBrain.HalFormat(GetResponse)
    GetResponse = HalBrain.ProcessSubstitutions(GetResponse, "corrections")
    MsgBox (GetResponse)
    'PROCESS: CALL USER BY CORRECT NAME
    'If the user has chosen a nickname or temporary name, call user by that
    'otherwise call the user by the username chosen by the host application
   
my line # 2144  MsgBox (GetResponse)  sends hals responce to a messagebox this could be ported to another program for example

                R2D2 Translator

         (c) Copyright 2008 Roger Meier
              All rights reserved
             
              roger.meier@pobox.com
         http://freeware.the-meiers.org

peace

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: grabbing hals output
« Reply #3 on: February 02, 2016, 12:01:41 am »
how would i get this to work as a plugin ?


  MsgBox (GetResponse)

how do i write the plugin so the command goes to the right part of the brain?

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3848
    • View Profile
Re: grabbing hals output
« Reply #4 on: February 02, 2016, 06:46:52 am »
You should find the answer to your question here and a whole lot more.

http://ultrahalscript.pbworks.com/w/page/11906966/FrontPage
In the world of AI it's the thought that counts!

- Art -

Calhoone

  • Sr. Member
  • ****
  • Posts: 289
    • View Profile
Re: grabbing hals output
« Reply #5 on: February 02, 2016, 11:59:38 pm »
I'd be very interested to see this in action if you get it to work. I have been trying to get something similar going myself.
 

peace

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: grabbing hals output
« Reply #6 on: February 03, 2016, 12:06:43 am »
http://s000.tinyupload.com/?file_id=66063270134403624027


this is a plugin as well as a .vbs and a .exe to make hals responce sound like r2d2 beeps
its a bit buggy but its just for fun
thanks for the help figuring this one out
was fun