· 4 years ago · May 25, 2021, 04:14 AM
1-- local variables for API functions. any changes to the line below will be lost on re-generation
2local bit_band, client_camera_angles, client_color_log, client_create_interface, client_delay_call, client_exec, client_eye_position, client_key_state, client_log, client_random_int, client_scale_damage, client_screen_size, client_set_event_callback, client_trace_bullet, client_userid_to_entindex, database_read, database_write, entity_get_local_player, entity_get_player_weapon, entity_get_players, entity_get_prop, entity_hitbox_position, entity_is_alive, entity_is_enemy, math_abs, math_atan2, require, error, globals_absoluteframetime, globals_curtime, globals_realtime, math_atan, math_cos, math_deg, math_floor, math_max, math_min, math_rad, math_sin, math_sqrt, print, renderer_circle_outline, renderer_gradient, renderer_measure_text, renderer_rectangle, renderer_text, renderer_triangle, string_find, string_gmatch, string_gsub, string_lower, table_insert, table_remove, ui_get, ui_new_checkbox, ui_new_color_picker, ui_new_hotkey, ui_new_multiselect, ui_reference, tostring, ui_is_menu_open, ui_mouse_position, ui_new_combobox, ui_new_slider, ui_set, ui_set_callback, ui_set_visible, tonumber, pcall = bit.band, client.camera_angles, client.color_log, client.create_interface, client.delay_call, client.exec, client.eye_position, client.key_state, client.log, client.random_int, client.scale_damage, client.screen_size, client.set_event_callback, client.trace_bullet, client.userid_to_entindex, database.read, database.write, entity.get_local_player, entity.get_player_weapon, entity.get_players, entity.get_prop, entity.hitbox_position, entity.is_alive, entity.is_enemy, math.abs, math.atan2, require, error, globals.absoluteframetime, globals.curtime, globals.realtime, math.atan, math.cos, math.deg, math.floor, math.max, math.min, math.rad, math.sin, math.sqrt, print, renderer.circle_outline, renderer.gradient, renderer.measure_text, renderer.rectangle, renderer.text, renderer.triangle, string.find, string.gmatch, string.gsub, string.lower, table.insert, table.remove, ui.get, ui.new_checkbox, ui.new_color_picker, ui.new_hotkey, ui.new_multiselect, ui.reference, tostring, ui.is_menu_open, ui.mouse_position, ui.new_combobox, ui.new_slider, ui.set, ui.set_callback, ui.set_visible, tonumber, pcall
3local ui_menu_position, ui_menu_size, math_pi, renderer_indicator, entity_is_dormant, client_set_clan_tag, client_trace_line, entity_get_all, entity_get_classname = ui.menu_position, ui.menu_size, math.pi, renderer.indicator, entity.is_dormant, client.set_clan_tag, client.trace_line, entity.get_all, entity.get_classname
4
5local vector = require('vector')
6local ffi = require('ffi')
7local ffi_cast = ffi.cast
8
9ffi.cdef [[
10 typedef int(__thiscall* get_clipboard_text_count)(void*);
11 typedef void(__thiscall* set_clipboard_text)(void*, const char*, int);
12 typedef void(__thiscall* get_clipboard_text)(void*, int, const char*, int);
13]]
14
15local VGUI_System010 = client_create_interface("vgui2.dll", "VGUI_System010") or print( "Error finding VGUI_System010")
16local VGUI_System = ffi_cast(ffi.typeof('void***'), VGUI_System010 )
17
18local get_clipboard_text_count = ffi_cast( "get_clipboard_text_count", VGUI_System[ 0 ][ 7 ] ) or print( "get_clipboard_text_count Invalid")
19local set_clipboard_text = ffi_cast( "set_clipboard_text", VGUI_System[ 0 ][ 9 ] ) or print( "set_clipboard_text Invalid")
20local get_clipboard_text = ffi_cast( "get_clipboard_text", VGUI_System[ 0 ][ 11 ] ) or print( "get_clipboard_text Invalid")
21
22local function clipboard_import( )
23 local clipboard_text_length = get_clipboard_text_count( VGUI_System )
24 local clipboard_data = ""
25
26 if clipboard_text_length > 0 then
27 buffer = ffi.new("char[?]", clipboard_text_length)
28 size = clipboard_text_length * ffi.sizeof("char[?]", clipboard_text_length)
29
30 get_clipboard_text( VGUI_System, 0, buffer, size )
31
32 clipboard_data = ffi.string( buffer, clipboard_text_length-1 )
33 end
34 return clipboard_data
35end
36
37local function clipboard_export(string)
38 if string then
39 set_clipboard_text(VGUI_System, string, string:len())
40 end
41end
42
43local ref = {
44 enabled = ui_reference("AA", "Anti-aimbot angles", "Enabled"),
45 pitch = ui_reference("AA", "Anti-aimbot angles", "pitch"),
46 yawbase = ui_reference("AA", "Anti-aimbot angles", "Yaw base"),
47 yaw = { ui_reference("AA", "Anti-aimbot angles", "Yaw") },
48 fakeyawlimit = ui_reference("AA", "anti-aimbot angles", "Fake yaw limit"),
49 fsbodyyaw = ui_reference("AA", "anti-aimbot angles", "Freestanding body yaw"),
50 -- lowerbodyyaw = ui_reference("AA", "Anti-aimbot angles", "Lower body yaw target"), // Removed due the latest Skeet update
51 edgeyaw = ui_reference("AA", "Anti-aimbot angles", "Edge yaw"),
52 maxprocticks = ui_reference("MISC", "Settings", "sv_maxusrcmdprocessticks"),
53 fakeduck = ui_reference("RAGE", "Other", "Duck peek assist"),
54 safepoint = ui_reference("RAGE", "Aimbot", "Force safe point"),
55 forcebaim = ui_reference("RAGE", "Other", "Force body aim"),
56 player_list = ui_reference("PLAYERS", "Players", "Player list"),
57 reset_all = ui_reference("PLAYERS", "Players", "Reset all"),
58 apply_all = ui_reference("PLAYERS", "Adjustments", "Apply to all"),
59 load_cfg = ui_reference("Config", "Presets", "Load"),
60 fl_limit = ui_reference("AA", "Fake lag", "Limit"),
61
62 quickpeek = { ui_reference("RAGE", "Other", "Quick peek assist") },
63 yawjitter = { ui_reference("AA", "Anti-aimbot angles", "Yaw jitter") },
64 bodyyaw = { ui_reference("AA", "Anti-aimbot angles", "Body yaw") },
65 freestand = { ui_reference("AA", "Anti-aimbot angles", "Freestanding") },
66 os = { ui_reference("AA", "Other", "On shot anti-aim") },
67 slow = { ui_reference("AA", "Other", "Slow motion") },
68 dt = { ui_reference("RAGE", "Other", "Double tap") },
69 ps = { ui_reference("RAGE", "Other", "Double tap") },
70 fakelag = { ui_reference("AA", "Fake lag", "Enabled") }
71}
72
73local var = {
74 legit_changed = false,
75 player_states = {"Global", "Standing", "Moving", "Slow motion", "Air", "On-key"},
76 state_to_idx = {["Global"] = 1, ["Standing"] = 2, ["Moving"] = 3, ["Slow motion"] = 4, ["Air"] = 5, ["On-key"] = 6},
77 aa_dir = 0,
78 auto_rage = false,
79 active_i = 1,
80 last_press_t = 0,
81 forward = false,
82 p_state = 0,
83 last_sway_time = 0,
84 choked_cmds = 0,
85 ts_time = 0,
86 miss = {},
87 on_shot_mode = "KEY",
88 custom_keys = {},
89 custom_key_saves = {},
90 hit = {},
91 shots = {},
92 last_hit = {},
93 stored_misses = {},
94 stored_shots = {},
95 last_nn = 0,
96 hotkey_modes1 = { "ALWAYS ON", "HELD", "TOGGLED", "OFF HOTKEY" },
97 hotkey_modes = { "Always on", "On hotkey", "Toggle", "Off hotkey" },
98 best_value = 180,
99 flip_value = 90,
100 bestenemy = 0,
101 flip_once = false,
102 clantag_enbl = false,
103 dragging = false,
104 disable_fs = false,
105 disable_edge = false,
106 initialized = false,
107 ox = 0,
108 oy = 0,
109 last_selected = 0,
110 classnames = {
111 "CWorld",
112 "CCSPlayer",
113 "CFuncBrush"
114 },
115 nonweapons = {
116 "knife",
117 "hegrenade",
118 "inferno",
119 "flashbang",
120 "decoy",
121 "smokegrenade",
122 "taser"
123 },
124 ts_clantag = {
125 "teamskeet.lua ",
126 "eamskeet.lua t",
127 "amskeet.lua te",
128 "mskeet.lua tea",
129 "skeet.lua team",
130 "keet.lua teams",
131 "eet.lua teamsk",
132 "et.lua teamske",
133 "t.lua teamskee",
134 ".lua teamskeet",
135 "lua teamskeet.",
136 "ua teamskeet.l",
137 "a teamskeet.lu",
138 " teamskeet.lua"
139 }
140}
141
142local plist_aa = {}
143for i=0, 64 do
144 plist_aa[i] = ui_new_combobox("PLAYERS", "Adjustments", "Override desync\n" .. tostring(i), {"-", "Freestanding", "Small", "Spin"})
145 ui_set_visible(plist_aa[i], false)
146end
147
148local anti_aim = { }
149
150anti_aim[0] = {
151 anti_aim_mode = ui_new_combobox("AA", "Anti-aimbot angles", "Anti-aim mode", {"Rage", "Legit", "Automatic rage"}),
152 player_state = ui_new_combobox("AA", "Anti-aimbot angles", "Player state", var.player_states),
153 onshot_aa_settings = ui_new_multiselect("AA", "Other", "On shot anti-aim", {"While standing", "While moving", "On slow-mo", "In air", "While crouching", "On key"}),
154 onshot_aa_key = ui_new_hotkey("AA", "Other", "On shot anti-aim key", false),
155}
156ui_set_visible(ref.maxprocticks, true)
157
158for i=1, 6 do
159 anti_aim[i] = {
160 enable = i == 6 and ui_new_hotkey("AA", "Anti-aimbot angles", "Enable " .. string_lower(var.player_states[i]) .. " anti-aim") or ui_new_checkbox("AA", "Anti-aimbot angles", "Enable " .. string_lower(var.player_states[i]) .. " anti-aim"),
161 pitch = ui_new_combobox("AA", "Anti-aimbot angles", "Pitch\n" .. var.player_states[i], { "Off", "Default", "Up", "Down", "Minimal", "Random" }),
162 yawbase = ui_new_combobox("AA", "Anti-aimbot angles", "Yaw base\n" .. var.player_states[i], { "Local view", "At targets" }),
163 yaw = ui_new_combobox("AA", "Anti-aimbot angles", "Yaw\n" .. var.player_states[i], { "Off", "180", "Spin", "Static", "180 Z", "Crosshair" }),
164 yawadd = ui_new_slider("AA", "Anti-aimbot angles", "\nYaw add" .. var.player_states[i], -180, 180, 0),
165 yawjitter = ui_new_combobox("AA", "Anti-aimbot angles", "Yaw jitter\n" .. var.player_states[i], { "Off", "Offset", "Center", "Random" }),
166 yawjitteradd = ui_new_slider("AA", "Anti-aimbot angles", "\nYaw jitter add" .. var.player_states[i], -180, 180, 0),
167 aa_mode = ui_new_combobox("AA", "Anti-aimbot angles", "Body yaw type\n" .. var.player_states[i], {"Teamskeet", "GameSense"}),
168 gs_bodyyaw = ui_new_combobox("AA", "Anti-aimbot angles", "Body yaw\n GS" .. var.player_states[i], { "Off", "Opposite", "Jitter", "Static" }),
169 gs_bodyyawadd = ui_new_slider("AA", "Anti-aimbot angles", "\nBody yaw add" .. var.player_states[i], -180, 180, 0),
170 bodyyaw = ui_new_combobox("AA", "Anti-aimbot angles", "Body yaw\n" .. var.player_states[i], { "Off", "Opposite", "Freestanding", "Reversed Freestanding", "Jitter", "Switch key"}),
171 bodyyaw_settings = ui_new_multiselect("AA", "Anti-aimbot angles", "Body yaw settings\n" .. var.player_states[i], { "Jitter when vulnerable", "Anti-resolver", "Detect missed angle"}),
172 --lowerbodyyaw = ui_new_combobox("AA", "Anti-aimbot angles", "Lower body yaw\n" .. var.player_states[i], { "Off", "Sway", "Half sway", "Opposite", "Eye yaw"}), // Removed due the latest Skeet update
173 fakeyawlimit = ui_new_slider("AA", "Anti-aimbot angles", "Fake yaw limit\n" .. var.player_states[i], 0, 60, 60),
174 fakeyawmode = ui_new_combobox("AA", "Anti-aimbot angles", "Customize fake yaw limit\n" .. var.player_states[i], { "Off", "Jitter", "Random", "Custom right" }),
175 fakeyawamt = ui_new_slider("AA", "Anti-aimbot angles", "\nFake yaw randomization" .. var.player_states[i], 0, 60, 0),
176 }
177end
178ui_set(anti_aim[1].enable, true)
179ui_set_visible(anti_aim[1].enable, false)
180
181anti_aim[7] = {
182 aa_settings = ui_new_multiselect("AA", "Fake lag", "Anti-aim settings", {"Anti-aim on use", "Disable use to plant", "Custom on-shot anti-aim", "On-key resets manual AA"}),
183 legit_sett = ui_new_multiselect("AA", "Fake lag", "Disable Anti-aim", { "High ping", "Low FPS", "Show values" }),
184
185 ping = ui_new_slider("AA", "Fake lag", "Disable if ping >", 0, 1000, 150),
186 fps = ui_new_slider("AA", "Fake lag", "Disable if fps <", 0, 300, 64),
187
188 manual_enable = ui_new_checkbox("AA", "Anti-aimbot angles", "Manual anti-aim"),
189 manual_left = ui_new_hotkey("AA", "Anti-aimbot angles", "Manual left"),
190 manual_right = ui_new_hotkey("AA", "Anti-aimbot angles", "Manual right"),
191 manual_back = ui_new_hotkey("AA", "Anti-aimbot angles", "Manual back"),
192 switch_k = ui_new_hotkey("AA", "Anti-aimbot angles", "Body yaw switch key"),
193
194 freestand = { ui_new_checkbox("AA", "Anti-aimbot angles", "Freestanding\nTS"),
195 ui_new_hotkey("AA", "Anti-aimbot angles", "Freestanding key", true),
196 ui_new_multiselect("AA", "Fake lag", "Disable freestanding", { "While slow walking", "In air", "While crouching", "While fakeducking" })
197 },
198
199 edge = { ui_new_checkbox("AA", "Anti-aimbot angles", "Edge yaw\nTS"),
200 ui_new_hotkey("AA", "Anti-aimbot angles", "Edge yaw key", true),
201 ui_new_multiselect("AA", "Fake lag", "Disable edye yaw", { "While slow walking", "In air", "While crouching", "While fakeducking" })
202 },
203
204 ind_set = ui_new_multiselect("AA", "Other", "Teamskeet ESP", {"Indicators", "Key states", "Anti-aim", "Clantag"}),
205 ind_sli = ui_new_multiselect("AA", "Other", "Indicator settings", {"Desync", "Fake lag", "Speed", "Gradient", "Show values", "Big", "Remove skeet indicators"}),
206 ind_clr = ui_new_color_picker("AA", "Other", "Indicator color picker", 175, 255, 0, 255),
207 aa_ind_type = ui_new_combobox("AA", "Other", "Anti-aim indicator type", {"Arrows", "Circle", "Static"}),
208 ind_clr2 = ui_new_color_picker("AA", "Other", "Indicator desync color", 0, 200, 255, 255),
209
210 pos_x = ui_new_slider("LUA", "B", "\nSaved Position X TS INDICATOR", 0, 10000, 10),
211 pos_y = ui_new_slider("LUA", "B", "\nSaved Position Y TS INDICATOR", 0, 10000, 420)
212}
213
214ui_set_visible(anti_aim[7].pos_x, false)
215ui_set_visible(anti_aim[7].pos_y, false)
216
217for i=1, 64 do
218 var.miss[i], var.hit[i], var.shots[i], var.last_hit[i], var.stored_misses[i], var.stored_shots[i] = {}, {}, {}, 0, 0, 0
219 for k=1, 3 do
220 var.miss[i][k], var.hit[i][k], var.shots[i][k] = {}, {}, {}
221 for j=1, 1000 do
222 var.miss[i][k][j], var.hit[i][k][j], var.shots[i][k][j] = 0, 0, 0
223 end
224 end
225 var.miss[i][4], var.hit[i][4], var.shots[i][4] = 0, 0, 0
226end
227
228local function contains(table, value)
229
230 if table == nil then
231 return false
232 end
233
234 table = ui_get(table)
235 for i=0, #table do
236 if table[i] == value then
237 return true
238 end
239 end
240 return false
241end
242
243ui_set_callback(anti_aim[7].aa_settings, function()
244 if not contains(anti_aim[7].aa_settings, "Anti-aim on use") then
245 ui_set(anti_aim[7].aa_settings, "-")
246 end
247end)
248
249local function set_og_menu(state)
250 ui_set_visible(ref.pitch, state)
251 ui_set_visible(ref.yawbase, state)
252 ui_set_visible(ref.yaw[1], state)
253 ui_set_visible(ref.yaw[2], state)
254 ui_set_visible(ref.yawjitter[1], state)
255 ui_set_visible(ref.yawjitter[2], state)
256 ui_set_visible(ref.bodyyaw[1], state)
257 ui_set_visible(ref.bodyyaw[2], state)
258 ui_set_visible(ref.fakeyawlimit, state)
259 ui_set_visible(ref.fsbodyyaw, state)
260 ui_set_visible(ref.edgeyaw, state)
261 ui_set_visible(ref.freestand[1], state)
262 ui_set_visible(ref.freestand[2], state)
263 -- ui_set_visible(ref.lowerbodyyaw, state) // Removed due the latest Skeet update
264 ui_set_visible(ref.os[1], not contains(anti_aim[7].aa_settings, "Custom on-shot anti-aim"))
265 ui_set_visible(ref.os[2], not contains(anti_aim[7].aa_settings, "Custom on-shot anti-aim"))
266end
267
268local function handle_menu(hide_all)
269 var.active_i = var.state_to_idx[ui_get(anti_aim[0].player_state)]
270 set_og_menu(false)
271
272 local show_menu = tostring(hide_all) ~= "hide"
273
274 local sk = false
275 local rage = ui_get(anti_aim[0].anti_aim_mode) == "Rage"
276 local legit = ui_get(anti_aim[0].anti_aim_mode) == "Legit"
277 local auto = ui_get(anti_aim[0].anti_aim_mode) == "Automatic rage"
278 local selected = ui_get(ref.player_list)
279
280 ui_set_visible(anti_aim[0].player_state, not auto and show_menu)
281
282 if selected ~= var.last_selected and selected ~= nil then
283 ui_set_visible(plist_aa[selected], true)
284 if var.last_selected ~= 0 then
285 ui_set_visible(plist_aa[var.last_selected], false)
286 end
287 var.last_selected = selected
288 end
289
290 for i=1, 6 do
291 ui_set_visible(anti_aim[i].enable, var.active_i == i and i > 1 and show_menu)
292
293 ui_set_visible(anti_aim[i].pitch, rage and var.active_i == i and show_menu)
294 ui_set_visible(anti_aim[i].yawbase, rage and var.active_i == i and show_menu)
295 ui_set_visible(anti_aim[i].yaw, rage and var.active_i == i and show_menu)
296 ui_set_visible(anti_aim[i].yawadd, rage and var.active_i == i and ui_get(anti_aim[var.active_i].yaw) ~= "Off" and show_menu)
297 ui_set_visible(anti_aim[i].yawjitter,rage and var.active_i == i and show_menu)
298 ui_set_visible(anti_aim[i].yawjitteradd, rage and var.active_i == i and ui_get(anti_aim[var.active_i].yawjitter) ~= "Off" and show_menu)
299
300 local gs_aa = ui_get(anti_aim[i].aa_mode) == "GameSense"
301 ui_set_visible(anti_aim[i].aa_mode, not auto and var.active_i == i and show_menu)
302
303 ui_set_visible(anti_aim[i].gs_bodyyaw, not auto and gs_aa and var.active_i == i and show_menu)
304 ui_set_visible(anti_aim[i].gs_bodyyawadd, not auto and gs_aa and var.active_i == i and ui_get(anti_aim[i].gs_bodyyaw) ~= "Off" and ui_get(anti_aim[i].gs_bodyyaw) ~= "Opposite" and show_menu)
305
306 ui_set_visible(anti_aim[i].bodyyaw, not auto and var.active_i == i and not gs_aa and show_menu)
307 ui_set_visible(anti_aim[i].bodyyaw_settings, not auto and not gs_aa and var.active_i == i and ui_get(anti_aim[i].bodyyaw) ~= "Off" and show_menu)
308
309 -- ui_set_visible(anti_aim[i].lowerbodyyaw, not auto and var.active_i == i and show_menu) // Removed due the latest Skeet update
310 ui_set_visible(anti_aim[i].fakeyawlimit, not auto and var.active_i == i and show_menu)
311 ui_set_visible(anti_aim[i].fakeyawmode, not auto and var.active_i == i and show_menu)
312 ui_set_visible(anti_aim[i].fakeyawamt, not auto and var.active_i == i and ui_get(anti_aim[i].fakeyawmode) ~= "Off" and show_menu)
313
314 if ui_get(anti_aim[i].bodyyaw) == "Switch key" and ui_get(anti_aim[i].enable) then
315 sk = true
316 end
317 end
318
319 local show_legit = ui_get(anti_aim[0].anti_aim_mode) == "Legit" and show_menu
320 ui_set_visible(anti_aim[7].legit_sett, show_legit)
321
322 ui_set_visible(anti_aim[7].fps, show_legit and contains(anti_aim[7].legit_sett, "Low FPS") and contains(anti_aim[7].legit_sett, "Show values"))
323 ui_set_visible(anti_aim[7].ping, show_legit and contains(anti_aim[7].legit_sett, "High ping") and contains(anti_aim[7].legit_sett, "Show values"))
324
325 ui_set_visible(anti_aim[7].switch_k, ui_get(anti_aim[var.active_i].bodyyaw) == "Switch key" and show_menu)
326 ui_set_visible(anti_aim[7].aa_ind_type, contains(anti_aim[7].ind_set, "Anti-aim"))
327 ui_set_visible(anti_aim[7].ind_clr2, contains(anti_aim[7].ind_set, "Anti-aim"))
328
329 ui_set_visible(anti_aim[7].freestand[1], not legit)
330 ui_set_visible(anti_aim[7].edge[1], not legit)
331 ui_set_visible(anti_aim[7].freestand[2], not legit)
332 ui_set_visible(anti_aim[7].edge[2], not legit)
333
334 ui_set_visible(anti_aim[7].freestand[3], not legit and ui_get(anti_aim[7].freestand[1]))
335 ui_set_visible(anti_aim[7].edge[3], not legit and ui_get(anti_aim[7].edge[1]))
336
337 ui_set_visible(anti_aim[7].manual_enable, not legit)
338 ui_set_visible(anti_aim[7].manual_left, not legit and ui_get(anti_aim[7].manual_enable))
339 ui_set_visible(anti_aim[7].manual_right, not legit and ui_get(anti_aim[7].manual_enable))
340 ui_set_visible(anti_aim[7].manual_back, not legit and ui_get(anti_aim[7].manual_enable))
341
342 ui_set_visible(anti_aim[0].onshot_aa_settings, contains(anti_aim[7].aa_settings, "Custom on-shot anti-aim"))
343 ui_set_visible(anti_aim[0].onshot_aa_key, contains(anti_aim[7].aa_settings, "Custom on-shot anti-aim"))
344end
345handle_menu(nil)
346
347local function normalize_yaw(yaw)
348 while yaw > 180 do yaw = yaw - 360 end
349 while yaw < -180 do yaw = yaw + 360 end
350 return yaw
351end
352
353local function round(num, decimals)
354 local mult = 10^(decimals or 0)
355 return math_floor(num * mult + 0.5) / mult
356end
357
358local function calc_angle(local_x, local_y, enemy_x, enemy_y)
359 local ydelta = local_y - enemy_y
360 local xdelta = local_x - enemy_x
361 local relativeyaw = math_atan( ydelta / xdelta )
362 relativeyaw = normalize_yaw( relativeyaw * 180 / math_pi )
363 if xdelta >= 0 then
364 relativeyaw = normalize_yaw(relativeyaw + 180)
365 end
366 return relativeyaw
367end
368
369local iter = 1
370local function rotate_string()
371 local ret_str = var.ts_clantag[iter]
372 if iter < 14 then
373 iter = iter + 1
374 else
375 iter = 1
376 end
377 return ret_str
378end
379
380local function arr_to_string(arr)
381 arr = ui_get(arr)
382 local str = ""
383 for i=1, #arr do
384 str = str .. arr[i] .. (i == #arr and "" or ",")
385 end
386
387 if str == "" then
388 str = "-"
389 end
390
391 return str
392end
393
394local function str_to_sub(input, sep)
395 local t = {}
396 for str in string_gmatch(input, "([^"..sep.."]+)") do
397 t[#t + 1] = string_gsub(str, "\n", "")
398 end
399 return t
400end
401
402local function to_boolean(str)
403 if str == "true" or str == "false" then
404 return (str == "true")
405 else
406 return str
407 end
408end
409
410local function get_key_mode(ref, secondary)
411 local k = { ui_get(ref) }
412 local hk_mode = k[2]
413 if hk_mode == nil then
414 return "nil"
415 end
416 return secondary == nil and var.hotkey_modes[hk_mode + 1] or var.hotkey_modes1[hk_mode + 1]
417end
418
419local function angle_vector(angle_x, angle_y)
420 local sy = math_sin(math_rad(angle_y))
421 local cy = math_cos(math_rad(angle_y))
422 local sp = math_sin(math_rad(angle_x))
423 local cp = math_cos(math_rad(angle_x))
424 return cp * cy, cp * sy, -sp
425end
426
427local function get_eye_pos(ent)
428 local x, y, z = entity_get_prop(ent, "m_vecOrigin")
429 local hx, hy, hz = entity_hitbox_position(ent, 0)
430 return x, y, hz
431end
432
433local function rotate_point(x, y, rot, size)
434 return math_cos(math_rad(rot)) * size + x, math_sin(math_rad(rot)) * size + y
435end
436
437local function renderer_arrow(x, y, r, g, b, a, rotation, size)
438 local x0, y0 = rotate_point(x, y, rotation, 45)
439 local x1, y1 = rotate_point(x, y, rotation + (size / 3.5), 45 - (size / 4))
440 local x2, y2 = rotate_point(x, y, rotation - (size / 3.5), 45 - (size / 4))
441 renderer_triangle(x0, y0, x1, y1, x2, y2, r, g, b, a)
442end
443
444local function calc_shit(xdelta, ydelta)
445 if xdelta == 0 and ydelta == 0 then
446 return 0
447 end
448
449 return math_deg(math_atan2(ydelta, xdelta))
450end
451
452local function get_damage(plocal, enemy, x, y,z)
453 local ex = { }
454 local ey = { }
455 local ez = { }
456 ex[0], ey[0], ez[0] = entity_hitbox_position(enemy, 1)
457 ex[1], ey[1], ez[1] = ex[0] + 40, ey[0], ez[0]
458 ex[2], ey[2], ez[2] = ex[0], ey[0] + 40, ez[0]
459 ex[3], ey[3], ez[3] = ex[0] - 40, ey[0], ez[0]
460 ex[4], ey[4], ez[4] = ex[0], ey[0] - 40, ez[0]
461 ex[5], ey[5], ez[5] = ex[0], ey[0], ez[0] + 40
462 ex[6], ey[6], ez[6] = ex[0], ey[0], ez[0] - 40
463 local ent, dmg = 0
464 for i=0, 6 do
465 if dmg == 0 or dmg == nil then
466 ent, dmg = client_trace_bullet(enemy, ex[i], ey[i], ez[i], x, y, z)
467 end
468 end
469 return ent == nil and client_scale_damage(plocal, 1, dmg) or dmg
470end
471
472local function get_nearest_enemy(plocal, enemies)
473 local lx, ly, lz = client_eye_position()
474 local view_x, view_y, roll = client_camera_angles()
475
476 local bestenemy = nil
477 local fov = 180
478 for i=1, #enemies do
479 local cur_x, cur_y, cur_z = entity_get_prop(enemies[i], "m_vecOrigin")
480 local cur_fov = math_abs(normalize_yaw(calc_shit(lx - cur_x, ly - cur_y) - view_y + 180))
481 if cur_fov < fov then
482 fov = cur_fov
483 bestenemy = enemies[i]
484 end
485 end
486
487 return bestenemy
488end
489
490local function is_valid(nn)
491 if nn == 0 then
492 return false
493 end
494
495 if not entity_is_alive(nn) then
496 return false
497 end
498
499 if entity_is_dormant(nn) then
500 return false
501 end
502
503 return true
504end
505
506
507local function get_best_desync()
508 local plocal = entity_get_local_player()
509
510 local lx, ly, lz = client_eye_position()
511 local view_x, view_y, roll = client_camera_angles()
512
513 if ui_get(anti_aim[var.p_state].bodyyaw) == "Switch key" and not var.auto_rage then
514 local should_flip = false
515
516 if var.flip_once and ui_get(anti_aim[7].switch_k) then
517 var.flip_value = var.flip_value == 90 and -90 or 90
518 var.flip_once = false
519 elseif not ui_get(anti_aim[7].switch_k) then
520 var.flip_once = true
521 end
522 end
523
524 local enemies = entity_get_players(true)
525
526 if #enemies == 0 then
527
528 if not var.auto_rage then
529 if ui_get(anti_aim[var.p_state].bodyyaw) == "Opposite" then
530 var.best_value = 180
531 elseif ui_get(anti_aim[var.p_state].bodyyaw) == "Jitter" then
532 var.best_value = 0
533 elseif ui_get(anti_aim[var.p_state].bodyyaw) == "Switch key" then
534 var.best_value = var.flip_value
535 else
536 var.best_value = 90
537 end
538 else
539 var.best_value = 90
540 end
541
542 return var.best_value
543 end
544
545 var.bestenemy = is_valid(var.last_nn) and var.last_nn or get_nearest_enemy(plocal, enemies)
546
547 if var.bestenemy ~= nil and var.bestenemy ~= 0 and entity_is_alive(var.bestenemy) then
548 local calc_hit = var.last_hit[var.bestenemy] ~= 0 and contains(anti_aim[var.p_state].bodyyaw_settings, "Anti-resolver")
549 local calc_miss = var.miss[var.bestenemy][4] > 0 and contains(anti_aim[var.p_state].bodyyaw_settings, "Anti-resolver")
550
551 if not calc_hit and not calc_miss then
552 local e_x, e_y, e_z = entity_hitbox_position(var.bestenemy, 0)
553
554 local yaw = calc_angle(lx, ly, e_x, e_y)
555 local rdir_x, rdir_y, rdir_z = angle_vector(0, (yaw + 90))
556 local rend_x = lx + rdir_x * 10
557 local rend_y = ly + rdir_y * 10
558
559 local ldir_x, ldir_y, ldir_z = angle_vector(0, (yaw - 90))
560 local lend_x = lx + ldir_x * 10
561 local lend_y = ly + ldir_y * 10
562
563 local r2dir_x, r2dir_y, r2dir_z = angle_vector(0, (yaw + 90))
564 local r2end_x = lx + r2dir_x * 100
565 local r2end_y = ly + r2dir_y * 100
566
567 local l2dir_x, l2dir_y, l2dir_z = angle_vector(0, (yaw - 90))
568 local l2end_x = lx + l2dir_x * 100
569 local l2end_y = ly + l2dir_y * 100
570
571 local ldamage = get_damage(plocal, var.bestenemy, rend_x, rend_y, lz)
572 local rdamage = get_damage(plocal, var.bestenemy, lend_x, lend_y, lz)
573
574 local l2damage = get_damage(plocal, var.bestenemy, r2end_x, r2end_y, lz)
575 local r2damage = get_damage(plocal, var.bestenemy, l2end_x, l2end_y, lz)
576
577 if not var.auto_rage and ldamage > 0 and rdamage > 0 and contains(anti_aim[var.p_state].bodyyaw_settings, "Jitter when vulnerable") then
578 var.best_value = 0
579 else
580 if not var.auto_rage then
581 if ui_get(anti_aim[var.p_state].bodyyaw) == "Opposite" then
582 var.best_value = 180
583 elseif ui_get(anti_aim[var.p_state].bodyyaw) == "Jitter" then
584 var.best_value = 0
585 elseif ui_get(anti_aim[var.p_state].bodyyaw) == "Switch key" then
586 var.best_value = var.flip_value
587 else
588 if l2damage > r2damage or ldamage > rdamage or l2damage > ldamage then
589 var.best_value = ui_get(anti_aim[var.p_state].bodyyaw) == "Freestanding" and -90 or 90
590 elseif r2damage > l2damage or rdamage > ldamage or r2damage > rdamage then
591 var.best_value = ui_get(anti_aim[var.p_state].bodyyaw) == "Freestanding" and 90 or -90
592 end
593 end
594 else
595 if l2damage > r2damage or ldamage > rdamage or l2damage > ldamage then
596 var.best_value = 90
597 elseif r2damage > l2damage or rdamage > ldamage or r2damage > rdamage then
598 var.best_value = -90
599 end
600 end
601 end
602 elseif calc_hit then
603 var.best_value = var.last_hit[var.bestenemy] == 90 and -90 or 90
604 elseif calc_miss then
605 if var.stored_misses[var.bestenemy] ~= var.miss[var.bestenemy][4] then
606 var.best_value = var.miss[var.bestenemy][2][var.miss[var.bestenemy][4]]
607 var.stored_misses[var.bestenemy] = var.miss[var.bestenemy][4]
608 end
609 end
610 else
611 if not var.auto_rage and ui_get(anti_aim[var.p_state].bodyyaw) == "Opposite" then
612 var.best_value = 180
613 elseif not var.auto_rage and ui_get(anti_aim[var.p_state].bodyyaw) == "Jitter" then
614 var.best_value = 0
615 elseif not var.auto_rage and ui_get(anti_aim[var.p_state].bodyyaw) == "Switch key" then
616 var.best_value = var.flip_value
617 else
618 var.best_value = 90
619 end
620 end
621 return var.best_value
622end
623
624local function run_direction()
625
626 ui_set(anti_aim[7].switch_k, "On hotkey")
627 ui_set(ref.freestand[2], "Always on")
628 ui_set(anti_aim[7].manual_back, "On hotkey")
629 ui_set(anti_aim[7].manual_left, "On hotkey")
630 ui_set(anti_aim[7].manual_right, "On hotkey")
631
632 local k = { ui_get(anti_aim[6].enable) }
633
634 if (k[1] and k[3] == 69) or ui_get(anti_aim[0].anti_aim_mode) == "Legit" then
635 ui_set(ref.freestand[1], "-")
636 ui_set(ref.edgeyaw, false)
637
638 if contains(anti_aim[7].aa_settings, "On-key resets manual AA") then
639 var.aa_dir = 0
640 var.last_press_t = globals_curtime()
641 end
642
643 return
644 end
645
646 local fs_e = ui_get(anti_aim[7].freestand[2]) and ui_get(anti_aim[7].freestand[1]) and not disable_fs
647 local edge_e = ui_get(anti_aim[7].edge[2]) and ui_get(anti_aim[7].edge[1]) and not disable_edge
648
649 ui_set(ref.freestand[1], fs_e and "Default" or "-")
650 ui_set(ref.edgeyaw, edge_e)
651
652 if fs_e or not ui_get(anti_aim[7].manual_enable) then
653 var.aa_dir = 0
654 var.last_press_t = globals_curtime()
655 else
656 if ui_get(anti_aim[7].manual_back) then
657 var.aa_dir = 0
658 elseif ui_get(anti_aim[7].manual_right) and var.last_press_t + 0.2 < globals_curtime() then
659 var.aa_dir = var.aa_dir == 90 and 0 or 90
660 var.last_press_t = globals_curtime()
661 elseif ui_get(anti_aim[7].manual_left) and var.last_press_t + 0.2 < globals_curtime() then
662 var.aa_dir = var.aa_dir == -90 and 0 or -90
663 var.last_press_t = globals_curtime()
664 elseif var.last_press_t > globals_curtime() then
665 var.last_press_t = globals_curtime()
666 end
667 end
668end
669
670local function run_shit(c)
671 local plocal = entity_get_local_player()
672
673 local vx, vy, vz = entity_get_prop(plocal, "m_vecVelocity")
674
675 local p_still = math_sqrt(vx ^ 2 + vy ^ 2) < 2
676 local on_ground = bit_band(entity_get_prop(plocal, "m_fFlags"), 1) == 1 and c.in_jump == 0
677 local p_slow = ui_get(ref.slow[1]) and ui_get(ref.slow[2])
678 local p_key = ui_get(anti_aim[6].enable) and not var.auto_rage
679
680 local wpn = entity_get_player_weapon(plocal)
681 local wpn_id = entity_get_prop(wpn, "m_iItemDefinitionIndex")
682 local m_item = bit_band(wpn_id, 0xFFFF)
683
684 local onshotaa = false
685 var.p_state = 1
686 disable_edge = false
687 disable_fs = false
688
689 if p_key then
690 var.p_state = 6
691 else
692 if not on_ground and ui_get(anti_aim[5].enable) then
693 var.p_state = 5
694 else
695 if p_slow and ui_get(anti_aim[4].enable) then
696 var.p_state = 4
697 else
698 if p_still and ui_get(anti_aim[2].enable) then
699 var.p_state = 2
700 elseif not p_still and ui_get(anti_aim[3].enable) then
701 var.p_state = 3
702 end
703 end
704 end
705 end
706
707 if not on_ground then
708
709 if contains(anti_aim[7].edge[3], "In air") then
710 disable_edge = true
711 end
712
713 if contains(anti_aim[7].freestand[3], "In air") then
714 disable_fs = true
715 end
716
717 onshotaa = contains(anti_aim[0].onshot_aa_settings, "In air")
718 var.on_shot_mode = contains(anti_aim[0].onshot_aa_settings, "In air") and "IN AIR" or var.on_shot_mode
719 else
720 if p_slow then
721
722 if contains(anti_aim[7].edge[3], "While slow walking") then
723 disable_edge = true
724 end
725
726 if contains(anti_aim[7].freestand[3], "While slow walking") then
727 disable_fs = true
728 end
729
730 onshotaa = contains(anti_aim[0].onshot_aa_settings, "On slow-mo")
731 var.on_shot_mode = contains(anti_aim[0].onshot_aa_settings, "On slow-mo") and "SLOW-MO" or var.on_shot_mode
732 else
733 if c.in_duck == 1 and not ui_get(ref.fakeduck) then
734
735 if contains(anti_aim[7].edge[3], "While crouching") then
736 disable_edge = true
737 end
738
739 if contains(anti_aim[7].freestand[3], "While crouching") then
740 disable_fs = true
741 end
742
743 onshotaa = contains(anti_aim[0].onshot_aa_settings, "While crouching")
744 var.on_shot_mode = contains(anti_aim[0].onshot_aa_settings, "While crouching") and "CROUCHING" or var.on_shot_mode
745 elseif not ui_get(ref.fakeduck) then
746 onshotaa = p_still and contains(anti_aim[0].onshot_aa_settings, "While standing") or contains(anti_aim[0].onshot_aa_settings, "While moving")
747 var.on_shot_mode = (contains(anti_aim[0].onshot_aa_settings, "While standing") or contains(anti_aim[0].onshot_aa_settings, "While moving")) and (p_still and "STANDING" or "MOVING") or var.on_shot_mode
748 else
749 onshotaa = false
750
751 if contains(anti_aim[7].edge[3], "While fakeducking") then
752 disable_edge = true
753 end
754
755 if contains(anti_aim[7].freestand[3], "While fakeducking") then
756 disable_fs = true
757 end
758 end
759 end
760 end
761
762 if ui_get(anti_aim[0].onshot_aa_key) and not ui_get(ref.fakeduck) then
763 var.on_shot_mode = get_key_mode(anti_aim[0].onshot_aa_key, 1)
764 onshotaa = true
765 end
766
767 if contains(anti_aim[7].aa_settings, "Custom on-shot anti-aim") then
768 ui_set(ref.os[2], "Always on")
769 ui_set(ref.os[1], onshotaa and m_item ~= 64)
770 else
771 var.on_shot_mode = get_key_mode(ref.os[2], 1)
772 end
773end
774
775local function distance3d(x1, y1, z1, x2, y2, z2)
776 return math_sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) + (z2-z1)*(z2-z1))
777end
778
779local function entity_has_c4(ent)
780 local bomb = entity_get_all("CC4")[1]
781 return bomb ~= nil and entity_get_prop(bomb, "m_hOwnerEntity") == ent
782end
783
784local function aa_on_use(c)
785
786 if contains(anti_aim[7].aa_settings, "Anti-aim on use") then
787 local plocal = entity_get_local_player()
788
789 local distance = 100
790 local bomb = entity_get_all("CPlantedC4")[1]
791 local bomb_x, bomb_y, bomb_z = entity_get_prop(bomb, "m_vecOrigin")
792
793 if bomb_x ~= nil then
794 local player_x, player_y, player_z = entity_get_prop(plocal, "m_vecOrigin")
795 distance = distance3d(bomb_x, bomb_y, bomb_z, player_x, player_y, player_z)
796 end
797
798 local team_num = entity_get_prop(plocal, "m_iTeamNum")
799 local defusing = team_num == 3 and distance < 62
800
801 local on_bombsite = entity_get_prop(plocal, "m_bInBombZone")
802
803 local has_bomb = entity_has_c4(plocal)
804 local trynna_plant = on_bombsite ~= 0 and team_num == 2 and has_bomb and not contains(anti_aim[7].aa_settings, "Disable use to plant")
805
806 local px, py, pz = client_eye_position()
807 local pitch, yaw = client_camera_angles()
808
809 local sin_pitch = math_sin(math_rad(pitch))
810 local cos_pitch = math_cos(math_rad(pitch))
811 local sin_yaw = math_sin(math_rad(yaw))
812 local cos_yaw = math_cos(math_rad(yaw))
813
814 local dir_vec = { cos_pitch * cos_yaw, cos_pitch * sin_yaw, -sin_pitch }
815
816 local fraction, entindex = client_trace_line(plocal, px, py, pz, px + (dir_vec[1] * 8192), py + (dir_vec[2] * 8192), pz + (dir_vec[3] * 8192))
817
818 local using = true
819
820 for i=0, #var.classnames do
821 if entity_get_classname(entindex) == var.classnames[i] then
822 using = false
823 end
824 end
825
826 if not using and not trynna_plant and not defusing then
827 c.in_use = 0
828 end
829 end
830end
831
832local function handle_shots()
833 local enemies = entity_get_players(true)
834
835 for i=1, #enemies do
836 local idx = enemies[i]
837 local s = var.shots[idx][4]
838 local h = var.hit[idx][4]
839
840 if s ~= var.stored_shots[idx] then
841 local missed = true
842
843 if var.shots[idx][1][s] == var.hit[idx][1][h] then
844 if var.hit[idx][2][h] ~= 0 and var.hit[idx][2][h] ~= 180 then
845 var.last_hit[idx] = var.hit[idx][2][h]
846 end
847 missed = false
848 end
849
850 if missed then
851 var.last_hit[idx] = 0
852 var.hit[idx][2][h] = 0
853 var.miss[idx][4] = var.miss[idx][4] + 1
854 var.miss[idx][2][var.miss[idx][4]] = var.shots[idx][2][s]
855 end
856
857 var.last_nn = idx
858 var.stored_shots[idx] = s
859 end
860 end
861end
862
863local frametimes = {}
864local fps_prev = 0
865local last_update_time = 0
866local function get_fps()
867 local ft = globals_absoluteframetime()
868 if ft > 0 then
869 table_insert(frametimes, 1, ft)
870 end
871 local count = #frametimes
872 if count == 0 then
873 return 0
874 end
875 local i, accum = 0, 0
876 while accum < 0.5 do
877 i = i + 1
878 accum = accum + frametimes[i]
879 if i >= count then
880 break
881 end
882 end
883 accum = accum / i
884 while i < count do
885 i = i + 1
886 table_remove(frametimes)
887 end
888 local fps = 1 / accum
889 local rt = globals_realtime()
890 if math_abs(fps - fps_prev) > 4 or rt - last_update_time > 2 then
891 fps_prev = fps
892 last_update_time = rt
893 else
894 fps = fps_prev
895 end
896 return math_floor(fps + 0.5)
897end
898
899local function should_use_aa()
900 local ping = client.latency() * 1000
901 local fps = get_fps()
902
903 if contains(anti_aim[7].legit_sett, "High ping") and ping > ui_get(anti_aim[7].ping) then
904 return false
905 end
906
907 if contains(anti_aim[7].legit_sett, "Low FPS") and fps < ui_get(anti_aim[7].fps) then
908 return false
909 end
910
911 return true
912end
913
914local function on_setup_command(c)
915
916 if ui_get(anti_aim[0].anti_aim_mode) == "Legit" then
917 local should_aa = should_use_aa()
918 if should_aa ~= var.legit_changed then
919 ui_set(ref.enabled, should_aa)
920 var.legit_changed = should_aa
921 end
922 end
923
924 if not ui_get(ref.enabled) then
925 return
926 end
927
928 run_shit(c)
929 run_direction()
930 handle_shots()
931 aa_on_use(c)
932
933 local best_desync = get_best_desync()
934 local k = { ui_get(anti_aim[6].enable) }
935
936 local doubletapping = ui_get(ref.dt[1]) and ui_get(ref.dt[2])
937 local onshotaa = ui_get(ref.os[1]) and ui_get(ref.os[2])
938 local low_legit_fl = ui_get(ref.fl_limit) < 3 and ui_get(anti_aim[0].anti_aim_mode) == "Legit"
939 local exploiting = doubletapping or onshotaa or low_legit_fl
940
941 local holding_e = (k[1] and k[3] == 69) or (var.auto_rage and client_key_state(69))
942 local yaw_to_add = holding_e and 0 or var.aa_dir
943 var.forward = ui_get(ref.yaw[2]) == 180
944
945 ui_set(ref.fsbodyyaw, ui_get(plist_aa[var.bestenemy]) == "Freestanding")
946
947 if ui_get(anti_aim[0].anti_aim_mode) == "Rage" then
948 ui_set(ref.pitch, ui_get(anti_aim[var.p_state].pitch))
949 ui_set(ref.yawbase, var.aa_dir == 0 and ui_get(anti_aim[var.p_state].yawbase) or "Local view")
950 ui_set(ref.yaw[1], ui_get(anti_aim[var.p_state].yaw))
951 ui_set(ref.yaw[2], normalize_yaw(ui_get(anti_aim[var.p_state].yawadd) + yaw_to_add))
952 ui_set(ref.yawjitter[1], ui_get(anti_aim[var.p_state].yawjitter))
953 ui_set(ref.yawjitter[2], ui_get(anti_aim[var.p_state].yawjitteradd))
954 elseif holding_e or ui_get(anti_aim[0].anti_aim_mode) == "Legit" then
955 ui_set(ref.pitch, "Off")
956 ui_set(ref.yawbase, "Local view")
957 ui_set(ref.yaw[1], "Off")
958 ui_set(ref.yaw[2], 180)
959 else
960 ui_set(ref.pitch, "Default")
961 ui_set(ref.yawbase, var.aa_dir == 0 and "At targets" or "Local view")
962 ui_set(ref.yaw[1], "180")
963 ui_set(ref.yaw[2], yaw_to_add)
964 ui_set(ref.yawjitter[1], "Off")
965 end
966
967 if ui_get(plist_aa[var.bestenemy]) == "Spin" then
968 ui_set(ref.yaw[1], "Spin")
969 ui_set(ref.yaw[2], 40)
970 end
971
972 local fakelimit = var.auto_rage and 60 or ui_get(anti_aim[var.p_state].fakeyawlimit)
973 local fakemode = var.auto_rage and "Random" or ui_get(anti_aim[var.p_state].fakeyawmode)
974 local fakeamt = var.auto_rage and 30 or ui_get(anti_aim[var.p_state].fakeyawamt)
975 -- local lby = var.auto_rage and "Half sway" or ui_get(anti_aim[var.p_state].lowerbodyyaw) // Removed due the latest Skeet update
976
977 if fakemode == "Jitter" then
978 fakelimit = client_random_int(0, 1) == 1 and fakeamt or fakelimit
979 elseif fakemode == "Random" then
980 fakelimit = client_random_int(math_max(math_min(60, fakelimit - fakeamt), 0), fakelimit)
981 elseif fakemode == "Smart" then
982 fakelimit = best_desync == 90 and 40 or fakelimit
983 end
984
985 if ui_get(plist_aa[var.bestenemy]) == "Small" then
986 fakelimit = fakelimit / 2
987 end
988
989 ui_set(ref.fakeyawlimit, holding_e and 60 or fakelimit)
990
991 if var.auto_rage then
992 if best_desync == 0 or best_desync == 180 then
993 ui_set(ref.bodyyaw[1], best_desync == 0 and "Jitter" or "Opposite")
994 ui_set(ref.bodyyaw[2], 0)
995 else
996 ui_set(ref.bodyyaw[1], "Static")
997 ui_set(ref.bodyyaw[2], var.forward and -best_desync or best_desync)
998 end
999 else
1000 if ui_get(anti_aim[var.p_state].aa_mode) == "Teamskeet" then
1001 if ui_get(anti_aim[var.p_state].bodyyaw) ~= "Off" then
1002 if best_desync == 0 or best_desync == 180 then
1003 ui_set(ref.bodyyaw[1], best_desync == 0 and "Jitter" or "Opposite")
1004 ui_set(ref.bodyyaw[2], 0)
1005 else
1006 ui_set(ref.bodyyaw[1], "Static")
1007 ui_set(ref.bodyyaw[2], var.forward and -best_desync or best_desync)
1008 end
1009 else
1010 ui_set(ref.bodyyaw[1], "Off")
1011 end
1012 else
1013 ui_set(ref.bodyyaw[1], ui_get(anti_aim[var.p_state].gs_bodyyaw))
1014 ui_set(ref.bodyyaw[2], ui_get(anti_aim[var.p_state].gs_bodyyawadd))
1015 end
1016 end
1017
1018
1019 --lowerbody
1020 --[[ // Removed due the latest Skeet update
1021 if holding_e or (var.auto_rage and exploiting) then
1022 ui_set(ref.lowerbodyyaw, exploiting and "Eye yaw" or "Opposite")
1023 else
1024 if lby ~= "Half sway" then
1025 ui_set(ref.lowerbodyyaw, (lby == "Opposite" and (exploiting or best_desync == 0)) and "Eye yaw" or lby)
1026 else
1027 if var.last_sway_time + 1.1 < globals_curtime() then
1028 ui_set(ref.lowerbodyyaw, ui_get(ref.lowerbodyyaw) == "Eye yaw" and "Opposite" or "Eye yaw")
1029 var.last_sway_time = globals_curtime()
1030 elseif var.last_sway_time > globals_curtime() then
1031 var.last_sway_time = globals_curtime()
1032 end
1033 end
1034 end ]]
1035
1036 var.choked_cmds = c.chokedcommands
1037 set_og_menu(false)
1038end
1039
1040local function is_dragging(x, y, w, h)
1041 local mx, my = ui_mouse_position()
1042 local click = client_key_state(0x01)
1043
1044 local in_x = mx > x and mx < x + w
1045 local in_y = my > y and my < y + h
1046
1047 return in_x and in_y and click and ui_is_menu_open()
1048end
1049
1050local function is_dragging_menu()
1051 local x, y = ui_mouse_position()
1052 local px, py = ui_menu_position()
1053 local sx, sy = ui_menu_size()
1054 local click = client_key_state(0x01)
1055
1056 local in_x = x > px and x < px + sx
1057 local in_y = y > py and y < py + sy
1058
1059 return in_x and in_y and click and ui_is_menu_open()
1060end
1061
1062local function run_clantag()
1063 if contains(anti_aim[7].ind_set, "Clantag") then
1064 if var.ts_time + 0.3 < globals_curtime() then
1065 client_set_clan_tag(rotate_string())
1066 var.ts_time = globals_curtime()
1067 elseif var.ts_time > globals_curtime() then
1068 var.ts_time = globals_curtime()
1069 end
1070 var.clantag_enbl = true
1071 elseif not contains(anti_aim[7].ind_set, "Clantag") and clantag_enbl then
1072 client_set_clan_tag("")
1073 var.clantag_enbl = false
1074 end
1075end
1076
1077local function run_remove_skeet()
1078 if contains(anti_aim[7].ind_sli, "Remove skeet indicators") then
1079 for i=1, 400 do
1080 renderer_indicator(0, 0, 0, 0, " ")
1081 end
1082 end
1083end
1084
1085local function run_dragging()
1086 local click = client_key_state(0x01)
1087 local mx, my = ui_mouse_position()
1088 local x, y = ui_get(anti_aim[7].pos_x), ui_get(anti_aim[7].pos_y)
1089 local sx, sy = client_screen_size()
1090
1091 if var.dragging then
1092 local dx, dy = x - var.ox, y - var.oy
1093 ui_set(anti_aim[7].pos_x, math_min(math_max(mx + dx, 0), sx))
1094 ui_set(anti_aim[7].pos_y, math_min(math_max(my + dy, 0), sy))
1095 var.ox, var.oy = mx, my
1096 else
1097 var.ox, var.oy = mx, my
1098 end
1099end
1100
1101local function get_sliders(plocal)
1102 local arr = {}
1103
1104 local desync = entity_get_prop(plocal, "m_flPoseParameter", 11) * 116 - 58
1105 local v = vector(entity_get_prop(plocal, "m_vecVelocity"))
1106 local speed = v:length2d()
1107
1108 if contains(anti_aim[7].ind_sli, "Desync") and ui_get(ref.enabled) then
1109 arr[#arr + 1] = {
1110 v = round(desync, 0),
1111 p = math_abs(desync / 58),
1112 t = "FAKE YAW",
1113 }
1114 end
1115
1116 if contains(anti_aim[7].ind_sli, "Fake lag") then
1117 arr[#arr + 1] = {
1118 v = var.choked_cmds,
1119 p = var.choked_cmds / (ui_get(ref.maxprocticks) - 2),
1120 t = "FAKE LAG"
1121 }
1122 end
1123
1124 if contains(anti_aim[7].ind_sli, "Speed") then
1125 arr[#arr + 1] = {
1126 v = round(speed),
1127 p = speed / 250,
1128 t = "VELOCITY"
1129 }
1130 end
1131 return arr
1132end
1133
1134local function get_chk(chk)
1135 return chk == nil and true or ui_get(chk)
1136end
1137
1138local function get_keys()
1139 local arr = {}
1140
1141 if ui_get(ref.fakeduck) then
1142 arr[#arr + 1] = {
1143 t = "FAKE DUCK",
1144 v = get_key_mode(ref.fakeduck, 1)
1145 }
1146 end
1147
1148 if ui_get(anti_aim[7].edge[1]) and ui_get(anti_aim[7].edge[2]) and not disable_edge then
1149 arr[#arr + 1] = {
1150 t = "EDGE YAW",
1151 v = get_key_mode(anti_aim[7].edge[2], 1)
1152 }
1153 end
1154
1155 if ui_get(anti_aim[6].enable) and not var.auto_rage then
1156 arr[#arr + 1] = {
1157 t = "ON-KEY AA",
1158 v = get_key_mode(anti_aim[6].enable, 1)
1159 }
1160 end
1161
1162 if ui_get(ref.os[1]) and ui_get(ref.os[2]) then
1163 arr[#arr + 1] = {
1164 t = "ONSHOT AA",
1165 v = var.on_shot_mode
1166 }
1167 end
1168
1169 if ui_get(ref.dt[1]) and ui_get(ref.dt[2]) then
1170 arr[#arr + 1] = {
1171 t = "DOUBLE TAP",
1172 v = get_key_mode(ref.dt[2], 1)
1173 }
1174 end
1175
1176 if ui_get(ref.safepoint) then
1177 arr[#arr + 1] = {
1178 t = "SAFE POINT",
1179 v = get_key_mode(ref.safepoint, 1)
1180 }
1181 end
1182
1183 if ui_get(ref.forcebaim) then
1184 arr[#arr + 1] = {
1185 t = "FORCE BAIM",
1186 v = get_key_mode(ref.forcebaim, 1)
1187 }
1188 end
1189
1190 if ui_get(anti_aim[7].freestand[1]) and ui_get(anti_aim[7].freestand[2]) and not disable_fs then
1191 arr[#arr + 1] = {
1192 t = "FREESTANDING",
1193 v = get_key_mode(anti_aim[7].freestand[2], 1)
1194 }
1195 end
1196
1197 if ui_get(ref.quickpeek[1]) and ui_get(ref.quickpeek[2]) then
1198 arr[#arr + 1] = {
1199 t = "QUICK PEEK",
1200 v = get_key_mode(ref.quickpeek[2], 1)
1201 }
1202 end
1203
1204 for i=1, #var.custom_keys do
1205 if ui_get(var.custom_keys[i].ref) and get_chk(var.custom_keys[i].chk) then
1206 arr[#arr + 1] = {
1207 t = var.custom_keys[i].name,
1208 v = get_key_mode(var.custom_keys[i].ref, 1)
1209 }
1210 end
1211 end
1212
1213 return arr
1214end
1215
1216local function on_paint()
1217 local plocal = entity_get_local_player()
1218
1219 run_clantag()
1220 run_remove_skeet()
1221
1222 if not entity_is_alive(plocal) then
1223 return
1224 end
1225
1226 local click = client_key_state(0x01)
1227 local sx, sy = client_screen_size()
1228 local cx, cy = sx / 2, sy / 2 - 2
1229 local r, g, b, a = ui_get(anti_aim[7].ind_clr)
1230 local r1, g1, b1, a1 = ui_get(anti_aim[7].ind_clr2)
1231
1232 local x, y = ui_get(anti_aim[7].pos_x), ui_get(anti_aim[7].pos_y)
1233
1234 local sliders, keys = {}, {}
1235 local scale = contains(anti_aim[7].ind_sli, "Big") and 1.5 or 1
1236 local w, h = 200 * scale, 20 * scale
1237 local i_dist = scale == 1 and 16 or 18
1238
1239 if contains(anti_aim[7].ind_set, "Indicators") then
1240
1241 sliders = get_sliders(plocal)
1242
1243 renderer_rectangle(x, y, w, h, 20, 20, 20, 255)
1244 renderer_text(x + w/2, y + i_dist/2, 255, 255, 255, 255, scale == 1 and "-c" or "cb", nil, "INDICATORS")
1245
1246 if contains(anti_aim[7].ind_sli, "Gradient") then
1247 renderer_gradient(x, y, w/2, scale^2, 0, 200, 255, 255, 255, 0, 255, 255, true)
1248 renderer_gradient(x + w/2, y, w/2, scale^2, 255, 0, 255, 255, 175, 255, 0, 255, true)
1249 else
1250 renderer_rectangle(x, y, w, scale^2, r, g, b, a)
1251 renderer_rectangle(x, y, w, scale^2, r, g, b, a)
1252 end
1253
1254 local m_h = (#sliders * i_dist)
1255
1256 renderer_rectangle(x, y+i_dist, w, m_h, 25, 25, 25, 255)
1257 renderer_rectangle(x, y+i_dist + m_h, w, 5, 20, 20, 20, 255)
1258
1259 for i=1, #sliders do
1260 renderer_text(x + 5, y + ((i + 1) * i_dist) - 15, 255, 255, 255, 255, scale == 1 and "-" or "b", nil, sliders[i].t)
1261
1262 local stx = x + math_floor(w/4.5) - 1
1263 local sty = y + ((i + 1) * i_dist) - 14
1264 local m_w = math_floor(w/1.33) + (scale == 1 and 0 or 1)
1265 local height = scale == 1 and h/2.25 or h/2.75
1266
1267 if contains(anti_aim[7].ind_sli, "Show values") then
1268 stx = x + math_floor(w/3.25)
1269 sty = y + ((i + 1) * i_dist) - 14
1270 m_w = math_floor(w/1.5)
1271 renderer_text(x + math_floor(w/4.5), y + ((i + 1) * i_dist) - 15, 255, 255, 255, 255, scale == 1 and "-" or "", nil, sliders[i].v)
1272 end
1273
1274 local width = math_max(math_min(m_w, m_w * sliders[i].p), 5)
1275
1276 if contains(anti_aim[7].ind_sli, "Gradient") then
1277 renderer_gradient(stx, sty, math_floor(m_w/2), height, 0, 200, 255, 255, 255, 0, 255, 255, true)
1278 renderer_gradient(stx + math_floor(m_w/2), sty, math_floor(m_w/2), height, 255, 0, 255, 255, 175, 255, 0, 255, true)
1279 renderer_rectangle(stx + 1, sty + 1, m_w - 2, height - 2, 25, 25, 25, 150)
1280
1281 local amt = m_w - width
1282 if amt > 0 then
1283 renderer_rectangle(x + w - 5 - amt, sty, amt, height, 25, 25, 25, 255)
1284 end
1285 else
1286 renderer_rectangle(stx, sty, width, height, r, g, b, a)
1287 renderer_rectangle(stx + 1, sty + 1, width - 2, height - 2, 25, 25, 25, 150)
1288 end
1289 end
1290
1291 if is_dragging(x, y, w, h + m_h) and not is_dragging_menu() then
1292 var.dragging = true
1293 elseif not click then
1294 var.dragging = false
1295 end
1296 end
1297
1298 if contains(anti_aim[7].ind_set, "Key states") then
1299 local x2, y2 = x, y + h + (#sliders * i_dist) + 5
1300
1301 renderer_rectangle(x2, y2, w, h, 20, 20, 20, 255)
1302 renderer_text(x2 + w/2, y2 + i_dist/2, 255, 255, 255, 255, scale == 1 and "-c" or "cb", nil, "KEYBINDS")
1303
1304 if contains(anti_aim[7].ind_sli, "Gradient") then
1305 renderer_gradient(x2, y2, w/2, scale^2, 0, 200, 255, 255, 255, 0, 255, 255, true)
1306 renderer_gradient(x2 + w/2, y2, w/2, scale^2, 255, 0, 255, 255, 175, 255, 0, 255, true)
1307 else
1308 renderer_rectangle(x2, y2, w, scale^2, r, g, b, a)
1309 renderer_rectangle(x2, y2, w, scale^2, r, g, b, a)
1310 end
1311
1312 keys = get_keys()
1313
1314 renderer_rectangle(x2, y2 + i_dist, w, #keys * i_dist + (4 * scale^2), 25, 25, 25, 255)
1315
1316 for i=1, #keys do
1317 local tw, th = renderer_measure_text(scale == 1 and "-" or "b", keys[i].v)
1318 local cur_pos = y2 + ((i + 1) * i_dist) - 13
1319 if contains(anti_aim[7].ind_sli, "Gradient") then
1320 renderer_text(x2 + 5, cur_pos, 100, 200, 255, 255, scale == 1 and "-" or "b", nil, keys[i].t)
1321 renderer_text(x2 + w - 10 - tw, cur_pos, 175, 255, 0, 255, scale == 1 and "-" or "b", nil, keys[i].v)
1322 else
1323 renderer_text(x2 + 5, cur_pos, r, g, b, a, scale == 1 and "-" or "b", nil, keys[i].t)
1324 renderer_text(x2 + w - 10 - tw, cur_pos, 255, 255, 255, 255, scale == 1 and "-" or "b", nil, keys[i].v)
1325 end
1326 end
1327
1328 if is_dragging(x2, y2, w, (#keys * i_dist) + h) and not is_dragging_menu() then
1329 var.dragging = true
1330 elseif not click then
1331 var.dragging = false
1332 end
1333 end
1334
1335 if contains(anti_aim[7].ind_set, "Anti-aim") then
1336 local cam = vector(client_camera_angles())
1337
1338 local h = vector(entity_hitbox_position(plocal, "head_0"))
1339 local p = vector(entity_hitbox_position(plocal, "pelvis"))
1340
1341 local yaw = normalize_yaw(calc_angle(p.x, p.y, h.x, h.y) - cam.y + 120)
1342 local bodyyaw = entity_get_prop(plocal, "m_flPoseParameter", 11) * 120 - 60
1343
1344 local fakeangle = normalize_yaw(yaw + bodyyaw)
1345
1346 if ui_get(anti_aim[7].aa_ind_type) == "Circle" then
1347 renderer_circle_outline(cx, cy + 1, 100, 100, 100, 100, 30, 0, 1, 4)
1348 renderer_circle_outline(cx, cy + 1, r, g, b, a, 30, (fakeangle * -1) - 15, 0.1, 4)
1349 renderer_circle_outline(cx, cy + 1, r1, g1, b1, a1, 30, (yaw * -1) - 15, 0.1, 4)
1350 elseif ui_get(anti_aim[7].aa_ind_type) == "Arrows" then
1351 renderer_arrow(cx, cy, r, g, b, a, (yaw - 25) * -1, 45)
1352 renderer_arrow(cx, cy, r1, g1, b1, a1, (fakeangle - 25) * -1, 25)
1353 else
1354 renderer_triangle(cx + 55, cy + 2, cx + 42, cy - 7, cx + 42, cy + 11,
1355 var.aa_dir == 90 and r or 35,
1356 var.aa_dir == 90 and g or 35,
1357 var.aa_dir == 90 and b or 35,
1358 var.aa_dir == 90 and a or 150)
1359
1360 renderer_triangle(cx - 55, cy + 2, cx - 42, cy - 7, cx - 42, cy + 11,
1361 var.aa_dir == -90 and r or 35,
1362 var.aa_dir == -90 and g or 35,
1363 var.aa_dir == -90 and b or 35,
1364 var.aa_dir == -90 and a or 150)
1365
1366 renderer_rectangle(cx + 38, cy - 7, 2, 18,
1367 bodyyaw < -10 and r1 or 35,
1368 bodyyaw < -10 and g1 or 35,
1369 bodyyaw < -10 and b1 or 35,
1370 bodyyaw < -10 and a1 or 150)
1371 renderer_rectangle(cx - 40, cy - 7, 2, 18,
1372 bodyyaw > 10 and r1 or 35,
1373 bodyyaw > 10 and g1 or 35,
1374 bodyyaw > 10 and b1 or 35,
1375 bodyyaw > 10 and a1 or 150)
1376 end
1377 end
1378
1379 run_dragging(dragging)
1380end
1381
1382local function dist_from_3dline(shooter, e)
1383 local x, y, z = entity_hitbox_position(shooter, 0)
1384 local x1, y1, z1 = client_eye_position()
1385
1386 return ((e.y - y)*x1 - (e.x - x)*y1 + e.x*y - e.y*x) / math_sqrt((e.y-y)^2 + (e.x - x)^2)
1387end
1388
1389local function on_bullet_impact(e)
1390 local plocal = entity_get_local_player()
1391 local shooter = client_userid_to_entindex(e.userid)
1392
1393 if not entity_is_enemy(shooter) or not entity_is_alive(plocal) then
1394 return
1395 end
1396
1397 local d = dist_from_3dline(shooter, e)
1398
1399 if math_abs(d) < 100 then
1400 local dsy = var.forward and (ui_get(ref.bodyyaw[2]) * -1) or ui_get(ref.bodyyaw[2])
1401
1402 local previous_record = var.shots[shooter][1][var.shots[shooter][4]] == globals_curtime()
1403 var.shots[shooter][4] = previous_record and var.shots[shooter][4] or var.shots[shooter][4] + 1
1404
1405 var.shots[shooter][1][var.shots[shooter][4]] = globals_curtime()
1406
1407 local dtc = (not var.forward and not var.auto_rage and contains(anti_aim[var.p_state].bodyyaw_settings, "Detect missed angle")) or dsy == 0 or dsy == 180
1408
1409 if dtc then
1410 var.shots[shooter][2][var.shots[shooter][4]] = math_abs(d) > 0.5 and (d < 0 and 90 or -90) or dsy
1411 else
1412 var.shots[shooter][2][var.shots[shooter][4]] = (dsy == 90 and -90 or 90)
1413 end
1414 end
1415end
1416
1417local function on_player_hurt(e)
1418 local plocal = entity_get_local_player()
1419 local victim = client_userid_to_entindex(e.userid)
1420 local attacker = client_userid_to_entindex(e.attacker)
1421
1422 if not entity_is_enemy(attacker) or not entity_is_alive(plocal) or entity_is_enemy(victim) then
1423 return
1424 end
1425
1426 for i=1, #var.nonweapons do
1427 if e.weapon == var.nonweapons[i] then
1428 return
1429 end
1430 end
1431
1432 local dsy = var.forward and (ui_get(ref.bodyyaw[2]) * -1) or ui_get(ref.bodyyaw[2])
1433
1434 var.hit[attacker][4] = var.hit[attacker][4] + 1
1435 var.hit[attacker][1][var.hit[attacker][4]] = globals_curtime()
1436 var.hit[attacker][2][var.hit[attacker][4]] = victim ~= plocal and 0 or dsy
1437 var.hit[attacker][3][var.hit[attacker][4]] = e.hitgroup
1438end
1439
1440local function reset_data(keep_hit)
1441 for i=1, 64 do
1442 var.last_hit[i], var.stored_misses[i], var.stored_shots[i] = (keep_hit and var.hit[i][2][var.hit[i][4]] ~= 0) and var.hit[i][2][var.hit[i][4]] or 0, 0, 0
1443 for k=1, 3 do
1444 for j=1, 1000 do
1445 var.miss[i][k][j], var.hit[i][k][j], var.shots[i][k][j] = 0, 0, 0
1446 end
1447 end
1448 var.miss[i][4], var.hit[i][4], var.shots[i][4], var.last_nn, var.best_value = 0, 0, 0, 0, 180
1449 end
1450end
1451
1452local function load_cfg(input)
1453 local tbl = str_to_sub(input, "|")
1454
1455 for i=1, 6 do
1456 ui_set(anti_aim[i].enable, to_boolean(tbl[1 + (16 * (i - 1))]))
1457 ui_set(anti_aim[i].pitch, tbl[2 + (16 * (i - 1))])
1458 ui_set(anti_aim[i].yawbase, tbl[3 + (16 * (i - 1))])
1459 ui_set(anti_aim[i].yaw, tbl[4 + (16 * (i - 1))])
1460 ui_set(anti_aim[i].yawadd, tonumber(tbl[5 + (16 * (i - 1))]))
1461 ui_set(anti_aim[i].yawjitter, tbl[6 + (16 * (i - 1))])
1462 ui_set(anti_aim[i].yawjitteradd, tonumber(tbl[7 + (16 * (i - 1))]))
1463 ui_set(anti_aim[i].aa_mode, tbl[8 + (16 * (i - 1))])
1464 ui_set(anti_aim[i].bodyyaw, tbl[9 + (16 * (i - 1))])
1465 ui_set(anti_aim[i].bodyyaw_settings, str_to_sub(tbl[10 + (16 * (i - 1))], ","))
1466 -- ui_set(anti_aim[i].lowerbodyyaw, tbl[11 + (16 * (i - 1))]) // Removed due the latest Skeet update
1467 ui_set(anti_aim[i].fakeyawlimit, tonumber(tbl[12 + (16 * (i - 1))]))
1468 ui_set(anti_aim[i].fakeyawmode, tbl[13 + (16 * (i - 1))])
1469 ui_set(anti_aim[i].fakeyawamt, tonumber(tbl[14 + (16 * (i - 1))]))
1470 ui_set(anti_aim[i].gs_bodyyaw, tbl[15 + (16 * (i - 1))])
1471 ui_set(anti_aim[i].gs_bodyyawadd, tonumber(tbl[16 + (16 * (i - 1))]))
1472 end
1473
1474 ui_set(anti_aim[7].manual_enable, to_boolean(tbl[97]))
1475 ui_set(anti_aim[0].onshot_aa_settings, str_to_sub(tbl[98], ","))
1476 ui_set(anti_aim[7].ind_set, str_to_sub(tbl[99], ","))
1477 ui_set(anti_aim[7].ind_sli, str_to_sub(tbl[100], ","))
1478 ui_set(anti_aim[7].aa_ind_type, tbl[101])
1479 ui_set(anti_aim[7].aa_settings, str_to_sub(tbl[102], ","))
1480
1481 client_log("Loaded config from clipboard")
1482end
1483
1484local function export_cfg()
1485 local str = ""
1486
1487 for i=1, 6 do
1488 local get_key = i == 6 and get_key_mode or ui_get
1489
1490 str = str .. tostring(get_key(anti_aim[i].enable)) .. "|"
1491 .. tostring(ui_get(anti_aim[i].pitch)) .. "|"
1492 .. tostring(ui_get(anti_aim[i].yawbase)) .. "|"
1493 .. tostring(ui_get(anti_aim[i].yaw)) .. "|"
1494 .. tostring(ui_get(anti_aim[i].yawadd)) .. "|"
1495 .. tostring(ui_get(anti_aim[i].yawjitter)) .. "|"
1496 .. tostring(ui_get(anti_aim[i].yawjitteradd)) .. "|"
1497 .. tostring(ui_get(anti_aim[i].aa_mode)) .. "|"
1498 .. tostring(ui_get(anti_aim[i].bodyyaw)) .. "|"
1499 .. arr_to_string(anti_aim[i].bodyyaw_settings) .. "|"
1500 -- .. tostring(ui_get(anti_aim[i].lowerbodyyaw)) .. "|" // Removed due the latest Skeet update
1501 .. tostring(ui_get(anti_aim[i].fakeyawlimit)) .. "|"
1502 .. tostring(ui_get(anti_aim[i].fakeyawmode)) .. "|"
1503 .. tostring(ui_get(anti_aim[i].fakeyawamt)) .. "|"
1504 .. tostring(ui_get(anti_aim[i].gs_bodyyaw)) .. "|"
1505 .. tostring(ui_get(anti_aim[i].gs_bodyyawadd)) .. "|"
1506 end
1507
1508 str = str .. tostring(ui_get(anti_aim[7].manual_enable)) .. "|"
1509 .. arr_to_string (anti_aim[0].onshot_aa_settings) .. "|"
1510 .. arr_to_string (anti_aim[7].ind_set) .. "|"
1511 .. arr_to_string (anti_aim[7].ind_sli) .. "|"
1512 .. tostring(ui_get(anti_aim[7].aa_ind_type)) .. "|"
1513 .. arr_to_string (anti_aim[7].aa_settings)
1514
1515 clipboard_export(str)
1516 client_log("Exported config to clipboard")
1517end
1518
1519local function add_custom_key(input)
1520 local str = string_gsub(input, "//add_keybind ", "")
1521
1522 local subs = str_to_sub(str, ",")
1523
1524 local ref1, ref2 = nil, nil
1525 local got_reference = pcall(function() ref1, ref2 = ui_reference(subs[1], subs[2], subs[3]) end)
1526
1527 if got_reference and #subs == 4 then
1528 var.custom_keys[#var.custom_keys + 1] = {
1529 ref = ref2 == nil and ref1 or ref2,
1530 chk = ref2 == nil and nil or ref1,
1531 name = subs[4]
1532 }
1533
1534 var.custom_key_saves[#var.custom_key_saves + 1] = str
1535 client_log("Succesfully added " .. subs[4] .. " to the keybinds list!")
1536 else
1537 if got_reference then
1538 client_log("You forgot to add the name of the key you fucking retard")
1539 else
1540 client_log("Failed to add the key :( Couldn't find it in the menu")
1541 end
1542 end
1543end
1544
1545local function load_kace()
1546 for i=2, 5 do
1547 ui_set(anti_aim[i].enable, false)
1548 end
1549 --global
1550 ui_set(anti_aim[1].pitch, "Default")
1551 ui_set(anti_aim[1].yawbase, "At targets")
1552 ui_set(anti_aim[1].yaw, "180")
1553 ui_set(anti_aim[1].yawadd, 0)
1554 ui_set(anti_aim[1].yawjitter, "Off")
1555 ui_set(anti_aim[1].yawjitteradd, 0)
1556 ui_set(anti_aim[1].aa_mode, "Teamskeet")
1557 ui_set(anti_aim[1].bodyyaw, "Reversed freestanding")
1558 ui_set(anti_aim[1].bodyyaw_settings, {"Anti-resolver", "Jitter when vulnerable"})
1559 -- ui_set(anti_aim[1].lowerbodyyaw, "Half sway") // Removed due the latest Skeet update
1560 ui_set(anti_aim[1].fakeyawlimit, 60)
1561 ui_set(anti_aim[1].fakeyawmode, "Custom right")
1562 ui_set(anti_aim[1].fakeyawamt, 35)
1563 --slow motion
1564 ui_set(anti_aim[4].enable, true)
1565 ui_set(anti_aim[4].pitch, "Default")
1566 ui_set(anti_aim[4].yawbase, "At targets")
1567 ui_set(anti_aim[4].yaw, "180")
1568 ui_set(anti_aim[4].yawadd, 0)
1569 ui_set(anti_aim[4].yawjitter, "Off")
1570 ui_set(anti_aim[4].yawjitteradd, 0)
1571 ui_set(anti_aim[4].aa_mode, "GameSense")
1572 ui_set(anti_aim[4].gs_bodyyaw, "Static")
1573 ui_set(anti_aim[4].gs_bodyyawadd, 60)
1574 -- ui_set(anti_aim[4].lowerbodyyaw, "Eye yaw") // Removed due the latest Skeet update
1575 ui_set(anti_aim[4].fakeyawlimit, 40)
1576 ui_set(anti_aim[4].fakeyawmode, "Jitter")
1577 ui_set(anti_aim[4].fakeyawamt, 30)
1578 --air
1579 ui_set(anti_aim[5].enable, true)
1580 ui_set(anti_aim[5].pitch, "Default")
1581 ui_set(anti_aim[5].yawbase, "At targets")
1582 ui_set(anti_aim[5].yaw, "180")
1583 ui_set(anti_aim[5].yawadd, 0)
1584 ui_set(anti_aim[5].yawjitter, "Off")
1585 ui_set(anti_aim[5].yawjitteradd, 0)
1586 ui_set(anti_aim[5].aa_mode, "Teamskeet")
1587 ui_set(anti_aim[5].bodyyaw, "Opposite")
1588 ui_set(anti_aim[5].bodyyaw_settings, {"Anti-resolver"})
1589 -- ui_set(anti_aim[5].lowerbodyyaw, "Opposite") // Removed due the latest Skeet update
1590 ui_set(anti_aim[5].fakeyawlimit, 60)
1591 ui_set(anti_aim[5].fakeyawmode, "Off")
1592 --on-key
1593 ui_set(anti_aim[6].pitch, "Off")
1594 ui_set(anti_aim[6].yawbase, "Local view")
1595 ui_set(anti_aim[6].yaw, "180")
1596 ui_set(anti_aim[6].yawadd, 180)
1597 ui_set(anti_aim[6].yawjitter, "Off")
1598 ui_set(anti_aim[6].yawjitteradd, 0)
1599 ui_set(anti_aim[6].aa_mode, "Teamskeet")
1600 ui_set(anti_aim[6].bodyyaw, "Reversed freestanding")
1601 ui_set(anti_aim[6].bodyyaw_settings, {"Anti-resolver"})
1602 -- ui_set(anti_aim[6].lowerbodyyaw, "Opposite") // Removed due the latest Skeet update
1603 ui_set(anti_aim[6].fakeyawlimit, 60)
1604 ui_set(anti_aim[6].fakeyawmode, "Off")
1605 ui_set(anti_aim[6].fakeyawamt, 0)
1606
1607 ui_set(anti_aim[7].manual_enable, true)
1608 ui_set(anti_aim[0].onshot_aa_key, "Toggle")
1609 ui_set(anti_aim[0].onshot_aa_settings, {"On slow-mo", "While crouching", "On key"})
1610 ui_set(anti_aim[7].ind_set, {"Indicators", "Anti-aim", "Key states"})
1611 ui_set(anti_aim[7].ind_sli, {"Desync", "Fake lag", "Speed", "Gradient", "Big"})
1612 ui_set(anti_aim[7].aa_ind_type, "Arrows")
1613
1614 ui_set(anti_aim[7].aa_settings, {"Anti-aim on use", "Disable use to plant"})
1615end
1616
1617local function on_console_input(input)
1618 if string_find(input, "//load kace") then
1619 load_kace()
1620
1621 client_log("Config loaded!")
1622 elseif string_find(input, "//load sigma") then
1623 client_log("Config loaded!")
1624 --global
1625 ui_set(anti_aim[1].pitch, "Default")
1626 ui_set(anti_aim[1].yawbase, "At targets")
1627 ui_set(anti_aim[1].yaw, "180")
1628 ui_set(anti_aim[1].yawadd, 0)
1629 ui_set(anti_aim[1].yawjitter, "Off")
1630 ui_set(anti_aim[1].yawjitteradd, 0)
1631 ui_set(anti_aim[1].aa_mode, "Teamskeet")
1632 ui_set(anti_aim[1].bodyyaw, "Reversed freestanding")
1633 ui_set(anti_aim[1].bodyyaw_settings, {"Anti-resolver", "Jitter when vulnerable"})
1634 -- ui_set(anti_aim[1].lowerbodyyaw, "Eye yaw") // Removed due the latest Skeet update
1635 ui_set(anti_aim[1].fakeyawlimit, 60)
1636 ui_set(anti_aim[1].fakeyawmode, "Off")
1637
1638 for i=2, 5 do
1639 ui_set(anti_aim[i].enable, false)
1640 end
1641
1642 ui_set(anti_aim[7].manual_enable, true)
1643 ui_set(anti_aim[0].onshot_aa_key, "Toggle")
1644 ui_set(anti_aim[0].onshot_aa_settings, {"On key"})
1645 ui_set(anti_aim[7].ind_set, {"Indicators", "Anti-aim", "Key states"})
1646 ui_set(anti_aim[7].ind_sli, {"Desync", "Fake lag", "Speed", "Gradient"})
1647 ui_set(anti_aim[7].aa_ind_type, "Static")
1648 elseif string_find(input, "//help") then
1649 client_color_log(255, 255, 255, "|--------------------------------------------------------|")
1650 client_color_log(0, 150, 255, "[//load kace] Load Kace's AA settings")
1651 client_color_log(150, 0, 200, "[//load sigma] Load Sigma's AA settings")
1652 client_color_log(225, 0, 225, "[//export] Export your anti-aim settings to your clipboard")
1653 client_color_log(255, 150, 175, "[//import] Import anti-aim settings from your clipboard")
1654 client_color_log(255, 150, 150, "[//add_keybind TAB,CONTAINER,ELEMENT,INDICATOR NAME] Add a custom keybind to the keybind indicator")
1655 client_color_log(255, 200, 60, "[//keybinds] Lists the stored keybinds")
1656 client_color_log(230, 255, 60, "[//remove_keybind #] Removes the selected keybind")
1657 client_color_log(175, 255, 0, "[//help] Print a list of commands")
1658 client_color_log(255, 255, 255, "|--------------------------------------------------------|")
1659 client_color_log()
1660 elseif string_find(input, "//export") then
1661 export_cfg()
1662 elseif string_find(input, "//import") then
1663 load_cfg(clipboard_import())
1664 elseif string_find(input, "//add_keybind") then
1665 add_custom_key(input)
1666 elseif string_find(input, "//keybinds") then
1667 for i=1, #var.custom_key_saves do
1668 local subs = str_to_sub(var.custom_key_saves[i], ",")
1669 client_log(i .. " - " .. subs[4])
1670 end
1671 elseif string_find(input, "//remove_keybind") then
1672 local t_str = string_gsub(input, "//remove_keybind ", "")
1673
1674 local num = tonumber(t_str)
1675 local subs = str_to_sub(var.custom_key_saves[num], ",")
1676
1677 if #var.custom_keys >= num and var.custom_keys[num].name == subs[4] then
1678 table_remove(var.custom_keys, num)
1679 end
1680
1681 table_remove(var.custom_key_saves, num)
1682 database_write("ts_custom_keys", var.custom_key_saves)
1683
1684 client_log("Succesfuly removed " .. tostring(subs[4]) .. " from the stored keybinds!")
1685 end
1686end
1687
1688local function reset_plist()
1689 for i=0, 64 do
1690 ui_set(plist_aa[i], "-")
1691 end
1692end
1693client_delay_call(1, reset_plist)
1694
1695local function apply_to_all()
1696
1697 local cur_selected = ui_get(plist_aa[ui_get(ref.player_list)])
1698
1699 if cur_selected == nil then
1700 return
1701 end
1702
1703 for i=1, 64 do
1704 ui_set(plist_aa[i], cur_selected)
1705 end
1706end
1707
1708local function handle_callbacks()
1709 ui_set_callback(anti_aim[7].aa_settings, handle_menu)
1710 ui_set_callback(anti_aim[0].player_state, handle_menu)
1711 ui_set_callback(ref.player_list, handle_menu)
1712 ui_set_callback(anti_aim[7].legit_sett, handle_menu)
1713 ui_set_callback(anti_aim[7].manual_enable, handle_menu)
1714 ui_set_callback(anti_aim[7].ind_set, handle_menu)
1715 ui_set_callback(ref.reset_all, reset_plist)
1716 ui_set_callback(ref.apply_all, apply_to_all)
1717 ui_set_callback(ref.load_cfg, reset_plist)
1718 ui_set_callback(anti_aim[7].edge[1], handle_menu)
1719 ui_set_callback(anti_aim[7].freestand[1], handle_menu)
1720
1721 for i=1, 6 do
1722 ui_set_callback(anti_aim[i].aa_mode, handle_menu)
1723 ui_set_callback(anti_aim[i].yaw, handle_menu)
1724 ui_set_callback(anti_aim[i].yawadd, handle_menu)
1725 ui_set_callback(anti_aim[i].bodyyaw, handle_menu)
1726 ui_set_callback(anti_aim[i].yawjitter, handle_menu)
1727 ui_set_callback(anti_aim[i].fakeyawmode, handle_menu)
1728 end
1729
1730 ui_set_callback(anti_aim[0].anti_aim_mode, function()
1731 local mode = ui_get(anti_aim[0].anti_aim_mode)
1732 if mode ~= "Automatic rage" then
1733 var.auto_rage = false
1734 handle_menu()
1735 else
1736
1737 ui_set(anti_aim[7].manual_enable, true)
1738 ui_set(anti_aim[0].onshot_aa_key, "Toggle")
1739 ui_set(anti_aim[0].onshot_aa_settings, {"On slow-mo", "While crouching", "On key"})
1740 ui_set(anti_aim[7].ind_set, {"Indicators", "Anti-aim", "Key states"})
1741 ui_set(anti_aim[7].ind_sli, {"Desync", "Fake lag", "Speed", "Gradient", "Big"})
1742 ui_set(anti_aim[7].aa_ind_type, "Arrows")
1743
1744 ui_set(anti_aim[7].aa_settings, {"Anti-aim on use", "Disable use to plant"})
1745
1746 handle_menu("hide")
1747 var.auto_rage = true
1748 end
1749 end)
1750
1751 local stored = database_read("ts_custom_keys")
1752
1753 if stored ~= nil then
1754 var.custom_key_saves = database_read("ts_custom_keys")
1755 end
1756
1757 for i=1, #var.custom_key_saves do
1758 local subs = str_to_sub(var.custom_key_saves[i], ",")
1759
1760 local ref1, ref2 = nil, nil
1761 if pcall(function() ref1, ref2 = ui_reference(subs[1], subs[2], subs[3]) end) then
1762 var.custom_keys[i] = {
1763 ref = ref2 == nil and ref1 or ref2,
1764 chk = ref2 == nil and nil or ref1,
1765 name = subs[4]
1766 }
1767 else
1768 client_log(subs[4] .. " not found!")
1769 end
1770 end
1771
1772 client_set_event_callback("shutdown", function()
1773 set_og_menu(true)
1774 database_write("ts_custom_keys", var.custom_key_saves)
1775 end)
1776
1777 client_set_event_callback("player_death", function(e)
1778 if client_userid_to_entindex(e.userid) == entity_get_local_player() then
1779 reset_data(true)
1780 end
1781 end)
1782
1783 client_set_event_callback("round_start", function()
1784 reset_data(true)
1785 end)
1786
1787 client_set_event_callback("client_disconnect", function()
1788 reset_data(false)
1789 end)
1790
1791 client_set_event_callback("game_newmap", function()
1792 reset_data(false)
1793 end)
1794
1795 client_set_event_callback("cs_game_disconnected", function()
1796 reset_data(false)
1797 end)
1798
1799 client_set_event_callback("bullet_impact", on_bullet_impact)
1800 client_set_event_callback("player_hurt", on_player_hurt)
1801 client_set_event_callback("console_input", on_console_input)
1802 client_set_event_callback("setup_command", on_setup_command)
1803 client_set_event_callback("paint", on_paint)
1804end
1805handle_callbacks()