5
« on: July 09, 2019, 04:39:00 AM »
Hi Both,
Thank you for taking the time to help me. Firstly - apologies - I had thought my example was clear but I agree I think in my attempt to make things clear I have done quite the opposite.
The goal is I have a list of radio stations in a payload. This Payload is dynamically created every so often - so stations listed change. As such I wanted to be able to "search" for if a station existed. Playing desired station is easy enough.
nime5ter, your example is as good as what I need. Thank you. I was so close in my own attempts. I (perhaps oddly) could not see how to obtain the value of a <Return> but can now see that you pass the action, then use {LastResult}, this is now clear. I also tried PayloadXML.GetPhrase myself but see now that I need to pass PayloadXML.GetValue to be then able to use PayloadXML.GetPhrase. I seemingly was staring at the answers but just was not paying enough attention!
This small help has really got me up and running - thank you.
My code now looks like the below - admittedly this is a altered version of the example by nime5ter but as good as there.
</command>
<command id="454" name="Search my list for {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>PayloadXML.GetValue</cmdType>
<params>
<param>Payloads\produce.xml</param>
<param>{1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<if ifBlockDisabled="False" ifNot="False">
<ifType>LastActionSuccess</ifType>
<ifParams>&&</ifParams>
<then>
<action>
<cmdType>PayloadXML.GetPhrase</cmdType>
<params>
<param>Payloads\produce.xml</param>
<param>{LastResult}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<params>
<param>Found: {LastResult}</param>
<param>5000</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else>
<action>
<cmdType>OSD.ShowText</cmdType>
<params>
<param>{1} was not found in the payload file</param>
<param>5000</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</else>
</if>
<phrase>Search my list for</phrase>
<payloadDictation>payloadDictation: Regular</payloadDictation>
</command>
</commandGroup>
What I am finding now however is that it does not always trigger off the back of the phrase so as such I may need to simply improve the phrase used? If I search for something I know is there it always works. If I search for something random it some times does and sometimes does not trigger the event to search if it is present or not. Any thoughts around this? Am I right in thinking I should just play with the phrase used?
I am using TellVox at present and not my actual voice however - not sure if this makes any difference? I assume not.
Thank you in advance.