' Quick Command Creator Inline-Function for VoiceAttack - Find available QCC Commands and set to Master Command Variables
' by SemlerPDX Jun2020
' VETERANS-GAMING.COM
Imports Microsoft.VisualBasic
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Data
Imports System.Drawing
Imports System.Diagnostics
Imports System.Windows.Forms
Imports System.Linq
Imports System.Xml.Linq
Imports System.Threading.Tasks
Public Class VAInline
dim cmdIndex as Int32
dim cmdMax as Int32 = 25
dim phrase as string
dim phrases as string
dim phraseDataCheck as string
dim phrasesUnique as string = ""
dim macrosUnique as string = ""
dim listenUnique as string = ""
dim toggleUnique as string = ""
dim phraseArray() as string
dim phrasesFinal as new list(of string) ()
Public Sub Main()
if ((VA.GetInt("AVCS_QCC_COMMAND_MAX")) IsNot nothing)
cmdMax = Convert.ToInt32(VA.GetInt("AVCS_QCC_COMMAND_MAX"))
end if
'Load all QCC Commands to main phrase(s) variable
for cmdIndex = 1 to cmdMax
if (((VA.GetText("AVCS_QCC_COMMAND_" + cmdIndex.ToString())) IsNot nothing) and ((VA.GetText("AVCS_QCC_DATA_COMMAND_" + cmdIndex.ToString())) IsNot nothing))
phrases = (VA.GetText("AVCS_QCC_COMMAND_" + cmdIndex.ToString()))
phraseArray = vaProxy.Utility.ExtractPhrases(phrases, true, true)
for each phrase in phraseArray
if ((not(phrase = "")) and (not(phrasesFinal.Contains(phrase))))
phrasesFinal.Add(phrase)
phrasesUnique = phrasesUnique + phrase + ";"
VA.SetText(phrase, cmdIndex.ToString())
end if
next
end if
if (((VA.GetText("AVCS_QCC_MACROS_" + cmdIndex.ToString())) IsNot nothing) and ((VA.GetText("AVCS_QCC_DATA_MACROS_" + cmdIndex.ToString())) IsNot nothing))
phraseDataCheck = VA.GetText("AVCS_QCC_DATA_MACROS_" + cmdIndex.ToString())
phrases = (VA.GetText("AVCS_QCC_MACROS_" + cmdIndex.ToString()))
phraseArray = vaProxy.Utility.ExtractPhrases(phrases, true, true)
for each phrase in phraseArray
if ((not(phrase = "")) and (not(phrasesFinal.Contains(phrase))))
phrasesFinal.Add(phrase)
'Check for commands with Start/Toggle VoiceAttack listening
if ((not(phraseDataCheck.Contains("1[(2)]VALB"))) and (not(phraseDataCheck.Contains("1[(2)]VALT"))))
macrosUnique = macrosUnique + phrase + ";"
else
if (phraseDataCheck.Contains("1[(2)]VALB"))
listenUnique = listenUnique + phrase + ";"
else if (phraseDataCheck.Contains("1[(2)]VALT"))
toggleUnique = toggleUnique + phrase + ";"
end if
end if
'Set Key Data Variable Name to Variable Name including each Quick Command Phrase
VA.SetText(phrase, cmdIndex.ToString())
end if
next
end if
next
'Create Variables for 'When I Say' Tokens containing all QCC phrases
if not (phrasesUnique = "")
VA.SetText("AVCS_QCC_COMMANDS", phrasesUnique)
else
VA.SetText("AVCS_QCC_COMMANDS", nothing)
end if
if not (macrosUnique = "")
VA.SetText("AVCS_QCC_MACROS", macrosUnique)
else
VA.SetText("AVCS_QCC_MACROS", nothing)
end if
if not (listenUnique = "")
VA.SetText("AVCS_QCC_LISTEN", listenUnique)
else
VA.SetText("AVCS_QCC_LISTEN", nothing)
end if
if not (toggleUnique = "")
VA.SetText("AVCS_QCC_LISTEN_TOGGLE", toggleUnique)
else
VA.SetText("AVCS_QCC_LISTEN_TOGGLE", nothing)
end if
End Sub
End Class
Comments
0 B
|0 👍
/0 👎
0 B
|👍
/👎