Advertisement
Guest User

Auto Edit Complete Fortnite Macro #2

a guest
Sep 6th, 2018
5,366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. // EditMacroConsole.cpp : This file contains the 'main' function. Program execution begins and ends there.
  2. //
  3.  
  4. #include "pch.h"
  5. #include <windows.h>
  6. #include <iostream>
  7. #include <fstream>
  8.  
  9. using namespace std;
  10.  
  11. void pressG()
  12. {
  13. INPUT ip;
  14.  
  15. ip.type = INPUT_KEYBOARD;
  16. ip.ki.wScan = 0;
  17. ip.ki.time = 0;
  18. ip.ki.dwExtraInfo = 0;
  19.  
  20. ip.ki.wVk = 0x47; //Hex code for 'D' 51 for Q
  21. ip.ki.dwFlags = 0; //Press the key down ?
  22. SendInput(1, &ip, sizeof(INPUT)); //Use function
  23.  
  24. Sleep(50); //Sleep so it doesn't spam the key press
  25.  
  26. ip.ki.dwFlags = KEYEVENTF_KEYUP; //Release the key
  27. SendInput(1, &ip, sizeof(INPUT)); //Use function
  28. }
  29.  
  30. int main()
  31. {
  32. while (true) {
  33. if (GetAsyncKeyState('G') != 0) {
  34. cout << "G was pressed!" << endl;
  35. bool waitforup = false;
  36. bool mousenotpressed = true;
  37. bool waitforupright = false;
  38. bool mousenotpressedright = true;
  39. while (mousenotpressed == true && waitforup == false && mousenotpressedright == true) {
  40. if (GetAsyncKeyState(VK_LBUTTON) != 0 || GetAsyncKeyState(VK_RBUTTON) != 0) {
  41. if (GetAsyncKeyState(VK_LBUTTON)) {
  42. waitforup = true;
  43. mousenotpressed = false;
  44. cout << "Left Mouse pressed" << endl;
  45. }
  46. else {
  47. waitforupright = true;
  48. mousenotpressedright = false;
  49. cout << "Right Mouse pressed" << endl;
  50. }
  51.  
  52. }
  53. }
  54. while (waitforup == true && mousenotpressed == false && waitforupright == false) {
  55. if (GetAsyncKeyState(VK_LBUTTON) == 0) {
  56. pressG();
  57. waitforup = false;
  58. mousenotpressed = true;
  59. cout << "Left Mouse released!" << endl;
  60. }
  61. }
  62. while (waitforupright == true && mousenotpressedright == false && waitforup == false) {
  63. if (GetAsyncKeyState(VK_RBUTTON) == 0) {
  64. pressG();
  65. waitforupright = false;
  66. mousenotpressedright = true;
  67. cout << "Right Mouse released!" << endl;
  68. }
  69. }
  70. }
  71. }
  72.  
  73. }
  74.  
  75. // Run program: Ctrl + F5 or Debug > Start Without Debugging menu
  76. // Debug program: F5 or Debug > Start Debugging menu
  77.  
  78. // Tips for Getting Started:
  79. // 1. Use the Solution Explorer window to add/manage files
  80. // 2. Use the Team Explorer window to connect to source control
  81. // 3. Use the Output window to see build output and other messages
  82. // 4. Use the Error List window to view errors
  83. // 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
  84. // 6. In the future, to open this project again, go to File > Open > Project and select the .sln file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement