-
Notifications
You must be signed in to change notification settings - Fork 1
/
Hax.cs
221 lines (184 loc) · 5.75 KB
/
Hax.cs
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
using HarmonyLib;
using System;
using System.Runtime.CompilerServices;
using UnityEngine;
using UnityEngine.InputSystem;
namespace Lethalhack
{
public class Hax : MonoBehaviour
{
//Init Classes
private GameUI gameUI = new GameUI();
private GameHackMethods gameHacks = new GameHackMethods();
//Init Game Hack Vars
private bool gui_on = false;
private Vector3 TeleportPos = Vector3.zero;
public void Start()
{
//Do stuff here once for initialization
AllocConsoleHandler.Open();
Console.WriteLine("Console Initialized");
}
public void Update()
{
//Do stuff here on every tick
//GUI Toggle
if (Keyboard.current[Key.Insert].wasPressedThisFrame)
{
if (!gui_on)
{
gui_on = true;
}
else
{
gui_on = false;
}
}
//Toggle Hacks
if (gameUI.godModeState == true)
{
gameHacks.Heal();
}
if (gameUI.batteryState == true)
{
gameHacks.InfiniteBattery();
}
if (gameUI.staminaState == true)
{
gameHacks.StaminaHack();
}
if (gameUI.enemyStunState == true)
{
gameHacks.ForceField();
}
if (gameUI.nightVisionState == true)
{
gameHacks.NightVision(gameUI.nightVisionState);
}
/*if (gameUI.nightVisionState == false)
{
gameHacks.NightVision(gameUI.nightVisionState);
}*/
if (gameUI.longGrabState == true)
{
gameHacks.GrabDistancehack(true);
}
else
{
gameHacks.GrabDistancehack(false);
}
//Button Hacks
if (gameUI.suicideButtonState == true)
{
gameHacks.Suicide();
gameUI.suicideButtonState = false;
}
if (gameUI.healButtonState == true)
{
gameHacks.Heal();
gameUI.healButtonState = false;
}
if (gameUI.teleportPosSaveButtonState == true)
{
TeleportPos = gameHacks.SaveTeleportPos();
gameUI.teleportPosSaveButtonState = false;
}
if (gameUI.teleportButtonState == true)
{
gameHacks.LocationTeleport(TeleportPos);
gameUI.teleportButtonState = false;
}
if (gameUI.teleportEntranceButtonState == true)
{
gameHacks.EntranceTeleport();
gameUI.teleportEntranceButtonState = false;
}
if (gameUI.teleportShipButtonState == true)
{
gameHacks.ShipTeleport();
gameUI.teleportShipButtonState = false;
}
if (gameUI.speedButtonState == true)
{
gameHacks.SpeedHack(gameUI.SpeedSlider);
gameUI.speedButtonState = false;
}
//Keybinds
if (Keyboard.current[Key.Numpad7].wasPressedThisFrame)
{
gameHacks.EntranceTeleport();
}
if (Keyboard.current[Key.Numpad8].wasPressedThisFrame)
{
gameHacks.ShipTeleport();
}
if (Keyboard.current[Key.Numpad4].wasPressedThisFrame)
{
gameHacks.SaveTeleportPos();
}
if (Keyboard.current[Key.Numpad5].wasPressedThisFrame)
{
gameHacks.LocationTeleport(TeleportPos);
}
/*if (Keyboard.current[Key.Numpad9].wasPressedThisFrame)
{
if (ControlPlayer.Localplayer != null)
{
if (ControlPlayer.Localplayer.movementSpeed == 4.6f)
{
ControlPlayer.Localplayer.movementSpeed = 15f;
}
else
{
ControlPlayer.Localplayer.movementSpeed = 4.6f;
}
}
}
if (Keyboard.current[Key.Numpad8].wasPressedThisFrame)
{
if (shipLights == null)
{
shipLights = FindObjectOfType<ShipLights>();
}
if (shipLights != null)
{
shipLights.ToggleShipLights();
}
}
if (Keyboard.current[Key.Numpad4].wasPressedThisFrame)
{
if (terminal == null)
{
terminal = FindObjectOfType<Terminal>();
}
if (terminal != null)
{
terminal.groupCredits += 1000;
}
}
if (Keyboard.current[Key.Numpad5].wasPressedThisFrame)
{
if (terminal == null)
{
terminal = FindObjectOfType<Terminal>();
}
if (terminal != null)
{
terminal.BeginUsingTerminal();
}
}*/
if (Keyboard.current[Key.Delete].wasPressedThisFrame)
{
Loader.Unload();
AllocConsoleHandler.Close();
}
}
public void OnGUI()
{
if (gui_on)
{
gameUI.UiToggle();
}
}
}
}