Semi-Advanced Spambot Tutorial 10-12-2013, 05:21 PM
#1
Hello, this will be my first tutorial on here. I'll probably be making more shortly. This was all made by me, however, I don't doubt that you'd be able to find a similar source out there somewhere for something as small as this.
First off, add the following to your form:
3 Labels
1 Rich Text Box
1 Text Box
1 NumericUpDown
3 Buttons
3 Timers
I prefer them to be in this format, but it's your choice:
The (F9), (F11), and (F12) are hotkeys that we'll be adding to this program.
If you simply want to copy-paste my source code, then you'll need to change some of the design names.
Change the following:
TextBox --> TimeDelay
NumericUpDown --> NumTimes
Button1 --> Start
Button2 --> Infinte
Button3 --> StopSpam
Then just copy-paste the following code:
If you want to understand it more, then keep reading.
First off, I'd like to say, don't worry if it's giving you errors throughout the tutorial, this is simply because at the point in the tutorial you're at, all things might not be instantiated yet. Just keep continuing until the end, and everything should be working completely fine. If it isn't, feel free to PM me.
First, double click on your Timer1. You'll want to add the following code inside of its sub:
Basically, this is a nested for loop. What will happen is times, an integer, will increase from 0 to however many times you want it to spam - 1. You could simply do "For times = 1 To NumTimes.Value", however, I prefer to start from 0 as I find that it is good practice for beginners to use.
The next for loop goes through each of the lines that you write inside of the RichTextBox and goes through each of them separately.
Inside of this loop is a delay, that will delay for however long you write inside of the textbox. This value is in milliseconds.
This line of code sends the keys that are on the line that the for loop is currently on, and then it will "press" Enter, as to send the message, or just go on to the next line.
NOTE: The for loop NEEDS to be "0 To RichTextBox1.Lines.Count - 1", and the send keys NEEDS to be RichTextBox1.Lines(lineCounter), or else it won't work.
Timer1.Stop() is used so that after the for loops finish (The message is spammed the requested amount of times), the Timer1 will stop so that it doesn't continue to repeat itself.
Now, double click on Timer2. This is basically the same exact thing as Timer1, except for you won't be needing the first forloop, as this Timer will be used for the spammer to spam infinitely (until you click stop). So, I don't think I'll be needing to reexplain this.
Onto the last Timer, Timer3. This one doesn't have to be a timer, however, since we've been working with Timers so much, I figured it may be easier for this to also be one. Click on the Timer ONCE. On the lower right you'll see the properties box which you used to change the name of your buttons, textbox, etc. Inside of here, you'll want to change "Enabled" from "False" to "True". This will make it so that the Timer is already on. Now, double click on Timer3. This will be where we'll be adding the hotkeys to our program.
Copy-Paste this into the sub:
What this does is it creates 3 different boolean variables (booleans are True/False). It then assigns each of these booleans to a specific key, that way, when the specific key it is assigned to is pressed, then the boolean value will be true. The if statements simply check whether or not the boolean is false or true, and if it is true, then it will perform a click on the button it is assigned to (Start, Infinite, or StopSpam). You can change what hotkeys you want to use simply by changing the F12 in "GetAsyncKeyState(Keys.F12)" to a different key. I prefer these 3 keys simply because it is most comfortable to me.
Almost at the very top of the program code, just under "Public Class Form1" you'll be wanting to add:
This declares the function "GetAsyncKeyState" and allows us to use the hotkeys.
OK, the program is now nearly all complete, now all we have to do is make it so the buttons will start or stop the timers.
Double click your Start button and write:
Double click your Infinite button and write:
And finally double click your StopSpam button and write:
All these lines of codes do is start or stop the timer which will make the program start spamming the messages. Now the program is complete.
If you have any questions, feel free to message me. Also, if you have another idea for a program that you want a tutorial on feel free to ask me to do it.
First off, add the following to your form:
3 Labels
1 Rich Text Box
1 Text Box
1 NumericUpDown
3 Buttons
3 Timers
I prefer them to be in this format, but it's your choice:
Spoiler:
The (F9), (F11), and (F12) are hotkeys that we'll be adding to this program.
If you simply want to copy-paste my source code, then you'll need to change some of the design names.
Change the following:
TextBox --> TimeDelay
NumericUpDown --> NumTimes
Button1 --> Start
Button2 --> Infinte
Button3 --> StopSpam
Then just copy-paste the following code:
Spoiler:
If you want to understand it more, then keep reading.
First off, I'd like to say, don't worry if it's giving you errors throughout the tutorial, this is simply because at the point in the tutorial you're at, all things might not be instantiated yet. Just keep continuing until the end, and everything should be working completely fine. If it isn't, feel free to PM me.
First, double click on your Timer1. You'll want to add the following code inside of its sub:
Code:
For times = 0 To NumTimes.Value - 1
For lineCounter = 0 To RichTextBox1.Lines.Count - 1
System.Threading.Thread.Sleep(TimeDelay.Text)
SendKeys.Send(RichTextBox1.Lines(lineCounter) + "{Enter}")
Next
Next
Timer1.Stop()
Basically, this is a nested for loop. What will happen is times, an integer, will increase from 0 to however many times you want it to spam - 1. You could simply do "For times = 1 To NumTimes.Value", however, I prefer to start from 0 as I find that it is good practice for beginners to use.
The next for loop goes through each of the lines that you write inside of the RichTextBox and goes through each of them separately.
Inside of this loop is a delay, that will delay for however long you write inside of the textbox. This value is in milliseconds.
This line of code sends the keys that are on the line that the for loop is currently on, and then it will "press" Enter, as to send the message, or just go on to the next line.
NOTE: The for loop NEEDS to be "0 To RichTextBox1.Lines.Count - 1", and the send keys NEEDS to be RichTextBox1.Lines(lineCounter), or else it won't work.
Timer1.Stop() is used so that after the for loops finish (The message is spammed the requested amount of times), the Timer1 will stop so that it doesn't continue to repeat itself.
Now, double click on Timer2. This is basically the same exact thing as Timer1, except for you won't be needing the first forloop, as this Timer will be used for the spammer to spam infinitely (until you click stop). So, I don't think I'll be needing to reexplain this.
Code:
For lineCounter = 0 To RichTextBox1.Lines.Count - 1
System.Threading.Thread.Sleep(TimeDelay.Text)
SendKeys.Send(RichTextBox1.Lines(lineCounter) + "{Enter}")
Next
Onto the last Timer, Timer3. This one doesn't have to be a timer, however, since we've been working with Timers so much, I figured it may be easier for this to also be one. Click on the Timer ONCE. On the lower right you'll see the properties box which you used to change the name of your buttons, textbox, etc. Inside of here, you'll want to change "Enabled" from "False" to "True". This will make it so that the Timer is already on. Now, double click on Timer3. This will be where we'll be adding the hotkeys to our program.
Copy-Paste this into the sub:
Code:
Dim hotkey1 As Boolean = GetAsyncKeyState(Keys.F9)
Dim hotkey2 As Boolean = GetAsyncKeyState(Keys.F11)
Dim hotkey3 As Boolean = GetAsyncKeyState(Keys.F12)
If hotkey1 Then
Start.PerformClick()
End If
If hotkey2 Then
Infinte.PerformClick()
End If
If hotkey3 Then
StopSpam.PerformClick()
End If
What this does is it creates 3 different boolean variables (booleans are True/False). It then assigns each of these booleans to a specific key, that way, when the specific key it is assigned to is pressed, then the boolean value will be true. The if statements simply check whether or not the boolean is false or true, and if it is true, then it will perform a click on the button it is assigned to (Start, Infinite, or StopSpam). You can change what hotkeys you want to use simply by changing the F12 in "GetAsyncKeyState(Keys.F12)" to a different key. I prefer these 3 keys simply because it is most comfortable to me.
Almost at the very top of the program code, just under "Public Class Form1" you'll be wanting to add:
Code:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Integer) As Integer
This declares the function "GetAsyncKeyState" and allows us to use the hotkeys.
OK, the program is now nearly all complete, now all we have to do is make it so the buttons will start or stop the timers.
Double click your Start button and write:
Code:
Timer1.Start()
Double click your Infinite button and write:
Code:
Timer2.Start()
And finally double click your StopSpam button and write:
Code:
Timer1.Stop()
Timer2.Stop()
All these lines of codes do is start or stop the timer which will make the program start spamming the messages. Now the program is complete.
If you have any questions, feel free to message me. Also, if you have another idea for a program that you want a tutorial on feel free to ask me to do it.