Advertisement
Guest User

Untitled

a guest
Feb 25th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. #include <Windows.h>
  2. #include <iostream>
  3. #include <thread>
  4. #include <stdlib.h>
  5.  
  6. using namespace std;
  7.  
  8. int input;
  9. int sharpness;
  10. int key;
  11. int mode;
  12.  
  13. void InGame() {
  14. while (true) {
  15.  
  16. Sleep(300);
  17. if (GetAsyncKeyState(38)) {
  18. input++;
  19. Sleep(300);
  20. }
  21.  
  22. Sleep(300);
  23. if (GetAsyncKeyState(40)) {
  24. input--;
  25. Sleep(300);
  26. }
  27. if (GetAsyncKeyState(37)) {
  28. sharpness--;
  29. Sleep(300);
  30. }
  31. if (GetAsyncKeyState(39)) {
  32. sharpness++;
  33. Sleep(300);
  34. }
  35.  
  36. std::this_thread::sleep_for(std::chrono::milliseconds(1));
  37. }
  38. }
  39.  
  40. void Emergency() {
  41. while (true) {
  42. if (GetAsyncKeyState(98)) {
  43. Beep(523, 300);
  44. Beep(523, 300);
  45. Beep(523, 300);
  46. exit(EXIT_FAILURE);
  47. }
  48. std::this_thread::sleep_for(std::chrono::milliseconds(1));
  49. }
  50. }
  51.  
  52. void Function() {
  53.  
  54. while (true) {
  55.  
  56. if (GetAsyncKeyState(key)) {
  57.  
  58. if (GetAsyncKeyState(1)) {
  59. POINT cursorpos;
  60. GetCursorPos(&cursorpos);
  61.  
  62. SetCursorPos(cursorpos.x, cursorpos.y + input);
  63. Sleep(sharpness);
  64. }
  65. else {
  66.  
  67. POINT cursorpos;
  68. GetCursorPos(&cursorpos);
  69.  
  70. SetCursorPos(cursorpos.x, cursorpos.y);
  71.  
  72. }
  73. }
  74. std::this_thread::sleep_for(std::chrono::milliseconds(1));
  75. }
  76. }
  77.  
  78. int main() {
  79.  
  80. SetConsoleTitle("Mazhu");
  81.  
  82. cout << "Mazhu - Small Project" << endl << endl;
  83. cout << "Hold Key: ";
  84. cin >> key;
  85. cout << endl;
  86. cout << "Power: ";
  87. cin >> input;
  88. cout << endl << "Sharpness Delay: ";
  89. cin >> sharpness;
  90. cout << endl << "LAN/Stream Mode: ";
  91. cin >> mode;
  92.  
  93.  
  94. if (mode >= 1) {
  95. FreeConsole();
  96. }
  97. else {
  98. getchar();
  99. }
  100.  
  101. std::thread EmergencyThread(Emergency);
  102. std::thread FunctionThread(Function);
  103. std::thread IngameThread(InGame);
  104. EmergencyThread.join();
  105. FunctionThread.join();
  106. IngameThread.join();
  107.  
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement