News:

HOT TIP! Commands and groups can be copied and pasted directly from your command editor to the forum, and vice versa. This makes sharing command XML on the forum much easier!

Main Menu

Do it again !

Started by Sieg, August 13, 2013, 08:35:02 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Sieg

Hi,

I'm looking to do something like "Do it again X time", but I have a small prob.

Here is my code :


<?xml version="1.0" encoding="utf-16"?>
<command id="858" name="Encore" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Results.SetVar</cmdType>
    <cmdString>actif&amp;&amp;{PreviousCommand}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="True">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>{Var.actif}&amp;&amp;Encore</ifParams>
    <then>
      <action>
        <cmdType>Results.SetVar</cmdType>
        <cmdString>encore&amp;&amp;{PreviousCommand}</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <action>
    <cmdType>VC.TellVox</cmdType>
    <cmdString>{Var.encore}</cmdString>
    <cmdRepeat>{1}</cmdRepeat>
  </action>
  <phrase>Recommence, Encore</phrase>
  <payloadRange optional="true">1,100</payloadRange>
  <phrase optional="true">fois</phrase>
</command>

( Encore == Again , in French ;) )

It work fine, but just if the last command does not have payloads, and if CommandName and Phrase are same.

I can't use {Last spoken} because the last is "Again". I did not find any solution about that in the forum, so if anyone has an idea, I'm interested. :)


jitterjames

Hi Sieg,

I think it is a good idea.  It is probably not possible to do it really well with VC as it is now, but I can probably make some modifications to make this easier.

Sieg

Quote from: jitterjames on August 13, 2013, 10:36:00 PM
Hi Sieg,

I think it is a good idea.  It is probably not possible to do it really well with VC as it is now, but I can probably make some modifications to make this easier.

It sounds pretty cool. :)

jitterjames

Version 1.140 now has a variable {PreviousSpoken} that should help you with this command.

http://voxcommando.com/forum/index.php?topic=1164.0

jitterjames

Just to clarify, we still have {LastSpoken} and the other variables.  Nothing was removed.

{LastSpoken}  - This is the text of the speech that was most recently recognized (speech for the current command)

{PreviousSpoken}  - This is the text of the speech that was recognized in the previous command (before the current command)

{PreviousCommand}  - This is the name of the previous command (before the current command)

Sieg

That's roxx !  ;D

(your map system is very intresting, I'll like to play with it)

Thank you very much.