Author Topic: "Send command to this target" commands are slow and delayed.  (Read 1677 times)

Malic

  • Full Member
  • ***
  • Posts: 102
"Send command to this target" commands are slow and delayed.
« on: January 30, 2024, 12:46:23 AM »
Found out my previous issue was that the commands were not sending to the program (mainly to prevent them from activating in other programs by accident)

But have now come across a new issue.  This is happening with both voiced, and commands that are looking at the act of pressing or releasing a button

When the command has "Send command to this target" UNchecked, it is instantaneous, as you would expect.

When the command has it checked, and it points to only run on a program, it seems to have a 3-5 second delay between the command or button press and it activating as expected.

Active window does not have any delay, also as expected.

I have tried changing recognition types, command type, and not sure what else it could be.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4763
  • RTFM
Re: "Send command to this target" commands are slow and delayed.
« Reply #1 on: January 30, 2024, 01:03:13 AM »
This would most likely mean that Windows is taking that long after being instructed to bring the window to the foreground to get back to VoiceAttack so the command can continue.

Given that you appear to be targeting based on a process name, the time it takes for Windows to find the window associated with that process may also be a factor.


Note that wildcards can be used for targeting, E.G. if the window title is "Star Citizen v0.01", you could try targeting that using
Code: [Select]
Star Citizen*
A disadvantage of this method would be that then any window starting with "Star Citizen" would match, including folders open in Explorer, etc...

Malic

  • Full Member
  • ***
  • Posts: 102
Re: "Send command to this target" commands are slow and delayed.
« Reply #2 on: January 30, 2024, 03:30:45 AM »
What I am wondering then, I am actively playing the game that it directed to send to, is there something I can change to stop the delay because it already the focus?. 

The reason I have this was originally to stop accidently pressing a series of buttons on everything else if I am tabbed out of the game

For example, Ctrl + N is the command I have to contact ATC

Ctrl + N will open a new window in my internet browser if it is in focus

I have it point to starcitizen to keep it from accidently doing anything in anything else.  it is just the delay is brutal for the commands that use button presses for things that are instant without this option on become delayed by several seconds

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4763
  • RTFM
Re: "Send command to this target" commands are slow and delayed.
« Reply #3 on: January 30, 2024, 03:45:59 AM »
Not with the targeting option, though depending on where the delay is occurring, you could try using something like this at the top of your command instead:
Code: [Select]
Begin Text Compare : [{ACTIVEWINDOWPROCESSNAME}] Does Not Equal 'StarCitizen'
    Display window '~StarCitizen' As [Show]
End Condition

The "~" prefix instructs VoiceAttack to only check process names, rather than the default behavior of checking window titles first, and only checking process names if no match was found.
It likely won't make much of a difference in performance, but it's worth using just in case (plus it can help prevent unintentional matches, in case a window title happens to match the process name)

The "Perform a Window Function" action may be less reliable at bringing a window to the foreground than the targeting system (this is not VoiceAttack-specific, it's a known "quirk" of the underlying Windows API function)