SemlerPDX

AVCS Ready or Not SWAT Target Command Parser v4

Jan 16th, 2022 (edited)
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 2.56 KB | None | 0 0
  1. ' Ready Or Not - AVCS4 SWAT Standard & Target Command Parsing
  2. '  by SemlerPDX Dec2021
  3. '  VETERANS-GAMING.COM
  4. ' --Parses spoken commands to retrieve config variables and resolve to VoiceAttack Global Keypress Variables
  5.  
  6.  
  7. Imports Microsoft.VisualBasic
  8. Imports System
  9.  
  10. Public Class VAInline
  11.     dim replacementWords() as string
  12.     dim replacement() as string
  13.     dim actionTypes() as string
  14.     dim deployOptions() as string
  15.     dim targeting as string = ""
  16.     dim actionType as string = ""
  17.     dim deployOption as string = ""
  18.     dim actionTypeKey as string = ""
  19.     dim deployOptionKey as string = ""
  20.     dim swatCommand as string
  21.    
  22.    
  23.     Public Sub Main()
  24.         if ((VA.GetText("~~avcs_swat_cmd")) isNot nothing)
  25.        
  26.             swatCommand = VA.GetText("~~avcs_swat_cmd")
  27.             if (swatCommand <> "")
  28.                
  29.                 if ((VA.GetText("AVCS_RON_Action_Types")) isNot nothing)
  30.                     actionTypes = VA.GetText("AVCS_RON_Action_Types").Split(";")
  31.                 end if
  32.                
  33.                 if ((VA.GetText("AVCS_RON_Deploy_Options")) isNot nothing)
  34.                     deployOptions = VA.GetText("AVCS_RON_Deploy_Options").Split(";")
  35.                 end if
  36.                
  37.                 if (swatCommand.Contains("target"))
  38.                     targeting = " Target"
  39.                 end if
  40.                
  41.                 if ((VA.GetText("AVCS_RON_Target_Replacements")) isNot nothing)
  42.                     replacementWords = VA.GetText("AVCS_RON_Target_Replacements").Split(";")
  43.                     for each replacementSet as string in replacementWords
  44.                         if (replacementSet.Contains(","))
  45.                             replacement = replacementSet.Split(",")
  46.                             swatCommand = swatCommand.Replace(replacement(0), replacement(1))
  47.                         end if
  48.                     next
  49.                 end if
  50.                
  51.                 for i as integer = 0 to actionTypes.Length - 1
  52.                     if (swatCommand.Contains(actionTypes(i)))
  53.                         actionType = actionTypes(i)
  54.                         if ((vaProxy.ParseTokens("{TXT:{TXT:AVCS_RON_Menu1_" + actionType + targeting + "}}")) isNot nothing)
  55.                             actionTypeKey = vaProxy.ParseTokens("{TXT:{TXT:AVCS_RON_Menu1_" + actionType + targeting + "}}")
  56.                             VA.SetText("~avcs_action_type_key", actionTypeKey)
  57.                         end if
  58.                         exit for
  59.                     end if
  60.                 next
  61.                
  62.                 for i as integer = 0 to deployOptions.Length - 1
  63.                     if (swatCommand.Contains(deployOptions(i)))
  64.                         deployOption = deployOptions(i)
  65.                         if ((vaProxy.ParseTokens("{TXT:{TXT:AVCS_RON_Menu2_Deploy_" + deployOption + "}}")) isNot nothing)
  66.                             deployOptionKey = vaProxy.ParseTokens("{TXT:{TXT:AVCS_RON_Menu2_Deploy_" + deployOption + "}}")
  67.                             VA.SetText("~avcs_deploy_option_key", deployOptionKey)
  68.                             VA.SetBoolean("~avcs_deploying", true)
  69.                         end if
  70.                         exit for
  71.                     end if
  72.                 next
  73.                
  74.             end if
  75.         end if
  76.     End Sub
  77.  
  78. End Class
Add Comment
Please, Sign In to add comment