Author Topic: New Here  (Read 21723 times)

0 Members and 1 Guest are viewing this topic.

danderson

  • Jr. Member
  • **
  • Posts: 38
  • Karma: 0
    • View Profile
Re: New Here
« Reply #15 on: August 04, 2014, 12:44:17 AM »
Now I just need to learn how to make this scrape function work for xbmc
dan
I also want to learn about the agent show\hide settings.Haven't found that yet

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2318
  • Karma: 47
    • View Profile
Re: New Here
« Reply #16 on: August 04, 2014, 04:12:46 AM »
Hi Dan and welcome to the VC Forum.
Ok, I will here explain step by step how it works and hope in this way some user learn a bit about using a Maptable, trigger events ...  ;)
To write here a desciption take me some hours, because english is not my native language and also I will get safe that each step will work for all users.

I use Denise as TTS output instead or also with the TTS.Speak action from VC, with the advantage that "Denise" can run on the same or any other machine as VC. So in this way you can have, for example, in each room a pc with a installed Guile3D bot like Denise, Spock or each other bot character with different voices. In theory you can say "Computer, I'm in the living room" and only the bot in the living room will talk to you.
To do this, we need a special Command Group in which this functions all managed, because there are more than one action to do this.

It is important to know, that we must have the data which should be "Denise" say in VC {LastResult} stored or stored on a place from which "Denise" can pick up the data (eg. in a txt file).
This can be done in different ways, but I will descibe here only the {LastResult} way.

1. Go safe, that you have connected the bot within the command group some posts above http://voxcommando.com/forum/index.php?topic=1650.msg14407#msg14407 if the bot speak aloud with lip sync: "Yes I can ..." the first step is done and now you have allready access to the bot. If not, please open the VC command editor, select the connect command by a double click and check that the IP-address, username and password are correct written and don't forget that the guile3D software must already run before you connect to the bot. Any error will highlighted orange in the VC history window and when you move the mouse over you can read what is wrong.

What the "connect" command do:

The connect command is triggered by the VC.Loaded event which will fired when VoxCommando start. The whole command create a Maptable in VC (by overwriting a existed key) and store the "AuthKey" automatically in this Maptable. This is necessary, because when you close the Guile3D software, it will create a new AuthKey each time and with this way everything is automated and you must do nothing by hand  ;)
The last action in the connect command will set the voice of the bot, which mean it overwrite the voice which is set in the bot software. Get safe that this TTS voice exist on your system, otherwise change the name to a name who exist or you can delete/disable this action if you use always the same voice.

--------------------------------------------------------------------------------------------------------------------------------------------------------------

From now on we can abbreviate everything if you want to know only how you get "TTS feedback" from XBMC or other stuff (like what song is this) to your bot without going to much in detail, then you need only to replace one action in your existing commands. Replace the TTS.Speak or TTS.SpeakSync with one scrape action. To make it easy copy the following command in a existing command group and open the command in the VC Editor to see what is going on. The VC.Pause action at the end of the command is required when you use XJson.SoftMute and XJson.SoftUnMute, because VC will execute the unmute action before the text is spoken by your bot. There is also a other trick to let the bot speak first before the unmute is executed without the VC.Pause, maybe I will this explain later if it is a wish.

here the fast way command code:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.0.3-->
<command id="780" name="What song is this with bot speak" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.SoftMute</cmdType>
    <params>
      <param>60</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Player.GetItem</param>
      <param>"playerid":0, "properties": ["title", "album", "artist", "rating","playcount","genre"]</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.ParseTokens</cmdType>
    <params>
      <param>This is {item.title}, by {item.artist[[&amp;]]}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>http://127.0.0.1:8000/Agent?function=AgentSpeak&amp;Auth={M:botpass.botpass}&amp;Text={LastResult}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>{LastResult}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.Pause</cmdType>
    <params>
      <param>2500</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.SoftUnMute</cmdType>
    <params />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>What, Which, wie heist der, welcher</phrase>
  <phrase>song, track</phrase>
  <phrase optional="true">is this, ist dass</phrase>
