Author Topic: What can I Say a la Siri Style !  (Read 5164 times)

0 Members and 1 Guest are viewing this topic.

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
What can I Say a la Siri Style !
« on: July 29, 2014, 10:11:54 PM »
here is couple of commands that give voice feed back of the enabled commands (this can be easily changed to show all commands)

the first is triggered when one says  "What can I say" .. so VC return topics, these are based on the groups

the second is to list what commands are available in that topic, which is basically the commands in the group ... command that do not have Phrases (i.e. triggered only by actions) will not be listed read by default as they are represented with a dot in VC command help HTML

the only setback is that VC command Help.showenabled ... opens the page in IE... maybe James can add a variation that just generate the HTML. I have revised the command that generate the topics to parse info directly from the commands ... the help window will not show ... if one wants to show it, one can use help commands that are part of VC

 ----- revised -------
the commands has been revised to ignore groups and commands starting with --- (three minus signs). you can change that to your liking by changing the --- with a supported character in [^---] in both commands ...

enjoy and please give feedback if you encounter problems ...

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.0.5-->
<command id="398" name="What Can I Say" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Builds a list of enabled commands topics (based on CommandsGroups)">
  <action>
    <cmdType>PayloadXML.Clear</cmdType>
    <params>
      <param>\payloads\VC_Commands_Topics.xml</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>Choose a Topic</param>
      <param>10000</param>
    </params>
    <cmdRepeat>{#M}</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>Choose a Topic</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>\voicecommands.xml</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <params>
      <param>\&amp;amp\;</param>
      <param>And</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegEx</cmdType>
    <params>
      <param>&lt;commandGroup.*name="([^---].*)".*enabled="True"</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.AddText</cmdType>
    <params>
      <param>{Match.{i}}</param>
    </params>
    <cmdRepeat>{#M}</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>&lt;silence msec="100"/&gt;{Match.{i}}.</param>
    </params>
    <cmdRepeat>{#M}</cmdRepeat>
  </action>
  <action>
    <cmdType>PayloadXML.AddPair</cmdType>
    <params>
      <param>\payloads\VC_Commands_Topics.xml</param>
      <param>{Match.{i}}</param>
      <param>{Match.{i}}</param>
      <param>False</param>
    </params>
    <cmdRepeat>{#M}</cmdRepeat>
  </action>
  <action>
    <cmdType>Group.Rebuild</cmdType>
    <params>
      <param>Show Help</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>What Can I Say?</phrase>
</command>

 ******************** Important **********
this command must reside in a group named Help ... or edit the first command to rebuild the group you place it in.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.0.3-->
<command id="327" name="Commands in a Topic" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>Commands in {1}</param>
      <param>10000</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.SpeakSync</cmdType>
    <params>
      <param>Commands in {1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.SetLastResult</cmdType>
    <params>
      <param>{1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.Replace</cmdType>
    <params>
      <param><![CDATA[ ]]></param>
      <param>\s</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.SetVar</cmdType>
    <params>
      <param>CommandGroup</param>
      <param>{LastResult}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>C:\Extensions\Vox Commando\commandhelp.html</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExSingle</cmdType>
    <params>
      <param>id="heading"\&gt; {Var.CommandGroup}&lt;/div&gt;(.*?)id="clear"</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.SetLastResult</cmdType>
    <params>
      <param>{Match.1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <params>
      <param>&lt;TD&gt;(.*?)&lt;/TD&gt;</param>
      <param> $1</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <params>
      <param>&lt;TD\sclass="optional"&gt;(.*?)&lt;/TD&gt;</param>
      <param> ($1) </param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <params>
      <param>(\d+),(\d+)</param>
      <param>$1 to $2 </param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <params>
      <param>{(.*?)}</param>
      <param>$1 </param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <params>
      <param>,</param>
      <param> or</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <params>
      <param>&lt;BR\s/&gt;</param>
      <param> or</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <params>
      <param> \|</param>
      <param>,</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <params>
      <param>&lt;div\sid="command"&gt;&lt;table&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <params>
      <param>&lt;tr&gt;(.*?)&lt;/tr&gt;</param>
      <param>$1.</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegEx</cmdType>
    <params>
      <param>&lt;table&gt;([^---].*)&lt;/table&gt;</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.addText</cmdType>
    <params>
      <param>{i}. {Match.{i}}</param>
    </params>
    <cmdRepeat>{#M}</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.Pause</cmdType>
    <params>
      <param>400</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>{Match.{i}}</param>
    </params>
    <cmdRepeat>{#M}</cmdRepeat>
  </action>
  <phrase optional="true">List</phrase>
  <phrase>Commands</phrase>
  <phrase optional="true">of, in, about, for</phrase>
  <payloadFromXML phraseOnly="True" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\VC_Commands_Topics.xml</payloadFromXML>
</command>
« Last Edit: July 03, 2015, 06:48:59 AM by Haddood »
When Voice command gets tough, use hand gestures

xtermin8r

  • $upporter
  • Sr. Member
  • *****
  • Posts: 366
  • Karma: 9
  • Crunchie
    • View Profile
Re: What can I Say a la Siri Style !
« Reply #1 on: July 30, 2014, 11:46:52 AM »
I was planning on doing the same thing but in python.
Thanks.
Neural Net Based Artificial Intelligence.

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: What can I Say a la Siri Style !
« Reply #2 on: July 30, 2014, 08:07:13 PM »
 ----- revised -------
the commands has been revised to ignore groups and commands starting with --- (three minus signs). you can change that to your liking by changing the --- with a supported character in [^---] in both commands ...

I was planning on doing the same thing but in python.
Thanks.

one man hard work is another man joy !!!  ;)
When Voice command gets tough, use hand gestures

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: What can I Say a la Siri Style !
« Reply #3 on: August 05, 2014, 04:50:22 PM »
I revised the "what can I say command" that lists topics. now it does not show help ...
When Voice command gets tough, use hand gestures

zen_SuR

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 2
    • View Profile
Re: What can I Say a la Siri Style !
« Reply #4 on: May 26, 2017, 03:25:30 PM »
I tried this now extensivly and i dont become happy... since i am quite an experienced user i think i avoided the pitfalls....

i changed the paths and the group name thats being rebuild, i manually created the VC_Commands_Topics.xml

but unfortunatly the xml remains empty... so i am pretty sure thats where the mistake lies... but i tried, tried again and tried a third time from scratch to get it to work. i am desperate enough to happily enough let someone else point out the error i am making (since i dont believe it is VC-Version related... i am using 2.2.3.5)

If i say "What can i say" - it responds with "choose the topic" (nothing else).
If i say then "List commands in *group name*" it detects "list commands *in/for/about* error"

would somebody please be so kind and take a look at my commands?

What can i say:
Code: [Select]

<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.3.5-->
<command id="443" name="What Can I Say" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Builds a list of enabled commands topics (based on CommandsGroups)">
  <action>
    <cmdType>PayloadXML.Clear</cmdType>
    <params>
      <param>\payloads\VC_Commands_Topics.xml</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>Choose a Topic</param>
      <param>10000</param>
    </params>
    <cmdRepeat>{#M}</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>Choose a Topic</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>\voicecommands.xml</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <params>
      <param>\&amp;amp\;</param>
      <param>And</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegEx</cmdType>
    <params>
      <param>&lt;commandGroup.*name="([^---].*)".*enabled="True"</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.AddText</cmdType>
    <params>
      <param>{Match.{i}}</param>
    </params>
    <cmdRepeat>{#M}</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>&lt;silence msec="100"/&gt;{Match.{i}}.</param>
    </params>
    <cmdRepeat>{#M}</cmdRepeat>
  </action>
  <action>
    <cmdType>PayloadXML.AddPair</cmdType>
    <params>
      <param>\payloads\VC_Commands_Topics.xml</param>
      <param>{Match.{i}}</param>
      <param>{Match.{i}}</param>
      <param>False</param>
    </params>
    <cmdRepeat>{#M}</cmdRepeat>
  </action>
  <action>
    <cmdType>Group.Rebuild</cmdType>
    <params>
      <param>Help</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>What Can I Say?</phrase>
</command>



Commands in a topic:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.3.5-->
<command id="339" name="Commands in a Topic" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>Commands in {1}</param>
      <param>10000</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.SpeakSync</cmdType>
    <params>
      <param>Commands in {1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.SetLastResult</cmdType>
    <params>
      <param>{1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.Replace</cmdType>
    <params>
      <param><![CDATA[ ]]></param>
      <param>\s</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.SetVar</cmdType>
    <params>
      <param>CommandGroup</param>
      <param>{LastResult}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>C:\Users\me\Google Drive\Dominique\Programme\Voxcommando\commandhelp.html</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExSingle</cmdType>
    <params>
      <param>id="heading"\&gt; {Var.CommandGroup}&lt;/div&gt;(.*?)id="clear"</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.SetLastResult</cmdType>
    <params>
      <param>{Match.1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <params>
      <param>&lt;TD&gt;(.*?)&lt;/TD&gt;</param>
      <param> $1</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <params>
      <param>&lt;TD\sclass="optional"&gt;(.*?)&lt;/TD&gt;</param>
      <param> ($1) </param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <params>
      <param>(\d+),(\d+)</param>
      <param>$1 to $2 </param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <params>
      <param>{(.*?)}</param>
      <param>$1 </param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <params>
      <param>,</param>
      <param> or</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <params>
      <param>&lt;BR\s/&gt;</param>
      <param> or</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <params>
      <param> \|</param>
      <param>,</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <params>
      <param>&lt;div\sid="command"&gt;&lt;table&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <params>
      <param>&lt;tr&gt;(.*?)&lt;/tr&gt;</param>
      <param>$1.</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegEx</cmdType>
    <params>
      <param>&lt;table&gt;([^---].*)&lt;/table&gt;</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.addText</cmdType>
    <params>
      <param>{i}. {Match.{i}}</param>
    </params>
    <cmdRepeat>{#M}</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.Pause</cmdType>
    <params>
      <param>400</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>{Match.{i}}</param>
    </params>
    <cmdRepeat>{#M}</cmdRepeat>
  </action>
  <phrase optional="true">List</phrase>
  <phrase>Commands</phrase>
  <phrase optional="true">of, in, about, for</phrase>
  <payloadFromXML phraseOnly="True" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\VC_Commands_Topics.xml</payloadFromXML>
</command>



jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: What can I Say a la Siri Style !
« Reply #5 on: May 26, 2017, 04:22:34 PM »
I seriously doubt that this command ever worked properly, but in any case the XML was not suitable for copy/paste to another user's system because it used file paths specific to the user that created the commands.

In my case this command would be useless anyway because I have so many groups that the TTS listing them never seems to stop speaking!

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: What can I Say a la Siri Style !
« Reply #6 on: May 26, 2017, 05:09:20 PM »
Hi zen_SuR. Welcome to the forum.

Have you already tried the default "Show help"/"What can I say?" command, which comes packaged in all of the standard configurations?

That command opens a web page that displays all the voice commands available to you.

A command that reads aloud a full group of voice commands is probably asking for trouble, even if it works. You'd have to make sure VC isn't actively listening for voice commands whenever this command executes. Otherwise, each time the TTS voice announces another command, VoxCommando will probably start trying to execute the voice commands that it recognizes.  ::yikes

Does Siri really provide people with a long list of commands when they ask "What can I say?"? Doesn't it just suggest one possible voice command?

That said:

If the default "Show Help" command the comes with VoxCommando doesn't meet your needs, maybe you can explain why you're looking for alternatives. We may be able to suggest some solutions that will work more reliably.
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)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: What can I Say a la Siri Style !
« Reply #7 on: May 28, 2017, 11:46:38 AM »
I still don't think these commands are going to be very satisfying, but here is a fixed version of the command group:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.3.6-->
<commandGroup open="True" name="what can I say" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="454" name="What Can I Say" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Builds a list of enabled commands topics (based on CommandsGroups). Make sure Group.rebuild refers to this group name, if you've chosen to change the group name.">
    <action>
      <cmdType>PayloadXML.Clear</cmdType>
      <params>
        <param>payloads\VC_Commands_Topics.xml</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>Choose a Topic</param>
        <param>15000</param>
        <param>-5</param>
      </params>
      <cmdRepeat>{#M}</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Choose a Topic</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>File.Read</cmdType>
      <params>
        <param>voicecommands.xml</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegExReplace</cmdType>
      <params>
        <param>\&amp;amp\;</param>
        <param>And</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <params>
        <param>&lt;commandGroup.*name="([^---].*)".*enabled="True"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.AddText</cmdType>
      <params>
        <param>{i}. {Match.{i}}</param>
      </params>
      <cmdRepeat>{#M}</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>&lt;silence msec="100"/&gt;{i}. {Match.{i}}.</param>
      </params>
      <cmdRepeat>{#M}</cmdRepeat>
    </action>
    <action>
      <cmdType>PayloadXML.AddPair</cmdType>
      <params>
        <param>payloads\VC_Commands_Topics.xml</param>
        <param>{Match.{i}}</param>
        <param>{Match.{i}}</param>
        <param>True</param>
      </params>
      <cmdRepeat>{#M}</cmdRepeat>
    </action>
    <action>
      <cmdType>Group.Rebuild</cmdType>
      <params>
        <param>what can I say</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType />
      <params />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>What Can I Say?</phrase>
  </command>
  <command id="356" name="Commands in a Topic" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Help.ShowAll</cmdType>
      <params>
        <param>False</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.SetLastResult</cmdType>
      <params>
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.Replace</cmdType>
      <params>
        <param><![CDATA[ ]]></param>
        <param>\s</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegExReplace</cmdType>
      <params>
        <param>\((.*?)\)</param>
        <param>\($1\)</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.SetVar</cmdType>
      <params>
        <param>CommandGroup</param>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>File.Read</cmdType>
      <params>
        <param>commandhelp.html</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegExSingle</cmdType>
      <params>
        <param>id="heading"&gt;{Var.CommandGroup}.*?&lt;/div&gt;(.*?)id="clear"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>LastActionSuccess</ifType>
      <ifParams>&amp;&amp;</ifParams>
      <then>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <params>
            <param>Commands in {1}</param>
            <param>10000</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.SetLastResult</cmdType>
          <params>
            <param>{Match.1}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.RegExReplace</cmdType>
          <params>
            <param>&lt;TD.*?&gt;(.*?)&lt;/TD&gt;</param>
            <param> $1</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.RegExReplace</cmdType>
          <params>
            <param>(\d+),(\d+)</param>
            <param>$1 to $2 </param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.RegExReplace</cmdType>
          <params>
            <param>&lt;BR\s/&gt;\s*</param>
            <param>/</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.RegExReplace</cmdType>
          <params>
            <param>{(.*?)}</param>
            <param>$1 </param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.RegExReplace</cmdType>
          <params>
            <param> \|</param>
            <param>,</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.RegExReplace</cmdType>
          <params>
            <param>&lt;tr&gt;(.*?)&lt;/tr&gt;</param>
            <param>$1</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.RegExReplace</cmdType>
          <params>
            <param>&lt;div\sid="command"&gt;&lt;table&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.RegEx</cmdType>
          <params>
            <param>&lt;table&gt;([^---].*)&lt;/table&gt;</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>TTS.SpeakSync</cmdType>
          <params>
            <param>Commands in {1}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>OSD.addText</cmdType>
          <params>
            <param>{i}. {Match.{i}}</param>
          </params>
          <cmdRepeat>{#M}</cmdRepeat>
        </action>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>{i}. {Match.{i}}</param>
          </params>
          <cmdRepeat>{#M}</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <params>
            <param>Sorry. I could not find voice commands for the '{1}'.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>Sorry. I could not find voice commands for the '{1}'.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>List commands</phrase>
    <phrase>of, in, about, for</phrase>
    <payloadFromXML phraseOnly="True" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\VC_Commands_Topics.xml</payloadFromXML>
  </command>
  <command id="55" name="Stop talking" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Stop</cmdType>
      <params />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Stop talking, shut up, that's enough</phrase>
  </command>
</commandGroup>

Some problems with the original:

1. When sharing commands like this on the forum it's best to use relative paths since other users will not share the same absolute file paths. The Scrape action, however, won't work with relative paths. Instead we can use the File.Read action, as this works with relative paths.

2. All default configurations come with a "Show help/What can I say?" command. This command uses the Help.ShowAll action, which first generates an html page called "commandhelp.html" and then displays that web page in your web browser.

If you have never used that command then the commandhelp.html file won't exist. If it doesn't exist, then the "List commands in group X" command will have nothing to read and the command will fail. This may have been the problem you were having. As well, if your configuration has changed since the last time that default show help command was executed, then the html page won't include those command changes.

In the revised command group above, I added a Help.ShowAll action at the beginning of the "What can I say" command to make sure that the html page is generated and is current.

3. I strip out optional phrases and made some other minor changes to how voice command strings are formed because I found it made the list of commands much more readable and easier to understand. I also strip out any ( ) symbols that are in group names, as these will obviously interfere with the subsequent regular expression matching and break the command if we ask for information about a group that has parentheses in the name. There may be other characters that will interfere as well. If the commands are still malfunctioning for you, this is something to look out for.

4. I added a "shut up" command which stops the TTS if it's carrying on too long and you don't want to wait for the command to finish reading out a long list of voice commands.

5. I have shared the commands in a command group called "what can I say". This group needs to be rebuilt in order to be able to load the payload xml with the command group names that is used in the the second command. If you change the name of the group, that Group.Rebuild action will need to be updated.

6. The default command that comes with all configurations already uses the phrase "What can I say?". Users who want to use the command group posted here should delete that phrasing from the default Show Help command. Obviously it's a bad idea to have 2 commands triggered by the same voice command.
« Last Edit: May 28, 2017, 07:14:55 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)