Author Topic: Using a if statement  (Read 1912 times)

0 Members and 1 Guest are viewing this topic.

crawfofd

  • Jr. Member
  • **
  • Posts: 29
  • Karma: 3
    • View Profile
Using a if statement
« on: July 12, 2013, 07:03:41 PM »
I am trying to output (tts:speak) depending on what voice command is passed during the Listen action under Vox Commands. I thought I saw it somewhere that you can do a if a=b perform a action, but I've been through so many posts and videos I cant find what I need.  Anyone have any suggestions.

crawfofd

  • Jr. Member
  • **
  • Posts: 29
  • Karma: 3
    • View Profile
Re: Using a if statement
« Reply #1 on: July 12, 2013, 07:36:18 PM »
Never mind everyone.  I figured it out myself.  I found where you can use logic in the command builder.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Using a if statement
« Reply #2 on: July 12, 2013, 08:45:19 PM »
I am curious to know what you are doing.  :)

crawfofd

  • Jr. Member
  • **
  • Posts: 29
  • Karma: 3
    • View Profile
Re: Using a if statement
« Reply #3 on: July 12, 2013, 10:56:56 PM »
I wanted to to get a different reply to the listen action depending on what activates it. If my wife says 'lets start' she would be welcomed with her name. If I say 'lets go' I would be welcomed with my name. Just trying to personalize it.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Using a if statement
« Reply #4 on: July 13, 2013, 05:24:38 AM »
I wanted to to get a different reply to the listen action depending on what activates it. If my wife says 'lets start' she would be welcomed with her name. If I say 'lets go' I would be welcomed with my name. Just trying to personalize it.

Hi crawofod, you can personalisize it also as following:

Action: TTS.SpeakSync -> Hello {1}, what can I do for you? | Welcome {1}, I'm listening to you
The red character is the "pipe", or "vertical line" symbol on your keyboard, if you use it between text in your TTS.Speak action, VC will select one of the strings at random.  ;)

Action: VC.On

As first command phrase: here is, I am
As second a payloadList: Your Name, Wife Name, any other name
As third a phrase: lets start, lets go, listen <- you can set this phrases as "optional", so if you say "here is YOURNAME" that trigger VC also to ON mode

This is only a example

Kalle
« Last Edit: July 13, 2013, 11:48:45 AM by jitterjames »
***********  get excited and make things  **********

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Using a if statement
« Reply #5 on: July 13, 2013, 09:47:59 AM »
I am trying to output (tts:speak) depending on what voice command is passed during the Listen action under Vox Commands. I thought I saw it somewhere that you can do a if a=b perform a action, but I've been through so many posts and videos I cant find what I need.  Anyone have any suggestions.


Thanks, crawfofd, for pointing out a gap in the wiki documentation for the Logical Command Builder. We've now updated the documentation to explain the Logic Block.

The main wiki entry for the Logical Command Builder is here: http://voxcommando.com/mediawiki/index.php?title=Logical_Command_Builder

For information on using the Logic Block specifically see: http://voxcommando.com/mediawiki/index.php?title=Logic_Block
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)

crawfofd

  • Jr. Member
  • **
  • Posts: 29
  • Karma: 3
    • View Profile
Re: Using a if statement
« Reply #6 on: July 13, 2013, 11:12:28 AM »
Thanks Kalle and nime5ter, your responses were greatly appreciated. Kalle judging from your response I can see I have a lot to learn. I will try those examples today.

nime5ter thanks for updating the docs, reading them helps me a lot.  Again thanks all for the speedy responses and I look forward to learning more about this great software and working with a forum that seems to be pretty awesome.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Using a if statement
« Reply #7 on: July 13, 2013, 11:47:06 AM »
As an alternative to using logic blocks, you could also just create a second listen command, with whatever phrase(s) your wife wants to use.  In this case, I think either solution is fine, whichever is easiest for you.