Author Topic: Cannot get VC.SetEventTimer event to actually function even though it is trigger  (Read 1864 times)

0 Members and 1 Guest are viewing this topic.

TheIntersect

  • Jr. Member
  • **
  • Posts: 9
  • Karma: 3
    • View Profile
I need some direction for how to use VC.SetEventTimer.  I am using Windows 10 under an administrator account with UAC off and I am running VoxCommando "as administrator."  I am running VC 2.2.4.1 with the program installed in "C:\Programs\VoxCommando\Setup01"  (*not* the Program Files directory).

Here is what I've tried:

1. I have a "testing" Group.  In that Group, I have a Command named "Timer Event."  I have a Phrase Command Part set to trigger when I say, "test event timer".  In the LCB (Logical Command Builder editor), I have this Action:  "VC.SetEventTimer" with the first parameter set to "3" (for a delay of 3 seconds) and the Event Name set to "OSD.HideOverlay."

  • Vox correctly detects my voice command and Vox History shows the megaphone icon next to "test event timer (90.3%)."
  • The next item in History shows a green gear icon with "VC.SetEventTimer:3&&OSD.HideOverlay"
  • The next item in History (3 seconds later according to the History time stamp) shows a red calendar item with a 9 on it and is "OSD.HideOverlay"
  • So, everything seems to be as it should be, except that the overlay is *not* actually hidden.
  • I have tried other commands as the 2nd parameter as well (e.g., VC.Standby, etc.] and the same thing happens--everything is correct in the History window, but Vox does not actually do the action/event/command (i.e., does not go to Standby mode).

2. I have also tried using a parameter of a named command that I have made instead of a built-in command. So, I have a "testing" Group.  In that Group, I have a Command named "Timer Event" and also have a Command named "Hide Overlay."  I have a Phrase Command Part for "Timer Event" set to trigger when I say, "test event timer".  In the LCB for "Timer Event", I have this Action:  "VC.SetEventTimer" with the first parameter set to "3" (for a delay of 3 seconds) and the Event Name set to "Hide Overlay".  For the Command named "Hide Overlay", I have LCB with this Action:  "OSD.HideOverlay".
  • When I manually click the green triangle next to "Hide Overlay" the Vox overlay is successfully hidden, so I know that Command is working when I manually trigger it.
  • However, as above, the Vox History shows that the voice command is recognized and 3 seconds later the Event named "Hide Overlay" shows as triggered, but the overlay is *not* actually hidden.
  • When hovering over the "Hide Overlay" command (or in #1 above, when hovering over the "VC.HideOverlay" command) in the History window, no error is given.  However, the popup tooltip shows "Commands triggered:" and nothing else--suggesting that no commands were triggered even though no error is reported.

I think I must just be misunderstanding the syntax or how to enter the parameter for what event/action to trigger after the delay.

Can someone point me in the right direction?    ::confused

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Yes. You are misunderstanding. Events do not actually do anything until you assign them to a command. The 2nd parameter in the VC.SetEventTimer action is just the name of the event.

https://voxcommando.com/mediawiki/index.php?title=Events

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
For future reference, when seeking support on the forum it's often easier to post the commands that you're running into challenges with (as long as there's no private/personal info in the commands that you're concerned about).

Basically, you can just select and Ctrl-C the command or command group in the VC editor window, then Ctrl-V into a code box on the forum.

Per the "Posting Your Code on the Forum" section of the wiki:

https://voxcommando.com/mediawiki/index.php?title=XML_on_the_forum
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

TheIntersect

  • Jr. Member
  • **
  • Posts: 9
  • Karma: 3
    • View Profile
@nime5ster--Right!  Thanks for that.  I (now) remember reading that in the intro-to-the-forum posts but forgot about being able to do that when it came down to it.  I appreciate your kind reminder.   :-[

@jitterjames thank you for explaining that.  I'd watched the videos and read the wiki, but had not quite understood that generating an event was separate from that event actually *doing* something--I had thought that when the event appeared in the History that meant that the event had actually *done* something. 

So, for others who might be struggling with this, here's what I did with my "test" to turn off the Vox overlay:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.4.1-->
<commandGroup open="True" name="testing" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="91" name="Timer Event" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>VC.SetEventTimer</cmdType>
      <params>
        <param>3</param>
        <param>User.MadeUp</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>test event timer</phrase>
  </command>
  <command id="69" name="Hide Overlay" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>OSD.HideOverlay</cmdType>
      <params />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>User.MadeUp</event>
  </command>
</commandGroup>

To summarize:  I created a Command that sets an event timer that causes the User.MadeUp event (not a "real" event, but it shows up in History and can be dragged to Command Groups to function as a trigger) to show up in the History window after 3 seconds.  I dragged the User.MadeUp event from the History window to a Command Group that has code to turn off the Vox Overlay.  So, now when I say, "test event timer" the User.MadeUp event appears in the History 3 seconds later which triggers the "Hide Overlay" Command Group to execute the actual OSD.HideOverlay command. 

It all makes sense now.  Thanks!   ;D



jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
I created a Command that sets an event timer that causes the User.MadeUp event (not a "real" event, but it shows up in History and can be dragged to Command Groups to function as a trigger)

It is a real event.  This is what an event is.

It works exactly the same way in EventGhost and in all programming languages (that I know of).

In computer programming, an event is like a trigger.  It's up to the program to either react to an event or not.  When the event is triggered many things could react to it, or maybe nothing happens. If you want to react to an event then you need to subscribe to it.  Dragging an event to a command is like having the command subscribe to the event.  More than one command in VoxCommando can be triggered by the same event.

JonPeyton

  • $upporter
  • Jr. Member
  • *****
  • Posts: 36
  • Karma: 3
    • View Profile
Im so glad people post these issues they are having (and extremely glad JJ and Nimester take their time to answer obviously.)
I've learned so much here that carries over into Python,Lua,PowerShell from folks asking questions (even the seemingly unnecessary one's [NOT that this one was unnecessary..]) and more experienced people giving patient answers.But of course mostly it helps me use VC more effectively!
I knew what events were and how they are used in VC but it was nice to hear it explained in a broad way as a trigger which by the way is also much the way Tasker uses events.Great stuff.
I am not a programmer,Developer or anything like that.My brain doesn't nimbly skip through those topics the way some of your's obviously do (JP is an Executive Chef ) So as a hobbyist code scribbler I appreciate the remedials sometimes  ::dis