Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <Windows.h>
- using namespace std;
- int main()
- {
- bool click = false;
- bool bClick = false;
- while (1)
- {
- if (GetAsyncKeyState('U') &1) {
- bClick = !bClick;
- }
- if (bClick) {
- if (GetAsyncKeyState(VK_LBUTTON) & 0x8000)
- {
- click = true;
- }
- if (click == true)
- {
- INPUT buffer[8];
- memset(buffer, 0, sizeof(INPUT) * 8);
- for (int i = 0; i < 7; i++)
- {
- buffer[i].mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
- i++;
- buffer[i].mi.dwFlags = MOUSEEVENTF_LEFTUP;
- }
- SendInput(8, buffer, sizeof(INPUT));
- click = false;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment