Author Topic: I beg your pardon + Repeat execution of the previous command  (Read 5685 times)

0 Members and 1 Guest are viewing this topic.

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
I beg your pardon + Repeat execution of the previous command
« on: March 17, 2015, 02:46:29 AM »
(requires 2.207 min + updated dll for 2.207 from here http://voxcommando.com/forum/index.php?topic=2299.msg19889#msg19889) to simulate a bit of human interaction with VC ... this command will make VC repeat what it just had said

ex: VC what time is it?
      it is quarter past two
      I beg your pardon
      it is quarter past two

note:if you change the phrasing make sure to revise the if statement to avoid infinite loops where VC keep on telling itself, can you repeat do not apply to updated command

update: the previous command had an issue. the it makes VC redo the action ...not only speaking the text (see discussion below)

the old command has been renamed to repeat last action and improved based on marcus post below ... (this should work with older releases of version 2)

I beg your pardon command

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.0.7-->
<command id="354" name="I beg your pardon" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>TTS.GetLastText</cmdType>
    <params />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>{LastResult}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>can you repeat, I beg your pardon, say that again</phrase>
  <phrase optional="true">that</phrase>
  <phrase optional="true">?</phrase>
</command>

Repeat last action

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.0.7-->
<command id="358" name="Repeat Last Action" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <if ifBlockDisabled="False" ifNot="True">
    <ifType>(A)==(B)</ifType>
    <ifParams>{LastSpoken}&amp;&amp;{PreviousSpoken}</ifParams>
    <then>
      <action>
        <cmdType>VC.TellVox</cmdType>
        <params>
          <param>{PreviousSpoken}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <phrase>do it again, repeat last action</phrase>
</command>
« Last Edit: August 05, 2015, 11:56:32 PM by Haddood »
When Voice command gets tough, use hand gestures

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: asking VC to repeat
« Reply #1 on: March 17, 2015, 08:34:23 AM »
Thanks hadood but can you please adjust your description of this command because I think it could mess some people up a bit!

This command will get VoxCommando to repeat execution of the previous command, not repeat what it said.

Example:
"Vc delete that file"
COMPUTER DELETES CURRENT FILE
"I beg your pardon"
COMPUTER DELETES (another) CURRENT FILE

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Repeat execution of the previous command
« Reply #2 on: March 17, 2015, 03:54:49 PM »
@James done :)

James here brought a very important point, if you have commands that do critical stuff, like deleting files ... I would add Logic blocks to avoid repeating them
When Voice command gets tough, use hand gestures

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Repeat execution of the previous command
« Reply #3 on: March 17, 2015, 04:30:10 PM »
The phrasing (what you say to execute this command) does not really make sense either.  Instead of asking VC to "repeat itself" which makes it sound like it will repeat the last TTS that it spoke, the phrasing should be more along the lines of "do that again".
« Last Edit: March 17, 2015, 04:39:21 PM by jitterjames »

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Repeat execution of the previous command
« Reply #4 on: March 18, 2015, 03:57:56 PM »
The phrasing (what you say to execute this command) does not really make sense either.  Instead of asking VC to "repeat itself" which makes it sound like it will repeat the last TTS that it spoke, the phrasing should be more along the lines of "do that again".

I thought of that after your post and thought would leave it to each user personal preference. In my logic  8), I would use this command once VC said somthing, like time, weather forecast ... Etc.

Now I am thinking this command will not work, if the Tts was generated by an event ...  ::dis. Still I think it is kinda fun to start with this and built on it
When Voice command gets tough, use hand gestures

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Repeat execution of the previous command
« Reply #5 on: March 18, 2015, 04:29:31 PM »
It might be handy to have an action to get the last spoken text from the TTS plugin.  Then you could make this command work exactly the way you want without the risk of it doing unintended damage.

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Repeat execution of the previous command
« Reply #6 on: March 19, 2015, 12:33:43 AM »
It might be handy to have an action to get the last spoken text from the TTS plugin.  Then you could make this command work exactly the way you want without the risk of it doing unintended damage.
;D ;D ;D... I smell new action coming
When Voice command gets tough, use hand gestures

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Repeat execution of the previous command
« Reply #7 on: July 06, 2015, 04:21:39 AM »
It might be handy to have an action to get the last spoken text from the TTS plugin.  Then you could make this command work exactly the way you want without the risk of it doing unintended damage.

