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 ?
use VC.SetEventTimer
it works similar to VC.TriggerEvent but with a delay
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
Problem with VC.SetEventTimer, doesn't seem to work, any ideas ?
[attachment=1]
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
@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.
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.
you could use logic blocks if you don't want to trigger 3 different events...
try this!
[attachment=1]
Thanks Dave, i will give it a shot.
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&&presskeys&&a</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>VC.SetEventTimer</cmdType>
<cmdString>10&&presskeys&&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>
@James
Your method does not work properly. both VC.SetEventTimer are triggered together.
Weird. I tested it here and it worked perfectly. How did you implement it? did you copy and paste or recreate it by hand?
hi James
copy and paste.
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...
>:(
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.
hi everyone
After giving it some thought, I figured out why it did not work.
what must be done is something like this
Scenario 1 : keys will be pressed 5 seconds apart.
VC.SetEventTimer 5 presskey a after 5 seconds key a gets pressed
VC.SetEventTimer 10 presskey b after another 5 seconds b gets pressed
VC.SetEventTimer 15 presskey c after another 5 seconds key c gets pressed
NOT THIS
Scenario 2 : all keys will pressed consecutively after 5 seconds.
VC.SetEventTimer 5 presskey a
VC.SetEventTimer 5 presskey b
VC.SetEventTimer 5 presskey c
thanks to everyone who helped.