• Oncommand解析代码


    Dim c(9999999) As String, v As String, g As Integer
    Private Sub Block_Click()
    Dim i, a, m As Integer

    With Command
    .SelStart = 1
    .SelLength = Len(Command.Text)
    .SelBold = False
    .SelColor = vbBlack
    End With

    For i = 0 To Block.ListCount - 1
        If Block.Selected(i) = True Then
            a = i
            v = Block.List(a)
            m = 0
            For b = 0 To Len(Command.Text) - Len(Replace(Command.Text, Block.List(a), ""))
                m = InStr(m + Len(Block.List(a)), Command.Text, Block.List(a))
                If m = 0 Then
                    Exit For
                End If
                With Command
                .SelStart = m - 1
                .SelLength = Len(Block.List(a))
                .SelBold = True
                .SelColor = vbRed
                End With
            Next
        End If
    Next

    JX.ListIndex = -1
    Scoreb.ListIndex = -1
    Tell.ListIndex = -1
    Dis.ListIndex = -1
    Did.ListIndex = -1
    Cmd.ListIndex = -1
    End Sub

    Private Sub Check1_Click()
    Dim a As Integer

    If Check1.Value = 1 Then
        g = 2
        a = MsgBox("你已经选择了数字顺序" & Chr(13) & Chr(10) & "会显示顺序的数值", , "顺序")
    ElseIf Check1.Value = 0 Then
        g = 1
        a = MsgBox("你已经选择了无顺序" & Chr(13) & Chr(10) & "不会显示顺序的数值", , "顺序")
    End If
    End Sub

    Private Sub Cmd_Click()
    Dim i, a, m As Integer

    With Command
    .SelStart = 1
    .SelLength = Len(Command.Text)
    .SelBold = False
    .SelColor = vbBlack
    End With

    For i = 0 To Cmd.ListCount - 1
        If Cmd.Selected(i) = True Then
            a = i
            v = Cmd.List(a)
            m = 0
            For b = 0 To Len(Command.Text) - Len(Replace(Command.Text, Cmd.List(a), ""))
                m = InStr(m + Len(Cmd.List(a)), Command.Text, Cmd.List(a))
                If m = 0 Then
                    Exit For
                End If
                With Command
                .SelStart = m - 1
                .SelLength = Len(Cmd.List(a))
                .SelBold = True
                .SelColor = vbRed
                End With
            Next
        End If
    Next

    JX.ListIndex = -1
    Scoreb.ListIndex = -1
    Tell.ListIndex = -1
    Dis.ListIndex = -1
    Did.ListIndex = -1
    End Sub

    Private Sub Command1_Click()
    Dim a, i, b, d, e(100), f, j, h, k As Integer
    Dim s As String
    If Command.Text = "" Then
        a = MsgBox("你没有输入指令", , "指令错误")
        GoTo 1
    End If

    JX.Clear
    v = Command.Text

    Command.Text = Replace(Command.Text, "\", "")
    Command.Text = Replace(Command.Text, """", "")
    Command.Text = Replace(Command.Text, vbCrLf, "")
    'Command.Text = Replace(Command.Text, ",id:FallingSand,Block:iron_block,Time:1}", "")      曾经避免干扰项

     'All
        b = 1
        d = 1
        k = 0
        For i = 1 To Len(Command.Text)
            'If InStr(d + 11, Command.Text, ",id:Control") < InStr(d + 11, Command.Text, "Command:") And InStr(d + 11, Command.Text, ",id:Control") < InStr(InStr(d + 11, Command.Text, ",id:Control") + 1, Command.Text, "Command:") Then
                'Command.Text = Replace(Command.Text, ",id:Control", Space(Len("id:Control")), InStr(d + 11, Command.Text, ",id:Control") + 1)
            'End If    '这段代码能够检测cp OneCommand中单执行指令


                
    '        If InStr(d + 1, Command.Text, ",id:Control") > 0 And InStr(d + 1, Command.Text, "},Riding:{id:FallingSand") <> 0 And InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock") <> 0 And InStr(d + 1, Command.Text, "},id:FallingSand") <> 0 And InStr(d + 1, Command.Text, ",id:Control") < InStr(d + 1, Command.Text, "},Riding:{id:FallingSand") And InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock") > InStr(d + 1, Command.Text, ",id:Control") And InStr(d + 1, Command.Text, "},id:FallingSand") > InStr(d + 1, Command.Text, ",id:Control") Then
    '            d = InStr(d + 1, Command.Text, ",id:Control")
    '            b = InStrRev(Command.Text, "Command:", d)
    '        ElseIf InStr(d + 1, Command.Text, "},Riding:{id:FallingSand") > 0 And InStr(d + 1, Command.Text, ",id:Control") <> 0 And InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock") <> 0 And InStr(d + 1, Command.Text, "},id:FallingSand") <> 0 And InStr(d + 1, Command.Text, ",id:Control") > InStr(d + 1, Command.Text, "},Riding:{id:FallingSand") And InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock") > InStr(d + 1, Command.Text, "},Riding:{id:FallingSand") And InStr(d + 1, Command.Text, "},id:FallingSand") > InStr(d + 1, Command.Text, "},Riding:{id:FallingSand") Then
    '            d = InStr(d + 1, Command.Text, "},Riding:{id:FallingSand")
    '            b = InStrRev(Command.Text, "Command:", d)
    '        ElseIf InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock") > 0 And InStr(d + 1, Command.Text, "},Riding:{id:FallingSand") <> 0 And InStr(d + 1, Command.Text, ",id:Control") <> 0 And InStr(d + 1, Command.Text, "},id:FallingSand") <> 0 And InStr(d + 1, Command.Text, ",id:Control") > InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock") And InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock") < InStr(d + 1, Command.Text, "},Riding:{id:FallingSand") And InStr(d + 1, Command.Text, "},id:FallingSand") > InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock") Then
    '            d = InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock")
    '            b = InStrRev(Command.Text, "Command:", d)
    '        ElseIf InStr(d + 1, Command.Text, "},id:FallingSand") > 0 And InStr(d + 1, Command.Text, "},Riding:{id:FallingSand") <> 0 And InStr(d + 1, Command.Text, ",id:Control") <> 0 And InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock") <> 0 And InStr(d + 1, Command.Text, "},id:FallingSand") < InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock") And InStr(d + 1, Command.Text, "},id:FallingSand") < InStr(d + 1, Command.Text, "},Riding:{id:FallingSand") And InStr(d + 1, Command.Text, "},id:FallingSand") < InStr(d + 1, Command.Text, ",id:Control") Then
    '            d = InStr(d + 1, Command.Text, "},id:FallingSand")
    '            b = InStrRev(Command.Text, "Command:", d)
    '
    '        ElseIf InStr(d + 1, Command.Text, ",id:Control") > 0 And InStr(d + 1, Command.Text, "},Riding:{id:FallingSand") <> 0 And InStr(d + 1, Command.Text, ",id;Control") < InStr(d + 1, Command.Text, "},Riding:{id:FallingSand") Or InStr(d + 1, Command.Text, ",id:Control") > 0 And InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock") <> 0 And InStr(d + 1, Command.Text, ",id;Control") < InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock") Or InStr(d + 1, Command.Text, ",id:Control") > 0 And InStr(d + 1, Command.Text, "},id:FallingSand") <> 0 And InStr(d + 1, Command.Text, ",id;Control") < InStr(d + 1, Command.Text, "},id:FallingSand") Then
    '            d = InStr(d + 1, Command.Text, ",id:Control")
    '            b = InStrRev(Command.Text, "Command:", d)
    '        ElseIf InStr(d + 1, Command.Text, "},Riding:{id:FallingSand") > 0 And InStr(d + 1, Command.Text, ",id;Control") <> 0 And InStr(d + 1, Command.Text, ",id;Control") > InStr(d + 1, Command.Text, "},Riding:{id:FallingSand") Or InStr(d + 1, Command.Text, "},Riding:{id:FallingSand") > 0 And InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock") <> 0 And InStr(d + 1, Command.Text, "},Riding:{id:FallingSand") < InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock") Or InStr(d + 1, Command.Text, "},Riding:{id:FallingSand") > 0 And InStr(d + 1, Command.Text, "},id:FallingSand") <> 0 And InStr(d + 1, Command.Text, "},Riding:{id:FallingSand") < InStr(d + 1, Command.Text, "},id:FallingSand") Then
    '            d = InStr(d + 1, Command.Text, "},Riding:{id:FallingSand")
    '            b = InStrRev(Command.Text, "Command:", d)
    '        ElseIf InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock") > 0 And InStr(d + 1, Command.Text, ",id;Control") <> 0 And InStr(d + 1, Command.Text, ",id;Control") > InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock") Or InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock") > 0 And InStr(d + 1, Command.Text, "},Riding:{id:FallingSand") <> 0 And InStr(d + 1, Command.Text, "},Riding:{id:FallingSand") > InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock") Or InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock") > 0 And InStr(d + 1, Command.Text, "},id:FallingSand") <> 0 And InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock") < InStr(d + 1, Command.Text, "},id:FallingSand") Then
    '            d = InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock")
    '            b = InStrRev(Command.Text, "Command:", d)
    '        ElseIf InStr(d + 1, Command.Text, "},id:FallingSand") > 0 And InStr(d + 1, Command.Text, ",id;Control") <> 0 And InStr(d + 1, Command.Text, ",id;Control") > InStr(d + 1, Command.Text, "},id:FallingSand") Or InStr(d + 1, Command.Text, "},id:FallingSand") > 0 And InStr(d + 1, Command.Text, "},Riding:{id:FallingSand") <> 0 And InStr(d + 1, Command.Text, "},Riding:{id:FallingSand") > InStr(d + 1, Command.Text, "},id:FallingSand") Or InStr(d + 1, Command.Text, "},id:FallingSand") > 0 And InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock") <> 0 And InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock") > InStr(d + 1, Command.Text, "},id:FallingSand") Then
    '            d = InStr(d + 1, Command.Text, "},id:FallingSand")
    '            b = InStrRev(Command.Text, "Command:", d)
    '
    '        ElseIf InStr(d + 1, Command.Text, ",id;Control") <> 0 Then
    '            d = InStr(d + 1, Command.Text, ",id:Control")
    '            b = InStrRev(Command.Text, "Command:", d)
    '        ElseIf InStr(d + 1, Command.Text, "},Riding:{id:FallingSand") <> 0 Then
    '            d = InStr(d + 1, Command.Text, "},Riding:{id:FallingSand")
    '            b = InStrRev(Command.Text, "Command:", d)
    '        ElseIf InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock") <> 0 Then
    '            d = InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock")
    '            b = InStrRev(Command.Text, "Command:", d)
    '        ElseIf InStr(d + 1, Command.Text, "},id:FallingSand") <> 0 Then
    '            d = InStr(d + 1, Command.Text, "},id:FallingSand")
    '            b = InStrRev(Command.Text, "Command:", d)
    '        End If   这段代码是no auto的主要算法

            e(0) = InStr(d + 1, Command.Text, ",id:Control")
            e(1) = InStr(d + 1, Command.Text, "},Riding:{id:FallingSand")
            e(2) = InStr(d + 1, Command.Text, ",Riding:{id:MinecartCommandBlock")
            e(3) = InStr(d + 1, Command.Text, "},id:FallingSand")
            e(4) = InStr(d + 1, Command.Text, "},Time:1")
            e(5) = InStr(d + 1, Command.Text, "},Block:command_block")
            
            For f = 0 To 5
                If e(f) > 0 Then
                    h = e(f)
                    Exit For
                End If
            Next
            For j = 0 To 5
                If e(j) = 0 Then
                    j = j + 1
                ElseIf e(j) < h Then
                    h = e(j)
                End If
            Next
            d = h                               'auto算法,得到最终值
            
            If d = 0 Then
                GoTo 1
            End If
            b = InStrRev(Command.Text, "Command:", d)
            
            If k = b Then
                GoTo 3
            Else
                k = b
            End If                              '将从属指令外层去除
            
            If InStr(d + 32, Command.Text, ",Riding:{id:MinecartCommandBlock") = 0 And InStr(d + 24, Command.Text, "},Riding:{id:FallingSand") = 0 And InStr(d + 11, Command.Text, ",id:Control") = 0 And InStr(d + 16, Command.Text, "},id:FallingSand") = 0 And InStr(d + 8, Command.Text, "},Time:1") = 0 Then
                Exit For
            End If
            If d - b - 8 < 0 Then
                a = MsgBox("指令解析完成", , "完成")
                GoTo 1
            End If
            
            s = Mid(Command.Text, b + 8, d - b - 8)
            c(i) = s
            JX.AddItem c(i)
    3:
        Next

    'If InStr(Command.Text, "summon MinecartCommandBlock") > 0 And InStr(Command.Text, "summon MinecartCommandBlock") < InStr(Command.Text, "{") Then 'Only Minecart
    '    b = 0
    '    d = 0
    '    For i = 1 To Len(Command.Text) - Len(Replace(Command.Text, ",Riding:{id:MinecartCommandBlock", ""))
    '        f = 1
    '        If InStr(d + 11, Command.Text, ",id:Control") > 0 And f = 1 Then
    '            d = InStr(d + 11, Command.Text, ",id:Control")
    '            b = InStrRev(Command.Text, "Command:", d)
    '        ElseIf InStr(d + 24, Command.Text, "},Riding:{id:FallingSand") > 0 And f = 1 Then
    '            b = InStr(b + 8, Command.Text, "Command:")
    '            d = InStr(b, Command.Text, "},Riding:{id:FallingSand")
    '        ElseIf InStr(d + 32, Command.Text, ",Riding:{id:MinecartCommandBlock") > 0 And f = 1 Then
    '            b = InStr(b + 8, Command.Text, "Command:")
    '            d = InStr(b, Command.Text, ",Riding:{id:MinecartCommandBlock")
    '        End If
    '
    '        If InStr(d + 32, Command.Text, ",Riding:{id:MinecartCommandBlock") = 0 And InStr(d + 24, Command.Text, "},Riding:{id:FallingSand") = 0 And InStr(d + 11, Command.Text, ",id:Control") = 0 Then
    '            Exit For
    '        End If
    '
    '        If d - b - 8 < 0 Then
    '            a = MsgBox("指令解析完成", , "完成")
    '            GoTo 1
    '        End If
    '
    '        s = Mid(Command.Text, b + 8, d - b - 8)
    '        c(i) = s
    '        If InStr(s, ",id:Control") > 0 Then
    '            c(i) = Mid(s, InStr(s, ",id:Control" - 1), Len(s) - InStr(s, ",id:Control") + 1)
    '        End If
    '        JX.AddItem c(i)
    '    Next
    '    GoTo 1                                 'Only Minecart

    'ElseIf InStr(Command.Text, ",Riding:{id:MinecartCommandBlock,Command:") > 0 And InStr(Command.Text, "summon FallingSand") < InStr(Command.Text, "{") Then 'OneCommand Spawner
    '    b = 0
    '    d = 0
    '    For i = 1 To Len(Command.Text) - Len(Replace(Command.Text, ",Riding:{id:MinecartCommandBlock", "")) + Len(Command.Text) - Len(Replace(Command.Text, "},Riding:{id:FallingSand", ""))
    '        f = 1
    '
    '        If InStr(d + 11, Command.Text, ",id:Control") > 0 And f = 1 Then
    '            d = InStr(d + 11, Command.Text, ",id:Control")
    '            b = InStrRev(Command.Text, "Command:", d)
    '        ElseIf InStr(d + 24, Command.Text, "},Riding:{id:FallingSand") > 0 And f = 1 Then
    '            b = InStr(b + 8, Command.Text, "Command:")
    '            d = InStr(b, Command.Text, "},Riding:{id:FallingSand")
    '        ElseIf InStr(d + 32, Command.Text, ",Riding:{id:MinecartCommandBlock") > 0 And f = 1 Then
    '            b = InStr(b + 8, Command.Text, "Command:")
    '            d = InStr(b, Command.Text, ",Riding:{id:MinecartCommandBlock")
    '        End If
    '
    '        If InStr(d + 32, Command.Text, ",Riding:{id:MinecartCommandBlock") = 0 And InStr(d + 24, Command.Text, "},Riding:{id:FallingSand") = 0 And InStr(d + 11, Command.Text, ",id:Control") = 0 Then
    '            Exit For
    '        End If
    '        If d - b - 8 < 0 Then
    '            a = MsgBox("指令解析完成", , "完成")
    '            GoTo 1
    '        End If
    '
    '        s = Mid(Command.Text, b + 8, d - b - 8)
    '        c(i) = s
    '        If InStr(s, ",id:Control") > 0 Then
    '            c(i) = Mid(s, InStr(s, ",id:Control" - 1), Len(s) - InStr(s, ",id:Control") + 1)
    '        End If
    '        JX.AddItem c(i)
    '    Next
    '    GoTo 1                             'Only Oocss


    For i = 0 To JX.ListCount
        JX.List(i) = Replace(JX.List(i), ",id:Control},id:FallingSand,Block:command_block,Time:1}", "")
        JX.List(i) = Replace(JX.List(i), "},Time:1,DropItem:0}}}}}}}}", "")
    Next                                                            '将从属项删除

    For i = 0 To JX.ListCount - 2
            If i > JX.ListCount - 1 Then Exit For
        For j = (i + 1) To JX.ListCount - 1
                If j > JX.ListCount - 1 Then Exit For
                If JX.List(i) = JX.List(j) Then
                    JX.RemoveItem j
                End If
        Next
    Next                                                            '将重复项删除

    a = MsgBox("已经完成解析指令" & Chr(13) & Chr(10) & "可以通过'分化指令'按钮优化指令和分化指令", , "完成")
    1:
    End Sub

    Private Sub Command10_Click()
    Dim a As Integer
    Cmd.Clear
    Tell.Clear
    Scoreb.Clear
    Block.Clear
    Dis.Clear
    Did.Clear

    a = MsgBox("已经清空", , "清空")
    End Sub

    Private Sub Command2_Click()
    Dim a As Integer

    Clipboard.Clear
    Clipboard.SetText v
    a = MsgBox("复制成功" & Chr(13) & Chr(10) & "请使用粘贴键粘贴", , "复制成功")

    End Sub

    Private Sub Command3_Click()
    Dim i As Integer, b As Integer
    JX.Clear
    v = ""
    b = MsgBox("已经清空", , "清空")
    End Sub

    Private Sub Command4_Click()
    Dim a As String, i As Integer, b As Integer

    a = ""
    a = a + "所有指令:" & Chr(13) & Chr(10)
    If g = 1 Then
        For i = 0 To JX.ListCount - 1
            If i = JX.ListCount - 1 Then
                a = a + JX.List(i)
                Exit For
            End If
            a = a + JX.List(i) & Chr(13) & Chr(10)
        Next
    ElseIf g = 2 Then
        For i = 0 To JX.ListCount - 1
            If i = JX.ListCount - 1 Then
                a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & JX.List(i)
                Exit For
            End If
            a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & JX.List(i) & Chr(13) & Chr(10)
        Next
    End If

    Clipboard.Clear
    Clipboard.SetText a
    b = MsgBox("复制成功" & Chr(13) & Chr(10) & "请使用粘贴键粘贴", , "复制成功")

    End Sub

    Private Sub Command5_Click()
    Dim a As Integer
    Command.Text = Clipboard.GetText
    a = MsgBox("已经粘贴OneCommand指令", , "粘贴成功")
    End Sub

    Private Sub Command6_Click()
    Dim i As Integer, a As String, b(1000) As String, c(1000) As String, d As Integer
    Tell.Clear
    Block.Clear
    Scoreb.Clear
    Dis.Clear
    Did.Clear

    For i = 0 To JX.ListCount - 1
        a = Replace(JX.List(i), " ", "")
        If InStr(a, "tellraw") = 1 Or InStr(a, "/tellraw") = 1 Then
            Tell.AddItem JX.List(i)
        ElseIf InStr(a, "say") = 1 Or InStr(a, "/say") = 1 Then
            Tell.AddItem JX.List(i)
        ElseIf InStr(a, "fill") = 1 Or InStr(a, "/fill") = 1 Then
            Block.AddItem JX.List(i)
            JX.List(i) = Replace(JX.List(i), ",id:Control", "")
            If InStr(JX.List(i), "},Time:1") > 0 Then
                JX.List(i) = Mid(JX.List(i), 1, InStr(JX.List(i), "},Time:1") - 1)
            End If
        ElseIf InStr(a, "setblock") = 1 Or InStr(a, "/setblock") = 1 Then
            Block.AddItem JX.List(i)
        
        ElseIf InStr(JX.List(i), "scoreboard objectives add") = 1 Or InStr(JX.List(i), "/scoreboard objectives add") = 1 Then
            JX.List(i) = Replace(JX.List(i), ",id:Control", "")
            JX.List(i) = Replace(JX.List(i), "},Time:1", "")
            b(i) = Mid(JX.List(i), InStr(JX.List(i), "add") + 4, InStr(InStr(JX.List(i), "add") + 4, JX.List(i), " ") - InStr(JX.List(i), "add") - 4)
                For d = 0 To i - 1
                    If b(i) = b(d) Then
                        JX.RemoveItem (i)
                        GoTo 2
                    End If
                Next
            Scoreb.AddItem JX.List(i)
            c(i) = Mid(JX.List(i), InStr(InStr(JX.List(i), "add") + 4, JX.List(i), " ") + 1, Len(JX.List(i)) - InStr(InStr(JX.List(i), "add") + 4, JX.List(i), " "))
            Dis.AddItem b(i)
            Did.AddItem c(i)
        Else
            Cmd.AddItem JX.List(i)
        End If
    2:
    Next
    a = MsgBox("已经完成优化与分化指令" & Chr(13) & Chr(10) & "可以通过鼠标左击选中一段指令" & Chr(13) & Chr(10) & "可以通过'复制指令'按钮复制选中指令指令", , "完成")
    End Sub

    Private Sub Command7_Click()
    Dim a As String, i As Integer
    a = ""

    If g = 1 Then
        a = a + "文字效果:" & Chr(13) & Chr(10)
        For i = 0 To Tell.ListCount - 1
            If i = Tell.ListCount - 1 Then
                a = a + Tell.List(i)
                Exit For
            End If
            a = a + Tell.List(i) & Chr(13) & Chr(10)
        Next
        a = a & Chr(13) & Chr(10) & "方块效果:" & Chr(13) & Chr(10)
        For i = 0 To Block.ListCount - 1
            If i = Block.ListCount - 1 Then
                a = a + Block.List(i)
                Exit For
            End If
            a = a + Block.List(i) & Chr(13) & Chr(10)
        Next
        a = a & Chr(13) & Chr(10) & "计分板添加:" & Chr(13) & Chr(10)
        For i = 0 To Scoreb.ListCount - 1
            If i = Scoreb.ListCount - 1 Then
                a = a + Scoreb.List(i)
                Exit For
            End If
            a = a + Scoreb.List(i) & Chr(13) & Chr(10)
        Next
        a = a & Chr(13) & Chr(10) & "计分板列表:" & Chr(13) & Chr(10)
        For i = 0 To Dis.ListCount - 1
            If i = Scoreb.ListCount - 1 Then
                a = a + Dis.List(i) & vbTab & Did.List(i)
                Exit For
            End If
            a = a + Dis.List(i) & vbTab & Did.List(i) & Chr(13) & Chr(10)
        Next
        a = a & Chr(13) & Chr(10) & "全部实意指令:" & Chr(13) & Chr(10)
        For i = 0 To Cmd.ListCount - 1
            If i = Cmd.ListCount - 1 Then
                a = a + Cmd.List(i)
                Exit For
            End If
            a = a + Cmd.List(i) & Chr(13) & Chr(10)
        Next
    End If
    If g = 2 Then
        a = a + "文字效果:" & Chr(13) & Chr(10)
        For i = 0 To Tell.ListCount - 1
            If i = Tell.ListCount - 1 Then
                a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Tell.List(i)
                Exit For
            End If
            a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Tell.List(i) & Chr(13) & Chr(10)
        Next
        a = a & Chr(13) & Chr(10) & "方块效果:" & Chr(13) & Chr(10)
        For i = 0 To Block.ListCount - 1
            If i = Block.ListCount - 1 Then
                a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Block.List(i)
                Exit For
            End If
            a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Block.List(i) & Chr(13) & Chr(10)
        Next
        a = a & Chr(13) & Chr(10) & "计分板添加:" & Chr(13) & Chr(10)
        For i = 0 To Scoreb.ListCount - 1
            If i = Scoreb.ListCount - 1 Then
                a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Scoreb.List(i)
                Exit For
            End If
            a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Scoreb.List(i) & Chr(13) & Chr(10)
        Next
        a = a & Chr(13) & Chr(10) & "计分板列表:" & Chr(13) & Chr(10)
        For i = 0 To Dis.ListCount - 1
            If i = Scoreb.ListCount - 1 Then
                a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Dis.List(i) & vbTab & Did.List(i)
                Exit For
            End If
            a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Dis.List(i) & vbTab & Did.List(i) & Chr(13) & Chr(10)
        Next
        a = a & Chr(13) & Chr(10) & "全部实意指令:" & Chr(13) & Chr(10)
        For i = 0 To Cmd.ListCount - 1
            If i = Cmd.ListCount - 1 Then
                a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Cmd.List(i)
                Exit For
            End If
            a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Cmd.List(i) & Chr(13) & Chr(10)
        Next
    End If


    Clipboard.Clear
    Clipboard.SetText a
    b = MsgBox("复制成功" & Chr(13) & Chr(10) & "请使用粘贴键粘贴", , "复制成功")
    End Sub

    Private Sub Command8_Click()
    Dim i, a, b As Integer
    b = 0
    With Command
    .SelStart = 1
    .SelLength = Len(Command.Text)
    .SelBold = False
    .SelColor = vbBlack
    End With

    For i = 0 To Len(Command.Text) - Len(Replace(Command.Text, Fi.Text, ""))
        b = InStr(b + 1, Command.Text, Fi.Text)
        If b <= 0 Then
            Exit For
        End If
        With Command
        .SelStart = b - 1
        .SelLength = Len(Fi.Text)
        .SelBold = True
        .SelColor = vbRed
    End With
    Next

    a = MsgBox("寻找完成", , "完成")
    End Sub

    Private Sub Command9_Click()
    Dim a As Integer
    With Command
    .SelStart = 1
    .SelLength = Len(Command.Text)
    .SelBold = False
    .SelColor = vbBlack
    End With

    JX.ListIndex = -1
    Scoreb.ListIndex = -1
    Block.ListIndex = -1
    Dis.ListIndex = -1
    Tell.ListIndex = -1
    Cmd.ListIndex = -1

    a = MsgBox("已经清空所有选中", , "清空")
    End Sub

    Private Sub Did_Click()
    Dim i, a, m As Integer

    With Command
    .SelStart = 1
    .SelLength = Len(Command.Text)
    .SelBold = False
    .SelColor = vbBlack
    End With

    For i = 0 To Did.ListCount - 1
        If Did.Selected(i) = True Then
            a = i
            v = Did.List(a)
            m = 0
            For b = 0 To Len(Command.Text) - Len(Replace(Command.Text, Did.List(a), ""))
                m = InStr(m + Len(Did.List(a)), Command.Text, Did.List(a))
                If m = 0 Then
                    Exit For
                End If
                With Command
                .SelStart = m - 1
                .SelLength = Len(Did.List(a))
                .SelBold = True
                .SelColor = vbRed
                End With
            Next
        End If
    Next

    JX.ListIndex = -1
    Scoreb.ListIndex = -1
    Block.ListIndex = -1
    Dis.ListIndex = -1
    Tell.ListIndex = -1
    Cmd.ListIndex = -1
    End Sub

    Private Sub Dis_Click()
    Dim i, a, b, m As Integer

    With Command
    .SelStart = 1
    .SelLength = Len(Command.Text)
    .SelBold = False
    .SelColor = vbBlack
    End With

    For i = Dis.ListCount - 1 To 0 Step -1
        If Dis.Selected(i) = True Then
            a = i
            v = Dis.List(a)
            m = 0
            For b = 0 To Len(Command.Text) - Len(Replace(Command.Text, Dis.List(a), ""))
                m = InStr(m + Len(Dis.List(a)), Command.Text, Dis.List(a))
                If m = 0 Then
                    Exit For
                End If
                With Command
                .SelStart = m - 1
                .SelLength = Len(Dis.List(a))
                .SelBold = True
                .SelColor = vbRed
                End With
            Next
        End If
    Next

    JX.ListIndex = -1
    Scoreb.ListIndex = -1
    Block.ListIndex = -1
    Tell.ListIndex = -1
    Did.ListIndex = -1
    Cmd.ListIndex = -1
    End Sub

    Private Sub Form_Load()
    g = 1
    Label4.FontSize = 8
    End Sub

    Private Sub JX_Click()
    Dim i, a, m As Integer

    With Command
    .SelStart = 1
    .SelLength = Len(Command.Text)
    .SelBold = False
    .SelColor = vbBlack
    End With

    For i = 0 To JX.ListCount - 1
        If JX.Selected(i) = True Then
            a = i
            v = JX.List(a)
            m = 0
            For b = 0 To Len(Command.Text) - Len(Replace(Command.Text, JX.List(a), ""))
                m = InStr(m + Len(JX.List(a)), Command.Text, JX.List(a))
                If m = 0 Then
                    Exit For
                End If
                With Command
                .SelStart = m - 1
                .SelLength = Len(JX.List(a))
                .SelBold = True
                .SelColor = vbRed
                End With
            Next
        End If
    Next

    Tell.ListIndex = -1
    Scoreb.ListIndex = -1
    Block.ListIndex = -1
    Dis.ListIndex = -1
    Did.ListIndex = -1
    Cmd.ListIndex = -1
    End Sub

    Private Sub JX_DblClick()
    Dim a As Integer

    a = MsgBox(CStr(Val(JX.ListIndex) + 1) & ":" & Chr(13) & Chr(10) & JX.Text, , "所有指令")
    Fi.Text = JX.Text
    End Sub

    Private Sub Label15_Click()
    Dim a As Integer
    a = MsgBox("联系作者或者访问发布网站" & Chr(13) & Chr(10) & "获取更多帮助", , "帮助")
    End Sub

    Private Sub Label16_Click()
    Dim a As String, i As Integer, b As Integer

    a = ""
    a = a + "全部实意指令:" & Chr(13) & Chr(10)
    For i = 0 To Cmd.ListCount - 1
        If g = 1 Then
        a = a + Cmd.List(i) & Chr(13) & Chr(10)

        End If
            
        If g = 2 Then
            If i = Cmd.ListCount - 1 Then
                a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Cmd.List(i)
            End If
        a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Cmd.List(i)
        End If
    Next

    Clipboard.Clear
    Clipboard.SetText a
    b = MsgBox("复制成功" & Chr(13) & Chr(10) & "请使用粘贴键粘贴", , "复制成功")
    End Sub

    Private Sub Tell_DblClick()
    Dim a As Integer

    a = MsgBox(CStr(Val(Tell.ListIndex) + 1) & ":" & Chr(13) & Chr(10) & Tell.Text, , "文字效果指令")
    Fi.Text = Tell.Text
    End Sub
    Private Sub Block_DblClick()
    Dim a As Integer

    a = MsgBox(CStr(Val(Block.ListIndex) + 1) & ":" & Chr(13) & Chr(10) & Block.Text, , "方块效果指令")
    Fi.Text = Block.Text
    End Sub
    Private Sub Scoreb_DblClick()
    Dim a As Integer

    a = MsgBox(CStr(Val(Scoreb.ListIndex) + 1) & ":" & Chr(13) & Chr(10) & Scoreb.Text, , "计分板创建指令")
    Fi.Text = Scoreb.Text
    End Sub
    Private Sub Dis_DblClick()
    Dim a As Integer

    a = MsgBox(CStr(Val(Dis.ListIndex) + 1) & ":" & Chr(13) & Chr(10) & Dis.Text, , "计分板")
    Fi.Text = Dis.Text
    End Sub
    Private Sub Did_DblClick()
    Dim a As Integer

    a = MsgBox(CStr(Val(Did.ListIndex) + 1) & ":" & Chr(13) & Chr(10) & Did.Text, , "计分板类型")
    Fi.Text = Did.Text
    End Sub
    Private Sub Cmd_DblClick()
    Dim a As Integer

    a = MsgBox(CStr(Val(Cmd.ListIndex) + 1) & ":" & Chr(13) & Chr(10) & Cmd.Text, , "实意指令")
    Fi.Text = Cmd.Text
    End Sub
    Private Sub Label14_Click()
    Dim a As String, i As Integer
    a = ""

    If g = 1 Then
        a = a + "文字效果:" & Chr(13) & Chr(10)
        For i = 0 To Tell.ListCount - 1
            If i = Tell.ListCount - 1 Then
                a = a + Tell.List(i)
                Exit For
            End If
            a = a + Tell.List(i) & Chr(13) & Chr(10)
        Next
        a = a & Chr(13) & Chr(10) & "方块效果:" & Chr(13) & Chr(10)
        For i = 0 To Block.ListCount - 1
            If i = Block.ListCount - 1 Then
                a = a + Block.List(i)
                Exit For
            End If
            a = a + Block.List(i) & Chr(13) & Chr(10)
        Next
        a = a & Chr(13) & Chr(10) & "计分板添加:" & Chr(13) & Chr(10)
        For i = 0 To Scoreb.ListCount - 1
            If i = Scoreb.ListCount - 1 Then
                a = a + Scoreb.List(i)
                Exit For
            End If
            a = a + Scoreb.List(i) & Chr(13) & Chr(10)
        Next
        a = a & Chr(13) & Chr(10) & "计分板列表:" & Chr(13) & Chr(10)
        For i = 0 To Dis.ListCount - 1
            If i = Scoreb.ListCount - 1 Then
                a = a + Dis.List(i) & vbTab & Did.List(i)
                Exit For
            End If
            a = a + Dis.List(i) & vbTab & Did.List(i) & Chr(13) & Chr(10)
        Next
    End If
    If g = 2 Then
        a = a + "文字效果:" & Chr(13) & Chr(10)
        For i = 0 To Tell.ListCount - 1
            If i = Tell.ListCount - 1 Then
                a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Tell.List(i)
            End If
            a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Tell.List(i) & Chr(13) & Chr(10)
        Next
        a = a & Chr(13) & Chr(10) & "方块效果:" & Chr(13) & Chr(10)
        For i = 0 To Block.ListCount - 1
            If i = Block.ListCount - 1 Then
                a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Block.List(i)
            End If
            a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Block.List(i) & Chr(13) & Chr(10)
        Next
        a = a & Chr(13) & Chr(10) & "计分板添加:" & Chr(13) & Chr(10)
        For i = 0 To Scoreb.ListCount - 1
            If i = Scoreb.ListCount - 1 Then
                a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Scoreb.List(i)
            End If
            a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Scoreb.List(i) & Chr(13) & Chr(10)
        Next
        a = a & Chr(13) & Chr(10) & "计分板列表:" & Chr(13) & Chr(10)
        For i = 0 To Dis.ListCount - 1
            If i = Scoreb.ListCount - 1 Then
                a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Dis.List(i) & vbTab & Did.List(i)
            End If
            a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Dis.List(i) & vbTab & Did.List(i) & Chr(13) & Chr(10)
        Next
    End If


    Clipboard.Clear
    Clipboard.SetText a
    b = MsgBox("复制成功" & Chr(13) & Chr(10) & "请使用粘贴键粘贴", , "复制成功")
    End Sub

    Private Sub Label6_Click()
    Dim a As String, i As Integer, b As Integer

    a = ""
    a = a + "文字效果:" & Chr(13) & Chr(10)
    For i = 0 To Tell.ListCount - 1
        If g = 1 Then
            If i = Tell.ListCount - 1 Then
                a = a + Tell.List(i)
                Exit For
            End If
            a = a + Tell.List(i) & Chr(13) & Chr(10)
        End If
            
        If g = 2 Then
            If i = Tell.ListCount - 1 Then
                a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Tell.List(i)
                Exit For
            End If
            a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Tell.List(i) & Chr(13) & Chr(10)
        End If
    Next

    Clipboard.Clear
    Clipboard.SetText a
    b = MsgBox("复制成功" & Chr(13) & Chr(10) & "请使用粘贴键粘贴", , "复制成功")
    End Sub

    Private Sub Label7_Click()
    Dim a As String, i As Integer, b As Integer

    a = ""
    a = a + "方块效果:" & Chr(13) & Chr(10)
    For i = 0 To Block.ListCount - 1
        If g = 1 Then
            If i = Block.ListCount - 1 Then
                a = a + Block.List(i)
                Exit For
            End If
            a = a + Block.List(i) & Chr(13) & Chr(10)
        End If
            
        If g = 2 Then
            If i = Block.ListCount - 1 Then
                a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Block.List(i)
                Exit For
            End If
            a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Block.List(i)
        End If
    Next

    Clipboard.Clear
    Clipboard.SetText a
    b = MsgBox("复制成功" & Chr(13) & Chr(10) & "请使用粘贴键粘贴", , "复制成功")
    End Sub

    Private Sub Label8_Click()
    Dim a As String, i As Integer, b As Integer

    a = ""
    a = a + "计分板添加:" & Chr(13) & Chr(10)
    For i = 0 To Scoreb.ListCount - 1
        If g = 1 Then
            If i = Scoreb.ListCount - 1 Then
                a = a + Scoreb.List(i)
                Exit For
            End If
            a = a + Scoreb.List(i) & Chr(13) & Chr(10)
        End If
            
        If g = 2 Then
            If i = Scoreb.ListCount - 1 Then
                a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Scoreb.List(i)
                Exit For
            End If
            a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Scoreb.List(i)
        End If
    Next

    Clipboard.Clear
    Clipboard.SetText a
    b = MsgBox("复制成功" & Chr(13) & Chr(10) & "请使用粘贴键粘贴", , "复制成功")
    End Sub

    Private Sub Label9_Click()
    Dim a As String, i As Integer, b As Integer

    a = ""
        a = a + "计分板列表:" & Chr(13) & Chr(10)
    For i = 0 To Dis.ListCount - 1
        If g = 1 Then
            If i = Scoreb.ListCount - 1 Then
                a = a + Dis.List(i) & vbTab & Did.List(i)
                Exit For
            End If
            a = a + Dis.List(i) & vbTab & Did.List(i) & Chr(13) & Chr(10)
        End If
            
        If g = 2 Then
            If i = Scoreb.ListCount - 1 Then
                a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Dis.List(i) & vbTab & Did.List(i)
                Exit For
            End If
            a = a + CStr(i + 1) & ":" & Chr(13) & Chr(10) & Dis.List(i) & vbTab & Did.List(i) & Chr(13) & Chr(10)
        End If
    Next

    Clipboard.Clear
    Clipboard.SetText a
    b = MsgBox("复制成功" & Chr(13) & Chr(10) & "请使用粘贴键粘贴", , "复制成功")
    End Sub

    Private Sub Scoreb_Click()
    Dim i, a, m As Integer

    With Command
    .SelStart = 1
    .SelLength = Len(Command.Text)
    .SelBold = False
    .SelColor = vbBlack
    End With

    For i = 0 To Scoreb.ListCount - 1
        If Scoreb.Selected(i) = True Then
            a = i
            v = Scoreb.List(a)
            m = 0
            For b = 0 To Len(Command.Text) - Len(Replace(Command.Text, Scoreb.List(a), ""))
                m = InStr(m + Len(Scoreb.List(a)), Command.Text, Scoreb.List(a))
                If m = 0 Then
                    Exit For
                End If
                With Command
                .SelStart = m - 1
                .SelLength = Len(Scoreb.List(a))
                .SelBold = True
                .SelColor = vbRed
                End With
            Next
        End If
    Next

    JX.ListIndex = -1
    Tell.ListIndex = -1
    Block.ListIndex = -1
    Dis.ListIndex = -1
    Did.ListIndex = -1
    Cmd.ListIndex = -1
    End Sub

    Private Sub Tell_Click()
    Dim i, a, m As Integer

    With Command
    .SelStart = 1
    .SelLength = Len(Command.Text)
    .SelBold = False
    .SelColor = vbBlack
    End With

    For i = 0 To Tell.ListCount - 1
        If Tell.Selected(i) = True Then
            a = i
            v = Tell.List(a)
            m = 0
            For b = 0 To Len(Command.Text) - Len(Replace(Command.Text, Tell.List(a), ""))
                m = InStr(m + Len(Tell.List(a)), Command.Text, Tell.List(a))
                If m = 0 Then
                    Exit For
                End If
                With Command
                .SelStart = m - 1
                .SelLength = Len(Tell.List(a))
                .SelBold = True
                .SelColor = vbRed
                End With
            Next
        End If
    Next

    JX.ListIndex = -1
    Scoreb.ListIndex = -1
    Block.ListIndex = -1
    Dis.ListIndex = -1
    Did.ListIndex = -1
    Cmd.ListIndex = -1
    End Sub

    Private Sub 清空OneCommand_Click()
    Dim a As Integer
    Command.Text = ""
    a = MsgBox("已经清空", , "清空")
    End Sub
     

  • 相关阅读:
    intellij plugin(插件)的项目解析及研读
    日常工作中常用的抓包工具都有哪些呢?
    java计算机毕业设计学生成绩管理系统源程序+mysql+系统+lw文档+远程调试
    MySQL日志类的数据表,实测MyISAM到底比InnoDB查询快多少
    放弃老旧的Mybatis,强类型替换字符串,这是一款你不应该错过的ORM
    [源码解析] NVIDIA HugeCTR,GPU版本参数服务器--- (4)
    总结七大排序算法
    关于Oracle中的关闭和启动数据库的几种方式(五)
    【JavaEE进阶系列 | 从小白到工程师】JavaEE中的迭代器,并发修改异常与增强for循环,一文上手使用
    idea设置了maven会自动变回C盘那个
  • 原文地址:https://blog.csdn.net/qq_38220914/article/details/127724604