Advertisement
Guest User

e

a guest
Mar 31st, 2020
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <string>
  4. #include <fstream>
  5. #include <windows.h>
  6. #include <cstdlib>
  7. #include <ctime>
  8. #include <sstream>
  9.  
  10. using namespace std;
  11.  
  12. int main() {
  13. srand(time(NULL));
  14. bool loopd = true;
  15. int min = -10;
  16. int max = 20;
  17. bool sus = true;
  18. int state;
  19. double version = 0;
  20. bool cont = true;
  21. string translate = "";
  22. LPCTSTR WindowName = NULL;
  23. POINT pt;
  24. HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
  25. SetConsoleTextAttribute(hStdOut, FOREGROUND_RED);
  26. cout << " _ __ " << endl;
  27. cout << " __ _ _ __(_)/ _|" << endl;
  28. cout << " / _` | '__| | |_ " << endl;
  29. cout << " | (_| | | | | _|" << endl;
  30. cout << " |__, |_| |_|_| " << endl;
  31. cout << " |___/ " << endl;
  32. cout << "" << endl;
  33. cout << "Welcome to grif's clicker! Press X to stop the clicker, and Z to resume." << endl;
  34. while (cont) {
  35. cout << "Please enter the Minecraft version you're using (1.7, 1.8): ";
  36. getline(cin, translate);
  37. stringstream trs(translate);
  38. if (trs >> version && version == 1.7 || version == 1.8) {
  39. cont = false;
  40. }
  41. }
  42. if (version = 1.7) {
  43. LPCTSTR WindowName = "Minecraft 1.7.10";
  44. }
  45. else if (version = 1.8) {
  46. LPCTSTR WindowName = "Minecraft 1.8.9";
  47. }
  48. HWND hwnd = FindWindowA(NULL, WindowName);
  49. if (hwnd == NULL) {
  50. cout << "Couldn't find the program..." << endl;
  51. Sleep(2000);
  52. exit(-2);
  53. }
  54. else {
  55. Sleep(1000);
  56. cout << "Attempting to hook..." << endl;
  57. Sleep(1000);
  58. cout << "Hooked!" << endl;
  59. }
  60.  
  61. while (sus = true) {
  62. loopd = true;
  63. hwnd = GetForegroundWindow();
  64. if (GetAsyncKeyState(VK_END)) {
  65. state = 0;
  66. }
  67.  
  68. if (GetAsyncKeyState(VK_LBUTTON)) {
  69. state = 1;
  70. }
  71.  
  72. while (GetAsyncKeyState(VK_LBUTTON)) {
  73. int delay = (40 + min + (rand() % (int)(max - min + 1)));
  74. GetCursorPos(&pt);
  75. SendMessage(hwnd, WM_LBUTTONDOWN, MK_LBUTTON, MAKELPARAM(pt.x, pt.y));
  76. Sleep(delay);
  77. SendMessage(hwnd, WM_LBUTTONUP, 0, MAKELPARAM(pt.x, pt.y));
  78. Sleep(delay);
  79. }
  80. if (GetAsyncKeyState(VK_RBUTTON)) {
  81. state = 1;
  82. }
  83. while (GetAsyncKeyState(VK_RBUTTON)) {
  84. int delay = (40 + min + (rand() % (int)(max - min + 1)));
  85. GetCursorPos(&pt);
  86. SendMessage(hwnd, WM_RBUTTONDOWN, MK_RBUTTON, MAKELPARAM(pt.x, pt.y));
  87. Sleep(delay);
  88. SendMessage(hwnd, WM_RBUTTONUP, 0, MAKELPARAM(pt.x, pt.y));
  89. Sleep(delay);
  90. }
  91. if (GetAsyncKeyState(0x58)) {
  92. while (loopd) {
  93. sus = false;
  94. if (GetAsyncKeyState(0x5A)) {
  95. sus = true;
  96. loopd = false;
  97. }
  98. }
  99. }
  100. }
  101. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement