Solved How to make a bot in C++ or automate tasks

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

apelyido271

Newbie
Full Member
Jun 25, 2015
13
94
0
good day all..

is there anyone can help me with c language..

program that control other program or making a task to other program..
by importing a txt file with many links inside of it and send all link inside the txt file 1 by 1 with interval, and also can make push a button in other program..
I don't even know how to build one so a tutorial would be nice or a programmer I can paid for the simple program...
I dont know if what I am asking is realistic, but I so want one!
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,140
78,998
2,394
apelyido271 Welcome to GuidedHacking!

As other members have suggested please read our rules

We have lots of great information here all you need to do is search.
It seems that you want to write a robot to automate some tasks in a video game. This is difficult to do and you will need to learn alot.

Do our guide:
https://guidedhacking.com/starthere

After completing those tasks you will have a foundation of knowledge that will enable you to start working on a robot. Good luck!
 
Last edited:

Liduen

Hacker
Dank Tier VIP
May 19, 2013
702
8,478
33
I highly doubt somebody here will do this for you.
Also I suggest reading the rules of this forum before you post again.
 

apelyido271

Newbie
Full Member
Jun 25, 2015
13
94
0
i know a little coding on c.. but not botting.. i only know to do like calculator, adding txtbox and etc.. i really don't know how start making a bot..
 

apelyido271

Newbie
Full Member
Jun 25, 2015
13
94
0
ohw.. sry... my mistake.. i just carried away... really sorry for making a money demand for the program..

it seems this is really not easy... i tried researching on site bout botting other program but i didn't find any... all i find was botting games, ...
 

Obsta

Jr.Hacker
Meme Tier VIP
Jan 27, 2014
394
2,978
17
You can use IO to read input from a textfile and then create a handle to the game and use sendinput based on what ur IO stream read.
 

apelyido271

Newbie
Full Member
Jun 25, 2015
13
94
0
what you mean by IO?

btw.. i want to program another program, created by C++.. not a game...

my bad.. i really newbie here.. i don't know anything yet.. but needing a knowledge how to do it..
 

till0sch

Respected Hacker
Dank Tier VIP
Dank Tier Donator
Oct 14, 2012
1,104
12,593
51
what you mean by IO?

btw.. i want to program another program, created by C++.. not a game...

my bad.. i really newbie here.. i don't know anything yet.. but needing a knowledge how to do it..
IO generally means input-output.
 

apelyido271

Newbie
Full Member
Jun 25, 2015
13
94
0
sry for the late response.. thank you sir till0sch and anomanderrake... i'll try the best of mine to get knowledge of what everyone here suggested.. thank you...
 

Kilo

Coder
Dank Tier Donator
Nobleman
Feb 4, 2015
98
4,028
1
sry for the late response.. thank you sir till0sch and anomanderrake... i'll try the best of mine to get knowledge of what everyone here suggested.. thank you...
Depending on what you're trying to do, or what program you're trying to make this for, I could assist. I don't really have any projects going on at the moment except frustrating ASM code that doesn't want to cooperate lol. You can respond in thread or PM me details.
 

apelyido271

Newbie
Full Member
Jun 25, 2015
13
94
0
i was bothered on something that i cant help myself to it.. i need some idea bout this...

" how to determine what programming language was use in a certain application..
" my goal is going to create a program that can bot other program, my question is.. . is there a way that a program can bot other program even they have used different programming language?

sry... i'm poor in English.. please ask me if there's is a need to clarify... .
 

apelyido271

Newbie
Full Member
Jun 25, 2015
13
94
0
Depending on what you're trying to do, or what program you're trying to make this for, I could assist. I don't really have any projects going on at the moment except frustrating ASM code that doesn't want to cooperate lol. You can respond in thread or PM me details.
thank you so much sir kilo... for now .. . i need to learn more about c++ targeting I/O,.
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,140
78,998
2,394
1) Use c++.
2)It doesn't matter what language the game is written in
3) follow the guide I wrote for you
 

apelyido271

Newbie
Full Member
Jun 25, 2015
13
94
0
good day.. thank you sir AnomanderRake :) ... i'm still learning it... but my vb was out of date.. ... :(

Can anyone suggest a link where i can download vb latest version.... thank you..
 

Obsta

Jr.Hacker
Meme Tier VIP
Jan 27, 2014
394
2,978
17
good day.. thank you sir AnomanderRake :) ... i'm still learning it... but my vb was out of date.. ... :(

Can anyone suggest a link where i can download vb latest version.... thank you..
Microsoft offers a free gimped version of visual studio on their site, or else you can just pirate the good version.

Edit: Did you mean VB or VS? I'm assuming VS cause VB doesn't go out of date? Lol
 

apelyido271

Newbie
Full Member
Jun 25, 2015
13
94
0
Microsoft offers a free gimped version of visual studio on their site, or else you can just pirate the good version.

Edit: Did you mean VB or VS? I'm assuming VS cause VB doesn't go out of date? Lol
my bad.. sry for that.. vs i mean.. . i'll be carefull what i'll going to say next time.. i only have here VS2010, i want to replace it with latest version like 2013. but i out of clue where to get it..
I tried on micro-soft, but there was an error when i'm trying to download it.. . i want to updated my Visual Basic...

or is there other program like visual basic... i'm just only going to compile a c++ program...
 

Kilo

Coder
Dank Tier Donator
Nobleman
Feb 4, 2015
98
4,028
1
Based on what was explained to me through PM here's the code

