Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Windows.h>
- #include <iostream>
- #include <string>
- int main() {
- // Declare some shit
- HWND windowHandle = FindWindow(0, "#spam - Discord");
- bool toggled = false;
- bool found = false;
- INPUT input;
- WORD vkey = 0x4C;
- input.type = INPUT_KEYBOARD;
- input.ki.wScan = MapVirtualKey(vkey, MAPVK_VK_TO_VSC);
- input.ki.time = 0;
- input.ki.dwExtraInfo = 0;
- input.ki.wVk = vkey;
- // Checks to see if the window is open, returns if not
- if (windowHandle == NULL) {
- MessageBox(NULL, "The '#spam' channel is not open!", "Levaa XP Bot", MB_OK);
- exit(0);
- return 0;
- } else {
- found = true;
- }
- // If the window is open
- if (found == true) {
- // Basic user information
- std::cout << "Levaa's XP Bot has been activated, please make sure that you have the discord chat box ready!" << std::endl;
- std::string debug;
- 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;
- std::getline(std::cin, debug);
- //-----------------------//
- // Sending keystrokes //
- //-----------------------//
- while (found) {
- Sleep(55000);
- SendInput(1, &input, sizeof(INPUT));
- input.ki.dwFlags = KEYEVENTF_KEYUP;
- SendInput(1, &input, sizeof(INPUT));
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement