Author Topic: how execute this command  (Read 2471 times)

toto313

  • Newbie
  • *
  • Posts: 28
how execute this command
« on: October 19, 2019, 12:17:12 PM »
hello
sorry for my bad English this is a google translation

I would like to control the flaps of my plane under fsx, I use the keys F5 F6 F7 F8, F5 enters the flaps completely, F6 return the flapss of a notch, F7 to take out the flaps of a notch, F8 to full out flaps , the flaps in 5 position 5° 10° 15° and 35° I want that ,when the flaps is in position 5°and i said flaps 15° voice attack execute this command press twice on F7, I want voiceattack know what position is the flaps and what does he have to do must do to perform this command


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: how execute this command
« Reply #1 on: October 19, 2019, 12:26:00 PM »
If you have a system like this where it is possible to return the control to a known position, the approach that works best, provided the target application allows for it, is to use that known position as a starting point for all movement, so that the positioning can be absolute rather than relative to the current position.

E.G. if you want the flaps at 15°, you can use F8 to go to full flaps (35°), but then immediately use F6 to go to 15°.

To minimize the amount of keypresses, as you have two known positions in this case, you could use F5 for 0°, 5°, and 10° (as you have an odd number of positions it doesn't really matter which side you come at the center from), and F8 for 15° and 35°.

toto313

  • Newbie
  • *
  • Posts: 28
Re: how execute this command
« Reply #2 on: October 19, 2019, 12:36:58 PM »
how to do that ?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: how execute this command
« Reply #3 on: October 19, 2019, 12:49:49 PM »
You could do that with a single command:

When I say: flaps [up;0;5;10;15;35;full]
Code: [Select]
Begin Condition : [{CMD}] Ends With 'up' OR [{CMD}] Ends With ' 0'
    Press F5 key and hold for 0,01 seconds and release
Else If Text Compare : [{CMD}] Ends With ' 5'
    Press F5 key and hold for 0,01 seconds and release
    Press F7 key and hold for 0,01 seconds and release
Else If Text Compare : [{CMD}] Ends With '10'
    Press F5 key and hold for 0,01 seconds and release
    Press F7 key and hold for 0,01 seconds and release
    Press F7 key and hold for 0,01 seconds and release
Else If Text Compare : [{CMD}] Ends With '15'
    Press F8 key and hold for 0,01 seconds and release
    Press F6 key and hold for 0,01 seconds and release
Else
    Press F8 key and hold for 0,01 seconds and release
End Condition

Note the space for " 0" and " 5"; Without it, those branches would trigger for "10", "15", and "35" as well.

If not all keypresses for a single setting are registered, you may need to add a delay between each press.


You can press F1 while VoiceAttack has focus to open VoiceAttackHelp.pdf in your default PDF reader; That document has information on VoiceAttack's features.

toto313

  • Newbie
  • *
  • Posts: 28
Re: how execute this command
« Reply #4 on: October 19, 2019, 01:24:54 PM »
thank you I will try later

toto313

  • Newbie
  • *
  • Posts: 28
Re: how execute this command
« Reply #5 on: October 20, 2019, 09:08:40 AM »
sorry
how to do that ( Begin Condition" : [{CMD}] Ends With 'up' OR [{CMD}] Ends With ' 0') ?

I can do that "Begin Text Compare : [{CMD}] Ends With ''up' OR [{CMD}] Ends With ' 0''

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: how execute this command
« Reply #6 on: October 20, 2019, 09:12:19 AM »
You need to use the condition builder to add a condition that checks more than one value at a time (technically it can be done using "{EXP:}" as well, but that's needlessly complicated).

If you have added a condition already, right-click it and choose "Edit With Condition Builder"; Otherwise you can select the "Compound Condition Builder" option when creating the condition rather than the "Single Condition" option.

toto313

  • Newbie
  • *
  • Posts: 28
Re: how execute this command
« Reply #7 on: October 20, 2019, 10:30:05 AM »
I still have Begin Text Compare and not Begin Condition
where is the mistake


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: how execute this command
« Reply #8 on: October 20, 2019, 10:33:19 AM »
You can't just paste
Code: [Select]
'up' OR [{CMD}] Ends With ' 0'into that field...it's two conditions, each in their own tab to form an OR, checking whether the literal text"{CMD}" ends with "up", or the literal text "{CMD}" ends with " 0".

toto313

  • Newbie
  • *
  • Posts: 28
Re: how execute this command
« Reply #9 on: October 20, 2019, 10:56:01 AM »
that's what I do





Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: how execute this command
« Reply #10 on: October 20, 2019, 11:04:36 AM »
You're checking whether the spoken command, represented by the "{CMD}" token, ends with the literal text "'up' OR [{CMD}] Ends With ' 0'", which it cannot as all the possible options are listed as dynamic command sections ("up", "0", "5","10", "15", "35", and "full").

You need to check whether "{CMD}" ends with "up", then you need to add a second condition using the compound condition builder by clicking "Add Set (Or)", that checks whether "{CMD}" ends with " 0".

toto313

  • Newbie
  • *
  • Posts: 28
Re: how execute this command
« Reply #11 on: October 20, 2019, 11:24:15 AM »
Yes




Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: how execute this command
« Reply #12 on: October 20, 2019, 11:35:33 AM »
You'll need to remove the single quotes.

E.G.
Code: [Select]
upinstead of
Code: [Select]
'up'
The action list and the condition builder will still show a set of single quotes, which is normal as those visually separate the text for your comparison from the rest of the text, but if you see two sets (as you have there in your screenshots), the compare can't work as the single quotes won't be part of the actual recognized phrase.

toto313

  • Newbie
  • *
  • Posts: 28
Re: how execute this command
« Reply #13 on: October 20, 2019, 11:47:35 AM »
Pfeil Thank you for your help :)