C++:
#include <chrono>
#include <fstream>
#include <iostream>
#include <string>
#include <thread>
#include <vector>
#include <Windows.h>

//Prototype our functions
void clearConsole();
void clipboard(const std::string &output);
void keyDown(unsigned char key);
void keyUp(unsigned char key);
void leftClick();

int main()
{
	//We're going to rename the console and resize it
	SetConsoleTitle(L"Bot");
	HWND hConsole = GetConsoleWindow();
	RECT rect;
	GetWindowRect(hConsole, &rect);
	MoveWindow(hConsole, rect.left, rect.top, 160, 25, true);
	//Creating a vector of strings that you will be using to copy to paste
	std::vector<std::string>copy;
	//Opening a file called Text.txt that hold the text you will be using to paste
	std::ifstream file("Text.txt");
	//Checking to see if the file Text.txt exists
	if(file.is_open())
	{
		//Using this string to temporarily hold the line of text to put into our vector
		std::string output;
		while(file)
		{
			//Writing to the temporary string to add to our vector
			getline(file, output);
			copy.push_back(output);
		}
		//We use our pop_back ONCE because for some reason it adds the last line in our text file twice 
		copy.pop_back();
		file.close();
	}
	//If Text.txt file does not exist, we'll create our own & close the program so we can add
	//the text we want to copy
	else
	{
		std::ofstream file("Text.txt");
		file.close();
		return 0;
	}
	//Declaring our toggle to pause the program
	bool pause = true;
	//Infinite loop to control our Virtual-Key 'INSERT'
	while(true)
	{
		std::cout << "Botting: " << std::boolalpha << !pause;
		//Program will not start until INSERT Key has been pressed
		while(!GetAsyncKeyState(0x2D))std::this_thread::sleep_for(std::chrono::milliseconds(1000));
		clearConsole();
		std::cout << "Botting: " << std::boolalpha << pause;
		//Our toggle loop
		while(pause)
		{
			//Setting our cursor in the textbox
			SetCursorPos(100,246);
			leftClick();
			//Pasting our strings
			for(std::string paste : copy)
			{
				clipboard(paste);
				keyDown(0x11);
				keyDown(0x56);
				std::this_thread::sleep_for(std::chrono::milliseconds(100));
				keyUp(0x56);
				keyUp(0x11);
				keyDown(0x0D);
				std::this_thread::sleep_for(std::chrono::milliseconds(100));
				keyUp(0x0D);
			}
			//Clicking our buttons
			SetCursorPos(512, 243);
			leftClick();
			std::this_thread::sleep_for(std::chrono::milliseconds(100));
			SetCursorPos(554, 383);
			leftClick();
			//This is our toggle for pausing the program ON/OFF during our 15 second wait 
			for(int i = 0; i <= 15; i++)
			{
				if(GetAsyncKeyState(0x2D) && i >= 1)
				{
					pause = !pause;
					std::this_thread::sleep_for(std::chrono::milliseconds(1000));
					break;
				}
				std::this_thread::sleep_for(std::chrono::milliseconds(1000));
			}
		}
		//Reset our toggle
		pause = !pause;
		clearConsole();
	}
}

void clearConsole()
{
	HANDLE hStdOut;
    CONSOLE_SCREEN_BUFFER_INFO csbi;
    DWORD count;
    DWORD cellCount;
    COORD homeCoords = { 0, 0 };
    hStdOut = GetStdHandle( STD_OUTPUT_HANDLE );
    if (hStdOut == INVALID_HANDLE_VALUE)return;
    if (!GetConsoleScreenBufferInfo( hStdOut, &csbi ))return;
    cellCount = csbi.dwSize.X *csbi.dwSize.Y;
    if (!FillConsoleOutputCharacter(hStdOut, (TCHAR) ' ', cellCount, homeCoords, &count))return;
    if (!FillConsoleOutputAttribute(hStdOut, csbi.wAttributes, cellCount, homeCoords, &count))return;
    SetConsoleCursorPosition( hStdOut, homeCoords );
 }
void clipboard(const std::string &output)
{
	OpenClipboard(0);
	EmptyClipboard();	
	HGLOBAL hGlobal=GlobalAlloc(GMEM_MOVEABLE,output.size()+1);
	if (!hGlobal)
	{
		CloseClipboard();
		return;
	}
	memcpy(GlobalLock(hGlobal),output.c_str(),output.size()+1);
	GlobalUnlock(hGlobal);
	SetClipboardData(CF_TEXT,hGlobal);
	CloseClipboard();
	GlobalFree(hGlobal);
}
void keyDown(unsigned char key)
{
        INPUT input = { 0 };
        input.type = INPUT_KEYBOARD;
        input.ki.wVk = key;
        input.ki.dwFlags = 0;
        input.ki.time = 0;
        input.ki.dwExtraInfo = 0;
        SendInput(1, &input, sizeof(INPUT));
}
void keyUp(unsigned char key)
{
        INPUT input;
        input.type = INPUT_KEYBOARD;
        input.ki.wVk = key;
        input.ki.dwFlags = KEYEVENTF_KEYUP;
        input.ki.time = 0;
        input.ki.dwExtraInfo = 0;
        SendInput(1, &input, sizeof(INPUT));
}
void leftClick()
{
	INPUT input = { 0 };
	input.type = INPUT_MOUSE;
	input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
	::SendInput(1, &input, sizeof(INPUT));
	::SecureZeroMemory(&input, sizeof(INPUT));
	input.type = INPUT_MOUSE;
	input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
	::SendInput(1, &input, sizeof(INPUT));
}
 
Last edited:
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods