Author Topic: Do it again !  (Read 1691 times)

0 Members and 1 Guest are viewing this topic.

Sieg

  • Jr. Member
  • **
  • Posts: 7
  • Karma: 0
    • View Profile
Do it again !
« on: August 13, 2013, 08:35:02 PM »
Hi,

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

Here is my code :

Code: [Select]
<?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. :)

« Last Edit: August 14, 2013, 05:18:08 AM by Sieg »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Do it again !
« Reply #1 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.

Sieg

  • Jr. Member
  • **
  • Posts: 7
  • Karma: 0
    • View Profile
Re: Do it again !
« Reply #2 on: August 14, 2013, 05:30:36 AM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Do it again !
« Reply #3 on: August 24, 2013, 11:08:39 AM »
Version 1.140 now has a variable
Code: [Select]
{PreviousSpoken} that should help you with this command.

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

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Do it again !
« Reply #4 on: August 24, 2013, 12:40:56 PM »
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

  • Jr. Member
  • **
  • Posts: 7
  • Karma: 0
    • View Profile
Re: Do it again !
« Reply #5 on: August 25, 2013, 09:09:25 AM »
That's roxx !  ;D

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

Thank you very much.