Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Methos

Pages: [1]
1
Hello I was trying to get vc to pause for a random interval between 4000 and 9000ms.

So I made a python script that uses random.choice and can choose from 4000 to 9000 in thousand increments, it then assigns the result to var.pauseDelay.
This works fine and var.pauseDelay gets a correct value, if I do "OSD.ShowText {var.pauseDelay}" I'll get 5000 or some other valid #.
Then I did "VC.Pause {var.pauseDelay}" but it doesn't work, vc.pause never fires in the log.

Will it accept a variable or is there a better way to accomplish this task?

2
VoxCommando Basics and Core Features / Re: Delete a map key once set?
« on: July 05, 2014, 02:53:08 PM »
Ok, sorry if I was being annoying about this. I just like to see what I can and cannot do then come up with ideas based on what I've learned.

Thanks again for all your help.

3
VoxCommando Basics and Core Features / Re: Delete a map key once set?
« on: July 05, 2014, 10:46:15 AM »
Thanks for the explanation James. I having another issue and figured it was related to what we are talking about so I included it here.

So earlier in this thread I posted code to blank a variable, show that it blanked the value, then assign a value and show the new value. Each time the command is executed it blanks it, and it works with no problem. Then later on in the night I found code to ping a ip and TTS speak if its working or not, and that works fine with no problem. The issue came up when I went back to run the variable code again. It would not blank. Below is the code, let me know if there is something I am doing wrong.

In order to replicate, launch the "variable test" command first, it will work. Then run the "Ping" command, that will work, then re-run the "variable test" command and the variable will now be set to the ping results and will ignore the blanking.

