Ну примерно вот так, я думаю.
I think, something like this:
Phobophile's example was a good start. Here is a command group that is based on his example.
I'm sorry that I used English in the commands, but better than bad Russian.
If you don't understand it, let me know. Then I can try to explain.
Again, this will only work if you use voice commands only. If you also use the buttons F and LeftShift F on your keyboard, then VoxCommando will no longer know what mode you are in and the math will be incorrect.
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.7-->
<commandGroup open="True" name="Flight Sim with DXInput" enabled="True" prefix="" priority="0" requiredProcess="" description="">
<command id="108" name="Flight Mode" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<if ifBlockDisabled="False" ifNot="False">
<ifType>(A)==(B)</ifType>
<ifParams>{var.eventSet}&&True</ifParams>
<then>
<action>
<cmdType>TTS.Speak</cmdType>
<params>
<param>Please wait still executing last order.</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>VC.StopMacro</cmdType>
<params />
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else />
</if>
<if ifBlockDisabled="False" ifNot="False">
<ifType>(A)==(B)</ifType>
<ifParams>{var.mode}&&</ifParams>
<then>
<action>
<cmdType>Results.SetVar</cmdType>
<params>
<param>mode</param>
<param>0</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>VC.StopMacro</cmdType>
<params />
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else />
</if>
<if ifBlockDisabled="False" ifNot="False">
<ifType>(A)==(B)</ifType>
<ifParams>{var.mode}&&{1}</ifParams>
<then>
<action>
<cmdType>TTS.Speak</cmdType>
<params>
<param>Maintaining current flap position.</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>VC.StopMacro</cmdType>
<params />
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else />
</if>
<if ifBlockDisabled="False" ifNot="False">
<ifType>(A)<(B)</ifType>
<ifParams>{var.mode}&&{1}</ifParams>
<then>
<action>
<cmdType>PY.ExecString</cmdType>
<params>
<param>result = abs({1} - {var.mode})</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.Speak</cmdType>
<params>
<param>Opening flaps for {LastResult} seconds</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<params>
<param>Opening flaps for {LastResult} seconds</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>DxInput.KeyDown</cmdType>
<params>
<param>F</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>VC.SetEventTimer</cmdType>
<params>
<param>{LastResult}s</param>
<param>releaseKey</param>
<param>F</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.SetVar</cmdType>
<params>
<param>eventSet</param>
<param>True</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.SetVar</cmdType>
<params>
<param>mode</param>
<param>{1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else>
<action>
<cmdType>PY.ExecString</cmdType>
<params>
<param>result = abs({var.mode} - {1})</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.Speak</cmdType>
<params>
<param>Retracting flaps for {LastResult} seconds</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<params>
<param>Retracting flaps for {LastResult} seconds</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>DxInput.KeyDown</cmdType>
<params>
<param>leftshift</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>DxInput.KeyDown</cmdType>
<params>
<param>F</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>VC.SetEventTimer</cmdType>
<params>
<param>{LastResult}s</param>
<param>releaseKey</param>
<param>F</param>
<param>leftshift</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.SetVar</cmdType>
<params>
<param>eventSet</param>
<param>True</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.SetVar</cmdType>
<params>
<param>mode</param>
<param>{1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</else>
</if>
<phrase>enter, switch to, choose, release, retract, begin</phrase>
<payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\flightsim.xml</payloadFromXML>
<event>vc.loaded</event>
</command>
<command id="206" name="release key" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>DxInput.KeyUp</cmdType>
<params>
<param>{1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>DxInput.KeyUp</cmdType>
<params>
<param>{2}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.SetVar</cmdType>
<params>
<param>eventSet</param>
<param>False</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.Speak</cmdType>
<params>
<param>Okay</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<event>releaseKey</event>
</command>
</commandGroup>
Yandex says:
Phobophile пример был хороший старт. Вот команда, группа, которая основана на его примере.
Я сожалею, что я использовал английский язык в команды, но лучше, чем плохой русский.
Если вы этого не понимаете, дайте мне знать. Тогда я могу попробовать объяснить.
Опять же, это будет работать только если вы используете только на голосовые команды. Если Вы также использовать кнопки F и LeftShift F на клавиатуре, затем VoxCommando больше не знаю, в каком режиме вы находитесь и математический расчет будет неверным.