Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <string>
- #include <fstream>
- #include <windows.h>
- #include <cstdlib>
- #include <ctime>
- #include <sstream>
- using namespace std;
- int main() {
- srand(time(NULL));
- bool loopd = true;
- int min = -10;
- int max = 20;
- bool sus = true;
- int state;
- double version = 0;
- bool cont = true;
- string translate = "";
- LPCTSTR WindowName = NULL;
- POINT pt;
- HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
- SetConsoleTextAttribute(hStdOut, FOREGROUND_RED);
- cout << " _ __ " << endl;
- cout << " __ _ _ __(_)/ _|" << endl;
- cout << " / _` | '__| | |_ " << endl;
- cout << " | (_| | | | | _|" << endl;
- cout << " |__, |_| |_|_| " << endl;
- cout << " |___/ " << endl;
- cout << "" << endl;
- cout << "Welcome to grif's clicker! Press X to stop the clicker, and Z to resume." << endl;
- while (cont) {
- cout << "Please enter the Minecraft version you're using (1.7, 1.8): ";
- getline(cin, translate);
- stringstream trs(translate);
- if (trs >> version && version == 1.7 || version == 1.8) {
- cont = false;
- }
- }
- if (version = 1.7) {
- LPCTSTR WindowName = "Minecraft 1.7.10";
- }
- else if (version = 1.8) {
- LPCTSTR WindowName = "Minecraft 1.8.9";
- }
- HWND hwnd = FindWindowA(NULL, WindowName);
- if (hwnd == NULL) {
- cout << "Couldn't find the program..." << endl;
- Sleep(2000);
- exit(-2);
- }
- else {
- Sleep(1000);
- cout << "Attempting to hook..." << endl;
- Sleep(1000);
- cout << "Hooked!" << endl;
- }
- while (sus = true) {
- loopd = true;
- hwnd = GetForegroundWindow();
- if (GetAsyncKeyState(VK_END)) {
- state = 0;
- }
- if (GetAsyncKeyState(VK_LBUTTON)) {
- state = 1;
- }
- while (GetAsyncKeyState(VK_LBUTTON)) {
- int delay = (40 + min + (rand() % (int)(max - min + 1)));
- GetCursorPos(&pt);
- SendMessage(hwnd, WM_LBUTTONDOWN, MK_LBUTTON, MAKELPARAM(pt.x, pt.y));
- Sleep(delay);
- SendMessage(hwnd, WM_LBUTTONUP, 0, MAKELPARAM(pt.x, pt.y));
- Sleep(delay);
- }
- if (GetAsyncKeyState(VK_RBUTTON)) {
- state = 1;
- }
- while (GetAsyncKeyState(VK_RBUTTON)) {
- int delay = (40 + min + (rand() % (int)(max - min + 1)));
- GetCursorPos(&pt);
- SendMessage(hwnd, WM_RBUTTONDOWN, MK_RBUTTON, MAKELPARAM(pt.x, pt.y));
- Sleep(delay);
- SendMessage(hwnd, WM_RBUTTONUP, 0, MAKELPARAM(pt.x, pt.y));
- Sleep(delay);
- }
- if (GetAsyncKeyState(0x58)) {
- while (loopd) {
- sus = false;
- if (GetAsyncKeyState(0x5A)) {
- sus = true;
- loopd = false;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement