This project is a C# form application for the game growtopia game, message spam sets the delay according to the character limit itself.
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace Test1
{
public partial class Form1 : Form
{
public Point mouseLocation;
public const uint WM_KEYDOWN = 0x100;
public const uint WM_KEYUP = 0x0101;
const int WM_LBUTTONDOWN = 0x0201;
const int WM_LBUTTONUP = 0x0202;
public TypeConverter converter = TypeDescriptor.GetConverter(typeof(Keys));
[DllImport("user32.dll")]
public static extern IntPtr PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr Hwnd, int msg, int param, int lparam);
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (spamText.Text.Length < 21)
{
timer1.Interval = 4000;
timer1.Start();
}
else if (spamText.Text.Length < 41)
{
timer1.Interval = 5500;
timer1.Start();
}
else if (spamText.Text.Length < 71)
{
timer1.Interval = 7600;
timer1.Start();
}
else if (spamText.Text.Length > 70)
{
timer1.Interval = 10000;
timer1.Start();
}
}
public void Spam(IntPtr Handle, string Text)
{
PostMessage(Handle, WM_KEYDOWN, (IntPtr)(Keys.Enter), IntPtr.Zero);
PostMessage(Handle, WM_KEYUP, (IntPtr)(Keys.Enter), IntPtr.Zero);
for (int i = 0; i < Text.Length; i++)
{
Keys keys1;
switch (Text[i].ToString())
{
case " ":
keys1 = Keys.Space;
break;
case "`":
keys1 = (Keys)0xC0;
break;
case @"":
keys1 = (Keys)0xDC;
break;
case "[":
keys1 = (Keys)0xDB;
break;
case "]":
keys1 = (Keys)0xDD;
break;
case "\t":
case "\n":
keys1 = Keys.Space;
break;
default:
keys1 = (Keys)converter.ConvertFromString(Text[i].ToString());
break;
}
PostMessage(Handle, WM_KEYDOWN, (IntPtr)keys1, IntPtr.Zero);
PostMessage(Handle, WM_KEYUP, (IntPtr)keys1, IntPtr.Zero);
}
PostMessage(Handle, WM_KEYDOWN, (IntPtr)Keys.Enter, IntPtr.Zero);
PostMessage(Handle, WM_KEYUP, (IntPtr)Keys.Enter, IntPtr.Zero);
}
private void timer1_Tick(object sender, EventArgs e)
{
IntPtr winTitle = Process.GetProcessesByName("Growtopia")[0].MainWindowHandle;
string spamText = this.spamText.Text.ToString();
Spam(winTitle, spamText.ToUpper());
}
private void button2_Click(object sender, EventArgs e)
{
timer1.Stop();
}
private void button1_Click_1(object sender, EventArgs e)
{
IntPtr winTitle = Process.GetProcessesByName("Growtopia")[0].MainWindowHandle;
test(winTitle);
}
void test(IntPtr hWnd)
{
PostMessage(hWnd, WM_LBUTTONDOWN, (IntPtr)1, (IntPtr)MakeLParam(1000,760));
}
public int MakeLParam(int LoWord, int HiWord)
{
return (int)((HiWord << 16) | (LoWord & 0xFFFF));
}
private void timer2_Tick(object sender, EventArgs e)
{
}
}
}