Author Topic: Custom commands / Command editor tree help  (Read 9358 times)

0 Members and 4 Guests are viewing this topic.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Custom commands / Command editor tree help
« Reply #15 on: June 19, 2013, 05:46:49 AM »
Ok so I have set the launch.hidden command to the VC.Loaded event. When I start vox it comes up in the history as being exectuted but there is an orange box around it and the Amuletusb app doesnt open at all.
I think it might be the format of the path to the amuletusb.exe? In the path parameter for the launch.hidden action I simply put "I:\HTPC\Vox Commando 1.1\AmuletUSB.exe".
Is this correct?
use the icon with the 3 squares right in the command builder, this open a extra window where you can pick the file.
let me know if it works  ;)
***********  get excited and make things  **********

jmizzle

  • Jr. Member
  • **
  • Posts: 10
  • Karma: 0
    • View Profile
Re: Custom commands / Command editor tree help
« Reply #16 on: June 19, 2013, 06:02:02 AM »
Yes well it opened Amuletusb.exe on startup that way however it is not minimized but rather focused on top of vox?

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="Amulet Hidden" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="436" name="Hide Amulet on Launch" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Launch.Hidden</cmdType>
      <cmdString>I:\HTPC\voxcommando 1.1\AmuletUSB.exe</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>VC.Loaded</event>
  </command>
</commandGroup>

This is my command ^

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Custom commands / Command editor tree help
« Reply #17 on: June 19, 2013, 07:14:17 AM »
Yes well it opened Amuletusb.exe on startup that way however it is not minimized but rather focused on top of vox?

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="Amulet Hidden" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="436" name="Hide Amulet on Launch" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Launch.Hidden</cmdType>
      <cmdString>I:\HTPC\voxcommando 1.1\AmuletUSB.exe</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>VC.Loaded</event>
  </command>
</commandGroup>

This is my command ^

mmhh, ok let us try a other way  ;)
1. create a shortcut for the amuletusb on desktop
2. right click on the link and open properties
3. on "link tab" is a option for open minimized
I'm not sure this will work, but I have also a other option :bignod
create a action with keyboard emulation, you need follow keys to minimize a window: [ALT]+[SPACE]+ n

A third option: use the attached amuletMINstart.bat (open it before using and check the correct path of the amulet)

Have fun  ;)
« Last Edit: June 19, 2013, 07:45:01 AM by Kalle »
***********  get excited and make things  **********

jmizzle

  • Jr. Member
  • **
  • Posts: 10
  • Karma: 0
    • View Profile
Re: Custom commands / Command editor tree help
« Reply #18 on: June 19, 2013, 07:32:58 AM »
mmhh, ok let us try a other way  ;)
1. create a shortcut for the amuletusb on desktop
2. right click on the link and open properties
3. on "link tab" is a option for open minimized
I'm not sure this will work, but I have also a other option :bignod
create a action with keyboard emulation, you need follow keys to minimize a window: [ALT]+[SPACE]+ n

Hehe yeah that was of the first things I tried lol didnt work.
I know there are 3rd party apps out there that will do this for me but was hoping to do it in vox. I mean it isnt really a big deal if we can't.
But I will try your last option.
So do i need to create an xml file for the keyboard emu? Can u walk me through this if it isnt too complicated? Thanks

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Custom commands / Command editor tree help
« Reply #19 on: June 19, 2013, 07:49:10 AM »
Hehe yeah that was of the first things I tried lol didnt work.
I know there are 3rd party apps out there that will do this for me but was hoping to do it in vox. I mean it isnt really a big deal if we can't.
But I will try your last option.
So do i need to create an xml file for the keyboard emu? Can u walk me through this if it isnt too complicated? Thanks
test first my third option with the batchfile.
To create keyboard emulation search the sendkey action in the command builder - it is easy, I'm sure you figured out.
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Custom commands / Command editor tree help
« Reply #20 on: June 19, 2013, 07:54:55 AM »
Let me look into this amulet minimise situation. If I can't find an easy fix, I will update the AmuletUSB program itself.  Actually I was thinking of putting it into a plugin anyway.

XBMC.softmute won't work on Frodo, none of the XBMC.* commands will. Try xJSON.softmute

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Custom commands / Command editor tree help
« Reply #21 on: June 19, 2013, 07:57:32 AM »
But if the system softmute works, it is preferable I think.  Depends on your scenario.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Custom commands / Command editor tree help
« Reply #22 on: June 19, 2013, 08:03:53 AM »
I don't see a good way to automatically hide it. I will need to modify the program.  The reason I never considered this a priority, is that I almost never restart my computer. I see no reason to do that. :)

I will fix.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Custom commands / Command editor tree help
« Reply #23 on: June 19, 2013, 08:19:26 AM »
If you're looking for a solution until James modifies the program, you can try the code below. Just tested it on my machine and it seems to work here. It launches AmuletUSB and uses keyboard emulation to hide it when you launch VC, so if you automatically launch VC on startup this should also launch and minimize automatically. You'll need to change the file path for AmuletUSB, of course.

... You might need to add a VC.Pause action between the Launch and Focus actions.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="427" name="DoIt" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>ProcessRunning</ifType>
    <ifParams>AmuletUSB&amp;&amp;</ifParams>
    <then>
      <action>
        <cmdType>OSD.ShowText</cmdType>
        <cmdString>AmuletUSB is already running.</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>Launch</cmdType>
        <cmdString>C:\Users\naomi\Desktop\VC XBMC\VoxCommandoExtras\AmuletUSB.exe</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Window.Focus</cmdType>
        <cmdString>AmuletUSB</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>SendKeys</cmdType>
        <cmdString>{tab}</cmdString>
        <cmdRepeat>4</cmdRepeat>
      </action>
      <action>
        <cmdType>SendKeys</cmdType>
        <cmdString>{enter}</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <event>VC.Loaded</event>
</command>
« Last Edit: June 19, 2013, 08:37:58 AM by nime5ter »
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)

jmizzle

  • Jr. Member
  • **
  • Posts: 10
  • Karma: 0
    • View Profile
Re: Custom commands / Command editor tree help
« Reply #24 on: June 19, 2013, 09:39:23 AM »
test first my third option with the batchfile.
Tried creating a batch file with the minimize command but didnt work.

If you're looking for a solution until James modifies the program, you can try the code below. Just tested it on my machine and it seems to work here. It launches AmuletUSB and uses keyboard emulation to hide it when you launch VC, so if you automatically launch VC on startup this should also launch and minimize automatically. You'll need to change the file path for AmuletUSB, of course.

... You might need to add a VC.Pause action between the Launch and Focus actions.

^ Thanks that worked perfectly. Its all starting to make sense to me now :)

I got the Random movie working as well. I think it was conflicting with another command i had created when I was messing around trying to get it working.

My last question for now (I promise lol) is being able to talk to my PC and it understands what i'm saying. Like at the start of james' new video.
For example if I get the PC to ask me if I would like to hear some music and then dependant on what I reply (yes/no) it will either play a song (yes) or ask 'ok then how about a movie?'
Is it just as simple as creating a bunch of commands to respond to a phrase. Or does it use the IF and THEN logic (which i am not too familiar with)?
I mean I can create a command that whenever the word 'yes' is said at any stage then it will play a song. But then this command would conflict if I say 'yes' to 'ok then how about a movie'
???
« Last Edit: June 19, 2013, 09:42:32 AM by jmizzle »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Custom commands / Command editor tree help
« Reply #25 on: June 19, 2013, 10:10:25 AM »
In the demo scenario that I posted to youtube, I am using some tricks to make this happen.  Mostly I am using the confirmation commands.

Let's say I have a command (A) that is triggered when I get home.  You could do this by saying "honey I'm home" or if you have the equipment, you could trigger this command using a motion sensor that sends an event to VC (which is what I have done).

This command (A) will use TTS.Speak to ask you if you would like to listen to music.  Then it will use VC.TellVox to call another command (B) which will play the music.

Command B is a command that requires confirmation.  So when it is started by the tellvox action, it will wait for confirmation.  If it gets a confirmation, then it will play music.

I will try to put together a sample for you that makes it easy to set up what you want.  First it will offer music, then if you say "no" it will offer a movie.  I assume that you want all this to happen in XBMC.  For the sake of this demo I will assume that XBMC is already running and ready to accept actions that will play music, or video. 

Does that sound OK?

jmizzle

  • Jr. Member
  • **
  • Posts: 10
  • Karma: 0
    • View Profile
Re: Custom commands / Command editor tree help
« Reply #26 on: June 19, 2013, 10:20:00 AM »
Yes please sounds good James,
Thanks :)
« Last Edit: June 19, 2013, 11:37:51 AM by jmizzle »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Custom commands / Command editor tree help
« Reply #27 on: June 19, 2013, 12:49:56 PM »
I added this sample with an explanation of how it works to the XML exchange:

http://voxcommando.com/forum/index.php?topic=1117.0

jmizzle

  • Jr. Member
  • **
  • Posts: 10
  • Karma: 0
    • View Profile
Re: Custom commands / Command editor tree help
« Reply #28 on: June 21, 2013, 12:37:22 AM »
Wow exactly what I was looking for. Thanks James and everyone else for your help. Much appreciated.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Custom commands / Command editor tree help
« Reply #29 on: June 21, 2013, 12:47:10 PM »
I have updated the amuletUSB program.  Now it will autohide on startup, as long as it has connected properly.

The new version is in the extra tools: http://voxcommando.com/downloads.asp