Author Topic: Help me understand some strange behavior  (Read 3862 times)

Zaal

  • Newbie
  • *
  • Posts: 4
Help me understand some strange behavior
« on: April 03, 2024, 05:19:21 PM »
Can someone tell me why these two commands will allow me to start/stop VA listening without problem:
Code: [Select]
when I say: stop listen

Stop VoiceAttack listening

Code: [Select]
When I say : start listen

Start VoiceAttack listening

But if I do something that I thought would be more streamlined into a single command, I cannot get VA to resume listening.

Code: [Select]
when I say: listen

Set small int (condition) [LISTENING] value to the converted value of {STATE_LISTENING}
Begin Small Integer Compare : [LISTENING] Equals 1
    Stop VoiceAttack listening
Else
    Start VoiceAttack listening
End Condition

The script will get VA to stop listening, but when I run it a second time VA will not change it's status to 'Listening' after the first iteration.

I was worried that having 'listen' as part of the separate start/stop commands that I changed their names and set them to voice disabled during my testing.

This is probably something really small and stupid but I'm just trying to understand the logic. Thanks.


Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2831
Re: Help me understand some strange behavior
« Reply #1 on: April 03, 2024, 10:28:58 PM »
Your logic is correct, however, since you are triggering the command by voice by saying, 'listen', listening is then disabled.  From then on, of course, VA will ignore spoken phrases (I know you get that by now - this is for those reading along ;)).

The reason why it works as separate commands for you is because VoiceAttack has a feature built in that was created initially to specifically handle exactly your situation - that is, you want to issue a simple spoken command to start listening when listening is off with little fuss.  As you know, if listening is off, VoiceAttack is actually still listening but not executing commands.  However, if the first action of any normally-ignored-because-listening-is-off command happens to be 'start listening', VoiceAttack will just go ahead and execute the command.

This feature is also to execute any command when listening is off (not just simply turning listening on and off).  The drawback being that listening is then turned on - which means it wont work for your conditional command, as listing will always be turned on and then immediately turned off through the logic.  For your conditional command to work, you would have to circumvent listening by going into Profile Options and setting up 'Override listening if my spoken command begins with:'.  If your override is, 'Computer', you would have to say, 'Computer listen' if listening was off.  I do have a (very, very) long-standing todo item to add an option to allow a command to be executed when listening is off (and then listening stays off).

On a side note, the logic you have could be replaced with 'Toggle Listening' action, which will do the toggling behind the scenes for you (no variables needed).

Hope that makes sense!

Zaal

  • Newbie
  • *
  • Posts: 4
Re: Help me understand some strange behavior
« Reply #2 on: April 03, 2024, 11:55:28 PM »
Thanks, Gary. I sometimes think I'm going crazy when I'm trying to figure out how some of these pieces fit together and I've spent an inordinate time within the help file which just makes me feel more insane.