</command>

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

The second command in this group is called "3D bot speak" and how the name said, it will send the data from{LastResult} to the bot, which speak it aloud.
This command has only one action (at the moment). It is the VC "Scrape" action in which contains the bot function "AgentSpeak" followed by the auto generated "AuthKey" from the Maptable {M:botpass.botpass} and the text which the bot should be speak from the {LastResult}. The command will triggered by the "bot speak" event (the calendar icon with digit 9).

The last command in this group "speak test" will show you in which way you send the {LastResult} to the bot. It contains two actions "Result.SetLastResult" which set all what is typed here in as {LastResult}. This can be text, {Match.x} or any other Data which we will send to speak aloud with the bot.
The second action is "VC.TiggerEvent" with the parameter "bot speak" - this trigger any command which contain the event "bot speak" and in our case it trigger the command "3D bot speak", because the command contain the "bot speak" event in his tree.


As next the bot show/hide function - first, copy the following code in your VC command tree:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.0.3-->
<commandGroup open="True" name="guile3D show/hide" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="1513" name="show bot" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>http://127.0.0.1:8000/Agent?function=AgentShow&amp;Auth={M:botpass.botpass}&amp;STATE=wsMaximized</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>http://127.0.0.1:8000/Agent?function=AgentPosition&amp;Auth={M:botpass.botpass}&amp;left=1920&amp;top=66</param>
      </params>
      <cmdRepeat>0</cmdRepeat>
    </action>
    <phrase>show</phrase>
    <phrase>denise</phrase>
    <event>VC.Prefix.Start</event>
    <event>show 3Dbot</event>
  </command>
  <command id="1477" name="3D bot hide event" enabled="true" alwaysOn="True" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>http://127.0.0.1:8000/Agent?function=AgentSpeak&amp;Auth={M:botpass.botpass}&amp;Text=you welcome!</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.SetEventTimer</cmdType>
      <params>
        <param>2</param>
        <param>hide bot</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase optional="true">please, yes I know, I know, ok</phrase>
    <phrase>ok thanks, ok bye, hide in background, please be quiet, be quiet</phrase>
  </command>
  <command id="1518" name="3D bot hide" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>http://127.0.0.1:8000/Agent?function=AgentShow&amp;Auth={M:botpass.botpass}&amp;STATE=wsMinimized</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>hide bot</event>
  </command>
</commandGroup>

This group contains 3 commands:

The first command in this group is the "show bot" command, which can execute here in 3 different ways.
1. by saying the phrase "show Denise"
2. triggered by the event "VC.Prefix.Start" when you say your prefix in standby mode (only if you have enabled the prefix mode in VC Options). For example: If your prefix is "denise" and you say first "denise" followed by any command, the bot will show up.
3. triggered by the event "show 3Dbot" which can you fired by insert a "VC.TriggerEvent" with parameter show 3Dbot in any command to show the bot

this command contains two "Scrape" actions: the first one maximize the bot and the second (is optional - diabled as default) move the bot to a specified postion on the screen (maybe you have two screens, then this is a good option to place it).

The second command is the "3D bot hide event" fired a event to hide the bot and contains two actions.
1. a "Scrape" action which send the text "you're welcome" directly to the bot.
2. a "VC.SetEventTimer" action, which fire the event "hide bot" after waiting 2 seconds.

When you saying the phrase "ok thanks, ok bye, hide in background, please be quiet, be quiet" (note that there are a optional phrases "please, yes I know, I know, ok" which can you say first, but it is not necessary).
This command has one important feature: If you take a look on it in the VoxCommando command tree ->the command name is showing bold, which means it is always ON - VC recognize and execute this command without a prefix in stanby mode. So if you are in ON or standby mode makes no different, the bot will hide when you say "ok thanks, ok bye ...". How you can change this feature will you find here: http://voxcommando.com/mediawiki/index.php?title=Logical_Command_Builder

