@@ -11,7 +11,9 @@ using namespace std;
11
11
12
12
// Promìnné
13
13
wstring wts;
14
- int delay;
14
+ int delay = 30 ;
15
+ int inbDelay = 0 ;
16
+ HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
15
17
16
18
// Arrays
17
19
vector<string> splashText = { " Le fishe au chocolat." , " Napajedla neexistují." , " Praise Gabèa." , " Python je cringe." , " Garance špagetového kódu." , " Schváleno Kuncišem." , " Spamujte s tím Hendrycha." , " Isn't it?" , " Nenávidím tento jazyk." , " Poøád stabilnìjší než Fallout 76." , " Amogus sus." };
@@ -54,14 +56,18 @@ void sendText() {
54
56
shift.ki .dwFlags = KEYEVENTF_KEYUP;
55
57
alt.ki .dwFlags = KEYEVENTF_KEYUP;
56
58
59
+ Sleep (inbDelay);
57
60
SendInput (1 , &input, sizeof (INPUT));
61
+ Sleep (inbDelay);
58
62
SendInput (1 , &shift, sizeof (INPUT));
63
+ Sleep (inbDelay);
59
64
SendInput (1 , &alt, sizeof (INPUT));
60
65
61
66
}
62
67
63
68
SendInput (1 , &enter, sizeof (INPUT));
64
69
enter.ki .dwFlags = KEYEVENTF_KEYUP;
70
+ Sleep (inbDelay);
65
71
SendInput (1 , &enter, sizeof (INPUT));
66
72
67
73
Sleep (delay);
@@ -75,19 +81,36 @@ void flushCin() {
75
81
76
82
void setColor (WORD msgColor) {
77
83
78
- HANDLE hConsole = GetStdHandle (STD_OUTPUT_HANDLE);
79
- SetConsoleTextAttribute (hConsole, msgColor);
84
+ SetConsoleTextAttribute (hConsole, msgColor); // Toto mi usnadní práci jen minimálnì, ale je to i tak užiteèné
80
85
}
81
86
82
87
void printColoredMsg (WORD msgColor, string msg, WORD nextColor) {
83
-
84
- HANDLE hConsole = GetStdHandle (STD_OUTPUT_HANDLE);
85
88
86
89
SetConsoleTextAttribute (hConsole, msgColor);
87
90
cout << msg;
88
91
SetConsoleTextAttribute (hConsole, nextColor);
89
92
}
90
93
94
+ void printRainbowMsg (int clrBase, string msg, WORD nextColor) {
95
+
96
+ int clr = clrBase;
97
+
98
+ for (int i = 0 ; i < msg.length (); i++) {
99
+
100
+ SetConsoleTextAttribute (hConsole, clr);
101
+ clr++;
102
+
103
+ if (clr > clrBase + 5 ) {
104
+
105
+ clr = clrBase;
106
+ }
107
+
108
+ cout << msg[i];
109
+ }
110
+
111
+ SetConsoleTextAttribute (hConsole, nextColor);
112
+ }
113
+
91
114
template <typename T>
92
115
93
116
T chooseRandElem (vector<T> arr) {
0 commit comments