A note neither command references the same variables nor are they in the same command group (I combined them here just to paste easier).

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.0.0-->
<commandGroup open="True" name="Issue" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="215" name="variable test" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Results.SetVar</cmdType>
      <params>
        <param>a1</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>Before: {var.a1}.</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.SetVar</cmdType>
      <params>
        <param>a1</param>
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.AddText</cmdType>
      <params>
        <param>After: {var.a1}.</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>variable test</phrase>
    <payloadDictation>payloadDictation: Regular</payloadDictation>
  </command>
  <command id="420" name="Ping" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Launch.Capture</cmdType>
      <params>
        <param>C:\Windows\System32\ping.exe</param>
        <param>8.8.8.8</param>
        <param>True</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <params>
        <param>bytes=(.)* time(.)*ms </param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.SetVar</cmdType>
      <params>
        <param>laptopOn</param>
        <param>{#M}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{var.laptopOn}&amp;&amp;4</ifParams>
      <then>
        <action>
          <cmdType>TTS.SpeakSync</cmdType>
          <params>
            <param>It's working.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>TTS.SpeakSync</cmdType>
          <params>
            <param>There is a problem!</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>run ping test</phrase>
  </command>
</commandGroup>

4
VoxCommando Basics and Core Features / Re: Delete a map key once set?
« on: July 05, 2014, 12:58:58 AM »
I still couldn't get my code to work (after taking care of the typos) so I compared mine to the code you gave, Nime5ter, and I found something out.

On the line where we are blanking the key, I had left out the "True" on the 4th parameter because when I read the wiki it said the default for the overwrite field was true, so I thought I could leave it blank and make it use the default.
This caused the "Error: expected 3 parameters" to show up, and the value would not clear. When I typed "true" into the box, it worked.

So then I thought of adding another parameter after the Overwrite field and typed random text into it and deleted the "true" from the overwrite field, and it still worked.

I guess Vox was just looking for some kind of 3rd parameter and it didn't matter where it came from. Just wanted to give a heads up, in case this might work in a similar situation.

Here is the code demonstrating what I mean:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.0.0-->
<command id="185" name="map key test" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Map.CreateTable</cmdType>
    <params>
      <param>Test</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Map.Set</cmdType>
    <params>
      <param>Test</param>
      <param>a1</param>
      <param />
      <param />
      <param>dsfds</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>Before: {M:Test.a1}.</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Map.Set</cmdType>
    <params>
      <param>Test</param>
      <param>a1</param>
      <param>{1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.AddText</cmdType>
    <params>
      <param>After: {M:Test.a1}.</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>map key test</phrase>
  <payloadDictation>payloadDictation: Regular</payloadDictation>
</command>

5
VoxCommando Basics and Core Features / Re: Delete a map key once set?
« on: July 04, 2014, 09:27:37 PM »
Oh yes, I didn't realize I had that second (.), thanks!!  :bonk

And thank you James for your example, this is an awesome program.

Quick question, I know its $30 for ver 1 and $40 for ver 1 & 2, is there a ver 2 only option, or not till the official ver 2 fully comes out?

6
VoxCommando Basics and Core Features / Re: Delete a map key once set?
« on: July 04, 2014, 08:05:50 PM »
So I tried something...

I know if you set a variable in a command and want to reuse the same variable but have it blank every time the command is executed you simply set the var to nothing on the first line of the command. Like so:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.0.0-->
<command id="172" name="variable test" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Results.SetVar</cmdType>
    <params>
      <param>a1</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>Before: {var.a1}.</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.SetVar</cmdType>
    <params>
      <param>a1</param>
      <param>{1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.AddText</cmdType>
    <params>
      <param>After: {var.a1}.</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>variable test</phrase>
  <payloadDictation>payloadDictation: Regular</payloadDictation>
</command>

I tried to do the same thing with Map.Set, but it did not work and gave me an error in the history saying it expected a 3rd parameter. So I thought, maybe if I combine the variable trick it would work, so I tried the following:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.0.0-->
<command id="184" name="map key test" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Results.SetVar</cmdType>
    <params>
      <param>a1</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Map.Set</cmdType>
    <params>
      <param>Test</param>
      <param>a1</param>
      <param> {var.a}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>Before: {M:Test..a1}.</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Map.Set</cmdType>
    <params>
      <param>Test</param>
      <param>a1</param>
      <param>{1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.AddText</cmdType>
    <params>
      <param>After: {M:Test.a1}.</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>map key test</phrase>
  <payloadDictation>payloadDictation: Regular</payloadDictation>
</command>

Now it does not give me an error in the history window but instead of a blank I get "map.error". Any ideas?

7
VoxCommando Basics and Core Features / Delete a map key once set?
« on: July 04, 2014, 07:50:57 PM »
Is it possible to delete a map key,value pair once it is set? If not, can you empty it?

Also, it seems that variables are global, as in set var.a in one command, ref it in another and it has the same value. Is there a way to make it local or confined to the command or command group? I know I could name each variable different, this is really just me wondering.

Thanks.

8
Its funny, I found this exact same script. It works really well.

Although I am having an issue with voxwav app (free version) when using this script. It causes it to run twice. I'm trying to nail down a procedure to replicate the error (trying to rule out that it also may be other things I'm doing).

Will let you know.

9
Ok, thanks Nime5ter. I will give this a shot. This is also why I was asking about dictating numbers, though now I am using the spelling as you suggested James.

Can you group Groups? When I installed Vox I chose the XBMC config and I like how it's broken up into groups but I would like to have all of those under one "XBMC Commands" group, is this possible?

10
Ah ok, then in my end goal scenario, how can i set up a command where vox would ask me a question and wait for a response (in dictation form). This was my original method but I could not get it to work, which is why I switched to a single command format, allow me to explain. (I would post code, but I deleted everything when I switched methods.)

Command 1
Phrase - "Lets play a game"
TTS "Great, let's play mad libs"
VC.TriggerEvent q1

Command 2
(event q1)
TTS "Please give me a noun."
*** This is where I could not figure out how to make vox wait for a response. I tried VC.pause but it wont listen while paused. ***
Results.SetVar a {1}
TTS "Good choice. | Excellent, thank you."
OSD.ShowText "You choose {var.a}."
VC. TriggerEvent q2

Command 3
This is a  copy of command 2 essentially

..and so on, etc.

Then last command would build the sentence using the above variables.

**** I just saw your post nime5ter, thanks for the confirmation idea, I like that. ****

11
Here is the code, but from what James said it may not be possible. I originally thought it might not be possible to have an empty payload which is why I was setting variables instead of using the payloads directly in the sentence formation.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 1.9.5.6-->
<command id="362" name="Mad Libs" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{1}&amp;&amp;Null</ifParams>
    <then />
    <else>
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>x</param>
          <param>{1}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{2}&amp;&amp;Null</ifParams>
    <then />
    <else>
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>y</param>
          <param>{2}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{3}&amp;&amp;</ifParams>
    <then />
    <else>
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>z</param>
          <param>{3}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>The {var.x} jumped over the {var.y} and startled the {var.z}.</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.SpeakSync</cmdType>
    <params>
      <param>The {var.x} jumped over the {var.y} and startled the {var.z}.</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>first word</phrase>
  <payloadDictation>payloadDictation: Regular</payloadDictation>
  <phrase>second word</phrase>
  <payloadDictation>payloadDictation: Regular</payloadDictation>
  <phrase>third word</phrase>
  <payloadDictation>payloadDictation: Regular</payloadDictation>
</command>

The end goal was to create a "vox game" that would go something like this:

Vox: "Please give me a noun."
Me: (payload dictation which gets saved to {var.a})

Vox: "Please give me an adjective."
Me: "Skip it" ({var.b} would be blank, and nothing would show up in the sentence when that variable is referenced)

Vox: "Please give me a verb."
Me: (payload dictation which gets saved to {var.c})

Then vox will plug in the variables to construct a sentence, and ideally the sentence itself would be pulled together using random sentence fragments from a map or payloadXML.

12
Lets say I have 3 payloads {1} - {3}, and I want to assign each one to a variable {var.a} - {var.c}, however if 1 of the payloads is empty then I do not want to assign that variable or have it be empty.

Then create a TTS sentence using the variables (think of Mad Libs), so the sentence would be formed like so:

The {var.a} jumped over the {var.b} and startled the {var.c}.

So you could say: dog, fence, cat and plug it into the sentence, or leave out the 2nd word and have that var be empty in the sentence.

Correct me if I'm wrong, but I believe you would use logic to determine if a payload is empty, like:

If A==B {2} null
then (leave this blank)
else Results.SetVar a {2}

I have tried testing for null and leaving it empty but "{2}" still shows up in the sentence. Any help would be appreciated.

Thanks

13
Thanks for the quick response.

I'll try that out, but to be sure if I want to output "76" I would have to say "7" and then "6", correct? Is there a way to say "76"?

14
VoxCommando Basics and Core Features / Help with payload dictation
« on: July 03, 2014, 06:28:04 PM »
Hello,

Just recently started using Vox and its wonderful!!

I was wondering, how do I dictate numbers?

I tried saying 11 but it came out as "eleven" (same result in windows sr), then I tried "numeral 11" which works in windows sr to produce "11" but in Vox it came out as "numeral eleven"

Am I missing something, or is there a way to convert it to number?

Thanks!

edit: For background this is to put a digit into a map field.

Pages: [1]