-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShinyTool.cpp
More file actions
121 lines (99 loc) · 2.28 KB
/
Copy pathShinyTool.cpp
File metadata and controls
121 lines (99 loc) · 2.28 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#include <iostream>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <windows.h>
#include <unistd.h>
#include <ctime>
using namespace std;
void setup();
int hunt();
void writePokeData(string, string, string, time_t);
void writeHuntData(int);
int main ()
{
int op;
cout<<"\t ||WELCOME TRAINER|| \n\n";
cout<<"1.start a new hunt\n\n";
do{
cout<<"Please pick an option...\n";
cin>>op;
switch(op)
{
case 1:
setup();
cout<<"Ready to start...";
//sleep(2);
hunt();
break;
default:
cout<<"Error: invalid option.\n";
sleep(1);
break;
}
}while(op != 1);
}
void setup()
{
time_t tiempoInicio;
time(&tiempoInicio);
string pokemon, game, meth;
system("cls");
cout<<"\t ||STARTING A NEW HUNT|| \n\n";
cout<<"Pokemon: ";
cin>>pokemon;
cout<<"Game: ";
cin>>game;
cout<<"Method: ";
cin>>meth;
writePokeData(pokemon, game, meth, tiempoInicio);
cout<<"\n\n";
}
int hunt()
{
system("cls");
int count;
cout<<"||Press Space bar to increase the counter, press left arrow to decrease the counter, press R to finish the hunt||\n\n";
cout << "Encounters: "<<count<<endl;
while (true)
{
while (true)
{
if (GetAsyncKeyState(VK_SPACE) & 0x8000)
{
count++;
break;
}
else if (GetAsyncKeyState(VK_LEFT) & 0x8000)
{
count--;
break;
}
else if (GetAsyncKeyState(0x52) & 0x8000)
{
writeHuntData(count);
cout<<"\nHunt finished, data exported\n";
return 0;
}
}
sleep(1);
system("cls");
cout<<"||Press Space bar to increase the counter, press left arrow to decrease the counter, press R to finish the hunt||\n\n";
cout << "Encounters: "<<count<<endl;
}
}
void writePokeData(string pokemon, string game, string meth, time_t tiempo)
{
ofstream archivo("caza.txt");
if(archivo.is_open())
{
archivo<<"||HUNT REPORT|\n\n";
archivo<<"Date: "<<ctime(&tiempo)<<endl;
archivo<<"Pokemon: "<<pokemon<<endl;
archivo<<"Game: "<<game<<endl;
archivo<<"Method: "<<meth<<endl;
}
}
void writeHuntData(int count)
{
}