Advertisement
SemlerPDX

AVCS QCC Delete Selected Macro Data variables

Aug 14th, 2020
1,093
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.79 KB | None | 0 0
  1. ' Quick Command Creator Inline-Function for VoiceAttack -  Get Command Index for Delete Function, remove phrase data variables
  2. '  by SemlerPDX Jun2020
  3. '  VETERANS-GAMING.COM
  4.  
  5.  
  6. Imports Microsoft.VisualBasic
  7. Imports System
  8. Imports System.Text
  9. Imports System.Collections
  10. Imports System.Collections.Generic
  11. Imports System.Data
  12. Imports System.Drawing
  13. Imports System.Diagnostics
  14. Imports System.Windows.Forms
  15. Imports System.Linq
  16. Imports System.Xml.Linq
  17. Imports System.Threading.Tasks
  18.  
  19. Public Class VAInline
  20.     dim dataIndex as integer = 0
  21.     dim dataList() as string
  22.     dim data() as string
  23.     dim phrase as string
  24.     dim phrases as string
  25.     dim phraseArray() as string
  26.     dim phrasesFinal as new list(of string) ()
  27.    
  28.     Public Sub Main()
  29.        
  30.         if VA.GetText("~avcs_qcc_command_list") IsNot nothing
  31.            
  32.             dataList = (VA.GetText("~avcs_qcc_command_list").Replace("[(1)]", "↑").Replace("[(2)]", "→").Replace("[(3)]", "↓").Replace("[(4)]", "←")).Split("↑")
  33.            
  34.             if(dataList) IsNot nothing
  35.                
  36.                 for each dataFunc as string in dataList
  37.                     if not(dataFunc = "")
  38.                         if(dataFunc.StartsWith("QCC#"))
  39.                             data = dataFunc.Split("#")
  40.                             dataIndex = Convert.ToInt32(data(1))
  41.                             VA.SetInt("~avcs_qcc_index", dataIndex)
  42.                         end if
  43.                     end if
  44.                 next
  45.                
  46.                 if (dataIndex > 0)
  47.                     if ((VA.GetText("AVCS_QCC_COMMAND_" + dataIndex.ToString())) IsNot nothing)
  48.                         phrases = (VA.GetText("AVCS_QCC_COMMAND_" + dataIndex.ToString()))
  49.                         phraseArray = vaProxy.Utility.ExtractPhrases(phrases, true, true)
  50.                         for each phrase in phraseArray
  51.                             if ((not(phrase = "")) and (not(phrasesFinal.Contains(phrase))))
  52.                                 phrasesFinal.Add(phrase)
  53.                                 VA.SetText(phrase, nothing)
  54.                             end if
  55.                         next
  56.                     end if
  57.                 end if
  58.            
  59.             end if
  60.        
  61.         end if
  62.    
  63.     End Sub
  64. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement