Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Simple Auto Typer

Still learning everything and I gained a bit of knowledge doing this so I thought I would release it here so others could possibly use bits of it to learn from.

Finished Product design: Spoiler (Click to View)

Source: Spoiler (Click to View)

Theme download Nexus Theme

I doubt it's against the rules to link to the solution download but gonna check to make sure so if you want it before I get it here pm me.


Thanks a lot to Earn who helped out a ton and Layle for the awesome theme 😁
[Image: ZspE9dA.gif]
Nothing special here, but good to see more people learning .NET. Good work.
Code
Dim Lines() As String 'making our string name into an array by adding () at the end of it.
  Sub Spam(ByVal TextToSpam) 'Setting an argument for the Text To Spam
        Lines = TextToSpam 'Setting our array to our sub arguments
        If Lines.Count > 0 Then 'Checking if there is any lines of text
            For Each CurrentTextLine As String In Lines 'Loops through each line of text
                SendKeys.Send(CurrentTextLine) 'Sends the privately declared(it only can be called/exists inside this loop) string "CurrentTextLine" which is the current text line within this loop of each item in the array.
                SendKeys.Send("{ENTER}")
            Next 'Goes to the NEXT text line within the array
  End If
End Sub


Usage,

Code
Spam(RichTextBox.Lines)'I am calling the sub, which additionally has arguments set up so I have to handle those arguments, in this case the argument is for the text we're going to spam.
(Oct 4, 2015 09:33 PM)Jackie Chun Wrote:  
Code
Dim Lines() As String 'making our string name into an array by adding () at the end of it.
  Sub Spam(ByVal TextToSpam) 'Setting an argument for the Text To Spam
        Lines = TextToSpam 'Setting our array to our sub arguments
        If Lines.Count > 0 Then 'Checking if there is any lines of text
            For Each CurrentTextLine As String In Lines 'Loops through each line of text
                SendKeys.Send(CurrentTextLine) 'Sends the privately declared(it only can be called/exists inside this loop) string "CurrentTextLine" which is the current text line within this loop of each item in the array.
                SendKeys.Send("{ENTER}")
            Next 'Goes to the NEXT text line within the array
  End If
End Sub


Usage,

Code
Spam(RichTextBox.Lines)'I am calling the sub, which additionally has arguments set up so I have to handle those arguments, in this case the argument is for the text we're going to spam.

You don't need to check if an array is empty when using for each. If the array is not null then it won't throw any errors.
Lotta blood to let, peace to make, give a fuk about a check


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by warezzzDec 6, 2016 12:35 AM 8 240 Dec 6, 2016 12:35 AM
Last Post: DopplerAF
[.NET] by Josh‎Apr 26, 2015 09:54 AM 2 228 Apr 26, 2015 09:54 AM
Last Post: Josh‎
[C#] by SIM-409959Jan 22, 2015 01:28 AM 4 227 Jan 22, 2015 01:28 AM
Last Post: Corios