Author Topic: Need HelppppppppppP!!!!!  (Read 6888 times)

0 Members and 1 Guest are viewing this topic.

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Need HelppppppppppP!!!!!
« Reply #15 on: October 28, 2014, 06:48:38 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

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Need HelppppppppppP!!!!!
« Reply #16 on: October 28, 2014, 09:39:02 PM »
... Another version of the same script:

Code: [Select]
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)
« Last Edit: October 28, 2014, 09:41:08 PM by nime5ter »
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

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Need HelppppppppppP!!!!!
« Reply #17 on: October 31, 2014, 09:33:43 AM »
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