1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
#include <windows.h>
#include <stdlib.h>
#include <cstdlib>
using namespace std;
int main(void)
{
for(;;){
int a;
a = rand()%7;
if (a == 1)
{keybd_event(VkKeyScan('w'),0,0,0);}
else if (a == 2)
keybd_event(VkKeyScan('a'),0,0,0);
else if (a == 3)
keybd_event(VkKeyScan('s'),0,0,0);
else if (a == 4)
keybd_event(VkKeyScan('d'),0,0,0);
else if (a == 5)
keybd_event(VkKeyScan('1'),0,0,0);
else if (a == 6)
keybd_event(VkKeyScan('2'),0,0,0);
else
keybd_event(VkKeyScan('3'),0,0,0);
}
return 0;
}
|