Flood Visual Basic

0

My goal is for the person to enter a text. Let's suppose that in a textbox with multiline=true , and in that text, with each line break, this row is treated differently, type, with each phrase in textbox I can perform a different function if you want. Simply using some command for the text incorporates everything written in textbox , and I wanted to line by line.

Another example: Let's suppose I want to do a flooder , then the person types what they want to be told in textbox and if I use a timer :

Clipboard.SetDataObject(TextBox1.Text, True)
    SendKeys.Send("^v{ENTER}")

With this code I was going to get what was written in textbox1 and as soon as her mouse went through a dialog box, the message would be sent, but I would send all the sentences of the person at once, and I want it send one by one separately, so I could even add a send interval between them.

The tool does not have to be exactly textbox , it can be the one that works better and simpler.

    
asked by anonymous 19.10.2017 / 01:52

1 answer

1

Your question is very confusing, but I understand that you want to separate the lines and execute commands on these separate lines , well, come on.

Let's create a method that performs actions on a single line, so as not to overload a single method:

Public Sub EvaluateLine(ByVal linha As String)
    Dim ItemsDaLinha As String() = linha.Split(" ")  ' Divide a linha por espaços
    Select Case ItemsDaLinha(0).ToLower()            ' Pega o primeiro item da linha
        Case "MandarMensagem"                        ' Quando o primeiro statement for um "EnviarMensagem"
            Dim ParaQuem$ = ItemsDaLinha(1)          ' Pega o primeiro argumento da linha
            If (String.IsNullOrWhitespace(ParaQuem)  ' Se o primeiro argumento for vazio ou nada...
                 Exit Sub                            ' Saia do método
            End If
            Dim Conteudo$ = linha.Substring(Len(ItemsDaLinha(0)) + Len(ItemsDaLinha(1)))
            Clipboard.SetString(Conteudo)            ' Obtém o conteúdo do código e joga para a área de transferência
     End Select
End Sub

In the above method, you will emulate each line for an item of Case . Learn how to use Select ... Case here . Here's a basic example of a line of code:

MandarMensagem Fulano Olá, mundo!

In this message above, the above method would interpret MandarMensagem as the first index of ItemsDaLinha() , Fulano as the second index, and finally, Olá, mundo! Conteudo %.

Now, to embed all lines of the TextBox and that EvaluateLine execute all these lines, implement this method and call it when you execute the command string:

Public Sub PerformText(ByVal code As String)
     ' Cria uma lista com todas as linhas de 'code'
     Dim linhas As String() = code.Split(Environment.NewLine)
     ' Faz um loop e executa todas as linhas
     For Each linhaAtual As String In linhas
           ' Chama o método que executa a linha
           EvaluateLine(linhaAtual)
     Next
End Sub

Ready. Now to execute all these lines, call this PerformText method with the text of TextBox as argument:

Public Sub Button1_Click(ByVal obj As Object, e As EventArgs) Handles Button1.Click
     Call PerformText(TextBox1.Text)
End Sub

To detect whether the mouse is over some component, use the MouseHover .

    
19.10.2017 / 06:49