Author Topic: How do I use inputs  (Read 1408 times)

Conclavice

  • Newbie
  • *
  • Posts: 10
  • All Hail Pfiel
How do I use inputs
« on: April 17, 2021, 04:31:39 PM »
I want my computer to ask me for a text input and then for it to use it as a variable but I don't know how to put variables into a input or quick input

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4758
  • RTFM
Re: How do I use inputs
« Reply #1 on: April 17, 2021, 04:35:36 PM »
You'd want to use the "{TXT:}" token to get the value of the variable you've set using the "Get User Input - Text" action as literal text, in the "Text" field of the "Quick Input" action, for example.

Tokens can be used in many actions. Usually the tooltip for a given field will mention whether it parses tokens.

The "Text (and Text-To-Speech) Tokens" section of the documentation contains more information (press F1 while VoiceAttack has focus to open VoiceAttackHelp.pdf in your default PDF viewer)

These topics may also be of use in addition to the official documentation:
Variables and tokens summed up
Control flow (If, Else, ElseIf, Loop, Jump) basics

Conclavice

  • Newbie
  • *
  • Posts: 10
  • All Hail Pfiel
Re: How do I use inputs
« Reply #2 on: April 17, 2021, 04:50:41 PM »
awesome, i got it. also i was wondering if I can get it to type something instantly instead of slowly like with quick input

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4758
  • RTFM
Re: How do I use inputs
« Reply #3 on: April 17, 2021, 04:59:27 PM »
The fastest to output text would be to paste it, which can be done using the "Set a Text Value to the Windows Clipboard" action and a keypress action that presses Ctrl-V (or Shift-Insert)


For literal typing, the "Quick Input" action can send keypresses quite rapidly, however there is an issue with the more recent versions of Windows 10 (2004 and onward, as far as I'm aware, though it doesn't happen on all machines) where Windows executes the keypresses less quickly, despite VoiceAttack issuing the exact same API calls as before.

You can try experimenting with the "Resource balance offset" option that can be found under the "Advanced" button on the "Edit a Command" window (as it is an advanced/experimental feature).
Even enabling that option with its default value of 1 yields a slight speed increase, and higher values even more so, though this does come at the cost of higher CPU load while the keypresses are processed.
Note that the option applies to all actions within a command, so be especially careful if you're using any loop actions and/or have the command set up to repeat itself.

Conclavice

  • Newbie
  • *
  • Posts: 10
  • All Hail Pfiel
Re: How do I use inputs
« Reply #4 on: April 17, 2021, 05:02:49 PM »
okay. it worked, thank you so much!