News:

HOT TIP! Enable the History Window in the main UI when trying to problem solve. It provides a handy log of what is happening. Roll over lines in the History to get more details.

Main Menu

Need HelppppppppppP!!!!!

Started by Haddood, October 26, 2014, 09:36:50 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Haddood

Quote from: jitterjames on October 27, 2014, 06:40:03 PM

This behaviour is not limited to scrape, or regex, it applies to all actions.  In theory we could probably put an option on an action to instruct VC not do replacements on its params, but I'm not sure it is worth the trouble to implement, or worth complicating the UI, for such a special case.

@ James I think it is one of the most powerful features in VC ... for example I use it with the LAN monitor script (discussed in ping phones)
Results.SetVar {1} Home ... so VC create variables as needed ...rather than hard-coded ... it is one of the basic requirements for AI is that the program can create its own variables ..

@nime5ter .... this is amazing .... will open much possibilities for me .... thank you, thank you.
When Voice command gets tough, use hand gestures

nime5ter

#16
... Another version of the same script:

import xml.etree.ElementTree as ET
tree = ET.parse('voicecommands.xml')
root = tree.getroot()

def getGroups():

   vc.callAction('OSD.ShowText','Command Groups:&&8000&&-10',None)
   vc.callAction('PayloadXML.Clear','payloads\\vcGroups.xml',None)

   groups =root.findall("./*[@enabled='True']")

   for group in groups:
       idx = groups.index(group)+1
       name = group.get('name')
       vc.callAction('OSD.AddText',str(idx)+'. '+name,None)
       vc.callAction('TTS.Speak',name,None)
       vc.callAction('PayloadXML.AddPair','payloads\\vcGroups.xml&&%s&&%s, group %d&&True'%(name,name,idx),None)
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

Haddood

it is impressive how efficient Python can get ... thanks nime5ter ... there is a lot to learn from these 2 solutions
When Voice command gets tough, use hand gestures