Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - 'example VoiceAttack profile containing this inline: https://tinyurl.com/yd25v8tx
 - 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 responses as integer = 0
 - dim response() as string
 - dim NATO_List as string
 - Public Sub Main()
 - if (VA.GetText("~NATO_List") isNot nothing)
 - NATO_List = VA.GetText("~NATO_List")
 - if (VA.GetText("~response") isNot nothing)
 - 'Split spoken responses at the space which separates words
 - response = VA.GetText("~response").Split(New Char() {" "c})
 - 'Set variable for each word in the response inside NATO_List
 - for each word as string in response
 - if (NATO_List.Contains(word))
 - responses += 1
 - VA.SetText("~response_" + responses.ToString(), word)
 - end if
 - next
 - 'Set variable to return count of valid words
 - if (responses > 0)
 - VA.SetInt("~response_count", responses)
 - end if
 - end if
 - end if
 - End Sub
 - End Class
 
                    Add Comment                
                
                        Please, Sign In to add comment