The third command from this group is the "3D bot hide" and contain one action.
1. a "Scrape" action which minimize the bot. This command is triggered by the "hide bot" event which is fired from the VC.SetEventTimer" above.


The story will continue later, - need a break  ::zzz

Kalle
« Last Edit: August 04, 2014, 09:52:29 AM by Kalle »
***********  get excited and make things  **********

danderson

  • Jr. Member
  • **
  • Posts: 38
  • Karma: 0
    • View Profile
Re: New Here
« Reply #17 on: August 04, 2014, 10:05:10 PM »
ThankYou sooo much Kalle,I'm getting to work on this now ,I'll let you know if I get it.This is very interesting how this works.I have had Denise now for about 2 years and I never knew she could be accessed this way
Dan

danderson

  • Jr. Member
  • **
  • Posts: 38
  • Karma: 0
    • View Profile
Re: New Here
« Reply #18 on: August 07, 2014, 10:19:11 PM »
 Hi Kalle ,Ok this is great. It took me a while because I wanted to see some of the tutorials and learn a few things.Success......I can now make denise appear and hide,,,,I edited your script a little to give me more options for making her appear ,and the XBMC part works but she would only respond with song titles ,but not albums.So I made a copy of your script then edited the name ,item and phrase ,,,then copied to command tree and it worked.Now she replies with album info.So, I see how to make more commands for this.I am definitely buying this software!    My next struggle is for Denise to respond to "what time is it"
Dan

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2318
  • Karma: 47
    • View Profile
Re: New Here
« Reply #19 on: August 08, 2014, 05:04:37 AM »
Hi Dan, that are great news  :clap

Yes, I've postet only the "what song is this" for XBMC as example, because it is easy to add this for all other XBMC commands which contains speech output  ;)

We have in VC two action parameter to get the time:

1. {ShortTime} will give you the current time back in a short format like this: 1:15 PM (for en-US) or 13:15 (for de-DE)

2. {LongTime} will give you the current time back in a long format like this: 6/15/2009 1:45:30 PM (en-US) or 15/06/2009 13:45:30 (es-ES)

you will find more about variables in our Wiki: http://voxcommando.com/mediawiki/index.php?title=Variables

So if you want the current time in short format spoken by "Denise", you need only this action in your command:


http://127.0.0.1:8000/Agent?function=AgentSpeak&Auth={M:botpass.botpass}&Text=the current time is {ShortTime}

Maybe today I will have a bit time to continue the tutorial above, because I'm sure one of the next question will be - "Why did you trigger bot speak instead of sending the speak action direct to the bot?" The short answer is, the flexibility to change the character, size, position, speech language and much more.
***********  get excited and make things  **********

danderson

  • Jr. Member
  • **
  • Posts: 38
  • Karma: 0
    • View Profile
Re: New Here
« Reply #20 on: August 09, 2014, 02:36:52 PM »
Ok I got it.I was able to copy a command and edit it ,to make it work.   I made a little video to show what I have so far.Of course I will have to edit some of my phrases.The next thing I'm curious about is how you got the weather and how to configure for my area......
&feature=youtu.be
dan

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2318
  • Karma: 47
    • View Profile
Re: New Here
« Reply #21 on: August 09, 2014, 03:33:15 PM »
Hi Dan, I've started to write a tutorial with the most functions for the bot - if you take a look on site two in this tutorial (it has only two at the moment  :D  ) you can read that the bot can speak all data which is stored by VC in a variable like {LastResult}, {ShortTime} ...
So you need only to activate the VC weather plugin http://voxcommando.com/mediawiki/index.php?title=Plugin_WUnder
and then the weather data will be  stored in the {LastResult}, the rest is written in my tutorial  ;)



The tutorial is finished and can be downloaded from this post: http://voxcommando.com/forum/index.php?topic=1650.msg14800#msg14800
« Last Edit: August 11, 2014, 03:45:36 AM by Kalle »
***********  get excited and make things  **********

