Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- #include <thread>
- #include <Windows.h>
- int RandomAction, Active, LoopDelay, HumanDelay,RandomDelay, RandomPixelsX, RandomPixelsY;
- class Action
- {
- public:
- void Delay(int ms)
- {
- std::this_thread::sleep_for(std::chrono::milliseconds(ms));
- }
- void KIP(int VirtualCode , int DwFlags)
- {
- Delay(HumanDelay);
- INPUT input;
- input.type = INPUT_KEYBOARD;
- input.ki.wScan = MapVirtualKey(VirtualCode , MAPVK_VK_TO_VSC);
- input.ki.time = NULL;
- input.ki.dwExtraInfo = NULL;
- input.ki.wVk = VirtualCode;
- input.ki.dwFlags = DwFlags;
- SendInput(1, &input, sizeof(INPUT));
- }
- void MIP(int x , int y , int DwFlags)
- {
- Delay(HumanDelay);
- INPUT input;
- input.type = INPUT_MOUSE;
- input.mi.dx = x;
- input.mi.dy = y;
- input.mi.mouseData = NULL;
- input.mi.dwFlags = DwFlags;
- input.mi.time = NULL;
- input.mi.dwExtraInfo = NULL;
- SendInput(1, &input, sizeof(INPUT));
- }
- };
- int Random(int Min ,int Max)
- {
- int Result = rand() % Max + Min;
- return Result;
- }
- void ActiveCheck()
- {
- if (GetAsyncKeyState(0x77))
- {
- Active = false;
- }
- }
- void InputAction(int UseKeyInput, int UseMouseInput , int VirtualCode, int MouseDwFlags , int MouseDwFlags2, int UseDelayBetweenKeyInput, int UseDelayBetweenMouseInput)
- {
- Action t1;
- std::cout << RandomAction << "\t Key:" << "\t " << VirtualCode << std::endl;
- if (UseKeyInput == 1)
- {
- t1.KIP(VirtualCode, NULL);
- }
- if (UseDelayBetweenKeyInput == 1)
- {
- t1.Delay(HumanDelay);
- }
- if (UseDelayBetweenKeyInput == 2)
- {
- t1.Delay(RandomDelay);
- }
- if (UseKeyInput == 1)
- {
- t1.KIP(VirtualCode, KEYEVENTF_KEYUP);
- }
- if (UseMouseInput == 1 || UseMouseInput == 2)
- {
- t1.MIP(RandomPixelsX, RandomPixelsY, MouseDwFlags);
- }
- if (UseDelayBetweenMouseInput == 1)
- {
- t1.Delay(HumanDelay);
- }
- if (UseDelayBetweenMouseInput == 2)
- {
- t1.Delay(RandomDelay);
- }
- if (UseMouseInput == 2)
- {
- t1.MIP(RandomPixelsX, RandomPixelsY, MouseDwFlags2);
- }
- }
- int main()
- {
- while (true)
- {
- Action Delay;
- Delay.Delay(1);
- while (true)
- {
- Delay.Delay(100);
- srand(Random(1 , 100));
- while (GetAsyncKeyState(0x76))
- {
- ActiveCheck();
- Active = true;
- while (Active == true)
- {
- LoopDelay = Random(100, 200);
- Delay.Delay(LoopDelay);
- RandomAction = Random(1, 250);
- std::cout << "Delay: " << LoopDelay << std::endl;
- HumanDelay = Random( 110 , 250);
- RandomDelay = Random( 700 , 1200);
- RandomPixelsX = Random ( -750, 1400 );
- RandomPixelsY = Random( -300, 600 );
- if (RandomAction <= 25)
- {
- InputAction(1, 1, 0x57, MOUSEEVENTF_MOVE, NULL, 2, 1); // 1
- }
- else if (RandomAction >= 26 && RandomAction <=50)
- {
- InputAction(1, 1, 0x44, MOUSEEVENTF_MOVE, NULL, 2, 1); // 2
- }
- else if (RandomAction >= 51 && RandomAction <= 75)
- {
- InputAction(1, 1, 0x20, MOUSEEVENTF_MOVE, NULL, 1, 1); // 3
- }
- else if (RandomAction >= 76 && RandomAction <= 100)
- {
- InputAction(1, 1, 0x57, MOUSEEVENTF_MOVE, NULL, 2, 1); // 4
- }
- else if (RandomAction >= 101 && RandomAction <= 125)
- {
- InputAction(1, 1, 0x53, MOUSEEVENTF_MOVE, NULL, 1, 1); // 5
- }
- else if (RandomAction >= 126 && RandomAction <= 135)
- {
- InputAction(1, 1, 0x51, MOUSEEVENTF_MOVE, NULL, 1, 1); // 6
- }
- else if (RandomAction >= 136 && RandomAction <= 150)
- {
- InputAction(1, 1, 0x51, MOUSEEVENTF_LEFTDOWN, MOUSEEVENTF_LEFTUP, 1, 2); // 7
- }
- else if (RandomAction >= 151 && RandomAction <= 175)
- {
- InputAction(1, 1, 0x41, MOUSEEVENTF_MOVE, NULL, 2, 1); // 8
- }
- else if (RandomAction >= 176 && RandomAction <= 200)
- {
- InputAction(1, 1, 0x11, MOUSEEVENTF_MOVE, NULL, 2, 1); // 9
- }
- else if (RandomAction >= 201 && RandomAction <= 250)
- {
- InputAction(1, 1, 0x57, MOUSEEVENTF_MOVE, NULL, 2, 1); // 10
- }
- if (GetAsyncKeyState(0x77))
- {
- Active = false;
- break;
- }
- }
- }
- break;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement