Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.Runtime.InteropServices;
- using System.IO;
- namespace Le_Spam_Tool
- {
- public partial class Form1 : Form
- {
- public const int WM_NCLBUTTONDOWN = 0xA1;
- public const int HT_CAPTION = 0x2;
- [DllImportAttribute("user32.dll")]
- public static extern int SendMessage(IntPtr hWnd,
- int Msg, int wParam, int lParam);
- [DllImportAttribute("user32.dll")]
- public static extern bool ReleaseCapture();
- private string sysdrive;
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_MouseDown(object sender,
- System.Windows.Forms.MouseEventArgs e)
- {
- if (e.Button == MouseButtons.Left)
- {
- ReleaseCapture();
- SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
- }
- }
- private void panel1_MouseDown(object sender,MouseEventArgs e)
- {
- if (e.Button == MouseButtons.Left)
- {
- ReleaseCapture();
- SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
- }
- }
- public void check_border_type()
- {
- StreamReader rBorder = new StreamReader(Application.StartupPath + "\\settings\\2.txt");
- if (rBorder.ReadToEnd().Contains("1"))
- {
- this.ControlBox = true;
- this.MaximizeBox = false;
- this.Text = Application.ProductName;
- }
- else
- {
- this.ControlBox = false;
- this.Text = "";
- }
- rBorder.Close();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- label1.Text = textBox1.MaxLength.ToString();
- installReqFont();
- check_border_type();
- }
- private void panel1_Paint(object sender, PaintEventArgs e)
- {
- }
- private void installReqFont()
- {
- sysdrive = Directory.GetDirectoryRoot(Application.ExecutablePath);
- if (File.Exists(sysdrive + "windows\\fonts\\04B03.TTF"))
- {
- goto end;
- }
- string[] files = Directory.GetFiles(Application.StartupPath + "\\fonts\\");
- foreach (string f in files)
- {
- FileInfo fi = new FileInfo(f);
- string fn = fi.Name;
- try
- {
- File.Copy(Application.StartupPath + "\\fonts\\" + fn, sysdrive + "windows\\fonts\\" + fn);
- }
- catch (Exception ex)
- {
- if (ex.ToString().Contains("denied"))
- {
- this.Hide();
- MessageBox.Show("Could not install font. Please launch as administrator.\r\n\r\nYou can manually install the font (File Location: '" + Application.StartupPath + "\\fonts\\" + fn + "').", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
- System.Diagnostics.Process.Start(Application.StartupPath);
- Application.Exit();
- }
- else
- {
- MessageBox.Show(ex.ToString(),"Exception Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
- }
- }
- }
- end: ;
- }
- private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
- {
- Application.Exit();
- }
- private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
- {
- this.WindowState = FormWindowState.Minimized;
- }
- private void linkLabel4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
- {
- Form3Settings f3 = new Form3Settings();
- f3.Show();
- }
- private void pictureBox1_Click(object sender, EventArgs ee)
- {
- bool e = false;
- string sl = Application.StartupPath + "\\settings\\";
- if (!File.Exists(sl + "1.txt") || !File.Exists(sl + "2.txt") || !File.Exists(sl + "3.txt"))
- {
- e = true;
- MessageBox.Show("Y U TRY N SPAM WITH NO OPTIONS CONFIGURED?! >:(", "", MessageBoxButtons.OK, MessageBoxIcon.Question);
- Form3Settings f3 = new Form3Settings();
- f3.Show();
- }
- if (!e)
- {
- ReadD();
- }
- }
- private int secAmount, Amount;
- private string _string;
- bool sendkeys, secondAmount, pressEnter;
- private void ReadD()
- {
- if (textBox1.Text.Equals(""))
- {
- MessageBox.Show("I'm not spamming nothing. >_>\r\nEnter some text and try again!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
- goto end;
- }
- string sl = Application.StartupPath + "\\settings\\";
- _string = textBox1.Text;
- StreamReader r1 = new StreamReader(sl + "1.txt");
- // r1 = 1 (seconds) | r1 = 0 (amount)
- StreamReader r2 = new StreamReader(sl + "2.txt");
- StreamReader r3 = new StreamReader(sl + "3.txt");
- StreamReader r4 = new StreamReader(sl + "4.txt");
- if (r2.ReadToEnd().Contains("1"))
- {
- sendkeys = true;
- }
- else
- {
- sendkeys = false;
- }
- if (r1.ReadToEnd().Contains("1"))
- {
- secondAmount = true;
- }
- else
- {
- secondAmount = false;
- }
- if (r4.ReadToEnd().Contains("1"))
- {
- pressEnter = true;
- }
- else
- {
- pressEnter = false;
- }
- try
- {
- if (secondAmount)
- {
- secAmount = Convert.ToInt32(r3.ReadToEnd());
- }
- else if (!secondAmount)
- {
- Amount = Convert.ToInt32(r3.ReadToEnd());
- }
- }
- catch
- {
- MessageBox.Show("Error reading settings :S", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
- goto end;
- }
- this.Enabled = false;
- this.Hide();
- if (secondAmount)
- {
- spam_seconds();
- }
- else
- {
- spam_amount();
- }
- end: ;
- }
- Timer timer, t_timeout;
- private bool spam = false;
- private int timeout, timeout_seconds;
- private int v;
- private void spam_seconds()
- {
- timer = new Timer();
- t_timeout = new Timer();
- timeout_seconds = secAmount;
- spam = true;
- timer.Interval = 10;
- timer.Enabled = true;
- timer.Tick += new EventHandler(timer_Tick);
- t_timeout.Enabled = true;
- t_timeout.Interval = 1000;
- t_timeout.Tick +=new EventHandler(t_timeout_Tick);
- timeout = 0;
- v = 0;
- }
- private void timer_Tick(object sender, EventArgs e)
- {
- v++;
- if (pressEnter)
- {
- SendKeys.Send(_string + "{ENTER}");
- }
- else
- {
- SendKeys.Send(_string);
- }
- }
- private void t_timeout_Tick(object sender, EventArgs e)
- {
- if (timeout == timeout_seconds)
- {
- spam = false;
- timer.Enabled = false;
- t_timeout.Enabled = false;
- this.Enabled = true;
- this.Show();
- }
- timeout++;
- }
- private void spam_amount()
- {
- int v = 0;
- for (int i = 0; i < Amount; i++)
- {
- v++;
- if (pressEnter)
- {
- SendKeys.Send(_string + "{ENTER}");
- }
- else
- {
- SendKeys.Send(_string);
- }
- }
- this.Enabled = true;
- this.Show();
- }
- private void textBox1_TextChanged(object sender, EventArgs e)
- {
- //Update amount of characters left in TextBox
- string s = textBox1.Text;
- int sl = Convert.ToInt32(s.Length);
- int ml = Convert.ToInt32(textBox1.MaxLength.ToString());
- int r = ml - sl; //Maxlength - Current Text Length = x
- label1.Text = r.ToString();
- }
- private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
- {
- Form2Contact f2 = new Form2Contact();
- f2.Show();
- }
- private void label1_Click(object sender, EventArgs e)
- {
- System.Diagnostics.Process.Start(Application.StartupPath);
- }
- }
- }
Add Comment
Please, Sign In to add comment