

#include <iostream.>
#include <Windows.h>
#include <string.h>
using namespace std;
bool spam = false; //Set the spam switch to off
string spamword = "IM A FAGG0T N0BB"; //... lol
int len=spamword.length(); //The length of the string to spam
HWND hwnd = NULL; //Set the window handle to NULL
DWORD word; //Temporary input var
void KeyPress(CHAR chr)
{
short key = VkKeyScan(tolower(chr));//Get the keycode of input character
keybd_event(key,key,KEYEVENTF_EXTENDEDKEY | 0, 0); //Simulate Key Press
keybd_event(key,key,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,0);//Simulate the release
}
void AddLine() //Adds a new line via pushing enter
{
keybd_event(VK_RETURN,VK_RETURN,KEYEVENTF_EXTENDEDKEY | 0, 0); //Simulate Key Press
keybd_event(VK_RETURN,VK_RETURN,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,0);//Simulate the release
}
int main()
{
cout<<"Welcome to my shitty spammer that i can haz 4 combat arms h4x\nPress Insert to start spamming.\n\n";
cout<<"Findng Combat Arms...\n";
while(hwnd==NULL) //While the window handle has not been set yet
{
if(FindWindow(NULL,"Name of Combat Arms Window goes here")) //If you are able to set the window handle
{
cout<<"Combat Arms found.\n";
hwnd = FindWindow(NULL,"Name of Combat Arms Window goes here"); //Set the window handle
break; //Break out of while loop to avoid Sleep time
}
if(!FindWindow(NULL,"Name of Combat Arms Window goes here")) //If you can't set the window handle (because CA is not running)
{
cout<<"Combat Arms not found. Searching again in 5 seconds.\n"; //Show a message then go to the sleep timer
}
Sleep(5000); //Wait 5 seconds before repeating while loop (if hwnd is NULL)
}
while(hwnd!=NULL) //infinite loop as long as you have control of the window
{
if (GetFocus()==hwnd)//If the currently focussed window is Combat Arms
{
main:
if(GetAsyncKeyState(VK_INSERT))//If you pushed insert
{
spam = !spam; //Toggle the spam boolean (on/off switch)
if(spam) //If it got toggled to on
{
cout<<"Spammer turned on.\n"; //Output some text
}
if(!spam) //If it got toggled to off
{
cout<<"Spammer turned off.\n"; //Output different text
}
Sleep(250); //Wait 250 milliseconds for use to release key
}
if(spam)//If the spammer is turned on
{
int i;
for(i=0;i<len;i++)//for loop, look it up
{
CHAR str=spamword[i]; //Change the string letter into a char
KeyPress(str);//Push the key accordingly
}
AddLine(); //Go to next line
Sleep(20); //The delay in milliseconds to wait between messages
goto main; //Yeah.
}
}
Sleep(250); //while loop delay
}
return 0; //teh end
}

