Author Topic: Second Counter - A little stuck on getting finishing touch  (Read 7286 times)

0 Members and 1 Guest are viewing this topic.

RickyD333

  • Contributor
  • ***
  • Posts: 71
  • Karma: 2
    • View Profile
I'm making a second counter for some workout routines. The concept is to say, "set clock for xx seconds." Then Vox says, "setting clock for xx seconds." Now I have it working at that point. So if I set the clock for 30 seconds, at the end of that time Vox will say, "30 seconds are up." However, I'm stuck on figuring out how to make it wait for me to say "begin" to then start the timer. I suppose I could have it require confirmation and have one of my confirmation phrases be "begin," but I have the confirmation set to expire after a certain amount of time elapses -- I think I have it set to 20 seconds. I would like to be able to wait longer than that set time to begin the timer.

I'm having one other small problem with the timer too (it's probably really simple). If I set the timer for 30 seconds, Vox should say at the end of that time, "30 seconds are up." But I can't seem to get it to say the number of seconds. It's just saying the payload number, "1".

Here's what I have so far:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.4.2-->
<commandGroup open="True" name="Second counter" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="409" name="Timer" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>VC.SetEventTimer</cmdType>
      <params>
        <param>0h 0m {1}s</param>
        <param>Timer</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Clock set for {1} seconds</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>set clock for</phrase>
    <payloadRange>1,60</payloadRange>
    <phrase>second, seconds</phrase>
  </command>
  <command id="425" name="Say When time is up" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>{1} seconds are up</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Timer</event>
  </command>
</commandGroup>
« Last Edit: May 07, 2015, 01:45:27 PM by RickyD333 »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Second Counter - A little stuck on getting finishing touch
« Reply #1 on: May 07, 2015, 02:03:39 PM »
Try three commands and set a variable for your timer. Along the lines of:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.4.6-->
<commandGroup open="True" name="RickyD Second Counter" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="720" name="set clock for {1} seconds" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Clock set for {1} seconds.</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.SetVar</cmdType>
      <params>
        <param>timer</param>
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Set clock for</phrase>
    <payloadRange>1,60</payloadRange>
    <phrase>second, seconds</phrase>
  </command>
  <command id="721" name="start timer" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Note that you have three optional payloads in VC.SetEventTimer. In your original version, you could have passed {1} as a payload to be used in the other command.">
    <action>
      <cmdType>VC.SetEventTimer</cmdType>
      <params>
        <param>{var.timer}</param>
        <param>Timer</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Counting down {var.timer} seconds.</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>start timer, begin</phrase>
  </command>
  <command id="722" name="time's up" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>{var.timer} seconds are up.</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Timer</event>
  </command>
</commandGroup>
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)

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 497
  • Karma: 43
    • View Profile
Re: Second Counter - A little stuck on getting finishing touch
« Reply #2 on: May 07, 2015, 02:10:58 PM »
Quote
I'm having one other small problem with the timer too (it's probably really simple). If I set the timer for 30 seconds, Vox should say at the end of that time, "30 seconds are up." But I can't seem to get it to say the number of seconds. It's just saying the payload number, "1".


in order for this to work you needed to place the seconds in the payload field after the event name in the VC.SetEventTimer action

This should do the trick, I created a third command that sets a variable to the number of seconds,

then the second command uses that variable to set the event timer when you say start the clock

and then the third is for the timer ending,


Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.4.5-->
<commandGroup open="True" name="Second counter" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="1113" name="Set Timer" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Results.SetVar</cmdType>
      <params>
        <param>Timmer</param>
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Clock set for {Var.Timer} seconds</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Set clock for </phrase>
    <payloadRange>1,60</payloadRange>
    <phrase>second, seconds</phrase>
  </command>
  <command id="443" name="Start Timer" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>VC.SetEventTimer</cmdType>
      <params>
        <param>0h 0m {Var.Timer}s</param>
        <param>Timer</param>
        <param>{Var.Timer}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>{Var.Timer} Second Clock Started</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Start the Clock</phrase>
  </command>
  <command id="442" name="Say When time is up" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>{1} seconds are up</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Timer</event>
  </command>
