Skip to content

Commit

Permalink
Fixed Spam Length not working correctly.
Browse files Browse the repository at this point in the history
Added extra button in options for a Tutorial.
  • Loading branch information
Yusuf Tuncay committed Jan 21, 2023
1 parent 67fc6c6 commit 2ddc0f8
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 49 deletions.
22 changes: 16 additions & 6 deletions Form.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

76 changes: 33 additions & 43 deletions Form.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Reflection.Emit;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Xsl;
using System.Threading;
using System.Timers;
using System.Threading.Tasks;

namespace SpamBot
{
Expand All @@ -21,16 +14,20 @@ public Form()
InitializeComponent();
}

/* This variable will be the loop counter */
private int counter;

/* Start Button */
private void ButtonStart_Click(object sender, EventArgs e)
private async void ButtonStart_Click(object sender, EventArgs e)
{
if (TextBox.TextLength >= 1)
{
/* Timer for spamming */
TimerLength.Interval = SpamSpeedTrackBar.Value;
TimerLength.Start();

/* Timer for spamming */
await Task.Delay(SpamLengthTrackBar.Value * 1000);

/* Exit loop code */
TimerLength.Stop();
}
else
{
Expand All @@ -56,9 +53,11 @@ private void ButtonStop_Click(object sender, EventArgs e)
/* Default Values Button */
private void ButtonDefault_Click(object sender, EventArgs e)
{
/* Clear text field and set focus */
TextBox.Clear();
TextBox.Focus();

/* Bring default values to the sliders and correct the labels */
SpamSpeedTrackBar.Value = 10;
SpamLengthTrackBar.Value = 1;
LabelSpamSpeed.Text = "1 message / 10 ms";
Expand All @@ -68,35 +67,9 @@ private void ButtonDefault_Click(object sender, EventArgs e)
/* Timer Tick */
private void TimerLength_Tick(object sender, EventArgs e)
{
if (counter == SpamLengthTrackBar.Value)
{
/* Exit loop code */
TimerLength.Stop();
counter = 0;
}
else
{
/* Spams input text and presses enter */
SendKeys.Send(TextBox.Text);
SendKeys.Send("{ENTER}");

/* Increment counter */
counter++;
}
}

/* Menu Strip */
private void CloseMenuStrip_Click(object sender, EventArgs e)
{
Close();
}
private void TwitterMenuStrip_Click(object sender, EventArgs e)
{
Process.Start("https://twitter.com/Ce9Fc4x");
}
private void GithubMenuStrip_Click(object sender, EventArgs e)
{
Process.Start("https://github.com/yusuftuncay");
/* Spams input text and presses enter */
SendKeys.Send(TextBox.Text);
SendKeys.Send("{ENTER}");
}

/* TrackBar */
Expand All @@ -121,9 +94,26 @@ private void SpamLengthTrackBar_Scroll(object sender, EventArgs e)
LabelSpamLength.Text = text;
}

/* Menu Strip */
private void CloseMenuStrip_Click(object sender, EventArgs e)
{
Close();
}
private void InfoMenuStrip_Click(object sender, EventArgs e)
{
MessageBox.Show("There are 1000 milliseconds in one second, the slider provided for Spam Speed only goes up to 1000 milliseconds (1 second)" + "\n \n" + "The maximum value that can be selected for Spam Speed would be 1 message / 1000 milliseconds (1 second)", "");
}
private void TutorialMenuStrip_Click(object sender, EventArgs e)
{
MessageBox.Show("How to use the Spambot program:\r\n\r\n1. Enter the text you want to spam in the designated text field.\r\n2. Choose an interval for the spam speed by using the slider.\r\n3. Choose a duration for the spamming, ranging from 1 to 60 seconds.\r\n4. Press the \"start\" button to begin the spamming process.\r\n5. Focus on the text field you want the spam to be sent to.\r\n6. To stop the program, press the \"stop\" button.\r\n7. To set everything back to the default values, use the \"default values\" button.\n\r\nPlease note that spamming is illegal and unethical. Therefore, it is important to use this program only for legitimate and lawful purposes and to obtain proper consent before sending any messages.", "");
}
private void TwitterMenuStrip_Click(object sender, EventArgs e)
{
Process.Start("https://twitter.com/Ce9Fc4x");
}
private void GithubMenuStrip_Click(object sender, EventArgs e)
{
Process.Start("https://github.com/yusuftuncay");
}
}
}

0 comments on commit 2ddc0f8

Please sign in to comment.