' Quick Command Creator Inline-Function for VoiceAttack - Check for Existing Phrases already in use
' 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 saveFile as string = ""
dim phrase as string
dim phrases as string
dim commands as string = ""
dim phraseArray() as string
dim errorCount as integer = 0
dim errorsFinal as new list(of string) ()
Public Sub Main()
if (VA.GetText("~save_file") IsNot nothing)
saveFile = VA.GetText("~save_file")
end if
if (VA.GetText("AVCS_QCC_COMMANDS") IsNot nothing)
commands = VA.GetText("AVCS_QCC_COMMANDS")
end if
if (VA.GetText("AVCS_QCC_MACROS") IsNot nothing)
commands = VA.GetText("AVCS_QCC_MACROS") + ";" + commands
end if
if (VA.GetText("AVCS_QCC_LISTEN") IsNot nothing)
commands = VA.GetText("AVCS_QCC_LISTEN") + ";" + commands
end if
if (VA.GetText("AVCS_QCC_LISTEN_TOGGLE") IsNot nothing)
commands = VA.GetText("AVCS_QCC_LISTEN_TOGGLE") + ";" + commands
end if
if (VA.GetText("~avcs_qcc_phrase") IsNot nothing)
phrases = (VA.GetText("~avcs_qcc_phrase"))
phraseArray = vaProxy.Utility.ExtractPhrases(phrases, true, true)
for each phrase in phraseArray
if ((not(phrase = "")) and (not(errorsFinal.Contains(phrase))))
if ((commands.Contains(phrase)) or (saveFile.Contains(phrase)) or(vaProxy.Command.Exists(phrase)))
errorsFinal.Add(phrase)
errorCount = errorCount + 1
VA.SetText("~avcs_qcc_error_" + errorCount.ToString(), phrase)
end if
end if
next
end if
if(errorCount > 0)
VA.SetInt("~avcs_qcc_error_count", errorCount)
end if
End Sub
End Class
Comments
0 B
|0 👍
/0 👎
0 B
|👍
/👎