I try to make logic with short time to execute some commands if time is higher then 19:00 but can't make it right.
So what i do.. If NOT (A)<(B), A is {ShortTime} and B is 19:00 then "do my command"
I try with LastResult and always get message in VC "Can't evaluate. Not a number".
Know is the simple thing but i get confused :o
Unfortunately, the time variables are not interpreted as numbers because of the : in the middle, so you can't directly use < / > logic on them. One option is to use regex.
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 1.9.5.6-->
<command id="269" name="Playing with time" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>Results.RegEx</cmdType>
<params>
<param>(\d*):(\d*)</param>
<param />
<param>{ShortTime}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<if ifBlockDisabled="False" ifNot="False">
<ifType>(A)<(B)</ifType>
<ifParams>1900&&{Match.1}</ifParams>
<then>
<action>
<cmdType>OSD.ShowText</cmdType>
<params>
<param>The time is later than 19:00.</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else>
<action>
<cmdType>OSD.ShowText</cmdType>
<params>
<param>It is still too early.</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</else>
</if>
</command>
Another option would be to use Python.
* Not shown here...
The third option is to use a custom time variable rather than {ShortTime} (http://voxcommando.com/mediawiki/index.php?title=Variables).
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 1.9.5.6-->
<command id="280" name="Playing with time" 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>1930&&{DtCustom.HHmm}</ifParams>
<then>
<action>
<cmdType>OSD.ShowText</cmdType>
<params>
<param>The time is later than 19:30.</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else>
<action>
<cmdType>OSD.ShowText</cmdType>
<params>
<param>It is still too early.</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</else>
</if>
</command>
TNX nime5ter, using first option and it's work great!
M.
For what it's worth I think the third option makes the most sense.