-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
96 lines (88 loc) · 3.14 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
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
#include <windows.h>
#include <iostream>
#include <vector>
#include <thread>
#include <string>
#include "mouse.h"
int x = 0;
int y = 3;
int z = 20;
bool recoilEnabled = false;
int mouseOpt = 3;
void recoil_thread();
void ui_thread();
int main() {
system("cls");
SetPriorityClass(GetCurrentProcess(), 0x00008000);
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)recoil_thread, NULL, 0, NULL);
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ui_thread, NULL, 0, NULL);
// std::cout << "Running!" << std::endl;
for (;;) {
Sleep(1);
}
std::cout << "Closing!" << std::endl;
return 0;
}
std::string onoroff(bool b) { // CONVERT BOOL 'b' TO STRING "On" OR STRING "Off"
if (b) {
return "On";
} else {
return "Off";
}
}
void ui_thread() {
system("Color 0F"); // 0=Black F=BrightWhite
int p = 0; int c = -1;
for (;;) {
switch (p)
{
case 0:
system("title Fishi's Simple Recoil - Menu"); system("cls");
std::cout << "[1] Toggle ["<<onoroff(recoilEnabled)<<"]" << std::endl << "[2] Change Settings" << std::endl << std::endl;
std::cin >> c;
if (c == 1 || c == 2) { // IF VALID OPTION
p = c;
} else {
// ELSE NOTHING
}
break;
case 1:
system("cls");
recoilEnabled = !recoilEnabled; // SWITCH TOGGLE (T>F || F>T)
p = 0; break;
case 2:
system("title Fishi's Simple Recoil - Menu - Settings"); system("cls");
std::cout << "[1] X" << std::endl << "[2] Y" << std::endl << "[3] Sleep" << std::endl << "[4] Mouse Button" << std::endl << std::endl;
c = -1; std::cin >> c; system("cls");
int inp; inp = 5000;
switch (c)
{
case 1:
std::cout << "X: "; if (std::cin >> inp && (inp >= -50 && inp <= 50)) { x = inp; } std::cout << std::endl; system("cls"); p = 0; break;
case 2:
std::cout << "Y: "; if (std::cin >> inp && (inp >= 0 && inp <= 50)) { y = inp; } std::cout << std::endl; system("cls"); p = 0; break;
case 3:
std::cout << "Sleep: "; if (std::cin >> inp && (inp > 0)) { z = inp; } std::cout << std::endl; system("cls"); p = 0; break;
case 4:
std::cout << "[1] Mouse 1\n[2] Mouse 2\n[3] Mouse 1+2" << std::endl << std::endl; if (std::cin >> inp && (inp == 1 || inp == 2 || inp == 3)) { mouseOpt = inp; } std::cout << std::endl; system("cls"); p = 0; break;
default:
p = 0; break; // GO BACK TO MAIN (IN ALL CASES)
}
break;
default:
std::cout << "UI Broke" << std::endl; // IF COMES HERE IDFK WHAT HAPPENED :kek:
break;
}
}
}
// RECOIL THREAD
void recoil_thread() {
Mouse mouse; // INIT MOUSE CLASS
for (;;) {
while (mouse.isDown(mouseOpt) && recoilEnabled) { // IF MOUSE DOWN AND RECOIL IS TOGGLED ON
mouse.Move(x, y); // MOVE MOUSE
Sleep(z); // WAIT TIMER
}
Sleep(1); // PLS NO EAT MY CPU :kek:
}
}