Site n00b.. (A leecher if I've been here for more than a month and can't earn 5 rep)
Rep Power: 2
Reputation: 3
Posts: 26
Join Date: Jul 2007
Really simple AFK-"bot" in C++ -
05-09-2008
Hello!
Thought I should make a simple "guide" on how to make a really simple AFK-bot in C++!
The idea is to send a keypress every now and then, and this is really easy.
We'll make a loop that presses "w" every 2 mins.
Code:
#include <iostream>
#include <windows.h>
#include <time.h>
// sleep() function
void sleep(unsigned int mseconds)
{
clock_t goal = mseconds + clock();
while (goal > clock());
}
int main()
{
std::cout << "AFK-Bot!\n";
std::cout << "Press any key to start!" << std::endl;
cin.get();
std::cout << "Starting in 30 seconds." << std::endl;
sleep(30000)
for(;;) {
std::cout << "Sending key: \"W\"" << std::endl;
keybd_event(VkKeyScan('W'), 0, 0, 0);
sleep(120000);
}
return 0;
}
[Only registered and activated users can see links. ] [Only registered and activated users can see links. ]
Now, you can experiment with some things.
For example try to make the program press the AV-trinket that ports you to the base 2 mins after you've started the bot.
The big downside to this bot, is that it isn't 100% automated.
You have to sign up for the battleground yourself, and exit and enter the bot again after you've done with that battleground.
Site n00b.. (A leecher if I've been here for more than a month and can't earn 5 rep)
Rep Power: 2
Reputation: 3
Posts: 26
Join Date: Jul 2007
05-09-2008
I would also recommend checking out the source for [Only registered and activated users can see links. ] if you want something more advanced. It's not made by me, but it's a lot better :P