-
Notifications
You must be signed in to change notification settings - Fork 0
/
click.c
42 lines (34 loc) · 943 Bytes
/
click.c
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
#include <iostream>
#include <time.h>
#include <chrono>
#include <thread>
#include <cstring>
#include <Windows.h>
void mouseCoordsToConsole() {
POINT p;
GetCursorPos(&p);
std::cout << "X: " << p.x << " Y: " << p.y << std::endl;
}
// TODO: CLI Arguments
int main() {
// mouseCoordsToConsole();
while (1)
{
time_t now = time(NULL);
struct tm* _tm;
_tm = localtime(&now);
char hours[3];
strftime(hours, sizeof(hours), "%H", _tm);
char minutes[3];
strftime(minutes, sizeof(minutes), "%M", _tm);
if (!strcmp(hours, "10") && !strcmp(minutes, "00")) {
break;
}
std::this_thread::sleep_for(std::chrono::seconds(60));
}
SetCursorPos(1853, 99);
// I could do it in one function call but oh well...
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
return 0;
}