Author Topic: Beaupa's learning thread  (Read 3794 times)

0 Members and 1 Guest are viewing this topic.

Beaupa

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 0
    • View Profile
Beaupa's learning thread
« on: February 13, 2014, 10:54:06 AM »
hey guys, I hope its ok with the admin to have a single thread with all my questions as I learn. If not you can just delete and I will post a thread for each.

Can someone look at
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="False" name="3_music on" enabled="False" prefix="" priority="0" requiredProcess="" description="">
  <command id="940" name="confirm.foobar" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>VC.DisableGroup*</cmdType>
      <cmdString>1</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>Hard drive music sir?</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <cmdString>Hard drive music sir?</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>confirm.foobar</event>
  </command>
  <command id="973" name="confirm.youtube" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>Launching youtube playlist sir.</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <cmdString>Launching youtube playlist sir.</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>confirm.youtube</event>
  </command>
  <command id="941" name="foobar" enabled="true" alwaysOn="False" confirm="True" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>Starting your hard drive playlist,... enjoy</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>Starting your hard drive playlist,... enjoy</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Launch</cmdType>
      <cmdString>C:\Users\mike\Desktop\mikesmusic\mikesmusic.fpl</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Window.Focus</cmdType>
      <cmdString>foobar2000</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>music</phrase>
  </command>
  <command id="951" name="youtube*" enabled="true" alwaysOn="False" confirm="True" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>Youtube then sir?</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <cmdString>Youtube then sir?</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Confirm.Cancel.foobar</event>
  </command>
</commandGroup>


and explain why the initial event [confirm.foobar] triggers an event, but the event [youtube] does not? Is it because VC only creates confirmation events for actions, and not events? If you trigger the script using "music" you will see what I mean.

btw, I know that I can fix most of these questions by taking a different (simpler) approach, but I want to learn the program in and out so I can eventually do advanced stuff.

thanks guys
-mike
« Last Edit: February 13, 2014, 12:47:32 PM by jitterjames »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Beaupa's learning thread
« Reply #1 on: February 13, 2014, 11:31:55 AM »
explain why the initial event [confirm.foobar] triggers an event, but the event [youtube] does not? Is it because VC only creates confirmation events for actions, and not events? If you trigger the script using "music" you will see what I mean.

If something is generating a "confirm.foobar" event, it is not happening based on anything in this command group. Nothiing in this group will generate either the confirm.foobar event OR the confirm.youtube event.

In this command group, I see that you have a command called "confirm.foobar". It is waiting for something (what?) to generate an event called "confirm.foobar". If that event occurs, it will in turn trigger the "confirm.foobar" command, which is a command that disables any command group that contains the substring "1" and also asks you if you would like to listen to music from your hard drive playlist.

Do you have a command in a different command group that is supposed to trigger the "confirm.foobar" event?

« Last Edit: February 13, 2014, 11:51:10 AM by nime5ter »
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)

Beaupa

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 0
    • View Profile
Re: Beaupa's learning thread
« Reply #2 on: February 13, 2014, 12:02:53 PM »
Thanks for the reply nime5ter :)

Quote
If something is triggering a "confirm.foobar" event, it is not happening based on anything in this command group. Nothiing in this group will trigger either the confirm.foobar event OR the confirm.youtube event.

OK, im not a pro, but lets follow this

[trigger] music>[event](confirm prompt)>yes=confirm.foobar>launches foobar

[trigger] music>[event](confirm prompt)>no>=confirm.cancel.foobar>[event]youtube(prompt)>yes=confirm.youtube

this is where my problem is... even though the event youtube is checked as confirm, confirm.youtube [event] does not show (populate, trigger, however you say it)

you made another reply and im too slow... lol lemme read that one

-mike

Beaupa

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 0
    • View Profile
Re: Beaupa's learning thread
« Reply #3 on: February 13, 2014, 12:09:06 PM »
OK, lemme pick your brain and you could tell me how you would write this:

say: music
VC prompt: hard drive music?
(say yes) = launch program
(say no) = VC prompt: how about youtube?

(say yes) = launch url
(say no) = VC tts OK then I wont


-mike

PS: olympic canadian mens hockey is on soon, so I will be disappearing and having afew drinks so I may not reply right away :)
« Last Edit: February 13, 2014, 12:12:32 PM by Beaupa »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Beaupa's learning thread
« Reply #4 on: February 13, 2014, 12:33:46 PM »
Totally my bad. For some weird reason it looked like only your one "music" command had the command confirmation box checked. I have no idea why. I blame my migraine.  :bonk :bonk

So ... getting back to your first question: VC doesn't require confirmation if you are using an event to trigger it.

http://voxcommando.com/forum/index.php?topic=772.msg6094#msg6094

So it also won't generate the event that you're trying to use to trigger the other command.

Again, sorry for the confusion!

But maybe all that will help someone else.  :biglaugh
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)

Beaupa

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 0
    • View Profile
Re: Beaupa's learning thread
« Reply #5 on: February 13, 2014, 12:47:01 PM »
Totally my bad. For some weird reason it looked like only your one "music" command had the command confirmation box checked. I have no idea why. I blame my migraine.  :bonk :bonk

So ... getting back to your first question: VC doesn't require confirmation if you are using an event to trigger it.

http://voxcommando.com/forum/index.php?topic=772.msg6094#msg6094

