User:Cakemix/Snippets/VB/Print JSBot Commands

Easy VB 10 module to provide all commands and if they got args could have done better but I have too little time. Public Class Form1 Sub addlog(ByVal Text As String) TextBox1.Text = TextBox1.Text + Text.ToString + vbNewLine End Sub Sub sublog(ByVal tag As Integer, ByVal Text As String) Dim TagText Do Until tag = 0 TagText = "-" + TagText tag -= 1 Loop TextBox1.Text = TextBox1.Text + TagText + " " + Text.ToString + vbNewLine End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim folder As New IO.DirectoryInfo("C:\PHP5\plugins\") Dim files As IO.FileInfo = folder.GetFiles("plug*.php") Dim info As IO.FileInfo For Each info In files For Each line In IO.File.ReadAllLines("C:\PHP5\plugins\" + info.Name) If line.ToString.Contains("function onCommand") And Not line.ToString.Contains("$auth") Then Dim a = line.ToString.Substring(line.ToString.IndexOf("onCommand").ToString + 9).ToString Dim b = a.Substring(0, a.ToString.IndexOf("(").ToString).ToString                   addlog(b)                    If line.ToString.Contains("$args") Then                        a = line.ToString.Substring(line.ToString.IndexOf("$args").ToString + 14).ToString                        b = a.Substring(0, a.ToString.IndexOf(")").ToString).ToString sublog(1, "Args: " + b)                   End If                End If            Next Next End Sub

End Class