VoxCommando
New Features and Feature Requests => Feature Requests => Topic started by: PegLegTV on February 17, 2015, 03:53:05 PM
-
I've been using AutoHotKey scripts that are converted to .exe files that are using the Run command to trigger events in VC to launch some stuff in xbmc so I can keep track of certain things like if PTVL is running, but the downside is that when those .exe files are ran they trigger the event on all systems which normally wouldn't be a big deal if you edit the script to trigger a different event for each computer,
but if you transferred a setup to another computer to work on it, then you would have the event being triggered twice.
so I was thinking a good away to stop this and also save us some time by not having to modify the event triggered for each computer
we could use a new variable {System.IP} then we could have the AutoHotKey script (or command line) carry the System Ip in payload 1
then we could use a logic block to compare {System.IP} to {1} to determine if that event should be triggered
example:
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.8-->
<command id="456" name="example " 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>{System.IP}&&{1}</ifParams>
<then>
<action>
<cmdType>TTS.SpeakSync</cmdType>
<params>
<param>hello world</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else />
</if>
<event>Hello World</event>
</command>
AutoHotKey script that could be used to pass the IP Address as {1}
Run VoxCommando.exe -33000 "VC.TriggerEvent&&Hello World&&%A_IPADDRESS1%
If this doesn't make sense let me know and I'll try to explain it better
also Im not sure if a variable for System IP can be made or not
Thanks
-
Apologies in advance if I'm misunderstanding -- that's a lot to process. ^-^
I guess what I'm wondering is how a variable {System.IP} would be different from simply using 127.0.0.1 or "localhost"?
Edit: I was thinking in terms of the System IP always referring to "this computer", but of course if you need to pass the actual IP value of "this computer" to another computer, 127.0.0.1 is not going to cut it. So maybe that was my confusion.
-
sorry for the confusion,
if I run this with AutoHotKey
Run VoxCommando.exe -33000 "VC.TriggerEvent&&Hello World&&%A_IPADDRESS1%
it triggers EVENT "Hello world/{1}192.168.1.100" and sends that to all VC in the network
%A_IPADDRESS1% = The IP of the computer that ran that script
so I was thinking that if we had a variable in VC that showed the IPv4 Address (same IP Like you would see if you ran ipconfig in CMD promt) so that way the IP's could be compared
It doesn't have to be {System.IP} I just thought using something different then 127.0.0.1 or LocalHost would make it less confusing for others
another example
use it on Living room pc ---{System.IP}=192.168.1.100 (IPv4 Address)
use it on Laptop--- {System.IP}=192.168.1.130 (IPv4 Address)
hope I explained it better this time
-
OK, thanks for clarifying.
In the meantime, if it helps, you could use a bit of Python to generate a {var.myIP} variable on VC.Loaded (or whatever suits your needs).
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.7-->
<command id="278" name="get my IP" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>PY.ExecString</cmdType>
<params>
<param>import socket{CR}result=socket.gethostbyname(socket.gethostname())</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.SetVar</cmdType>
<params>
<param>myIP</param>
<param>{LastResult}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<params>
<param>{var.myIP}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<event>VC.Loaded</event>
</command>
At least, that works for me!
-
Thanks That works great ::banana
-
Groovy. :D