</commandGroup>


Nime5ter responded while I was replying,
but I thought I would still share, mine does the same thing except mine has the varibale carried as a payload with the VC.SetEventTimer action like nime5ter noted in the command it's self

RickyD333

  • Contributor
  • ***
  • Posts: 71
  • Karma: 2
    • View Profile
Re: Second Counter - A little stuck on getting finishing touch
« Reply #3 on: May 07, 2015, 02:27:07 PM »
Awesome, thanks guys! I love dissecting these commands people make. Learning new stuff all the time.

RickyD333

  • Contributor
  • ***
  • Posts: 71
  • Karma: 2
    • View Profile
Re: Second Counter - A little stuck on getting finishing touch
« Reply #4 on: May 07, 2015, 05:55:54 PM »
Okay, so I've been trying to figure out how to modify this to do minutes instead of seconds (or maybe modify this one action to do either minutes or seconds...might as well throw in hours because I am thinking of using this command for purposes other than working out, such as cooking). I'm not understanding something with this command to allow me to do this. I've been using Nime5ter's xml to tinker around and also another command that James posted somewhere on the forum for setting reminders (and that one I actually came closest to getting it to work... I think. I thought I had it working for a minute, literally, but when I tried to have it countdown for two minutes it instead just did one :P  ). I'm missing something and I don't know what.

Thanks for your help guys.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Second Counter - A little stuck on getting finishing touch
« Reply #5 on: May 07, 2015, 06:34:02 PM »
Yes, that's slightly more complicated.

If I were using the group above as my starting point, I might do something like this. Note that you can't combine minutes and seconds here -- one or the other. Not sure if that's an issue for you. There are other ways to do it, if so.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.4.6-->
<commandGroup open="True" name="RickyD Second Counter minutes or seconds" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="720" name="set clock for {1} {2}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Results.SetVar</cmdType>
      <params>
        <param>timer</param>
        <param>{1}{2}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <params>
        <param>\w.*?({1}.*?)$</param>
        <param />
        <param>{LastSpoken}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.SetVar</cmdType>
      <params>
        <param>friendlyTime</param>
        <param>{Match.1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Clock set for {var.friendlyTime} .</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Set clock for</phrase>
    <payloadRange>1,60</payloadRange>
    <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\timer_unit.xml</payloadFromXML>
  </command>
  <command id="721" name="start timer" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>VC.SetEventTimer</cmdType>
      <params>
        <param>{var.timer}</param>
        <param>Timer</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Counting down {var.friendlyTime}.</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>start timer, begin</phrase>
  </command>
  <command id="722" name="time's up" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{var.timer}&amp;&amp;1</ifParams>
      <then>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param> {var.friendlyTime} is up.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param> {var.friendlyTime} are up.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <event>Timer</event>
  </command>
</commandGroup>

Edited to fix my logic block: should be A==B, not A contains B.
« Last Edit: May 07, 2015, 06:37:07 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)

Dave

  • $upporter
  • Sr. Member
  • *****
  • Posts: 139
  • Karma: 31
    • View Profile
