Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. #include <Windows.h>
  2. #include <iostream>
  3. #include <string>
  4.  
  5. int main() {
  6. // Declare some shit
  7. HWND windowHandle = FindWindow(0, "#spam - Discord");
  8. bool toggled = false;
  9. bool found = false;
  10. INPUT input;
  11. WORD vkey = 0x4C;
  12. input.type = INPUT_KEYBOARD;
  13. input.ki.wScan = MapVirtualKey(vkey, MAPVK_VK_TO_VSC);
  14. input.ki.time = 0;
  15. input.ki.dwExtraInfo = 0;
  16. input.ki.wVk = vkey;
  17.  
  18. // Checks to see if the window is open, returns if not
  19. if (windowHandle == NULL) {
  20. MessageBox(NULL, "The '#spam' channel is not open!", "Levaa XP Bot", MB_OK);
  21. exit(0);
  22. return 0;
  23. } else {
  24. found = true;
  25. }
  26.  
  27. // If the window is open
  28. if (found == true) {
  29.  
  30. // Basic user information
  31. std::cout << "Levaa's XP Bot has been activated, please make sure that you have the discord chat box ready!" << std::endl;
  32. std::string debug;
  33. std::cout << "First message will send in 55 seconds. This is an AFK bot, so don't use your computer while running or press any keys..." << std::endl;
  34. std::getline(std::cin, debug);
  35.  
  36.  
  37.  
  38. //-----------------------//
  39. // Sending keystrokes //
  40. //-----------------------//
  41. while (found) {
  42. Sleep(55000);
  43.  
  44. SendInput(1, &input, sizeof(INPUT));
  45.  
  46. input.ki.dwFlags = KEYEVENTF_KEYUP;
  47. SendInput(1, &input, sizeof(INPUT));
  48. }
  49.  
  50. }
  51. return 0;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement