-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
40 lines (33 loc) · 1.09 KB
/
main.cpp
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
#include <iostream>
#include <unistd.h>
#include <time.h>
#include <windows.h>
using namespace std;
int main()
{
cout << "run test" << endl;
system("Auto.bat");
while (1) {
time_t nowTime = time(NULL);
tm* t_tm = localtime(&nowTime);
if(7<t_tm->tm_hour < 16){
if(t_tm->tm_hour < 9 ){
if(t_tm->tm_hour == 9 && t_tm->tm_min == 1 && t_tm->tm_sec == 0){
cout << "It`s time to clock in!" << endl;
system("Auto.bat");
cout << "\033[40;32m Next run is 15:01:00 \033[0m" << endl;
}
} else{
if(t_tm->tm_hour == 15 && t_tm->tm_min == 1 && t_tm->tm_sec == 0){
cout << "It`s time to clock in!" << endl;
system("Auto.bat");
cout << "\033[40;32m Next run is 09:01:00 \033[0m" << endl;
}
}
} else {
cout << "\033[40;31m No Clock in is needed!\033[0m" << endl;
exit(0);
}
}
return 0;
}