Re: Second Counter - A little stuck on getting finishing touch
« Reply #6 on: May 07, 2015, 06:43:39 PM »
Here is another way, but nime5ters commands are of course a bit more elegant  ;)
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.8-->
<commandGroup open="True" name="RickyD Second Counter" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="720" name="set clock for {1} seconds" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)Contains(B)</ifType>
      <ifParams>{LastSpoken}&amp;&amp;minute</ifParams>
      <then>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>Clock set for {1} minutes.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.SetVar</cmdType>
          <params>
            <param>timerM</param>
            <param>{1}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.SetVar</cmdType>
          <params>
            <param>timerS</param>
            <param>0</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>Clock set for {1} seconds.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.SetVar</cmdType>
          <params>
            <param>timerS</param>
            <param>{1}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.SetVar</cmdType>
          <params>
            <param>timerM</param>
            <param>0</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>Set clock for</phrase>
    <payloadRange optional="true">1,60</payloadRange>
    <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">test.xml</payloadFromXML>
    <phrase>second, seconds, minute, minutes</phrase>
  </command>
  <command id="721" name="start timer" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Note that you have three optional payloads in VC.SetEventTimer. In your original version, you could have passed {1} as a payload to be used in the other command.">
    <action>
      <cmdType>VC.SetEventTimer</cmdType>
      <params>
        <param>{var.timerM}m {var.timerS}s</param>
        <param>Timer</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{var.timerM}&amp;&amp;0</ifParams>
      <then>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>Counting down {var.timerS} seconds.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>Counting down {var.timerM} minutes.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>start timer, begin</phrase>
  </command>
  <command id="722" name="time's up" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{var.timerM}&amp;&amp;0</ifParams>
      <then>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>{var.timerS} seconds are up.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>{var.timerM} minutes are up.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <event>Timer</event>
  </command>
</commandGroup>

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Second Counter - A little stuck on getting finishing touch
« Reply #7 on: May 07, 2015, 06:56:26 PM »
:)  We have an expression in English: "There's more than one way to skin a cat." (Equivalent to 'Viele Wege führen nach Rom.')

Thanks for posting your alternative method. I wish more people would post different solutions to questions. Keep them coming!


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)

RickyD333

  • Contributor
  • ***
  • Posts: 71
  • Karma: 2
    • View Profile
Re: Second Counter - A little stuck on getting finishing touch
« Reply #8 on: May 07, 2015, 07:14:17 PM »
Is there anything I have to edit within the command to make it work on my pc? Because neither of these commands works for me. I just selected the xml, copied, pasted it into my command tree, saved it, refreshed, and tested. I'll attach my log in case that helps...


nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Second Counter - A little stuck on getting finishing touch
« Reply #9 on: May 07, 2015, 07:26:13 PM »
Looks like you didn't download the payload XML file that I attached to my post, so unless you guess what was in there and made your own, you should see a bright red payload in your command tree.

If you look at the commands I posted, the initial command uses payload XML.

(And you should always save and exit the tree after pasting in new commands, so that your tree rebuilds.)
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)

Dave

  • $upporter
  • Sr. Member
  • *****
  • Posts: 139
  • Karma: 31
    • View Profile
Re: Second Counter - A little stuck on getting finishing touch
« Reply #10 on: May 07, 2015, 07:32:36 PM »
Sorry my mistake, now it should work:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.8-->
<commandGroup open="True" name="RickyD Second Counter" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="736" name="set clock for {1} seconds" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)Contains(B)</ifType>
      <ifParams>{LastSpoken}&amp;&amp;minute</ifParams>
      <then>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>Clock set for {1} minutes.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.SetVar</cmdType>
          <params>
            <param>timerM</param>
            <param>{1}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.SetVar</cmdType>
          <params>
            <param>timerS</param>
            <param>0</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>Clock set for {1} seconds.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.SetVar</cmdType>
          <params>
            <param>timerS</param>
            <param>{1}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.SetVar</cmdType>
          <params>
            <param>timerM</param>
            <param>0</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>Set clock for</phrase>
    <payloadRange>1,60</payloadRange>
    <phrase>second, seconds, minute, minutes</phrase>
  </command>
  <command id="737" name="start timer" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Note that you have three optional payloads in VC.SetEventTimer. In your original version, you could have passed {1} as a payload to be used in the other command.">
    <action>
      <cmdType>VC.SetEventTimer</cmdType>
      <params>
        <param>{var.timerM}m {var.timerS}s</param>
        <param>Timer</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{var.timerM}&amp;&amp;0</ifParams>
      <then>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>Counting down {var.timerS} seconds.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>Counting down {var.timerM} minutes.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>start timer, begin</phrase>
  </command>
  <command id="738" name="time's up" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{var.timerM}&amp;&amp;0</ifParams>
      <then>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>{var.timerS} seconds are up.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>{var.timerM} minutes are up.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <event>Timer</event>
  </command>
