Advertisement
SemlerPDX

Get List of Profiles for Get-Choice box

Aug 14th, 2020
919
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 2.07 KB | None | 0 0
  1. ' AVCS CORE System Inline-Function for VoiceAttack -  Load AVCS Profile Names List Variables for Get Choice Box
  2. '  by SemlerPDX Aug2020
  3. '  VETERANS-GAMING.COM
  4.  
  5. Imports Microsoft.VisualBasic
  6. Imports System
  7. Imports System.Collections
  8. Imports System.Collections.Generic
  9. Imports System.Data
  10. Imports System.Drawing
  11. Imports System.Diagnostics
  12. Imports System.Windows.Forms
  13. Imports System.Linq
  14. Imports System.Xml.Linq
  15. Imports System.Threading.Tasks
  16.  
  17. Public Class VAInline
  18.     dim profile as string = ""
  19.     dim usersProfile as string = ""
  20.     dim coreProfile as string = ""
  21.     dim profileList as string = ""
  22.     dim usersList as string = ""
  23.     dim contents() as string
  24.     dim entry() as string
  25.    
  26.     Public Sub Main()
  27.        
  28.         if ((VA.GetText("~avcs_core_profile")) IsNot nothing)
  29.             coreProfile = VA.GetText("~avcs_core_profile")
  30.         end if
  31.        
  32.         if ((VA.GetText("~avcs_profiles_list")) IsNot nothing)
  33.             'Split contents of profiles list into array separated by the newline
  34.             contents = VA.GetText("~avcs_profiles_list").Split(new string() {Environment.NewLine},StringSplitOptions.None)
  35.             for each line as string in contents
  36.                 if (not(line = ""))
  37.                     'In each line, isolate Var Name/Val via '=' and format string for Get Choice Box
  38.                     entry = line.Split("=")
  39.                     if ((entry) IsNot nothing)
  40.                         if (not(((entry(0).StartsWith("AVCS_PROFILE_AVCSCORE")) and (not(entry(1).Contains(coreProfile))))))
  41.                             profileList = entry(1) + ";" + profileList
  42.                         end if
  43.                     end if
  44.                 end if
  45.             next 'loop around to the next line in the profiles list
  46.            
  47.             for profileIndex as integer = 0 to 10
  48.                 if ((vaProxy.Utility.ParseTokens("{PROFILE:" + profileIndex.ToString() + "}")) IsNot nothing)
  49.                     usersProfile = vaProxy.Utility.ParseTokens("{PROFILE:" + profileIndex.ToString() + "}")
  50.                     if (not(usersProfile = ""))
  51.                         if (not(usersProfile.StartsWith("AVCS")))
  52.                             usersList = usersProfile + ";" + usersList
  53.                         end if
  54.                     end if
  55.                 end if
  56.             next
  57.            
  58.             VA.SetText("~avcs_profiles_list", profileList)
  59.             VA.SetText("~avcs_user_profiles_list", usersList)
  60.         end if
  61.    
  62.     End Sub
  63. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement