· 5 years ago · Nov 22, 2020, 03:12 AM
1--local variables for API. Automatically generated by https://github.com/simpleavaster/gslua/blob/master/authors/sapphyrus/generate_api.lua
2client_latency, client_log, client_draw_rectangle, client_draw_circle_outline, client_userid_to_entindex, client_draw_indicator, client_draw_gradient, client_set_event_callback, client_screen_size, client_eye_position = client.latency, client.log, client.draw_rectangle, client.draw_circle_outline, client.userid_to_entindex, client.draw_indicator, client.draw_gradient, client.set_event_callback, client.screen_size, client.eye_position
3client_draw_circle, client_color_log, client_delay_call, client_draw_text, client_visible, client_exec, client_trace_line, client_set_cvar = client.draw_circle, client.color_log, client.delay_call, client.draw_text, client.visible, client.exec, client.trace_line, client.set_cvar
4client_world_to_screen, client_draw_hitboxes, client_get_cvar, client_draw_line, client_camera_angles, client_draw_debug_text, client_random_int, client_random_float = client.world_to_screen, client.draw_hitboxes, client.get_cvar, client.draw_line, client.camera_angles, client.draw_debug_text, client.random_int, client.random_float
5entity_get_local_player, entity_is_enemy, entity_hitbox_position, entity_get_player_name, entity_get_steam64, entity_get_bounding_box, entity_get_all, entity_set_prop = entity.get_local_player, entity.is_enemy, entity.hitbox_position, entity.get_player_name, entity.get_steam64, entity.get_bounding_box, entity.get_all, entity.set_prop
6entity_is_alive, entity_get_player_weapon, entity_get_prop, entity_get_players, entity_get_classname = entity.is_alive, entity.get_player_weapon, entity.get_prop, entity.get_players, entity.get_classname
7globals_realtime, globals_absoluteframetime, globals_tickcount, globals_curtime, globals_mapname, globals_tickinterval, globals_framecount, globals_frametime, globals_maxplayers = globals.realtime, globals.absoluteframetime, globals.tickcount, globals.curtime, globals.mapname, globals.tickinterval, globals.framecount, globals.frametime, globals.maxplayers
8ui_new_slider, ui_new_combobox, ui_reference, ui_set_visible, ui_is_menu_open, ui_new_color_picker, ui_set_callback, ui_set, ui_new_checkbox, ui_new_hotkey, ui_new_button, ui_new_multiselect, ui_get = ui.new_slider, ui.new_combobox, ui.reference, ui.set_visible, ui.is_menu_open, ui.new_color_picker, ui.set_callback, ui.set, ui.new_checkbox, ui.new_hotkey, ui.new_button, ui.new_multiselect, ui.get
9math_ceil, math_tan, math_log10, math_randomseed, math_cos, math_sinh, math_random, math_huge, math_pi, math_max, math_atan2, math_ldexp, math_floor, math_sqrt, math_deg, math_atan, math_fmod = math.ceil, math.tan, math.log10, math.randomseed, math.cos, math.sinh, math.random, math.huge, math.pi, math.max, math.atan2, math.ldexp, math.floor, math.sqrt, math.deg, math.atan, math.fmod
10math_acos, math_pow, math_abs, math_min, math_sin, math_frexp, math_log, math_tanh, math_exp, math_modf, math_cosh, math_asin, math_rad = math.acos, math.pow, math.abs, math.min, math.sin, math.frexp, math.log, math.tanh, math.exp, math.modf, math.cosh, math.asin, math.rad
11table_maxn, table_foreach, table_sort, table_remove, table_foreachi, table_move, table_getn, table_concat, table_insert = table.maxn, table.foreach, table.sort, table.remove, table.foreachi, table.move, table.getn, table.concat, table.insert
12string_find, string_format, string_rep, string_gsub, string_len, string_gmatch, string_dump, string_match, string_reverse, string_byte, string_char, string_upper, string_lower, string_sub = string.find, string.format, string.rep, string.gsub, string.len, string.gmatch, string.dump, string.match, string.reverse, string.byte, string.char, string.upper, string.lower, string.sub
13bit_band, client_delay_call, client_set_event_callback, entity_get_local_player, entity_get_player_weapon, entity_get_prop, print, func, select, table_insert, table_sort, type, ui_get, ui_name, ui_new_checkbox, ui_new_combobox, ui_new_multiselect, ui_reference, ui_set, ui_set_callback, ui_set_visible, xpcall, pairs = bit.band, client.delay_call, client.set_event_callback, entity.get_local_player, entity.get_player_weapon, entity.get_prop, print, func, select, table.insert, table.sort, type, ui.get, ui.name, ui.new_checkbox, ui.new_combobox, ui.new_multiselect, ui.reference, ui.set, ui.set_callback, ui.set_visible, xpcall, pairs
14
15Latency = client.latency
16LocalPlayer,
17GetProp = entity.get_local_player, entity.get_prop
18min, abs, sqrt,
19floor = math.min, math.abs, math.sqrt, math.floor
20RealTime = globals.realtime
21TimeStart = RealTime
22
23
24
25--end of local variables
26
27--SteamID check for Watermark
28local js = panorama.open()
29local api = js.MyPersonaAPI
30local name = api.GetName()
31local MyPersonaAPI, LobbyAPI, PartyListAPI = js.MyPersonaAPI, js.LobbyAPI, js.PartyListAPI
32local steamid64 = MyPersonaAPI.GetXuid()
33local my_table = {}
34 my_table["76561199041794839"] = "Envy"
35 my_table["76561198053186442"] = "Smile"
36 my_table["76561198932929027"] = "Smile"
37 my_table["76561199073225646"] = "Homosexual"
38 my_table["76561198984363487"] = "Jordan"
39 my_table["76561199076754127"] = "Bright"
40 my_table["76561198873301658"] = "Bright"
41 my_table["76561198089846189"] = "Kelvin"
42 my_table["76561199043456036"] = "Akki"
43 my_table["76561198883357825"] = "Mosxina"
44
45
46if my_table[steamid64] == "Envy" then
47 client.color_log(42, 144, 202, "Welcome to AnvilSense, "..my_table[steamid64])
48end
49if my_table[steamid64] == "Smile" then
50 client.color_log(182, 145, 255, "Welcome to AnvilSense, "..my_table[steamid64])
51end
52if my_table[steamid64] == "Homosexual" then
53 client.color_log(255,182,193 , "Welcome to AnvilSense, "..my_table[steamid64])
54end
55if my_table[steamid64] == "Jordan" then
56 client.color_log(77, 195, 255, "Welcome to AnvilSense, "..my_table[steamid64])
57end
58if my_table[steamid64] == "Bright" then
59 client.color_log(224,255,255, "Welcome to AnvilSense, "..my_table[steamid64])
60end
61if my_table[steamid64] == "Kelvin" then
62 client.color_log(255,158,239, "Welcome to AnvilSense, "..my_table[steamid64])
63end
64if my_table[steamid64] == "Mosxina" then
65 client.color_log(139,0,0, "Welcome to AnvilSense, "..my_table[steamid64])
66end
67--endregion
68
69--Changelog
70luaname = "AnvilSense"
71luaversion = "v0.5"
72
73client.color_log(150, 200, 60, "Changelog for ", luaname.." ", luaversion)
74client.color_log(150, 200, 60, "["..luaname.."] \0")
75client.color_log(60, 120, 180, "Added a SteamID check (watermark will now display your username on the lua)")
76client.color_log(150, 200, 60, "["..luaname.."] \0")
77client.color_log(60, 120, 180, "Changed how logging works, It will now go into the console instead of chat")
78client.color_log(150, 200, 60, "["..luaname.."] \0")
79client.color_log(60, 120, 180, "Added a changelog inside of the lua")
80client.color_log(150, 200, 60, "["..luaname.."] \0")
81client.color_log(60, 120, 180, "Removed PresidentKidz Resolver (was causing FPS issues + kinda shit)")
82--endregion
83
84local ffi = require('ffi')
85
86ffi.cdef [[
87 typedef bool(__thiscall* lgts)(float, float, float, float, float, float, short);
88 typedef void***(__thiscall* FindHudElement_t)(void*, const char*);
89 typedef void(__cdecl* ChatPrintf_t)(void*, int, int, const char*, ...);
90]]
91
92local signature = '\x55\x8B\xEC\x83\xEC\x08\x8B\x15\xCC\xCC\xCC\xCC\x0F\x57'
93local signature_gHud = '\xB9\xCC\xCC\xCC\xCC\x88\x46\x09'
94local signature_FindElement = '\x55\x8B\xEC\x53\x8B\x5D\x08\x56\x57\x8B\xF9\x33\xF6\x39\x77\x28'
95local match = client.find_signature('client.dll', signature) or error('client_find_signature fucked up')
96local line_goes_through_smoke = ffi.cast('lgts', match) or error('ffi.cast fucked up')
97local match = client.find_signature('client.dll', signature_gHud) or error('signature not found')
98local hud = ffi.cast('void**', ffi.cast('char*', match) + 1)[0] or error('hud is nil')
99local helement_match = client.find_signature('client.dll', signature_FindElement) or error('FindHudElement not found')
100local hudchat = ffi.cast('FindHudElement_t', helement_match)(hud, 'CHudChat') or error('CHudChat not found')
101local chudchat_vtbl = hudchat[0] or error('CHudChat instance vtable is nil')
102local print_to_chat = ffi.cast('ChatPrintf_t', chudchat_vtbl[27])
103
104local function print_chat(text)
105 print_to_chat(hudchat, 0, 0, text)
106end
107
108local vars = {
109 rage = {
110 fire = false,
111 penetration = false,
112 penetration2 = false,
113 autofactor = nil,
114 max_fov = nil,
115 min_fov = nil,
116 dynamicfov_new_fov = 0,
117 bool_in_fov = false,
118 closest_enemy = nil,
119 visible_hitboxes = 0,
120 nearest_player = nil,
121 nearest_player_fov = nil
122 },
123
124 misc = {
125 name = false
126 },
127}
128
129local w, h = client.screen_size()
130local x, y = w / 2, h / 2
131local angle = 0
132local bruteforce_manual
133PI = 3.14159265358979323846
134DEG_TO_RAD = PI / 180.0
135RAD_TO_DEG = 180.0 / PI
136
137local weapon_classes = {
138 ['CWeaponG3SG1'] = 'Snipers',
139 ['CWeaponSCAR20'] = 'Snipers',
140 ['CWeaponAWP'] = 'Snipers',
141 ['CWeaponSSG08'] = 'Snipers',
142 ['CDEagle'] = 'Deagle',
143 ['CWeaponFiveSeven'] = 'Pistols',
144 ['CWeaponHKP2000'] = 'Pistols',
145 ['CWeaponP250'] = 'Pistols',
146 ['CWeaponGlock'] = 'Pistols',
147 ['CWeaponElite'] = 'Pistols',
148 ['CWeaponTec9'] = 'Pistols',
149 ['CAK47'] = 'Others',
150 ['CWeaponAug'] = 'Others',
151 ['CWeaponFamas'] = 'Others',
152 ['CWeaponGalilAR'] = 'Others',
153 ['CWeaponM4A1'] = 'Others',
154 ['CWeaponSG556'] = 'Others',
155 ['CWeaponMP7'] = 'Others',
156 ['CWeaponMP9'] = 'Others',
157 ['CWeaponBizon'] = 'Others',
158 ['CWeaponP90'] = 'Others',
159 ['CWeaponUMP45'] = 'Others',
160 ['CWeaponM249'] = 'Others',
161 ['CWeaponNegev'] = 'Others',
162 ['CWeaponMag7'] = 'Others',
163 ['CWeaponNOVA'] = 'Others',
164 ['CWeaponSawedoff'] = 'Others',
165 ['CWeaponXM1014'] = 'Others',
166}
167
168local improvements_modes = {
169 'Snipers',
170 'Deagle',
171 'Pistols',
172 'Others'
173}
174
175local improvements_nades = {
176 'Smoke',
177 'Flash'
178}
179
180local dynamicfov_modes = {
181 'Snipers',
182 'Deagle',
183 'Pistols',
184 'Others'
185}
186
187local penetration_modes = {
188 'On hotkey',
189 'Visible'
190}
191
192local indicators_types = {
193 'Default',
194 'Crosshair'
195}
196
197local indicators_modes = {
198 'Resolver',
199 'FOV',
200 'FAKE',
201 'FL',
202 'Automatic fire',
203 'Automatic penetration',
204 'Force body aim',
205 'Minimum damage'
206}
207
208local flags_modes = {
209 'FAKE',
210 'Resolver'
211}
212
213local references = {
214 rage = {
215 enabled = { ui.reference('RAGE', 'Aimbot', 'Enabled') },
216 fire = ui.reference('RAGE', 'Aimbot', 'Automatic fire'),
217 penetration = ui.reference('RAGE', 'Aimbot', 'Automatic penetration'),
218 mindmg = ui.reference('RAGE', 'Aimbot', 'Minimum damage'),
219 fov = ui.reference('RAGE', 'Aimbot', 'Maximum FOV'),
220 bodyaim = ui.reference('RAGE', 'Other', 'Force body aim'),
221 miss = ui.reference('RAGE', 'Aimbot', 'Log misses due to spread'),
222 },
223
224 aa = {
225 enabled = { ui.reference('AA', 'Anti-aimbot angles', 'Enabled') },
226 },
227
228 misc = {
229 namesteal = ui.reference('MISC', 'Miscellaneous', 'Steal player name'),
230 },
231
232 players = {
233 body_yaw = ui.reference('PLAYERS', 'Adjustments', 'Force body yaw'),
234 body_yaw_slider = { ui.reference('PLAYERS', 'Adjustments', 'Force body yaw value') },
235 lists = ui.reference('PLAYERS', 'Players', 'Player list'),
236 whitelist = ui.reference('PLAYERS', 'Adjustments', 'Add to whitelist'),
237 reset_all = ui.reference('PLAYERS', 'Players', 'Reset all'),
238 apply_all = ui.reference('PLAYERS', 'Adjustments', 'Apply to all'),
239 },
240}
241
242local menu = {
243 rage = {
244 enabled = ui.new_checkbox('RAGE', 'Other', 'SEMI RAGE'),
245 improvements = ui.new_checkbox('RAGE', 'Other', 'Improvements'),
246 improvements_mode = { ui.new_multiselect('RAGE', 'Other', 'Aimbot improvements', improvements_modes) },
247 improvements_hotkey = ui.new_hotkey('RAGE', 'Other', '\nAimbot improvements modes', true, 0x01),
248 improvements_nades = { ui.new_multiselect('RAGE', 'Other', 'Disable aimbot', improvements_nades) },
249 fire = ui.new_checkbox('RAGE', 'Other', 'Automatic fire'),
250 fire_hotkey = ui.new_hotkey('RAGE', 'Other', 'Automatic fire', true),
251 penetration = ui.new_checkbox('RAGE', 'Other', 'Automatic penetration'),
252 penetration_hotkey = ui.new_hotkey('RAGE', 'Other', 'Automatic penetration', true),
253 penetration_mode = { ui.new_multiselect('RAGE', 'Other', '\nPenetration modes', penetration_modes) },
254 penetreation_slider = ui.new_slider('RAGE', 'Other', 'when X hitboxes visible', 0, 12, 2, true),
255 dynamicfov = ui.new_checkbox('RAGE', 'Other', 'Dynamic FOV'),
256 dynamicfov_mode = { ui.new_combobox('RAGE', 'Other', '\nDynamic FOV modes', dynamicfov_modes) },
257 dynamicfov_autofactor = ui.new_slider('RAGE', 'Other', 'Dynamic FOV auto factor', 0, 250, 100, true, 'x', 0.01),
258 dynamicfov_min_snipers = ui.new_slider('RAGE', 'Other', 'Snipers Dynamic FOV min', 1, 180, 3, true, '°', 1),
259 dynamicfov_max_snipers = ui.new_slider('RAGE', 'Other', 'Snipers Dynamic FOV max', 1, 180, 10, true, '°', 1),
260 dynamicfov_min_deagle = ui.new_slider('RAGE', 'Other', 'Deagle Dynamic FOV min', 1, 180, 3, true, '°', 1),
261 dynamicfov_max_deagle = ui.new_slider('RAGE', 'Other', 'Deagle Dynamic FOV max', 1, 180, 10, true, '°', 1),
262 dynamicfov_min_pistols = ui.new_slider('RAGE', 'Other', 'Pistols Dynamic FOV min', 1, 180, 3, true, '°', 1),
263 dynamicfov_max_pistols = ui.new_slider('RAGE', 'Other', 'Pistols Dynamic FOV max', 1, 180, 10, true, '°', 1),
264 dynamicfov_min_others = ui.new_slider('RAGE', 'Other', 'Others Dynamic FOV min', 1, 180, 3, true, '°', 1),
265 dynamicfov_max_others = ui.new_slider('RAGE', 'Other', 'Others Dynamic FOV max', 1, 180, 10, true, '°', 1),
266 resolver = ui.new_checkbox('RAGE', 'Other', 'Resolver'),
267 resolver_hotkey = ui.new_hotkey('RAGE', 'Other', '\nResolver', true),
268 },
269
270 visuals = {
271 enabled = ui.new_checkbox('VISUALS', 'Other ESP', 'SEMI VISUALS'),
272 indicators = ui.new_checkbox('VISUALS', 'Other ESP', 'Indicators'),
273 indicators_type = { ui.new_combobox('VISUALS', 'Other ESP', '\nIndicators types', indicators_types) },
274 indicators_mode = { ui.new_multiselect('VISUALS', 'Other ESP', 'Indicators modes', indicators_modes) },
275 flags = ui.new_checkbox('VISUALS', 'Other ESP', 'Flags'),
276 flags_mode = { ui.new_multiselect('VISUALS', 'Other ESP', '\nFlags modes', flags_modes) },
277 },
278
279 misc = {
280 enabled = ui.new_checkbox('MISC', 'Miscellaneous', 'SEMI MISC'),
281 logs = ui.new_checkbox('MISC', 'Miscellaneous', 'Log misses'),
282 },
283}
284
285local function table_contains(tbl, val)
286 for i = 1, #tbl do
287 if tbl[i] == val then
288 return true
289 end
290 end
291 return false
292end
293
294local function angle_to_vec(pitch, yaw)
295 local pitch_rad, yaw_rad = DEG_TO_RAD * pitch, DEG_TO_RAD * yaw
296 local sp, cp, sy, cy = math.sin(pitch_rad), math.cos(pitch_rad), math.sin(yaw_rad), math.cos(yaw_rad)
297 return cp * cy, cp * sy, -sp
298end
299
300local function vec3_normalize(x, y, z)
301 local len = math.sqrt(x * x + y * y + z * z)
302 if len == 0 then
303 return 0, 0, 0
304 end
305 local r = 1 / len
306 return x * r, y * r, z * r
307end
308
309local function vec3_dot(ax, ay, az, bx, by, bz)
310 return ax * bx + ay * by + az * bz
311end
312
313local function calculate_fov(ent, lx, ly, lz, fx, fy, fz)
314 local px, py, pz = entity.get_prop(ent, 'm_vecOrigin')
315 local dx, dy, dz = vec3_normalize(px - lx, py - ly, lz - lz)
316 local dot_product = vec3_dot(dx, dy, dz, fx, fy, fz)
317 local cos_inverse = math.acos(dot_product)
318 return RAD_TO_DEG * cos_inverse
319end
320
321local function player_visible(player, lx, ly, lz, ent)
322 local visible_hitboxes = vars.rage.visible_hitboxes
323 local visible_hitboxes = 0
324 local visible_hitboxes_value = ui.get(menu.rage.penetreation_slider)
325 for i = 0, 18 do
326 local ex, ey, ez = entity.hitbox_position(ent, i)
327 local _, entindex = client.trace_line(player, lx, ly, lz, ex, ey, ez)
328 if entindex == ent then
329 visible_hitboxes = visible_hitboxes + 1
330 end
331 end
332 return visible_hitboxes >= visible_hitboxes_value
333end
334
335local function get_closest_player(lx, ly, lz, pitch, yaw)
336 local nearest_player = vars.rage.nearest_player
337 local nearest_player_fov = vars.rage.nearest_player_fov
338
339 local fx, fy, fz = angle_to_vec(pitch, yaw)
340 local enemy_players = entity.get_players(true)
341 local nearest_player = nil
342 local nearest_player_fov = math.huge
343 for i = 1, #enemy_players do
344 local enemy_ent = enemy_players[i]
345 local fov_to_player = calculate_fov(enemy_ent, lx, ly, lz, fx, fy, fz)
346 if fov_to_player <= nearest_player_fov then
347 nearest_player = enemy_ent
348 nearest_player_fov = fov_to_player
349 end
350 end
351 return nearest_player, nearest_player_fov
352end
353
354local function visibility_rage()
355 local rage = ui.get(menu.rage.enabled)
356 local improvements = ui.get(menu.rage.improvements)
357 local fire = ui.get(menu.rage.fire)
358 local penetration = ui.get(menu.rage.penetration)
359 local dynamicfov = ui.get(menu.rage.dynamicfov)
360 local dynamicfov_mode = ui.get(menu.rage.dynamicfov_mode[1])
361 local resolver = ui.get(menu.rage.resolver)
362
363 local penetration_hotkey = table_contains(ui.get(menu.rage.penetration_mode[1]), 'On hotkey')
364 local penetration_visible = table_contains(ui.get(menu.rage.penetration_mode[1]), 'Visible')
365
366 if rage then
367 ui.set_visible(menu.rage.improvements, true)
368 ui.set_visible(menu.rage.fire, true)
369 ui.set_visible(menu.rage.penetration, true)
370 ui.set_visible(menu.rage.dynamicfov, true)
371 ui.set_visible(menu.rage.resolver, true)
372 else
373 ui.set_visible(menu.rage.improvements, false)
374 ui.set_visible(menu.rage.fire, false)
375 ui.set_visible(menu.rage.penetration, false)
376 ui.set_visible(menu.rage.dynamicfov, false)
377 ui.set_visible(menu.rage.resolver, false)
378 end
379
380 if improvements and rage then
381 ui.set_visible(menu.rage.improvements_mode[1], true)
382 ui.set_visible(menu.rage.improvements_hotkey, true)
383 ui.set_visible(menu.rage.improvements_nades[1], true)
384 else
385 ui.set_visible(menu.rage.improvements_mode[1], false)
386 ui.set_visible(menu.rage.improvements_hotkey, false)
387 ui.set_visible(menu.rage.improvements_nades[1], false)
388 end
389
390 if fire and rage then
391 ui.set_visible(menu.rage.fire_hotkey, true)
392 else
393 ui.set_visible(menu.rage.fire_hotkey, false)
394 end
395
396 if penetration and rage then
397 ui.set_visible(menu.rage.penetration_mode[1], true)
398 ui.set_visible(menu.rage.penetreation_slider, true)
399 else
400 ui.set_visible(menu.rage.penetration_mode[1], false)
401 ui.set_visible(menu.rage.penetreation_slider, false)
402 end
403
404 if dynamicfov and rage then
405 ui.set_visible(menu.rage.dynamicfov_mode[1], true)
406 ui.set_visible(menu.rage.dynamicfov_autofactor, true)
407 else
408 ui.set_visible(menu.rage.dynamicfov_mode[1], false)
409 ui.set_visible(menu.rage.dynamicfov_autofactor, false)
410 end
411
412 if resolver and rage then
413 ui.set_visible(menu.rage.resolver_hotkey, true)
414 else
415 ui.set_visible(menu.rage.resolver_hotkey, false)
416 end
417
418 ui.set_visible(menu.rage.penetration_hotkey, penetration and penetration_hotkey and rage)
419 ui.set_visible(menu.rage.penetreation_slider, penetration and penetration_visible and rage)
420 ui.set_visible(menu.rage.dynamicfov_min_snipers, dynamicfov and dynamicfov_mode == 'Snipers' and rage)
421 ui.set_visible(menu.rage.dynamicfov_max_snipers, dynamicfov and dynamicfov_mode == 'Snipers' and rage)
422 ui.set_visible(menu.rage.dynamicfov_min_deagle, dynamicfov and dynamicfov_mode == 'Deagle' and rage)
423 ui.set_visible(menu.rage.dynamicfov_max_deagle, dynamicfov and dynamicfov_mode == 'Deagle' and rage)
424 ui.set_visible(menu.rage.dynamicfov_min_pistols, dynamicfov and dynamicfov_mode == 'Pistols' and rage)
425 ui.set_visible(menu.rage.dynamicfov_max_pistols, dynamicfov and dynamicfov_mode == 'Pistols' and rage)
426 ui.set_visible(menu.rage.dynamicfov_min_others, dynamicfov and dynamicfov_mode == 'Others' and rage)
427 ui.set_visible(menu.rage.dynamicfov_max_others, dynamicfov and dynamicfov_mode == 'Others' and rage)
428end
429
430local function visibility_visuals()
431 local visuals = ui.get(menu.visuals.enabled)
432 local indicators = ui.get(menu.visuals.indicators)
433 local flags = ui.get(menu.visuals.flags)
434
435 if visuals then
436 ui.set_visible(menu.visuals.indicators, true)
437 ui.set_visible(menu.visuals.flags, true)
438 else
439 ui.set_visible(menu.visuals.indicators, false)
440 ui.set_visible(menu.visuals.flags, false)
441 end
442
443 if indicators and visuals then
444 ui.set_visible(menu.visuals.indicators_type[1], true)
445 ui.set_visible(menu.visuals.indicators_mode[1], true)
446 else
447 ui.set_visible(menu.visuals.indicators_type[1], false)
448 ui.set_visible(menu.visuals.indicators_mode[1], false)
449 end
450
451 if flags and visuals then
452 ui.set_visible(menu.visuals.flags_mode[1], true)
453 else
454 ui.set_visible(menu.visuals.flags_mode[1], false)
455 end
456end
457
458local function visibility_misc()
459 local misc = ui.get(menu.misc.enabled)
460
461 if misc then
462 ui.set_visible(menu.misc.logs, true)
463 --ui.set_visible(menu.misc.spam, true)
464 else
465 ui.set_visible(menu.misc.logs, false)
466 -- ui.set_visible(menu.misc.spam, false)
467 end
468end
469
470local function rage()
471 local weapon = weapon_classes[entity.get_classname(entity.get_player_weapon(entity.get_local_player()))]
472 local vars_fire = vars.rage.fire
473 local vars_penetration = vars.rage.penetration
474 local vars_penetration2 = vars.rage.penetration2
475
476 local semirage = ui.get(menu.rage.enabled)
477 local improvements = ui.get(menu.rage.improvements)
478 local improvements_hotkey = ui.get(menu.rage.improvements_hotkey)
479 local fire = ui.get(menu.rage.fire)
480 local fire_hotkey = ui.get(menu.rage.fire_hotkey)
481 local penetration = ui.get(menu.rage.penetration)
482 local penetration_hotkey = ui.get(menu.rage.penetration_hotkey)
483
484 local maximum_fov = ui.get(references.rage.fov)
485 local player = entity.get_local_player()
486 local pitch, yaw = client.camera_angles()
487 local lx, ly, lz = entity.get_prop(player, 'm_vecOrigin')
488 local nearest_player, nearest_player_fov = get_closest_player(lx, ly, lz, pitch, yaw)
489 local view_offset = entity.get_prop(player, 'm_vecViewOffset[2]')
490 local lz = lz + view_offset
491
492 local penetration_visible = table_contains(ui.get(menu.rage.penetration_mode[1]), 'Visible')
493
494 if semirage and improvements and improvements_hotkey and table_contains(ui.get(menu.rage.improvements_mode[1]), weapon) or semirage and fire and fire_hotkey then
495 vars.rage.fire = true
496 else
497 vars.rage.fire = false
498 end
499
500 if semirage and penetration and penetration_hotkey then
501 vars.rage.penetration = true
502 else
503 vars.rage.penetration = false
504 end
505
506 if nearest_player ~= nil and nearest_player_fov <= maximum_fov and penetration and penetration_visible then
507 vars_penetration2 = player_visible(player, lx, ly, lz, nearest_player)
508 else
509 vars_penetration2 = false
510 end
511
512 if vars_fire and fire and fire_hotkey then
513 ui.set(references.rage.enabled[2], 'Always on')
514 ui.set(references.rage.fire, true)
515 else
516 ui.set(references.rage.enabled[2], 'On hotkey')
517 ui.set(references.rage.fire, false)
518 end
519
520 if vars_penetration2 or vars_penetration and penetration and penetration_hotkey then
521 ui.set(references.rage.penetration, true)
522 else
523 ui.set(references.rage.penetration, false)
524 end
525end
526
527local function dynamicfov()
528 local weapon = weapon_classes[entity.get_classname(entity.get_player_weapon(entity.get_local_player()))]
529
530 local autofactor = vars.rage.autofactor
531 local max_fov = vars.rage.max_fov
532 local min_fov = vars.rage.min_fov
533 local dynamicfov_new_fov = vars.rage.dynamicfov_new_fov
534 local bool_in_fov = vars.rage.bool_in_fov
535 local closest_enemy = vars.rage.closest_enemy
536
537 if weapon == 'Snipers' then
538 autofactor = ui.get(menu.rage.dynamicfov_autofactor)
539 max_fov = ui.get(menu.rage.dynamicfov_max_snipers)
540 min_fov = ui.get(menu.rage.dynamicfov_min_snipers)
541 elseif weapon == 'Deagle' then
542 autofactor = ui.get(menu.rage.dynamicfov_autofactor)
543 max_fov = ui.get(menu.rage.dynamicfov_max_deagle)
544 min_fov = ui.get(menu.rage.dynamicfov_min_deagle)
545 elseif weapon == 'Pistols' then
546 autofactor = ui.get(menu.rage.dynamicfov_autofactor)
547 max_fov = ui.get(menu.rage.dynamicfov_max_pistols)
548 min_fov = ui.get(menu.rage.dynamicfov_min_pistols)
549 elseif weapon == 'Others' then
550 autofactor = ui.get(menu.rage.dynamicfov_autofactor)
551 max_fov = ui.get(menu.rage.dynamicfov_max_others)
552 min_fov = ui.get(menu.rage.dynamicfov_min_others)
553 end
554
555 if autofactor == nil or max_fov == nil or min_fov == nil then
556 return
557 end
558
559 local old_fov = ui.get(references.rage.fov)
560 dynamicfov_new_fov = old_fov
561 local enemy_players = entity.get_players(true)
562
563 if min_fov > max_fov then
564 local store_min_fov = min_fov
565 min_fov = max_fov
566 max_fov = store_min_fov
567 end
568
569 if #enemy_players ~= 0 then
570 local own_x, own_y, own_z = client.eye_position()
571 local own_pitch, own_yaw = client.camera_angles()
572 local closest_enemy = nil
573 local closest_distance = 999999999
574
575 for i = 1, #enemy_players do
576 local enemy = enemy_players[i]
577 local enemy_x, enemy_y, enemy_z = entity.hitbox_position(enemy, 0)
578
579 local x = enemy_x - own_x
580 local y = enemy_y - own_y
581 local z = enemy_z - own_z
582
583 local yaw = ((math.atan2(y, x) * 180 / math.pi))
584 local pitch = -(math.atan2(z, math.sqrt(math.pow(x, 2) + math.pow(y, 2))) * 180 / math.pi)
585
586 local yaw_dif = math.abs(own_yaw % 360 - yaw % 360) % 360
587 local pitch_dif = math.abs(own_pitch - pitch ) % 360
588
589 if yaw_dif > 180 then
590 yaw_dif = 360 - yaw_dif
591 end
592
593 local real_dif = math.sqrt(math.pow(yaw_dif, 2) + math.pow(pitch_dif, 2))
594
595 if closest_distance > real_dif then
596 closest_distance = real_dif
597 closest_enemy = enemy
598 end
599 end
600
601 if closest_enemy ~= nil then
602 local closest_enemy_x, closest_enemy_y, closest_enemy_z = entity.hitbox_position(closest_enemy, 0)
603 local real_distance = math.sqrt(math.pow(own_x - closest_enemy_x, 2) + math.pow(own_y - closest_enemy_y, 2) + math.pow(own_z - closest_enemy_z, 2))
604
605 dynamicfov_new_fov = (3800 / real_distance) * (ui.get(menu.rage.dynamicfov_autofactor) * 0.01)
606
607 if (dynamicfov_new_fov > max_fov) then
608 dynamicfov_new_fov = max_fov
609 elseif dynamicfov_new_fov < min_fov then
610 dynamicfov_new_fov = min_fov
611 end
612 end
613
614 dynamicfov_new_fov = math.floor(dynamicfov_new_fov + 0.5)
615
616 if (dynamicfov_new_fov > closest_distance) then
617 bool_in_fov = true
618 else
619 bool_in_fov = false
620 end
621 else
622 dynamicfov_new_fov = min_fov
623 bool_in_fov = false
624 end
625
626 if dynamicfov_new_fov ~= old_fov and weapon == 'Snipers' then
627 ui.set(references.rage.fov, dynamicfov_new_fov)
628 end
629
630 if dynamicfov_new_fov ~= old_fov and weapon == 'Deagle' then
631 ui.set(references.rage.fov, dynamicfov_new_fov)
632 end
633
634 if dynamicfov_new_fov ~= old_fov and weapon == 'Pistols' then
635 ui.set(references.rage.fov, dynamicfov_new_fov)
636 end
637
638 if dynamicfov_new_fov ~= old_fov and weapon == 'Others' then
639 ui.set(references.rage.fov, dynamicfov_new_fov)
640 end
641
642end
643
644local function visuals()
645 local penetration = ui.get(references.rage.penetration)
646 local fire = ui.get(references.rage.fire)
647
648 local semivisuals = ui.get(menu.visuals.enabled)
649 local indicators = ui.get(menu.visuals.indicators)
650 local flags = ui.get(menu.visuals.flags)
651 local resolver = ui.get(menu.rage.resolver)
652 local body_yaw = ui.get(references.players.body_yaw)
653 local body_yaw_slider = ui.get(references.players.body_yaw_slider[1])
654 local antiaim = ui.get(references.aa.enabled[1])
655 local fov = ui.get(references.rage.fov)
656 local penetration_hotkey = ui.get(menu.rage.penetration_hotkey)
657 local bodyaim = ui.get(references.rage.bodyaim)
658
659 local indicators_type = ui.get(menu.visuals.indicators_type[1])
660
661 local indicators_mode_resolver = table_contains(ui.get(menu.visuals.indicators_mode[1]), 'Resolver')
662 local indicators_mode_fake = table_contains(ui.get(menu.visuals.indicators_mode[1]), 'FAKE')
663 local indicators_mode_fl = table_contains(ui.get(menu.visuals.indicators_mode[1]), 'FL')
664 local indicators_mode_fov = table_contains(ui.get(menu.visuals.indicators_mode[1]), 'FOV')
665 local indicators_mode_fire = table_contains(ui.get(menu.visuals.indicators_mode[1]), 'Automatic fire')
666 local indicators_mode_penetration = table_contains(ui.get(menu.visuals.indicators_mode[1]), 'Automatic penetration')
667 local indicators_mode_bodyaim = table_contains(ui.get(menu.visuals.indicators_mode[1]), 'Force body aim')
668 local indicators_mode_mindmg = table_contains(ui.get(menu.visuals.indicators_mode[1]), 'Minimum damage')
669
670 if indicators and indicators_mode_fake and entity.is_alive(entity.get_local_player()) and antiaim then
671 local color = { 255-(angle*2.29824561404), angle*3.42105263158, angle*0.22807017543 }
672 local y = renderer.indicator(color[1], color[2], color[3], 255, 'FAKE')+20
673 local x = 87
674 renderer.circle_outline(x, y, 0, 0, 0, 155, 10, 0, 1, 6)
675 renderer.circle_outline(x, y, color[1], color[2], color[3], 255, 9, 0, angle*0.01754385964, 4)
676 end
677
678
679
680 if indicators and indicators_mode_fov then
681 renderer.indicator(180, 238, 0, 255, 'FOV: ', fov, '°')
682 end
683
684 if indicators and indicators_mode_mindmg then
685 renderer.indicator(255, 255, 255, 255, 'DMG: ', ui.get(references.rage.mindmg))
686 end
687
688 if (indicators_type == 'Default') then
689 if indicators and indicators_mode_resolver and resolver then
690 if body_yaw_slider == 60 and body_yaw then
691 renderer.indicator(152, 204, 0, 255, 'R:RIGHT')
692 elseif body_yaw_slider == -60 and body_yaw then
693 renderer.indicator(152, 204, 0, 255, 'R:LEFT')
694 elseif body_yaw_slider == 0 then
695 renderer.indicator(152, 204, 0, 255, 'R:OFF')
696 end
697 end
698
699 if indicators and indicators_mode_fire and fire then
700 renderer.indicator(180, 238, 0, 255, 'TM')
701 end
702
703 if indicators and indicators_mode_penetration and penetration then
704 renderer.indicator(180, 238, 0, 255, 'AW')
705 end
706
707 if indicators and indicators_mode_bodyaim and bodyaim then
708 renderer.indicator(180, 238, 0, 255, 'BAIM')
709 end
710 elseif (indicators_type == 'Crosshair') then
711 if indicators and indicators_mode_resolver and resolver then
712 if body_yaw_slider == 60 and body_yaw then
713 renderer.text(x, y + 60, 180, 238, 0, 255, 'dcb', 0, 'R:RIGHT')
714 elseif body_yaw_slider == -60 and body_yaw then
715 renderer.text(x, y + 60, 180, 238, 0, 255, 'dcb', 0, 'R:LEFT')
716 elseif body_yaw_slider == 0 then
717 renderer.text(x, y + 60, 180, 238, 0, 255, 'dcb', 0, 'R:OFF')
718 end
719 end
720
721 if indicators and indicators_mode_fire and fire then
722 renderer.text(x, y + 30, 180, 238, 0, 255, 'dcb', 0, 'TM')
723 else
724 renderer.text(x, y + 30, 0, 0, 0, 50, 'dcb', 0, 'TM')
725 end
726
727 if indicators and indicators_mode_penetration and penetration then
728 renderer.text(x, y + 40, 180, 238, 0, 255, 'dcb', 0, 'AW')
729 else
730 renderer.text(x, y + 40, 0, 0, 0, 50, 'dcb', 0, 'AW')
731 end
732
733 if indicators and indicators_mode_bodyaim and bodyaim then
734 renderer.text(x, y + 50, 180, 238, 0, 255, 'dcb', 0, 'BAIM')
735 else
736 renderer.text(x, y + 50, 0, 0, 0, 50, 'dcb', 0, 'BAIM')
737 end
738 end
739end
740
741local function body_yaw()
742 local resolver = ui.get(menu.rage.resolver)
743 local body_yaw = ui.get(references.players.body_yaw_slider[1])
744
745 if resolver == false then
746 return
747 end
748
749 if body_yaw == 0 and bruteforce_manual == true then
750 ui.set(references.players.body_yaw, true)
751 ui.set(references.players.body_yaw_slider[1], 60)
752 ui.set(references.players.apply_all, true)
753 bruteforce_manual = false
754 end
755 if body_yaw == 60 and bruteforce_manual == true then
756 ui.set(references.players.body_yaw, true)
757 ui.set(references.players.body_yaw_slider[1], -60)
758 ui.set(references.players.apply_all, true)
759 bruteforce_manual = false
760 end
761 if body_yaw == -60 and bruteforce_manual == true then
762 ui.set(references.players.body_yaw, false)
763 ui.set(references.players.body_yaw_slider[1], 0)
764 ui.set(references.players.apply_all, true)
765 bruteforce_manual = false
766 end
767end
768
769local function resolver()
770 local resolver = ui.get(menu.rage.resolver)
771 local resolver_hotkey = ui.get(menu.rage.resolver_hotkey)
772
773 if not resolver then
774 return
775 end
776
777 if resolver_hotkey then
778 if bruteforce_manual == true then
779 body_yaw()
780 bruteforce_manual = false
781 end
782 else
783 bruteforce_manual = true
784 end
785end
786
787
788local function miss(e)
789 local logs = ui.get(menu.misc.logs)
790
791 if logs then
792 ui.set(references.rage.miss, false)
793 local reason
794 local entityHealth = entity.get_prop(e.target, 'm_iHealth')
795 if (entityHealth == nil) or (entityHealth <= 0) then
796 client.log('The player was killed prior to your shot being able to land')
797 return
798 end
799 if e.reason == '?' then
800 reason = 'resolver'
801 else
802 reason = e.reason
803 end
804 client.log('Missed shot due to ' .. reason)
805 end
806end
807client.set_event_callback('aim_miss', miss)
808
809client.set_event_callback('pre_render', function()
810 visibility_rage()
811 visibility_visuals()
812 visibility_misc()
813end)
814
815client.set_event_callback('setup_command', function(c)
816 if c.chokedcommands == 0 then
817 if c.in_use == 1 then
818 angle = 0
819 else
820 angle = math.min(57, math.abs(entity.get_prop(entity.get_local_player(), 'm_flPoseParameter', 11)*120-60))
821 end
822 end
823end)
824
825client.set_event_callback('run_command', function()
826 local smoke_check = table_contains(ui.get(menu.rage.improvements_nades[1]), 'Smoke')
827
828 if smoke_check then
829 client.update_player_list()
830 local local_player = entity.get_local_player()
831 local local_head = { entity.hitbox_position(local_player, 0) }
832 for _, v in pairs(entity.get_players(true)) do
833 ui.set(references.players.lists, v)
834 local entity_head = { entity.hitbox_position(v, 0) }
835 ui.set(references.players.whitelist, line_goes_through_smoke(local_head[1], local_head[2], local_head[3], entity_head[1], entity_head[2], entity_head[3], 1))
836 end
837 end
838end)
839
840client.set_event_callback('player_blind', function(e)
841 local flash_check = table_contains(ui.get(menu.rage.improvements_nades[1]), 'Flash')
842
843 local player = entity.get_local_player()
844 local useridEnt = (client.userid_to_entindex(e.userid))
845
846 if useridEnt == player and flash_check then
847 client.delay_call(0.1, function()
848 local flash_duration = entity.get_prop(player, 'm_flFlashDuration')
849 if flash_duration >= 1 then
850 ui.set(references.rage.enabled[1], false)
851 client.delay_call(flash_duration - 2, function()
852 ui.set(references.rage.enabled[1], true)
853 end)
854 end
855 end)
856 end
857end)
858
859client.set_event_callback('paint', function()
860 rage()
861 dynamicfov()
862 visuals()
863 resolver()
864end)
865
866
867client.register_esp_flag('FAKE', 255, 255, 255, function(c)
868 local flags = ui.get(menu.visuals.flags)
869 local flags_mode_fake = table_contains(ui.get(menu.visuals.flags_mode[1]), 'FAKE')
870
871 if entity.is_enemy(c) and flags and flags_mode_fake then
872 return plist.get(c, 'Correction active')
873 end
874end)
875
876client.register_esp_flag('RIGHT', 255, 0, 0, function(c)
877 local body_yaw = ui.get(references.players.body_yaw_slider[1])
878 local flags = ui.get(menu.visuals.flags)
879 local flags_mode_fake = table_contains(ui.get(menu.visuals.flags_mode[1]), 'Resolver')
880
881 if body_yaw == 60 then
882 if entity.is_enemy(c) and flags and flags_mode_fake then
883 return plist.get(c, 'Force body yaw value')
884 end
885 end
886end)
887
888client.register_esp_flag('LEFT', 255, 0, 0, function(c)
889 local body_yaw = ui.get(references.players.body_yaw_slider[1])
890 local flags = ui.get(menu.visuals.flags)
891 local flags_mode_fake = table_contains(ui.get(menu.visuals.flags_mode[1]), 'Resolver')
892
893 if body_yaw == -60 then
894 if entity.is_enemy(c) and flags and flags_mode_fake then
895 return plist.get(c, 'Force body yaw value')
896 end
897 end
898end)
899
900
901
902client.set_event_callback('shutdown', function()
903 if my_table[steamid64] == "Envy" then
904 client.color_log(42, 144, 202, "Goodbye, "..my_table[steamid64])
905 end
906 if my_table[steamid64] == "Smile" then
907 client.color_log(182, 145, 255, "Goodbye, "..my_table[steamid64])
908 end
909 if my_table[steamid64] == "Homosexual" then
910 client.color_log(255,182,193 , "Goodbye, "..my_table[steamid64])
911 end
912 if my_table[steamid64] == "Jordan" then
913 client.color_log(77, 195, 255, "Goodbye, "..my_table[steamid64])
914 end
915 if my_table[steamid64] == "Bright" then
916 client.color_log(224,255,255, "Goodbye, "..my_table[steamid64])
917 end
918 if my_table[steamid64] == "Kelvin" then
919 client.color_log(255,158,239, "Goodbye, "..my_table[steamid64])
920 end
921 if my_table[steamid64] == "Mosxina" then
922 client.color_log(139,0,0, "Goodbye, "..my_table[steamid64])
923 end
924 ui.set(references.players.reset_all, true)
925end)
926
927--------------------------Disable AA on FD, Thanks revolade
928local duck_peek_ref = ui.reference("RAGE", "Other", "Duck peek assist")
929client.set_event_callback("setup_command", function(cmd)
930 if ui.get(duck_peek_ref) then
931 cmd.in_use = 1
932 end
933end)
934--------------------------Legit AA, Get fucked presidentkidz :)
935local edge_count = { [1] = 7, [2] = 12, [3] = 15, [4] = 19, [5] = 23, [6] = 28, [7] = 35, [8] = 39 }
936
937legitAA = ui.new_checkbox("AA", "Anti-aimbot angles", "Legit anti-aim")
938legitAAbase = ui.new_combobox("AA", "Anti-aimbot angles", "\n aa_legit_base", "Manual", "Dynamic")
939LegitAAHotkey = ui.new_hotkey("AA", "Anti-aimbot angles", "Anti-aim switch key", true)
940LegitAABreaker = ui.new_combobox("AA", "Anti-aimbot angles", "Anti-aim mode", "Max Desync", "Skeet Desync", "Sway","Jitter")
941ui_indicator_combobox4 = ui.new_combobox("AA", "Anti-aimbot angles", "Anti-aim indicator", "Off", "Metro", "Parentheses", "Dashes")
942ui_indicator_color_picker4 = ui.new_color_picker("AA", "Anti-aimbot angles", "Indicator colour", "0", "115", "255", "255")
943enableaawm = ui.new_checkbox("AA", "Anti-aimbot angles", "Jitter AA while slow walking")
944aaenabler = ui.reference("AA", "Anti-aimbot angles", "Enabled")
945pitch = ui.reference("AA", "Anti-aimbot angles", "Pitch")
946yaw_base = ui.reference("AA", "Anti-aimbot angles", "Yaw base")
947yaw, yaw_num = ui.reference("AA", "Anti-aimbot angles", "Yaw")
948yaw_jitter = ui.reference("AA", "Anti-aimbot angles", "Yaw jitter")
949body, body_num = ui.reference("AA", "Anti-aimbot angles", "Body yaw")
950freestand_body_yaw_hide = ui.reference("AA", "Anti-aimbot angles", "Freestanding body yaw")
951lby = ui.reference("AA", "Anti-aimbot angles", "Lower body yaw target")
952edge_yaw_hide = ui.reference("AA", "Anti-aimbot angles", "Edge yaw")
953freestand_hide, bind_freestand_hide = ui.reference("AA", "Anti-aimbot angles", "Freestanding")
954limit = ui.reference("AA", "Anti-aimbot angles", "Fake yaw limit")
955fakelag_enable, fakelag_key = ui.reference("AA", "Fake lag", "Enabled")
956ref_fakelag_enable = ui.reference("AA", "Fake lag", "Limit")
957variance = ui.reference("AA", "Fake lag", "Variance")
958amount = ui.reference("AA", "Fake lag", "Amount")
959checkbox_reference, hotkey_reference = ui.reference("AA", "Other", "Slow motion")
960slowmot_type = ui.reference("AA", "Other", "Slow motion type")
961onshotaa = ui.reference("AA", "Other", "On shot anti-aim")
962
963ragebot, ragebotmode = ui.reference("RAGE", "Aimbot", "Enabled")
964rage_selection = ui.reference("RAGE", "Aimbot", "Target hitbox")
965autowall = ui.reference("RAGE", "Aimbot", "Automatic penetration")
966rageautofire = ui.reference("RAGE", "Aimbot", "Automatic fire")
967hitchance = ui.reference("RAGE", "Aimbot", "Minimum hit chance")
968min_dmg = ui.reference("RAGE", "Aimbot", "Minimum damage")
969FOVS5 = ui.reference("RAGE", "Aimbot", "Maximum FOV")
970silent = ui.reference("RAGE", "Aimbot", "Silent aim")
971missed_due = ui.reference("RAGE", "Aimbot", "Log misses due to spread")
972aacorrect = ui.reference("RAGE", "OTHER", "Anti-aim correction")
973removerecoil = ui.reference("RAGE", "Other", "Remove recoil")
974doubletap_reff = ui.reference("RAGE", "Other", "Double tap")
975dp_a = ui.reference("RAGE", "Other", "Duck peek assist")
976force_body_aim = ui.reference("RAGE", "Other", "Force body aim")
977-----AA SHIT
978local function rrrrr()
979 if ui.get(legitAA) then
980 ui.set_visible(aaenabler, false)
981 ui.set_visible(pitch, false)
982 ui.set_visible(yaw_base, false)
983 ui.set_visible(yaw, false)
984 ui.set_visible(yaw_jitter, false)
985 ui.set_visible(body, false)
986 ui.set_visible(yaw_num, false)
987 ui.set_visible(body_num, false)
988 ui.set_visible(freestand_body_yaw_hide, false)
989 ui.set_visible(lby, false)
990 ui.set_visible(edge_yaw_hide, false)
991 ui.set_visible(freestand_hide, false)
992 ui.set_visible(bind_freestand_hide, false)
993 ui.set_visible(limit, true)
994 ui.set_visible(slowmot_type, false)
995 ui.set_visible(onshotaa, false)
996 else
997 ui.set_visible(aaenabler, true)
998 ui.set_visible(pitch, true)
999 ui.set_visible(yaw_base, true)
1000 ui.set_visible(yaw, true)
1001 ui.set_visible(yaw_jitter, true)
1002 ui.set_visible(body, true)
1003 ui.set_visible(yaw_num, true)
1004 ui.set_visible(body_num, true)
1005 ui.set_visible(freestand_body_yaw_hide, true)
1006 ui.set_visible(lby, true)
1007 ui.set_visible(edge_yaw_hide, true)
1008 ui.set_visible(freestand_hide, true)
1009 ui.set_visible(bind_freestand_hide, true)
1010 ui.set_visible(limit, true)
1011 ui.set_visible(slowmot_type, true)
1012 ui.set_visible(onshotaa, true)
1013 end
1014end
1015
1016-----INDICATORS
1017local function indicatorvisible()
1018end
1019
1020client.set_event_callback("paint", rrrrr)
1021
1022indicatorvisible()
1023rrrrr()
1024
1025----------DYNAMIC LEGIT AA----------
1026
1027local world_to_screen = function(x, y, z, func)
1028 local x, y = renderer.world_to_screen(x, y, z)
1029 if x ~= nil and y ~= nil then
1030 func(x, y)
1031 end
1032end
1033
1034local leftdamage = 0
1035local rightdamage = 0
1036local rad2deg = function(rad)
1037 return (rad * 180 / math.pi)
1038end
1039local deg2rad = function(deg)
1040 return (deg * math.pi / 180)
1041end
1042local trace_line = function(entity, start, _end)
1043 return client.trace_line(entity, start.x, start.y, start.z, _end.x, _end.y, _end.z)
1044end
1045
1046local screenx, screeny = client.screen_size()
1047
1048local vector = function(x, y, z)
1049 x = x ~= nil and x or 0
1050 y = y ~= nil and y or 0
1051 z = z ~= nil and z or 0
1052
1053 return {
1054 ["x"] = x,
1055 ["y"] = y,
1056 ["z"] = z
1057 }
1058end
1059
1060local vector_add = function(vector1, vector2)
1061 return {
1062 ["x"] = vector1.x + vector2.x,
1063 ["y"] = vector1.y + vector2.y,
1064 ["z"] = vector1.z + vector2.z
1065 }
1066end
1067
1068local vector_substract = function(vector1, vector2)
1069 return {
1070 ["x"] = vector1.x - vector2.x,
1071 ["y"] = vector1.y - vector2.y,
1072 ["z"] = vector1.z - vector2.z
1073 }
1074end
1075
1076function slot136(slot0, slot1)
1077 for slot5 = 1, #slot0, 1 do
1078 if slot0[slot5] == slot1 then
1079 return true
1080 end
1081 end
1082 return false
1083end
1084
1085function slot137(slot0, slot1)
1086 for slot5, slot6 in ipairs(slot0) do
1087 if slot6 == slot1 then
1088 return true, slot5
1089 end
1090 end
1091 return false
1092end
1093
1094function slot138()
1095 if ui.get(otherref.tp_alive) and ui.get(otherref.tp_alive_key) then
1096 ui.set_visible(otherref.tp_dead, true)
1097 else
1098 ui.set_visible(otherref.tp_dead, false)
1099 end
1100end
1101
1102local clamp_angles = function(angle)
1103 angle = angle % 360
1104 angle = (angle + 360) % 360
1105 if angle > 180 then
1106 angle = angle - 360
1107 end
1108 return angle
1109end
1110
1111function LAASetup()
1112 if ui.get(legitAA) then
1113 if ui.get(legitAAbase) == "Manual" then
1114 ui.set_visible(LegitAAHotkey, true)
1115 elseif ui.get(legitAAbase) == "Dynamic" then
1116 ui.set_visible(LegitAAHotkey, false)
1117 end
1118 else
1119 ui.set_visible(LegitAAHotkey, false)
1120 end
1121end
1122
1123function LAAFunc()
1124 -----LEGITAA
1125 local legita = ui.get(legitAA)
1126 local base = ui.get(legitAAbase)
1127 ui.set_visible(legitAAbase, legita)
1128 ui.set_visible(ui_indicator_combobox4, legita)
1129 ui.set_visible(ui_indicator_color_picker4, legita)
1130 ui.set_visible(LegitAAHotkey, legita and base == "Manual")
1131 -----LEGITAA WHILE MOVING
1132 if not ui.get(legitAA) then
1133 LAASetup()
1134 ui.set(yaw, "Off")
1135 ui.set(body, "Off")
1136 ui.set(freestand_hide, "-")
1137 ui.set(bind_freestand_hide, "On hotkey")
1138 ui.set(aaenabler, false)
1139 elseif ui.get(legitAA) then
1140 LAASetup()
1141 ui.set(yaw, "180")
1142 ui.set(yaw_num, 180)
1143 ui.set(body, "Static")
1144 ui.set(freestand_hide, "-")
1145 ui.set(bind_freestand_hide, "On hotkey")
1146 ui.set(aaenabler, true)
1147 end
1148end
1149
1150LAAFunc()
1151 ui.set_callback(legitAA, LAAFunc)
1152 ui.set_callback(legitAAbase, LAAFunc)
1153 ui.set_callback(LegitAAHotkey, LAAFunc)
1154 ui.set_callback(LegitAABreaker, LAAFunc)
1155
1156local get_atan = function(ent, eye_pos, camera)
1157 local data = { id = nil, dst = 2147483647, fov = 360 }
1158 local screenx, screeny = client_screen_size()
1159 local crosshair = screenx / 2, screeny / 2
1160 for i = 0, 19 do
1161 local hitbox = vector(entity.hitbox_position(ent, i))
1162 local ext = vector_substract(hitbox, eye_pos)
1163 local yaw = rad2deg(math.atan2(ext.y, ext.x))
1164 local pitchhide = -rad2deg(math.atan2(ext.z, math.sqrt(ext.x ^ 2 + ext.y ^ 2)))
1165 local yaw_dif = math.abs(camera.y % 360 - yaw % 360) % 360
1166 local pitchhide_dif = math.abs(camera.x - pitchhide) % 360
1167 if yaw_dif > 180 then
1168 yaw_dif = 360 - yaw_dif
1169 end
1170 local dst = math.sqrt(yaw_dif ^ 2 + pitchhide_dif ^ 2)
1171 local dstcorrect = math.sqrt(ext.x ^ 2 + ext.y ^ 2 + ext.z ^ 2)
1172 if dstcorrect < data.dst then
1173 data.dst = dstcorrect
1174 data.id = i
1175 data.fov = yaw - crosshair
1176 end
1177 end
1178 return data.id, data.dst, data.fov
1179end
1180
1181local function getdistance()
1182 local get_players = entity.get_players(true)
1183 if #get_players == 0 then
1184 return
1185 end
1186 local eye_pos = vector(client.eye_position())
1187 local camera = vector(client.camera_angles())
1188 camera.z = z_pos ~= nil and 64 or camera.z
1189 local distance = math.huge
1190 local closest_enemy = nil
1191 local adv_fov = 1000
1192 local screenx, screeny = client_screen_size()
1193 local crosshair = screenx / 2, screeny / 2
1194 for i = 1, #get_players do
1195 local hitbox_id, dist, fov = get_atan(get_players[i], eye_pos, camera)
1196 if distance > dist then
1197 distance = dist
1198 hitbox = hitbox_id
1199 closest_enemy = get_players[i]
1200 adv_fov = fov
1201 end
1202 end
1203 return closest_enemy, hitbox, distance, adv_fov
1204end
1205
1206function slot158()
1207 if ui.get(yaw) == "Off" then
1208 return
1209 end
1210 if entity.get_prop(entity.get_game_rules(), "m_bFreezePeriod") == 1 then
1211 return
1212 end
1213 local screenx, screeny = client.screen_size()
1214 local lx, ly, lz = entity.get_prop(entity.get_local_player(), "m_angEyeAngles")
1215 local divisor = screenx / 2
1216 local divisor2 = screeny / 2
1217 local size = 15 * cvar.cl_crosshairsize:get_float() * 0.67
1218 if ui.get(yaw_num) ~= 180 and ui.get(yaw_num) ~= -180 then
1219 render_text(divisor, divisor2, 255, 0, 0, 255, "c-", 0, "AA IS BROKEN, SET YAW SLIDER TO 180 OR -180")
1220 render_text(divisor, divisor2 + 10, 255, 0, 0, 255, "c-", 0, "CURRENT YAW: ", ly)
1221 end
1222end
1223
1224function slot159()
1225 ui.set(pitch, "Off")
1226 ui.set(yaw_base, "Local view")
1227 ui.set(yaw, "180")
1228 ui.set(yaw_jitter, "Off")
1229 ui.set(edge_yaw_hide, false)
1230 ui.set(freestand_body_yaw_hide, false)
1231 ui.set(bind_freestand_hide, "On hotkey")
1232end
1233
1234function slot160()
1235 if not ui.get(legitAA) or ui.get(dp_a) or ui.get(legitAAbase) == "Dynamic" or entity.get_local_player() == nil or entity.get_prop(entity.get_local_player(), "m_lifeState") ~= 0 then
1236 return
1237 end
1238 if entity.get_prop(entity.get_game_rules(), "m_bFreezePeriod") == 1 then
1239 return
1240 end
1241 local screenx, screeny = client.screen_size()
1242 local halfx = screenx / 2
1243 local halfy = screeny / 2
1244 if ui.get(legitAA) then
1245 if ui.get(legitAAbase) == "Manual" then
1246 ui.set_visible(LegitAAHotkey, true)
1247 ui.set(LegitAAHotkey, "Toggle")
1248 if ui.get(LegitAAHotkey) then
1249 slot159()
1250 ui.set(yaw_num, 180)
1251 ui.set(body_num, 90)
1252 slot94 = "LEFT"
1253 else
1254 slot159()
1255 ui.set(yaw_num, 180)
1256 ui.set(body_num, -90)
1257 slot94 = "RIGHT"
1258 end
1259 else
1260 ui.set_visible(LegitAAHotkey, false)
1261 end
1262 end
1263end
1264
1265local function do_legit_aa()
1266 local local_player = entity.get_local_player()
1267 if not local_player or not entity.is_alive(local_player) then
1268 return
1269 end
1270 local m_vecOrigin = vector(entity.get_prop(local_player, "m_vecOrigin"))
1271 local m_vecViewOffset = vector(entity.get_prop(local_player, "m_vecViewOffset"))
1272 local m_vecOrigin = vector_add(m_vecOrigin, m_vecViewOffset)
1273 local radius = 20 + 110 + 0.1
1274 local step = math.pi * 2.0 / edge_count[8]
1275 local camera = vector(client.camera_angles())
1276 local central = deg2rad(math.floor(camera.y + 0.5))
1277 local data = {
1278 fraction = 1,
1279 surpassed = false,
1280 angle = vector(0, 0, 0),
1281 var = 0,
1282 side = "LAST KNOWN"
1283 }
1284 for a = central, math.pi * 3.0, step do
1285 if a == central then
1286 central = clamp_angles(rad2deg(a))
1287 local trace_line = function(entity, start, _end)
1288 return client.trace_line(entity, start.x, start.y, start.z, _end.x, _end.y, _end.z)
1289 end
1290 end
1291 local clm = clamp_angles(central - rad2deg(a))
1292 local abs = math.abs(clm)
1293 if abs < 90 and abs > 1 then
1294 local side = "LAST KNOWN"
1295 local location = vector(
1296 radius * math.cos(a) + m_vecOrigin.x,
1297 radius * math.sin(a) + m_vecOrigin.y,
1298 m_vecOrigin.z
1299 )
1300 local _fr, entindex = client.trace_line(local_player, m_vecOrigin.x, m_vecOrigin.y, m_vecOrigin.z, location.x, location.y, location.z)
1301 if math.floor(clm + 0.5) < -21 then
1302 side = "RIGHT"
1303 end
1304 if math.floor(clm + 0.5) > 21 then
1305 side = "LEFT"
1306 end
1307 local fr_info = {
1308 fraction = _fr,
1309 surpassed = (_fr < 1),
1310 angle = vector(0, clamp_angles(rad2deg(a)), 0),
1311 var = math.floor(clm + 0.5),
1312 side = side --[ 0 - center / 1 - right / 2 - left ]
1313 }
1314 if data.fraction > _fr then
1315 data = fr_info
1316 end
1317 end
1318 end
1319 return data
1320end
1321
1322function dodynamic()
1323 local local_player = entity.get_local_player()
1324 if not local_player or not entity.is_alive(local_player) then
1325 return
1326 end
1327 local local_player = entity.get_local_player()
1328 local topX, topY, botX, botY, alpha = entity.get_bounding_box(client_draw_text, local_player)
1329 local origin = vector(entity.get_prop(local_player, "m_vecOrigin"))
1330 local collision = (entity.get_prop(local_player, "m_Collision"))
1331 local vecmin = vector(entity.get_prop(local_player, "m_vecMins"))
1332 local vecmax = vector(entity.get_prop(local_player, "m_vecMaxs"))
1333 local min = vector_add(vecmin, origin)
1334 local max = vector_add(vecmax, origin)
1335 if not ui.get(legitAA) or ui.get(dp_a) or ui.get(legitAAbase) == "Manual" then
1336 return
1337 end
1338 if ui.get(legitAA) and ui.get(legitAAbase) == "Dynamic" then
1339 if entity.get_prop(entity.get_game_rules(), "m_bFreezePeriod") == 1 then
1340 return
1341 end
1342 local data = do_legit_aa()
1343 if data == nil then
1344 return
1345 end
1346 if data.fraction < 1 then
1347 slot159()
1348 ui.set(body_num, data.var > 0 and 180 or -180)
1349 ui.set(yaw_num, -180)
1350 end
1351 end
1352end
1353
1354local function fyls()
1355 if ui.get(legitAA) == false then
1356 return
1357 else
1358 if ui.get(LegitAABreaker) == "Skeet Desync" then
1359 ui.set(limit, 60)
1360 ui.set(body, "Static")
1361 elseif ui.get(LegitAABreaker) == "Max Desync" then
1362
1363 ui.set(body, "Static")
1364 elseif ui.get(LegitAABreaker) == "Sway" then
1365 ui.set(lby, "Opposite")
1366 ui.set(body, "Static")
1367 elseif ui.get(LegitAABreaker) == "Jitter" then
1368 ui.set(body, "Static")
1369 end
1370 end
1371end
1372client.set_event_callback("paint", fyls)
1373
1374local player_is_alive
1375local spamtime = 0
1376local antiresolve
1377local delay_time = 0
1378local inverse_time = 0
1379local anti_resolve_timer = 0
1380local change_value = 60
1381local reached_lowest = false
1382local anti_resolve_timer = globals.curtime()
1383
1384
1385function anti_resolver3()
1386 if ui.get(legitAA, true) then
1387 else
1388 return
1389 end
1390 if ui.get(LegitAABreaker) == "Sway" then ----- DON'T JUDGE :D
1391 if globals.realtime() - 0.001 >= anti_resolve_timer then
1392 ui.set(limit, change_value)
1393 if(reached_lowest == false) then
1394 change_value = change_value - 1
1395 if(change_value == 10) then
1396 reached_lowest = true
1397 end
1398 elseif(reached_lowest == true) then
1399 change_value = change_value + 1
1400 if(change_value == 35) then
1401 reached_lowest = false
1402 end
1403 end
1404 anti_resolve_timer = globals.realtime()
1405 end
1406 end
1407end
1408client.set_event_callback("run_command", anti_resolver3)
1409
1410local function anti_resolver3()
1411 if ui.get(legitAA, true) then
1412 else
1413 return
1414 end
1415 if ui.get(LegitAABreaker) == "Jitter" then
1416 ui.set(lby, "Opposite")
1417 if globals.realtime() >= anti_resolve_timer then
1418 client.delay_call(0.08, ui.set, limit, 60)
1419 client.delay_call(0.16, ui.set, limit, 2)
1420
1421 anti_resolve_timer = globals.realtime() + 0.1
1422 end
1423 end
1424 end
1425client.set_event_callback("run_command", anti_resolver3)
1426
1427before = false
1428
1429local function movingaa()
1430 local x, y = entity.get_prop(entity.get_local_player(), "m_vecVelocity")
1431 local speed = math.sqrt(x^2 + y^2)
1432 if (ui.get(enableaawm, true) and ui.get(enableaawm) and ui.get(hotkey_reference) and before == false and speed > 5) then
1433 stored_aabreaker = ui.get(LegitAABreaker)
1434 stored_lby = ui.get(lby)
1435 ui.set(LegitAABreaker, "Jitter")
1436 before = true
1437 elseif (ui.get(enableaawm, true) and ui.get(enableaawm) and not ui.get(hotkey_reference) or speed < 5) and before == true then
1438 ui.set(LegitAABreaker, stored_aabreaker)
1439 ui.set(lby, stored_lby)
1440 before = false
1441 end
1442end
1443client.set_event_callback("run_command", movingaa)
1444
1445function slot163()
1446 if ui.get(legitAA) then
1447 if ui.get(LegitAABreaker) == "Max Desync" then
1448 ui.set(lby, "Opposite")
1449 elseif ui.get(LegitAABreaker) == "Skeet Desync" then
1450 ui.set(lby, "Eye yaw")
1451 elseif ui.get(LegitAABreaker) == "Sway" then
1452 ui.set(lby, "Sway")
1453 elseif ui.get(LegitAABreaker) == "Jitter" then
1454 ui.set(lby, "Opposite")
1455 end
1456 else
1457 ui.set(lby, "Off")
1458 end
1459end
1460
1461client.set_event_callback("run_command", function()
1462 slot158()
1463 slot160()
1464end)
1465
1466client.set_event_callback("paint", function(c)
1467 slot163()
1468 dodynamic()
1469end)
1470
1471client.set_event_callback("game_newmap", function()
1472end)
1473-------INDICATORS LEGIT AA------------
1474function on_paint(c)
1475 local scrsize_x, scrsize_y = client.screen_size()
1476 local center_x, center_y = scrsize_x / 2, scrsize_y / 2
1477 local indicator = ui.get(ui_indicator_combobox4)
1478 local indicator_r, indicator_g, indicator_b, indicator_a = ui.get(ui_indicator_color_picker4)
1479 local local_player = entity_get_local_player()
1480 if not local_player or not entity.is_alive(local_player) then
1481 return
1482 end
1483 if ui.get(body_num) == 55 and indicator == "Metro" and ui.get(legitAA) == true or ui.get(body_num) == 180 and indicator == "Metro" and ui.get(legitAA) == true then
1484 client.draw_text(c, center_x + 45, center_y, indicator_r, indicator_g, indicator_b, indicator_a, "c+", 0, "⮞")
1485 elseif ui.get(body_num) == -55 and indicator == "Metro" and ui.get(legitAA) == true or ui.get(body_num) == -180 and indicator == "Metro" and ui.get(legitAA) == true then
1486 client.draw_text(c, center_x - 45, center_y, indicator_r, indicator_g, indicator_b, indicator_a, "c+", 0, "⮜")
1487 end
1488
1489 if ui.get(body_num) == 90 and indicator == "Parentheses" and ui.get(legitAA) == true or ui.get(body_num) == 180 and indicator == "Parentheses" and ui.get(legitAA) == true then
1490 client.draw_text(c, center_x + 45, center_y, indicator_r, indicator_g, indicator_b, indicator_a, "c+)", 0, ")")
1491 elseif ui.get(body_num) == -90 and indicator == "Parentheses" and ui.get(legitAA) == true or ui.get(body_num) == -180 and indicator == "Parentheses" and ui.get(legitAA) == true then
1492 client.draw_text(c, center_x - 45, center_y, indicator_r, indicator_g, indicator_b, indicator_a, "c+)", 0, "(")
1493 end
1494
1495 if ui.get(body_num) == 90 and indicator == "Dashes" and ui.get(legitAA) == true or ui.get(body_num) == 180 and indicator == "Dashes" and ui.get(legitAA) == true then
1496 client.draw_text(c, center_x + 45, center_y, indicator_r, indicator_g, indicator_b, indicator_a, "c-", 0, "—")
1497 elseif ui.get(body_num) == -90 and indicator == "Dashes" and ui.get(legitAA) == true or ui.get(body_num) == -180 and indicator == "Dashes" and ui.get(legitAA) == true then
1498 client.draw_text(c, center_x - 45, center_y, indicator_r, indicator_g, indicator_b, indicator_a, "c-", 0, "—")
1499 end
1500end
1501
1502err = client.set_event_callback('paint', on_paint)
1503
1504-------------------------- Watermark :)
1505local locals = {
1506 last_choke = 0,
1507 lby_next_think = 0,
1508}
1509local renderer_rectangle = renderer.rectangle
1510local renderer_gradient = renderer.gradient
1511local renderer_text = renderer.text
1512local renderer_circle_outline = renderer.circle_outline
1513local renderer_measure_text = renderer.measure_text
1514--region retarded gay nigga shit
1515local notes_pos = function(b)
1516 local c=function(d,e)
1517 local f={}
1518 for g in pairs(d) do
1519 table.insert(f,g)
1520 end;
1521 table.sort(f,e)
1522 local h=0;
1523 local i=function()
1524 h=h+1;
1525 if f[h]==nil then
1526 return nil
1527 else
1528 return f[h],d[f[h]]
1529 end
1530 end;
1531 return i
1532 end;
1533
1534 local j={
1535 get=function(k)
1536 local l,m=0,{}
1537 for n,o in c(package.cnotes) do
1538 if o==true then
1539 l=l+1;m[#m+1]={n,l}
1540 end
1541 end;
1542 for p=1,#m do
1543 if m[p][1]==b then
1544 return k(m[p][2]-1)
1545 end
1546 end
1547 end,
1548
1549 set_state=function(q)
1550 package.cnotes[b]=q;
1551 table.sort(package.cnotes)
1552 end,
1553 unset=function()
1554 client.unset_event_callback('shutdown',callback)
1555 end
1556 }
1557
1558 client.set_event_callback('shutdown',function()
1559 if package.cnotes[b]~=nil then package.cnotes[b]=nil end
1560 end)
1561
1562 if package.cnotes==nil then
1563 package.cnotes={}
1564 end;
1565
1566 return j
1567end
1568--endregion
1569
1570
1571local watermark = ui.new_checkbox("MISC", "Miscellaneous", "Watermark")
1572
1573local colorpickerwatermark = ui.new_color_picker("MISC", "Miscellaneous", "Color", 42, 144, 202, 255)
1574
1575local note = notes_pos 'b_aa_indicators.v1'
1576local g_paint_handler = function()
1577 note.set_state(true)
1578
1579 local me = entity_get_local_player()
1580
1581 local enabled = ui.get(watermark)
1582
1583 local is_active = true
1584
1585 local r, g, b, a = ui.get(colorpickerwatermark)
1586
1587 if not is_active then
1588 return
1589 end
1590
1591 if enabled then
1592 note.set_state(true)
1593 note.get(function(id)
1594
1595 local text = string_format('AnvilSense | '..my_table[steamid64]..'')
1596 local h, w = 17, renderer_measure_text(nil, text) + 8
1597 local x, y = client_screen_size(), 10 + (25*id)
1598
1599 x = x - w - 10
1600
1601 renderer_rectangle(x-3, y, 2, h, r, g, b, a)
1602 renderer_gradient(x-1, y, (w+1) / 2, h, 0, 0, 0, 25, 17, 17, 17, alpha, true)
1603 renderer_gradient(x-1 + w/2, y, (w+1) / 2, h, 17, 17, 17, alpha, 0, 0, 0, 25, true)
1604 renderer_text(x+4, y + 2, 255, 255, 255, 255, "", 0, text)
1605
1606 end)
1607 end
1608end
1609
1610client.set_event_callback('paint', g_paint_handler)
1611
1612