Dominique

  • Jr. Member
  • **
  • Posts: 41
  • Karma: -1
    • View Profile
Re: New Here
« Reply #22 on: August 09, 2014, 07:44:42 PM »
Hi Dan, I've started to write a tutorial with the most functions for the bot - if you take a look on site two in this tutorial (it has only two at the moment  :D  ) you can read that the bot can speak all data which is stored by VC in a variable like {LastResult}, {ShortTime} ...
So you need only to activate the VC weather plugin http://voxcommando.com/mediawiki/index.php?title=Plugin_WUnder
and then the weather data will be  stored in the {LastResult}, the rest is written in my tutorial  ;)

Wow Kalle that looks great and should be of great help.  I will be joining you two shortly in getting Denise to be as cool as yours and also Dans.  I've just been a little busy.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2318
  • Karma: 47
    • View Profile
Re: New Here
« Reply #23 on: August 11, 2014, 03:43:33 AM »
Ok guys, today I've finished the tutorial to use the Guile3D API functions in VoxCommando and I hope the API functions are all clear enough described  ;)

Let me know how it looks for you and also if I have anything forgotten to explain.

Have fun
Kalle

The tutorial is updated and contain now the correct function to chat with the bot.
« Last Edit: September 03, 2014, 07:15:12 AM by Kalle »
***********  get excited and make things  **********

danderson

  • Jr. Member
  • **
  • Posts: 38
  • Karma: 0
    • View Profile
Re: New Here
« Reply #24 on: August 11, 2014, 08:21:18 AM »
Thank you so much Kalle, I was able to get the weather plugin to work. And this PDF file that you have provided has most of the answers I was looking for.I was especially interested in the speak in chat function.This is like having the best of both worlds.I'm going to work on this tonight ,,Again Thank you ,I never would have figured this out on my own.
Dan

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2318
  • Karma: 47
    • View Profile
Re: New Here
« Reply #25 on: August 11, 2014, 08:36:52 AM »
Thanks Dan you are welcome.
It would be nice if you share your results with us  ;)

Kalle
***********  get excited and make things  **********

danderson

  • Jr. Member
  • **
  • Posts: 38
  • Karma: 0
    • View Profile
Re: New Here
« Reply #26 on: August 14, 2014, 08:27:39 PM »
Hi, I will post my results just as soon as I learn enough to finish my project.I have been going through the tutorials and reading the forum for information. Learning about payloads now. Of all I have seen so far ,I have yet to come across anything that shows me how to open a program , in my program files. I can open a file and launch a URL ( but in default browser only), set volume , but launch application has eluded me. Can someone offer a link to show how to do this. This has to be a dumb question,so this Topic should be appropriate,(new here).
Dan

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: New Here
« Reply #27 on: August 14, 2014, 09:18:57 PM »
Launch or Launch.RawParam.
http://voxcommando.com/mediawiki/index.php?title=Actions#Launch

I think it's discussed in Fireside Chat 1 (the videos for new users). Not sure if it's in any other tutorial vids.

If you want to browse directories to find the correct file path for the program you want to open, you can do so within the parameter helper:
http://voxcommando.com/mediawiki/index.php?title=Parameter_Helper

If you've installed a default configuration such as the XBMC configuration, just search your command tree for "Launch" to find an example. The XBMC config comes with a "launch XBMC" command.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

danderson

  • Jr. Member
  • **
  • Posts: 38
  • Karma: 0
    • View Profile
Re: New Here
« Reply #28 on: August 14, 2014, 10:09:36 PM »
Thank you very much ,that is exactly what I was looking for,,you just saved me hours ,,,again thanks....
Dan

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: New Here
« Reply #29 on: August 31, 2014, 10:35:17 AM »
@Dan - your follow-up question on a different topic was moved over to the "XBMC (aka Kodi) Frodo / Gotham" board.

See: "Video add-on question" --> http://voxcommando.com/forum/index.php?topic=1725.0
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)