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;
}
Explaination on keybd_event()
Explaination on VkKeyScan()
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.
Hope this helpes someone