VoxCommando

Help and Support (Using VoxCommando) => VoxCommando Basics and Core Features => Topic started by: SteveB69 on January 02, 2016, 02:04:44 AM

Title: Payload Command on the wiki missing
Post by: SteveB69 on January 02, 2016, 02:04:44 AM
Am following the payload creation on the wiki page - http://voxcommando.com/mediawiki/index.php?title=File:Payload_remindme.png (http://voxcommando.com/mediawiki/index.php?title=File:Payload_remindme.png)
I can figure out the TTS bit but what command do I use for vc to trigger the event after the minutes I say?

(https://voxcommando.com/mediawiki/images/8/80/Payload_remindme.png)
Title: Re: Payload Command on the wiki missing
Post by: PegLegTV on January 02, 2016, 02:59:21 AM
this one will require two commands

1.) uses VC.SetEventTimer to trigger an event in X amount of time (payload 2 = {2})
and then add payload one (the reason for the reminder... walk the dog) as payload one in VC.SetEventTimer
(I also added in TTS.Speak to give a vocal confirmation)

2.) is triggered by the event (Reminder) and I added another TTS.Speak action to let you know your reminder is done and which reminder is it by using {1} (payload 1) that we added as payload 1 in the first command

Reminders
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.4-->
<commandGroup open="True" name="Reminders" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="717" name="Remind me to {1} in {2} Minutes" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>I set a reminder to {1} for {2} minutes</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.SetEventTimer</cmdType>
      <params>
        <param>{2}m</param>
        <param>Reminder</param>
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Remind me to</phrase>
    <payloadList>walk the dog, take out the garbage, let the dog in, take the dog for a walk</payloadList>
    <phrase>in</phrase>
    <payloadRange>1,60</payloadRange>
    <phrase>minutes</phrase>
  </command>
  <command id="730" name="Reminder is done" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <params>
        <param>your reminder to {1} is done</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Reminder</event>
  </command>
</commandGroup>

in the VC.SetEventTimer action the "m" after {2} is to tell it to set the event timer for minutes (h = hours, m = minutes, s = seconds)
Title: Re: Payload Command on the wiki missing
Post by: SteveB69 on January 03, 2016, 08:44:40 PM
Thanks for that, that works & gives me a future example of how to use payloads.

One thing though, by having a payload list it can limit the reminder options, so I tried deleting the payload list & added a payload dictation regular (in exactly the same place) but then nothing works, VC comes up with command unrecognized.

(I've changed the minutes to seconds just for test purposes)

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.2-->
<command id="717" name="Remind me to {1} in {2} Minutes" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="10" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>I set a reminder to {1} for {2} minutes</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.SetEventTimer</cmdType>
    <params>
      <param>{2}s</param>
      <param>Reminder</param>
      <param>{1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Remind me to</phrase>
  <payloadDictation>payloadDictation: Regular</payloadDictation>
  <phrase>in</phrase>
  <payloadRange>1,60</payloadRange>
  <phrase>minutes</phrase>
</command>
***********************************************************************************************
Solved, the above code uses payload dication regular, thought I'd leave the above code which is working with payload dictation regular, of course this method isn't as accurate