News:

There is a soft-mute function which we use with the commands like "What song is this?" There is one for system volume, one for each of: MediaMonkey, XBMC, iTunes, MediaPortal.

Main Menu

Best method for long delays ?

Started by xtermin8r, December 28, 2012, 08:09:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

xtermin8r

hola

I need a delay of 8 seconds between 2 commands. i have tried vc.pause, what other methods are there that do not freeze voxcommando ?
Neural Net Based Artificial Intelligence.

jitterjames

use VC.SetEventTimer

it works similar to VC.TriggerEvent but with a delay

xtermin8r

Quote from: jitterjames on December 28, 2012, 09:31:03 PM
use VC.SetEventTimer

it works similar to VC.TriggerEvent but with a delay

muchas gracias
Neural Net Based Artificial Intelligence.

xtermin8r

Problem with VC.SetEventTimer, doesn't seem to work, any ideas ?

[attachment=1]
Neural Net Based Artificial Intelligence.

Dave

vc.SetEventTimer triggers an event after a specific time, so you can't use it in exactly the same way like vc.pause.
take a look here:
http://voxcommando.com/mediawiki/index.php?title=Actions#SetEventTimer

xtermin8r

@Dave
thanks for the reply, the thing is i dont want to trigger another event, it means that i will need to trigger an event for every long delay i need , makes no sense.
Neural Net Based Artificial Intelligence.

jitterjames

It is what it is.  I think for your purposes you should be able to use either method, but the trigger event action is obviously for triggering events, and requires two parameters, not one.

You can also include a payload in your event to make it more versatile.  In this case the event could be "key press" and the payload could be the key.  In the command that is triggered by the event, you can use {1} to get the value of the key.

Dave

you could use logic blocks if you don't want to trigger 3 different events...
try this!
[attachment=1]




xtermin8r

Thanks Dave, i will give it a shot.
Neural Net Based Artificial Intelligence.

jitterjames

#9
here is an alternative method:

<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="delayed keys" enabled="True" prefix="" priority="0" requiredProcess="" description="">
 <command id="823" name="first command" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
   <action>
     <cmdType>XBMC.ExecBuiltin</cmdType>
     <cmdString>playmed...</cmdString>
     <cmdRepeat>1</cmdRepeat>
   </action>
   <action>
     <cmdType>VC.SetEventTimer</cmdType>
     <cmdString>5&amp;&amp;presskeys&amp;&amp;a</cmdString>
     <cmdRepeat>1</cmdRepeat>
   </action>
   <action>
     <cmdType>VC.SetEventTimer</cmdType>
     <cmdString>10&amp;&amp;presskeys&amp;&amp;w</cmdString>
     <cmdRepeat>1</cmdRepeat>
   </action>
 </command>
 <command id="840" name="press keys" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
   <action>
     <cmdType>SendKeys</cmdType>
     <cmdString>{1}</cmdString>
     <cmdRepeat>1</cmdRepeat>
   </action>
   <event>presskeys</event>
 </command>
</commandGroup>

xtermin8r

#10
@James

Your method  does not work properly. both VC.SetEventTimer are triggered together.
Neural Net Based Artificial Intelligence.

jitterjames

Weird.  I tested it here and it worked perfectly.  How did you implement it?  did you copy and paste or recreate it by hand?

xtermin8r

Neural Net Based Artificial Intelligence.

jitterjames

I can't explain it.  Works exactly as expected on my system.

Can you send me your voicecommands.xml ?

here's the group again as an exported xml file, just in case...

jitterjames

 >:(

You may have copied and pasted, but then you ust have edited it, because I just looked at your image again, and you changed the delay of 10 seconds to a delay of 5, so both are delayed by 5 seconds, so that is why they both fire at the same time!  You just need to change the second one back to 10 seconds and it will work perfectly.