Author Topic: Enabling and disabling specific commands  (Read 3253 times)

Malic

  • Full Member
  • ***
  • Posts: 105
Enabling and disabling specific commands
« on: February 10, 2019, 08:00:03 AM »
I have a series of commands that listen for when the users says a letter, that imports into a text file that I can then use for decoding  (part of Elite Dangerous eagle eye messaging)

The issue is that these are getting triggered all the time, mostly my mechanical keyboard keeps registering as "five" so it keeps filling out the txt file

Is there an easy way for me to enable and disable those specific series of commands with another command without needing to make a different profile or having to go into the edit a profile portion and turn them on/off?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Enabling and disabling specific commands
« Reply #1 on: February 10, 2019, 09:35:57 AM »
It's not possible to toggle the "When I say" checkbox, as you would manually to prevent a command from getting executed by speech, programatically.


You have a few options to mitigate this issue, among which are:

Make your command phrases longer so they're less likely to get triggered erroneously, and/or up to minimum confidence level.

Allow the command to trigger, but use a condition to have them do nothing if a variable has a certain value(you can combine this with the "Ignore an Unrecognized Word or Phrase" action to stop it from showing up in the log).

If you really want to stop the commands from executing by speech entirely, you'll have to use a token in the "When I say" field to make it blank at will. This requires using the "Reset the Active Profile" action to refresh the value of the variable, which also means stopping all commands.
« Last Edit: February 17, 2019, 06:20:44 PM by Pfeil »

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Enabling and disabling specific commands
« Reply #2 on: February 18, 2019, 11:46:01 PM »
Malic, I may have something for you soon.  At first it will be a proxy method to allow you to disable specific commands by name for a session, bypassing any options that may have the commands enabled (when I say, when I press buttons, etc.).

Malic

  • Full Member
  • ***
  • Posts: 105
Re: Enabling and disabling specific commands
« Reply #3 on: April 06, 2019, 07:04:55 PM »
awesome, look forward to it

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Enabling and disabling specific commands
« Reply #4 on: April 06, 2019, 07:12:59 PM »
Those proxy methods were implemented in v1.7.5, so you can use them already.

Quote from: VoiceAttackHelp.pdf page 182/183
SetSessionEnabled(string CommandName, Boolean Enabled) - This function temporarily
sets the enabled state of a command (indicated by name) during the current session (that
is, while VoiceAttack is running – the setting is not saved). If a command is able to be
executed (by voice, keyboard shortcut, mouse button, etc.), setting Enabled to false will
temporarily disable the command from executing. Setting Enabled to true again will re-
enable the command. Note: You will still be able to execute the command from right-
clicking on the, ‘Execute’ menu item from the command list.

SetSessionEnabled(Guid InternalID, Boolean Enabled) – This function works exactly like
the one above except that the command to be affected is located by its InternalID.

GetSessionEnabled(string CommandName) - This Boolean function returns the enabled
state of a command indicated by CommandName. This function returns true if the
indicated command is enabled during the current session and false if the command is
temporarily disabled (see, ‘SetSessionEnabled’ above). The command is located by its
name specified in CommandName.

GetSessionEnabled(Guid InternalID) - This Boolean function works exactly like,
‘GetSessionEnabled’ above, except the command is located by its InternalID.

SetSessionEnabledByCategory(string CategoryName, Boolean Enabled) - This function
temporarily sets the enabled state of a set of commands (indicated by category name)
during the current session (that is, while VoiceAttack is running – the setting is not saved).
If a command is able to be executed (by voice, keyboard shortcut, mouse button, etc.),
setting Enabled to false will temporarily disable the all commands of a given category from
executing. Setting Enabled to true again will re-enable the commands. Important: If you
edit the category of a command affected by this function, you will need to re-execute this
function in order for the changes to be effective.
Note: You will still be able to execute the affected commands from right-clicking on the,
‘Execute’ menu item from the command list.

GetSessionEnabledByCategory(string CategoryName) - This Boolean function returns
true if the indicated category is enabled and false if the category has been set to be
temporarily disabled during the current session (see, ‘SetSessionEnabledByCategory’
above).