So it also won't generate the event that you're trying to use to trigger the other command.

Again, sorry for the confusion!

But maybe all that will help someone else.  :biglaugh

lol, no worries

...and yeah I figured yesturday that I could use the vc.tellvox command. I was just confirming exactly what was in that post, and again I missed searching for it.

thanks again
-mike

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Beaupa's learning thread
« Reply #6 on: February 13, 2014, 02:48:57 PM »
Right. This is a scenario where VC.TellVox would serve your wishes best. Along the lines of:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="3_music on" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="940" name="foobar" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>VC.DisableGroup*</cmdType>
      <cmdString>1</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>Hard drive music, sir?&amp;&amp;1000</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>Hard drive music, sir?</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.TellVox</cmdType>
      <cmdString>play music from my hard drive</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>music</phrase>
    <phrase optional="true">maestro</phrase>
  </command>
  <command id="973" name="confirm.youtube" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>Launching youtube playlist sir.</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <cmdString>Launching youtube playlist sir.</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Launch.OpenURL</cmdType>
      <cmdString>www.youtube.com\[yourplaylist]</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase optional="true">Yes</phrase>
    <phrase>That would be great, Launch my youtube playlist</phrase>
  </command>
  <command id="941" name="foobar" enabled="true" alwaysOn="False" confirm="True" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>Starting your hard drive playlist,... enjoy</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <cmdString>Starting your hard drive playlist,... enjoy</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Launch</cmdType>
      <cmdString>C:\Users\mike\Desktop\mikesmusic\mikesmusic.fpl</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Window.Focus</cmdType>
      <cmdString>foobar2000</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>play music from my hard drive</phrase>
  </command>
  <command id="951" name="youtube request" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>Youtube then sir?</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <cmdString>Youtube then sir?</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Confirm.Cancel.foobar</event>
  </command>
</commandGroup>

This way, you can use the same commands to play music or start your youtube playlist (or whatever) either by simply asking it to do that, or in the context of the script you posted above. (Assuming there will be occasions when you don't actually want to have a big long fake conversation with your computer, you just want it to do what you say. ;))
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)

Beaupa

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 0
    • View Profile
Re: Beaupa's learning thread
« Reply #7 on: February 13, 2014, 07:00:37 PM »
hmmm, well i did some more work and cleaned up the code a little

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="False" name="3_music on" enabled="False" prefix="" priority="0" requiredProcess="" description="">
  <command id="974" name="music?" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>Hard drive music sir?</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.TellVox</cmdType>
      <cmdString>?what type of music</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>music</phrase>
  </command>
  <command id="975" name="Hard Drive Music" enabled="true" alwaysOn="False" confirm="True" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>Playing your hard drive music sir, enjoy</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.TriggerEvent</cmdType>
      <cmdString>launch foobar</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>?what type of music</phrase>
  </command>
  <command id="977" name="Launch Foobar" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Launch</cmdType>
      <cmdString>C:\Program Files\foobar2000\foobar2000.exe</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>launch foobar</event>
  </command>
  <command id="978" name="youtube?" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>Youtube then sir?</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.TellVox</cmdType>
      <cmdString>?launch youtube</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Confirm.Cancel.Hard Drive Music</event>
  </command>
  <command id="979" name="launching youtube" enabled="true" alwaysOn="False" confirm="True" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>launching youtube</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.TriggerEvent</cmdType>
      <cmdString>youtube playlist</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>?launch youtube</phrase>
  </command>
  <command id="980" name="youtube playlist" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Launch.OpenURL</cmdType>
      <cmdString>http://www.youtube.com/?gl=CA</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>youtube playlist</event>
  </command>
</commandGroup>


I have a very strange problem. Everything works except the action of launching youtube,... AND if I run the command in the command builder with confirmation it works!!? I dunno if this is a bug or if I am doing something wrong.

Thats it for tonight

-mike
« Last Edit: February 13, 2014, 07:16:30 PM by jitterjames »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Beaupa's learning thread
« Reply #8 on: February 13, 2014, 10:28:08 PM »
Yes. This is because you're chaining confirmations, which is not advisable: http://voxcommando.com/forum/index.php?topic=1253.msg10903#msg10903

You'll need to use threading if you really feel strongly about using multiple confirmations rather than the other methods discussed.

To do so, replace your current youtube playlist command with the following:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="980" name="++youtube playlist" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Launch.OpenURL</cmdType>
    <cmdString>http://www.youtube.com/?gl=CA</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <event>youtube playlist</event>
</command>

A command that has "++" at the beginning of its name will run in its own thread. This is a solution that you should use sparingly.
« Last Edit: January 12, 2016, 02:53:17 PM by nime5ter »
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)

Beaupa

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 0
    • View Profile
Re: Beaupa's learning thread
« Reply #9 on: February 17, 2014, 09:42:49 AM »
Hey nime5ter,

That code never even showed in the command builder for me, BUT, I have actually chosen a much safer way to get a semi-dialogue friendly code by using tts to announce the choices during the question, then using an event trigger for each.  ;D

I know that VC was never designed for dialogue, but as it grows I will hope that the dev considers branching in this direction because I see many users using VC for this purpose. A good start would be to allow (fix or whatever) confirmation to events and trigger other events as a result.

I am also chosen to post of my problems in a separate thread because I cant cleanup this one. No worries tho

-mike