Author Topic: if there was another way to do it  (Read 1326 times)

ALFADELTA

  • Newbie
  • *
  • Posts: 19
if there was another way to do it
« on: March 05, 2021, 02:53:16 AM »
hi everybody

when I say: altitude 1000 feet
this Command is executed in this way

Quote
Press ! § key and hold for 0.1 seconds and release
Press NumPad 0 key and hold for 0.1 seconds and release
Press NumPad 1 key and hold for 0.1 seconds and release
Press NumPad 0 key and hold for 0.1 seconds and release
Press NumPad 0 key and hold for 0.1 seconds and release
Press NumPad 0 key and hold for 0.1 seconds and release
Say, 'Altitude régler sur 1000 pied'

I say altitude 1000 ft VA executes the command in
Press the § key and then the numeric pad keys "NumPad 0 ,NumPad 1 ,NumPad 0 ,NumPad 0 ,NumPad 0

and for heading (set heading 150) speed ( set speed 241)

1 - What I want to do is to execute this command with out use the NumPad key

2 - if ther is a solution, is it the same as typing the numbers on the NumPad key and this solution ?

ps: I use a lua script for this Command and this script uses the NumPad key


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4758
  • RTFM
Re: if there was another way to do it
« Reply #1 on: March 05, 2021, 03:31:07 AM »
What do you mean by "with out use the NumPad key"?

If you're looking to make the output dynamic based on a spoken number, rather than using a set of predefined keypress actions, that could look something like
Code: [Select]
Set text [~output] to '{TXTNUM:"{CMD}"}'
Start Loop : Repeat [{EXP: 5 - {TXTLEN:~output}}] Times
    Set text [~output] to '0{TXT:~output}'
End Loop
Start Loop : Repeat From 0 to [{EXP:{TXTLEN:~output} - 1}], using indexer [~i]
    Set text [~outputChar] to '[NUM{TXTSUBSTR:~output:~i:1}]'
    Press variable key(s) [~outputChar] and hold for 0,05 seconds and release
End Loop

Which will take a spoken number up to five characters long, prepend zeroes if the input is less than five characters long, and type the input using the appropriate numpad keys.



If you're using a script to interface with a game, it's up to you to determine which options are available from within that script for communicating with an external application.

VoiceAttack can send keypresses (and mouse input), write to a file, run an application, or perform a HTTP GET request, using native actions.
If you are familiar with C# (or VB.NET), you could also add additional methods using a plugin or inline function.

ALFADELTA

  • Newbie
  • *
  • Posts: 19
Re: if there was another way to do it
« Reply #2 on: March 05, 2021, 05:04:03 AM »
it works very well :)

i make change

Quote
Press variable key(s) [~outputChar] and hold for 0,05 seconds and release

0,55
« Last Edit: March 05, 2021, 07:14:42 AM by ALFADELTA »