-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
72 lines (68 loc) · 1.25 KB
/
main.cpp
File metadata and controls
72 lines (68 loc) · 1.25 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include <iostream>
#include <vector>
#include <algorithm>
#define WINVER 0x0500
#include <Windows.h>
#include <stdlib.h>
#include <time.h>
#include "h_getkeyPresses.h"
using namespace std;
int main(){
FreeConsole();
//definition
int counter;
int target;
char i;
bool abbort;
char last;
char lastLast;
//zahlen
bool isEnabled[MAX_KEYS];
//time
clock_t start;
clock_t end;
//initialisation
abbort = false;
counter = 0;
last = 1;
lastLast = 0;
//random zahlengenerator
srand (time(NULL));
target = rand() %200 + 300;
//zahlen
for(counter = 0; counter < MAX_KEYS; counter++){
isEnabled[counter] = false;
}
counter = 0;
//schlaufe
start = clock();
end = start + target;
do{
for(i = 8; i <= 255; i++){
if(GetAsyncKeyState(i) == -32767){
// the key / on the numpad
last = i;
if(i == VK_NUMPAD9){
abbort = true;
}
else if(i == VK_DECIMAL){
clearAll(isEnabled);
}
else{
handleKeyPress(isEnabled, i);
}
}
if(abbort){
break;
}
start = clock();
if(start >= end){
sendInput(isEnabled);
start = clock();
target = rand() %200 + 300;
end = start + target;
}
}
}while(!abbort);
return 0;
}