1
WAY Off Topic / The xtermin8r has returned
« on: August 17, 2015, 11:36:02 AM »
hi everyone
im back.
Snap - The Ex-Terminator - 1992 (Rare)
im back.
Snap - The Ex-Terminator - 1992 (Rare)
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.
One important note about payloadXML files is that they can't be the only part of a command. You should have some other phrase before them that the engine can use to identify which command to execute (in the example above, "Play song" is said first).
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 1.9.5.1-->
<command id="859" name="Play Song" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>Launch</cmdType>
<params>
<param>F:\Appz\Media_Players\Winamp\Winamp.exe</param>
<param>{1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.SpeakSync</cmdType>
<params>
<param>{PF.1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>Play Song</phrase>
<payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">E:\Appz\Vox\Payloads\music.xml</payloadFromXML>
</command>
<payload>
<value>E:\Music\MIJ Selection\Lustral - Everytime (Nalin & Kane mix).mp3</value>
<phrase>Lustral Everytime Nalin & Kane mix</phrase>
</payload>
<p id="mpchc_np">« MPC-HC v1.7.3.0 • Snap - The Power • 00:00:00/00:04:24 • 19.4 MB »</p>
#-------------------------------------------------------------------------------
# Name: VC Payload Xml Generator
# Purpose: I need it
#
# Author: xtermin8r
#
# Created: 21/05/2014
# Copyright: (c) xtermin8r 2014
# Licence:
#-------------------------------------------------------------------------------
import re
import os
from re import findall
from xml.etree import ElementTree as ET
# Set the directories
mvpath = "E:\\Videos"
xmlpath = "E:\\Appz\\Vox\VC_187_Eden\\payloads\\musicvideos.xml"
#function get rid of unwanted characters
def cfix(zx):
global x
f2 = re.sub( '\s+', ' ', zx).strip()
f2 = f2.replace(" -", "")
f2 = f2.replace("-", "")
f2 = f2.replace(":", "")
x = f2
return x
#create the root </PayloadsRoot> <PayloadsRoot>
root_element = ET.Element("PayloadsRoot")
for dirName, subdirList, fileList in os.walk(mvpath):
for fname in fileList:
#create the first subelemet <payload> </payload>
pay_element = ET.SubElement(root_element, "payload")
#create the first child <value> </value>
child = ET.SubElement(pay_element, "value")
child.text = dirName +"\\" + fname
#create the second child <phrase> </phrase>
child = ET.Element("phrase")
#get the filename without the extension
fname = ('.').join(fname.split('.')[:-1])
#get rid of unwanted characters
cfix(fname)
fileName = x
child.text = fileName
#now append
pay_element.append(child)
def indent(elem, level=0):
i = "\n" + level*'\t'
if len(elem):
if not elem.text or not elem.text.strip():
elem.text = i + '\t'
if not elem.tail or not elem.tail.strip():
elem.tail = i
for elem in elem:
indent(elem, level+1)
if not elem.tail or not elem.tail.strip():
elem.tail = i
else:
if level and (not elem.tail or not elem.tail.strip()):
elem.tail = i
indent(root_element)
print ( ET.tostring(root_element) )
output_file = open(xmlpath, 'w' )
output_file.write( '<?xml version="1.0" encoding="utf-8"?>'+'\n' )
output_file.write( '<!--A VoxCommando Payload file-->' +'\n' )
output_file.write( ET.tostring(root_element) )
output_file.close()