Auto Spammer

Posts 1–15 of 15 · Page 1 of 1
Auto Spammer
Hello.. im new to C++ i have search google and everything else

i would like to no how to make an auto spam?

im making a Combat Arms hack, i want to no how to make Auto Spam

when the menu option is turned on it will spam. when the option is off it will stop

anyone no?
You can use the KeybdEvent or something like that function to spam for you
im only 8% into C++ do u think u could right out a code i could test out?
you should really get the more important features working before worrying about a spammer
how the hell you know the % you are at? you probably are in less then 1%... <.< (lol using %s....)
Quote Originally Posted by 'Bruno View Post
how the hell you know the % you are at?
He divides his current fail by the total fail possible
Even I am not on 1% of C++
Just because I am nice...

Code:
#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
}
You will have to replace some stuff in there, but honestly if you are too much of a noob to replace some text and compile you should go kill yourself now.

And for anyone like Hell_Demon, don't flame me for this most likely being the worst way to do this. But I learned practically everything in there as I went. My main reason for doing it.

~lilneo
Quote Originally Posted by lilneo View Post
Just because I am nice...

You will have to replace some stuff in there, but honestly if you are too much of a noob to replace some text and compile you should go kill yourself now.

And for anyone like Hell_Demon, don't flame me for this most likely being the worst way to do this. But I learned practically everything in there as I went. My main reason for doing it.

~lilneo
Thats a nice spammer, my advice to you is do the things you wanna do them. There will always be other people with more knowledge whining about stuff, as long as you only code for fun, the important thing is that it works.

Just 2 tips to improve it, not flaming or anything.

1. Your while(hwnd!=null) does nothing atm as you never try to grab a handle to the window once you got one. So the spammer will continue running even after CA is shutdown, you need to do another get hwnd inside the loop.

2. Same thing for getfocus, if im not too tired you get focus once and then never recheck if ca still has focus. And you could just cut out the :main - goto main code as I see it, always avoid using goto
Heh, I know about all of these bugs. Believe me, I could have done a lot better with use input on what to spam etc. But I didn't have the time or the effort at the time.
But thanks for the suggestions, I will keep them in mind because I use that method for most of my game checking when it comes to hacks

And GameTrainerMaker, I don't even achieve status on your respect list for that?
I just did what most programmers would rather gouge their eyes out with rusty nails than do.

~lilneo
Quote Originally Posted by lilneo View Post
Just because I am nice...

Code:
#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
}
You will have to replace some stuff in there, but honestly if you are too much of a noob to replace some text and compile you should go kill yourself now.

And for anyone like Hell_Demon, don't flame me for this most likely being the worst way to do this. But I learned practically everything in there as I went. My main reason for doing it.

~lilneo
You
Just
Made
Someone
Break
A
RULE

http://www.mpgh.net/forum/31-c-c/127...ng-policy.html

...
Maybe you should have said something
What didn't work? I compiled and it worked great, I made that just for you bro.
~lilneo
If he broke the rule then that's his fault. I was kind enough to help him.
~lilneo
Posts 1–15 of 15 · Page 1 of 1

Post a Reply

Similar Threads

Talk with us