Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - zen_SuR

Pages: [1]
1
Feature Requests / dynamic command creation/updating
« on: September 18, 2017, 10:30:43 PM »
i just want to be able to include an external often changing xml with commands and combine it with an existing commandtree on restart of vc.

kind of a command on VC.Loaded that says something along the line:

"VC.importcommands from http://www.yourdomain.de/vc_commands.xml in group xy"

or is there a workaround i am not aware of?

2
Integration Ideas / Faster TTS.Speech - Response Management
« on: August 31, 2017, 09:04:01 PM »
Faster TTS.Speech - Response Management

Description:
Create a php-formular based on your commandtree. In this formular you can put in tts-strings that are used randomly when the command is called. On the fly. With 1 Click.


Setup/Update Online Formular:
======================================
- Put the attached folder "formupdate" in your vc-installfolder.
- copy attached xml into your command tree
- open the command called "setup". Put in the path to your webspace were you will store the php formular
- Press Save and Execute.
- upload the now generated contents of the folder "/formupdate/to_webspace" to your webspace
- set chmod for files to 777 in your ftp client
- go to your webspace and open input_formular.php.
- try my examplecommands and see if it works.

now for the commandstructure for it to work:
- write "public" as first word in the command description (this field). Only then command will show up in the form.
- set "vc.setEventTimer" with "1" for one second and set the eventname to "speak" as the first action.


what do you guys think of it? I use it to fastly fill up tts commandresponses to make vc feel way more immersive without even having to open the commandbuilder. I also let friends fill it out for me so i get surprise-answers from voxcommando.

3
RegEx (Regular Expressions) / Getting enabled commands using regex
« on: August 30, 2017, 11:24:55 AM »
hy,

i am trying to get an AND regex to work for the last few hours and i give up and hope somebody here can help me...

first i file.read my voicecommands.xml
Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<VoiceCommands version="2.2.3.7" space="preserve" date="8/30/2017 12:00:00 AM">
    <commandGroup open="True" name="Vox Commands" enabled="True" prefix="" priority="1" requiredProcess="" description="">
        <command id="8" name="Don't Listen" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>VC.Standby</cmdType>
                <params />
                <cmdRepeat>1</cmdRepeat>
            </action>
            <phrase>ignore me,don't listen,stand by</phrase>
        </command>
        <command id="31" name="Listen" enabled="true" alwaysOn="True" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>VC.On</cmdType>
                <params />
                <cmdRepeat>1</cmdRepeat>
            </action>
            <phrase>computer, start listening, pay attention</phrase>
            <event>Amulet.On</event>
        </command>
        <command id="32" name="Option" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>VC.Option</cmdType>
                <params />
                <cmdRepeat>1</cmdRepeat>
            </action>
            <phrase>Option,Select Option</phrase>
            <payloadRange>1,10</payloadRange>
        </command>
        <command id="43" name="Vox Off" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>VC.Off</cmdType>
                <params />
                <cmdRepeat>1</cmdRepeat>
            </action>
            <phrase>vox off, vox commando off,disable vox commando</phrase>
            <event>Amulet.Off</event>
        </command>
    </commandGroup>
    <commandGroup open="True" name="Show Help" enabled="True" prefix="" priority="0" requiredProcess="" description="">
        <command id="266" name="Show help" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>Help.ShowAll</cmdType>
                <params />
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>TTS.Speak</cmdType>
                <params>
                    <param>These are all of the voice commands for this configuration.</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <phrase>Show help, What can I say</phrase>
        </command>
        <command id="264" name="Show active commands" enabled="False" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>Help.ShowEnabled</cmdType>
                <params />
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>TTS.Speak</cmdType>
                <params>
                    <param>These are voice commands in groups that are enabled.</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <phrase>Show</phrase>
            <phrase optional="true">me, us</phrase>
            <phrase optional="true">the</phrase>
            <phrase>active, enabled</phrase>
            <phrase optional="true">voice</phrase>
            <phrase>commands</phrase>
        </command>
        <command id="305" name="Send help" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>File.Read</cmdType>
                <params>
                    <param>Resources\help.css</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>File.Write</cmdType>
                <params>
                    <param>plugins\TCP\html\commandhelp2.html</param>
                    <param>&lt;html&gt;&lt;head&gt;&lt;meta charset="UTF-8"&gt;&lt;title&gt;aaaaa&lt;/title&gt;&lt;style&gt;{LastResult}asdfasdf&lt;/style&gt;&lt;/head&gt;</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>Results.RegExSingle</cmdType>
                <params />
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>Help.ShowEnabled</cmdType>
                <params />
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>TTS.Speak</cmdType>
                <params>
                    <param>Refreshing command list on your local web server.</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>File.Read</cmdType>
                <params>
                    <param>commandhelp2.html</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>Results.RegExSingle</cmdType>
                <params>
                    <param>&lt;/head&gt;(.*?)$</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>File.Append</cmdType>
                <params>
                    <param>plugins\TCP\html\commandhelp2.html</param>
                    <param>{Match.1}</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <phrase>Send help</phrase>
        </command>
    </commandGroup>
    <commandGroup open="True" name="reuters" enabled="True" prefix="" priority="0" requiredProcess="" description="">
        <command id="1173" name="Reuters news" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{Match.{i}.1} is the headline (where {i} is 1st, 2nd, 3rd ... headlines)&#xD;&#xA;{Match.{i}.2} is the URL linking to each full story.&#xD;&#xA;&#xD;&#xA;There will be more matches stored in the payload xml file than the 4 announced in the command.">
            <action>
                <cmdType>Scrape</cmdType>
                <params>
                    <param>http://feeds.reuters.com/reuters/worldNews</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>Results.RegExSingle</cmdType>
                <params>
                    <param>&lt;item&gt;.*?&lt;title&gt;(.*?)&lt;.*?description.*?&lt;link&gt;(.*?)&lt;</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>PayloadXML.Clear</cmdType>
                <params>
                    <param>reuters.xml</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>PayloadXML.AddPair</cmdType>
                <params>
                    <param>reuters.xml</param>
                    <param>{Match.{i}.2}</param>
                    <param>{i}</param>
                </params>
                <cmdRepeat>{#M}</cmdRepeat>
            </action>
            <action>
                <cmdType>OSD.ShowText</cmdType>
                <params>
                    <param>Today's Reuter's headlines ({#M} total):</param>
                    <param>10000</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>OSD.AddText</cmdType>
                <params>
                    <param>{i}. {Match.{i}.1}.</param>
                </params>
                <cmdRepeat>4</cmdRepeat>
            </action>
            <action>
                <cmdType>TTS.SpeakSync</cmdType>
                <params>
                    <param>Here are the top 4 of {#M} Reuter's headlines</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>TTS.Speak</cmdType>
                <params>
                    <param>{i}. {Match.{i}.1}.</param>
                </params>
                <cmdRepeat>4</cmdRepeat>
            </action>
            <phrase>What's the news from Reuters</phrase>
        </command>
        <command id="1179" name="More from Reuters" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Shows the first line of the story. Reads out the whole story.&#xD;&#xA;&#xD;&#xA;If you want it to only read the first few sentences, you can change {#M} to a specific number. So, if you use 2 instead of {#M} then it will read the first 3 lines, because the first sentence is read in the separate, TTS.Speak - {Match.1} action. (Or, you can create a separate &quot;shut up&quot; command with a TTS.Stop action to stop the TTS in mid-read. This would allow you to hear as much or as little as you wanted.)">
            <action>
                <cmdType>Launch.OpenURL</cmdType>
                <params>
                    <param>{1}</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>Scrape</cmdType>
                <params>
                    <param>{1}</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>Results.RegExSingle</cmdType>
                <params>
                    <param>="description"\scontent="(.*?)"</param>
                    <param><![CDATA[ ]]></param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>TTS.Speak</cmdType>
                <params>
                    <param>{Match.1}</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>OSD.ShowText</cmdType>
                <params>
                    <param>{Match.1}</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>Results.RegExSingle</cmdType>
                <params>
                    <param>&lt;.*?midArticle_\d"&gt;&lt;/span&gt;&lt;p&gt;(.*?)&lt;</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>TTS.Speak</cmdType>
                <params>
                    <param>{Match.{i}}</param>
                </params>
                <cmdRepeat>{#M}</cmdRepeat>
            </action>
            <phrase>Tell me more about headline number</phrase>
            <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">reuters.xml</payloadFromXML>
        </command>
    </commandGroup>
</VoiceCommands>

and with my regex i want all commandnames where enabled="true"...

no matter what i tried i dont get it.

the first half of the regex works very well:
Code: [Select]
<command\s[^<>]*name="(.*?)"gives me all the command names... but yeah... all of them. and i just want the enabled commands.

here would be a quick regex-onlinetool in case somebody wants to try... http://regexr.com/

Pages: [1]