Author Topic: Use the same phrase in different categories  (Read 1070 times)

errspace

  • Guest
Use the same phrase in different categories
« on: March 18, 2019, 05:20:03 AM »
Can I use the same phrase as a command suffix to different command prefixes? Like, can I have the prefix "select radio channnel" with (say) suffixes of 0-9, and have the prefix "select TACAN channel" also have suffixes of 0-9? These two groups of suffixes would have different output sequences, which I think is the wrinkle here.

I don't seem to be able to do this as I get the "already used" warning, but I'm a new user and I don't know if I'm doing it right. I've tried putting the commands in different categories but it hasn't helped.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Use the same phrase in different categories
« Reply #1 on: March 18, 2019, 11:39:41 AM »
This is not possible at the moment. A feature request was made to see if it would be feasible to implement.


However, you can use dynamic command sections(VoiceAttackHelp.pdf page 16 and 17) to achieve the same goal.

E.G.
select radio channnel [0..9]
Code: [Select]
Press R key and hold for 0,06 seconds and release
Begin Text Compare : [{TXTNUM:"{CMD}"}] Equals '0'
    Press NumPad 0 key and hold for 0,06 seconds and release
Else If Text Compare : [{TXTNUM:"{CMD}"}] Equals '1'
    Press NumPad 1 key and hold for 0,06 seconds and release
Else If Text Compare : [{TXTNUM:"{CMD}"}] Equals '2'
    Press NumPad 2 key and hold for 0,06 seconds and release
Else If Text Compare : [{TXTNUM:"{CMD}"}] Equals '3'
    Press NumPad 3 key and hold for 0,06 seconds and release
Else If Text Compare : [{TXTNUM:"{CMD}"}] Equals '4'
    Press NumPad 4 key and hold for 0,06 seconds and release
Else If Text Compare : [{TXTNUM:"{CMD}"}] Equals '5'
    Press NumPad 5 key and hold for 0,06 seconds and release
Else If Text Compare : [{TXTNUM:"{CMD}"}] Equals '6'
    Press NumPad 6 key and hold for 0,06 seconds and release
Else If Text Compare : [{TXTNUM:"{CMD}"}] Equals '7'
    Press NumPad 7 key and hold for 0,06 seconds and release
Else If Text Compare : [{TXTNUM:"{CMD}"}] Equals '8'
    Press NumPad 8 key and hold for 0,06 seconds and release
Else If Text Compare : [{TXTNUM:"{CMD}"}] Equals '9'
    Press NumPad 9 key and hold for 0,06 seconds and release
End Condition
This will function pretty much like prefix/suffix would; Pressing R is what the prefix would do, pressing a numpad key is equivalent to the suffix.

The "{TXTNUM:}" token(VoiceAttackHelp.pdf page 142) will filter anything that's not a number from your spoken command phrase(represented by the "{CMD}" token), so you can add "TACAN" to the command name anywhere and it'll still work(I.E. you can duplicate the command without setting it up from scratch again).


I should also note that categories are only intended to organize commands for easier maintenance, they do not imply any relation or separation between those commands programmatically(although they can be used for the new "Set/GetSessionEnabledByCategory" methods for inline functions and plugins).

errspace

  • Guest
Re: Use the same phrase in different categories
« Reply #2 on: March 19, 2019, 04:02:45 PM »
Thank you, I will investigate dynamic commands.