</commandGroup>

RickyD333

  • Contributor
  • ***
  • Posts: 71
  • Karma: 2
    • View Profile
Re: Second Counter - A little stuck on getting finishing touch
« Reply #11 on: May 07, 2015, 07:56:52 PM »
 :bonk

Awesome! You guys are fantastic.

Dave

  • $upporter
  • Sr. Member
  • *****
  • Posts: 139
  • Karma: 31
    • View Profile
Re: Second Counter - A little stuck on getting finishing touch
« Reply #12 on: May 08, 2015, 09:22:08 AM »
I modified my code a little bit, so now you can mix minutes and seconds in your command  ;D

Possible voice commands are:
Set clock for XX minutes.
Set clock for XX seconds.
Set clock for XX minutes and YY seconds.
Set clock for XX minutes, YY seconds.


That was a fun one  :biglaugh

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.8-->
<commandGroup open="True" name="RickyD Second Counter minutes and seconds mixed" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="751" name="set clock for {1} seconds" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)Contains(B)</ifType>
      <ifParams>{LastSpoken}&amp;&amp;minute</ifParams>
      <then>
        <action>
          <cmdType>Results.SetVar</cmdType>
          <params>
            <param>timerM</param>
            <param>{1}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>Results.SetVar</cmdType>
          <params>
            <param>timerM</param>
            <param>0</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.SetVar</cmdType>
          <params>
            <param>timerS</param>
            <param>{1}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>Clock set for {1} seconds.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.StopMacro</cmdType>
          <params />
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)Contains(B)</ifType>
      <ifParams>{LastSpoken}&amp;&amp;second</ifParams>
      <then>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>Clock set for {1} minutes and {2} seconds.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.SetVar</cmdType>
          <params>
            <param>timerS</param>
            <param>{2}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>Clock set for {1} minutes.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.SetVar</cmdType>
          <params>
            <param>timerS</param>
            <param>0</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>Set clock for</phrase>
    <payloadRange>1,60</payloadRange>
    <phrase>second, seconds, minute, minutes</phrase>
    <phrase optional="true">and</phrase>
    <payloadRange optional="true">1,59</payloadRange>
    <phrase optional="true">second, seconds, minute, minutes</phrase>
  </command>
  <command id="752" name="start timer" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Note that you have three optional payloads in VC.SetEventTimer. In your original version, you could have passed {1} as a payload to be used in the other command.">
    <action>
      <cmdType>VC.SetEventTimer</cmdType>
      <params>
        <param>{var.timerM}m {var.timerS}s</param>
        <param>Timer</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{var.timerM}&amp;&amp;0</ifParams>
      <then>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>Counting down {var.timerS} seconds.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.StopMacro</cmdType>
          <params />
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{var.timerS}&amp;&amp;0</ifParams>
      <then>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>Counting down {var.timerM} minutes.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>Counting down {var.timerM} minutes and {var.timerS} seconds.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>start timer, begin</phrase>
  </command>
  <command id="753" name="time's up" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{var.timerM}&amp;&amp;0</ifParams>
      <then>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>{var.timerS} seconds are up.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.StopMacro</cmdType>
          <params />
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{var.timerS}&amp;&amp;0</ifParams>
      <then>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>{var.timerM} minutes are up.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>{var.timerM} minutes and {var.timerS} seconds are up.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <event>Timer</event>
  </command>
</commandGroup>

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Second Counter - A little stuck on getting finishing touch
« Reply #13 on: May 08, 2015, 09:43:24 AM »
 :clap
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)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Second Counter - A little stuck on getting finishing touch
« Reply #14 on: May 08, 2015, 09:44:24 AM »
Nice!  ::bow