@James any plans to add this? or it dropped from your radar :)
When Voice command gets tough, use hand gestures

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Repeat execution of the previous command
« Reply #8 on: July 06, 2015, 09:02:34 AM »
I think it was forgotten.  ::confused

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Repeat execution of the previous command
« Reply #9 on: July 06, 2015, 06:56:14 PM »
I think it is normal I never put it as a feature request ... and it is impossible for you to remember all what is going on in the forums ...

I will add it as a feature request ... and maybe you can take a look at it for the next release
When Voice command gets tough, use hand gestures

marcusvdt

  • Sr. Member
  • ****
  • Posts: 152
  • Karma: 6
  • Researching
    • View Profile
Re: Repeat execution of the previous command
« Reply #10 on: August 05, 2015, 03:34:10 PM »
@Haddood
Thanks for the idea! I'm using it together with another action for repeating the last tts, and they are very useful.
Is there any reason why you did not do it this way below? I just want to make sure I'm not doing it wrong. THanks!

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.0.6-->
<command id="340" name="repetir o comando anterior" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
[color=red]  <if ifBlockDisabled="False" ifNot="True">
    <ifType>(A)==(B)</ifType>
    <ifParams>{LastSpoken}&amp;&amp;{PreviousSpoken}</ifParams>
    <then>
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>cmdTOrepeat</param>
          <param>{PreviousSpoken}</param>
        </params>[/color]
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>VC.TellVox</cmdType>
        <params>
          <param>{Var.cmdTOrepeat}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>Não posso repetir um comando quando ele já é o seu pedido para eu repetir. Isso faria eu entrar em um lúp infinito.</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <phrase>repita,repetir,pode repetir,favor repetir,executar de novo,executar novamente,executar</phrase>
  <phrase optional="true">o</phrase>
  <phrase>último comando,comando,comando anterior</phrase>
  <phrase optional="true">por favor,de novo,novamente</phrase>
</command>

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Repeat execution of the previous command
« Reply #11 on: August 05, 2015, 08:10:07 PM »
@marcus
well the idea was to repeat what was last said by the TTS ... James brought into light that I missed that it will repeat any other command ... so if a command deletes a file, using this it will try to delete it again ... that is why in last version 2.207 (the new sexy J.Lo, I mean VC  ;D) James introduced TTS.GetLastSpoken ... so this command must be split in two commands:

1. repeat last action ... which is this one above (or yours)
2. I beg your pardon or Say that again ... which is simply TTS.GetLastSpoken then TTS.Speak {LastResults} ... however,  TTS.GetLastSpoken is not working for me with ivona voice... always get an error (nothing was spoken) ... I should report this in the bugs ...

now as for your command, first I should say great minds think of different ways to reach the same goal   :biglaugh :biglaugh

I think you did a better job than mine ... I put the IF to avoid an infinite loop if one says I beg your pardon twice. My approach is to put those possible phrases in the IF statement ... so it limits the phrases and if one change them in the syntax, one must follow up and change the IF statement ...

your command solve this in an elegant way ... will switch to your method


P.S. I did not forget about writing the post about my set-up... but those days hardly have few minutes for VC ...

When Voice command gets tough, use hand gestures

marcusvdt

  • Sr. Member
  • ****
  • Posts: 152
  • Karma: 6
  • Researching
    • View Profile
Re: I beg your pardon + Repeat execution of the previous command
« Reply #12 on: August 06, 2015, 12:04:12 AM »
Haddood, that's good then. I was affraid I was missing something important in my approach.

Regarding the other subject, yes I know I made a lot of questions, there is no rush anyway. Take your time!

Thank you!