Advertisement
SemlerPDX

AVCS QCC Get Command Actions Info from Data List String

Aug 14th, 2020
1,047
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 5.58 KB | None | 0 0
  1. ' Quick Command Creator Inline-Function for VoiceAttack -  Evaluate Command Functions Data List
  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 levelVAS as string
  21.     dim stepIndex as integer
  22.     dim stepCount as integer = 0
  23.     dim dataList() as string
  24.     dim macroSteps() as string
  25.     dim macroData() as string
  26.     dim thisStep() as string
  27.     dim thisAction as string
  28.     dim thisFunc as string
  29.     dim debugCheck as boolean
  30.     dim debugCount as integer = 0
  31.     dim debugColor as integer = 3
  32.     dim debugText as string = ""
  33.    
  34.     Public Sub Main()
  35.        
  36.         if (VA.GetBoolean("AVCS_Debug_ON") IsNot nothing)
  37.             debugCheck = VA.GetBoolean("AVCS_Debug_ON")
  38.         end if
  39.        
  40.         if (VA.GetText("~~AVCS_QCC_COMMAND") IsNot nothing)
  41.            
  42.             dataList = (VA.GetText("~~AVCS_QCC_COMMAND").Replace("[(1)]", "↑").Replace("[(2)]", "→").Replace("[(3)]", "↓").Replace("[(4)]", "←")).Split("↑")
  43.            
  44.             if (dataList IsNot nothing)
  45.                 for each dataFunc as string in dataList
  46.                     if (not(dataFunc = ""))
  47.                         if (dataFunc.StartsWith("QCCKEY"))
  48.                             thisStep = dataFunc.Split("/")
  49.                             VA.SetText("~QCCKEY", thisStep(1))
  50.                             if (debugCheck)
  51.                                 debugText = "QCC Simple Command - " + dataFunc + " = " + thisStep(1).ToString()
  52.                                 debugCount += 1
  53.                                 debugColor = 5
  54.                                 VA.SetText("~avcs_qcc_debug_" + debugCount.ToString(), debugText)
  55.                                 VA.SetInt("~avcs_qcc_debug_wclr_" + debugCount.ToString(), debugColor)
  56.                             end if
  57.                         else if (dataFunc.Contains("PTTON"))
  58.                             VA.SetBoolean("~PTTON", true)
  59.                             if (debugCheck)
  60.                                 debugText = "ENABLED OPTION - " + dataFunc
  61.                                 debugCount += 1
  62.                                 debugColor = 5
  63.                                 VA.SetText("~avcs_qcc_debug_" + debugCount.ToString(), debugText)
  64.                                 VA.SetInt("~avcs_qcc_debug_wclr_" + debugCount.ToString(), debugColor)
  65.                             end if
  66.                         else if (dataFunc.Contains("AFMON"))
  67.                             VA.SetBoolean("~AFMON", true)
  68.                             if (debugCheck)
  69.                                 debugText = "ENABLED OPTION - " + dataFunc
  70.                                 debugCount += 1
  71.                                 debugColor = 5
  72.                                 VA.SetText("~avcs_qcc_debug_" + debugCount.ToString(), debugText)
  73.                                 VA.SetInt("~avcs_qcc_debug_wclr_" + debugCount.ToString(), debugColor)
  74.                             end if
  75.                         else if (dataFunc.Contains("VAASC"))
  76.                             VA.SetBoolean("~VAASC", true)
  77.                             VA.SetBoolean("~VASON", true)
  78.                             if (debugCheck)
  79.                                 debugText = "ENABLED OPTION - VAS Simple Yes/No Confirmation"
  80.                                 debugCount += 1
  81.                                 debugColor = 5
  82.                                 VA.SetText("~avcs_qcc_debug_" + debugCount.ToString(), debugText)
  83.                                 VA.SetInt("~avcs_qcc_debug_wclr_" + debugCount.ToString(), debugColor)
  84.                             end if
  85.                         else if (dataFunc.StartsWith("VAS"))
  86.                             if (dataFunc.length = 5)
  87.                                 levelVAS = dataFunc.Substring(3,2)
  88.                             else
  89.                                 levelVAS = dataFunc.Substring(3,1)
  90.                             end if
  91.                             VA.SetInt("~VAS", levelVAS)
  92.                             VA.SetBoolean("~VASON", true)
  93.                             if (debugCheck)
  94.                                 debugText = "ENABLED OPTION - VAS Level " + levelVAS
  95.                                 debugCount += 1
  96.                                 debugColor = 5
  97.                                 VA.SetText("~avcs_qcc_debug_" + debugCount.ToString(), debugText)
  98.                                 VA.SetInt("~avcs_qcc_debug_wclr_" + debugCount.ToString(), debugColor)
  99.                             end if
  100.                         else if (dataFunc.Contains("↓"))
  101.                             macroSteps = dataFunc.Split("↓")
  102.                             if not(macroSteps.ToString() = "")
  103.                                 for each macroStep as string in macroSteps
  104.                                     if (not(macroStep = ""))
  105.                                         macroData = macroStep.Split("←")
  106.                                         thisStep = macroData(0).Split("→")
  107.                                         stepIndex = Convert.ToInt32(thisStep(0))
  108.                                         stepCount += 1
  109.                                         thisAction = thisStep(1)
  110.                                         thisFunc = macroData(1)
  111.                                         VA.SetText("~avcs_qcc_step_type_" + stepIndex.ToString(), thisAction.ToString())
  112.                                         VA.SetText("~avcs_qcc_step_func_" + stepIndex.ToString(), thisFunc.ToString())
  113.                                        
  114.                                         if (debugCheck)
  115.                                             debugText = "STEP INDEX - " + stepIndex.ToString()
  116.                                             debugCount += 1
  117.                                             debugColor = 4
  118.                                             VA.SetText("~avcs_qcc_debug_" + debugCount.ToString(), debugText)
  119.                                             VA.SetInt("~avcs_qcc_debug_wclr_" + debugCount.ToString(), debugColor)
  120.                                             debugText = "THIS ACTION - " + thisAction.ToString()
  121.                                             debugCount += 1
  122.                                             debugColor = 7
  123.                                             VA.SetText("~avcs_qcc_debug_" + debugCount.ToString(), debugText)
  124.                                             VA.SetInt("~avcs_qcc_debug_wclr_" + debugCount.ToString(), debugColor)
  125.                                             debugText = "THIS FUNCTION - " + thisFunc.ToString()
  126.                                             debugCount += 1
  127.                                             debugColor = 3
  128.                                             VA.SetText("~avcs_qcc_debug_" + debugCount.ToString(), debugText)
  129.                                             VA.SetInt("~avcs_qcc_debug_wclr_" + debugCount.ToString(), debugColor)
  130.                                         end if
  131.                                    
  132.                                     end if
  133.                                 next
  134.                                
  135.                                 VA.SetInt("~avcs_qcc_step_count", stepCount.ToString())
  136.                                 if (debugCheck)
  137.                                     debugText = "STEPS COUNT - " + stepCount.ToString()
  138.                                     debugCount += 1
  139.                                     debugColor = 2
  140.                                     VA.SetText("~avcs_qcc_debug_" + debugCount.ToString(), debugText)
  141.                                     VA.SetInt("~avcs_qcc_debug_wclr_" + debugCount.ToString(), debugColor)
  142.                                 end if
  143.                            
  144.                             end if
  145.                         end if
  146.                    
  147.                     end if
  148.                 next
  149.             end if
  150.        
  151.         end if
  152.        
  153.         if (debugCount > 0)
  154.             VA.SetInt("~avcs_qcc_debug_count", debugCount)
  155.         end if
  156.    
  157.     End Sub
  158. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement