-
Notifications
You must be signed in to change notification settings - Fork 2
/
teamskeet.lua
1945 lines (1611 loc) · 69 KB
/
teamskeet.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-- local variables for API functions. any changes to the line below will be lost on re-generation
local 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
local 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
local plist_set = plist.get
local vector = require('vector')
local ffi = require('ffi')
local ffi_cast = ffi.cast
ffi.cdef [[
typedef int(__thiscall* get_clipboard_text_count)(void*);
typedef void(__thiscall* set_clipboard_text)(void*, const char*, int);
typedef void(__thiscall* get_clipboard_text)(void*, int, const char*, int);
]]
local VGUI_System010 = client_create_interface("vgui2.dll", "VGUI_System010") or print( "Error finding VGUI_System010")
local VGUI_System = ffi_cast(ffi.typeof('void***'), VGUI_System010 )
local IEngineClient__GetNetChannelInfo = vtable_bind("engine.dll", "VEngineClient014", 78, "void* (__thiscall*)(void* ecx)")
local INetChannelInfo__GetAvgLoss = vtable_thunk(11, "float (__thiscall*)(void* ecx, int flow)")
local INetChannelInfo__GetAvgChoke = vtable_thunk(12, "float (__thiscall*)(void* ecx, int flow)")
local function get_loss()
local pInfo = IEngineClient__GetNetChannelInfo()
return INetChannelInfo__GetAvgLoss(pInfo, 1)
end
local function get_choke()
local pInfo = IEngineClient__GetNetChannelInfo()
return INetChannelInfo__GetAvgChoke(pInfo, 1)
end
local get_clipboard_text_count = ffi_cast( "get_clipboard_text_count", VGUI_System[ 0 ][ 7 ] ) or print( "get_clipboard_text_count Invalid")
local set_clipboard_text = ffi_cast( "set_clipboard_text", VGUI_System[ 0 ][ 9 ] ) or print( "set_clipboard_text Invalid")
local get_clipboard_text = ffi_cast( "get_clipboard_text", VGUI_System[ 0 ][ 11 ] ) or print( "get_clipboard_text Invalid")
local function clipboard_import( )
local clipboard_text_length = get_clipboard_text_count( VGUI_System )
local clipboard_data = ""
if clipboard_text_length > 0 then
buffer = ffi.new("char[?]", clipboard_text_length)
size = clipboard_text_length * ffi.sizeof("char[?]", clipboard_text_length)
get_clipboard_text( VGUI_System, 0, buffer, size )
clipboard_data = ffi.string( buffer, clipboard_text_length-1 )
end
return clipboard_data
end
local function clipboard_export(string)
if string then
set_clipboard_text(VGUI_System, string, string:len())
end
end
local ref = {
enabled = ui_reference("AA", "Anti-aimbot angles", "Enabled"),
pitch = ui_reference("AA", "Anti-aimbot angles", "pitch"),
yawbase = ui_reference("AA", "Anti-aimbot angles", "Yaw base"),
yaw = { ui_reference("AA", "Anti-aimbot angles", "Yaw") },
fakeyawlimit = ui_reference("AA", "anti-aimbot angles", "Fake yaw limit"),
fsbodyyaw = ui_reference("AA", "anti-aimbot angles", "Freestanding body yaw"),
edgeyaw = ui_reference("AA", "Anti-aimbot angles", "Edge yaw"),
maxprocticks = ui_reference("MISC", "Settings", "sv_maxusrcmdprocessticks"),
fakeduck = ui_reference("RAGE", "Other", "Duck peek assist"),
safepoint = ui_reference("RAGE", "Aimbot", "Force safe point"),
forcebaim = ui_reference("RAGE", "Other", "Force body aim"),
player_list = ui_reference("PLAYERS", "Players", "Player list"),
reset_all = ui_reference("PLAYERS", "Players", "Reset all"),
apply_all = ui_reference("PLAYERS", "Adjustments", "Apply to all"),
load_cfg = ui_reference("Config", "Presets", "Load"),
fl_limit = ui_reference("AA", "Fake lag", "Limit"),
dt_limit = ui_reference("RAGE", "Other", "Double tap fake lag limit"),
quickpeek = { ui_reference("RAGE", "Other", "Quick peek assist") },
yawjitter = { ui_reference("AA", "Anti-aimbot angles", "Yaw jitter") },
bodyyaw = { ui_reference("AA", "Anti-aimbot angles", "Body yaw") },
freestand = { ui_reference("AA", "Anti-aimbot angles", "Freestanding") },
os = { ui_reference("AA", "Other", "On shot anti-aim") },
slow = { ui_reference("AA", "Other", "Slow motion") },
dt = { ui_reference("RAGE", "Other", "Double tap") },
ps = { ui_reference("RAGE", "Other", "Double tap") },
fakelag = { ui_reference("AA", "Fake lag", "Enabled") }
}
local var = {
player_states = {"Global", "Standing", "Moving", "Slow motion", "Air", "On-key"},
state_to_idx = {["Global"] = 1, ["Standing"] = 2, ["Moving"] = 3, ["Slow motion"] = 4, ["Air"] = 5, ["On-key"] = 6},
aa_dir = 0,
auto_rage = false,
active_i = 1,
last_press_t = 0,
forward = false,
p_state = 0,
last_sway_time = 0,
choked_cmds = 0,
ts_time = 0,
miss = {},
on_shot_mode = "KEY",
custom_keys = {},
custom_key_saves = {},
hit = {},
shots = {},
last_hit = {},
stored_misses = {},
stored_shots = {},
last_nn = 0,
hotkey_modes1 = { "ALWAYS ON", "HELD", "TOGGLED", "OFF HOTKEY" },
hotkey_modes = { "Always on", "On hotkey", "Toggle", "Off hotkey" },
best_value = 180,
flip_value = 90,
bestenemy = 0,
flip_once = false,
clantag_enbl = false,
dragging = false,
disable_fs = false,
disable_edge = false,
last_shot = 0,
ox = 0,
oy = 0,
last_selected = 0,
classnames = {
"CWorld",
"CCSPlayer",
"CFuncBrush"
},
nonweapons = {
"knife",
"hegrenade",
"inferno",
"flashbang",
"decoy",
"smokegrenade",
"taser"
},
ts_clantag = "t e a m s k e e t . l u a"
}
local plist_aa = {}
for i=0, 64 do
plist_aa[i] = ui_new_combobox("PLAYERS", "Adjustments", "Override desync\n" .. tostring(i), {"-", "Freestanding", "Small", "Spin"})
ui_set_visible(plist_aa[i], false)
end
local anti_aim = { }
anti_aim[0] = {
anti_aim_mode = ui_new_combobox("AA", "Anti-aimbot angles", "Anti-aim mode", {"Rage", "Legit", "Automatic rage"}),
player_state = ui_new_combobox("AA", "Anti-aimbot angles", "Player state", var.player_states),
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"}),
onshot_aa_key = ui_new_hotkey("AA", "Other", "On shot anti-aim key", false),
}
ui_set_visible(ref.maxprocticks, true)
for i=1, 6 do
anti_aim[i] = {
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"),
pitch = ui_new_combobox("AA", "Anti-aimbot angles", "Pitch\n" .. var.player_states[i], { "Off", "Default", "Up", "Down", "Minimal", "Random" }),
yawbase = ui_new_combobox("AA", "Anti-aimbot angles", "Yaw base\n" .. var.player_states[i], { "Local view", "At targets" }),
yaw = ui_new_combobox("AA", "Anti-aimbot angles", "Yaw\n" .. var.player_states[i], { "Off", "180", "Spin", "Static", "180 Z", "Crosshair" }),
yawadd = ui_new_slider("AA", "Anti-aimbot angles", "\nYaw add" .. var.player_states[i], -180, 180, 0),
yawjitter = ui_new_combobox("AA", "Anti-aimbot angles", "Yaw jitter\n" .. var.player_states[i], { "Off", "Offset", "Center", "Random" }),
yawjitteradd = ui_new_slider("AA", "Anti-aimbot angles", "\nYaw jitter add" .. var.player_states[i], -180, 180, 0),
aa_mode = ui_new_combobox("AA", "Anti-aimbot angles", "Body yaw type\n" .. var.player_states[i], {"Teamskeet", "GameSense"}),
gs_bodyyaw = ui_new_combobox("AA", "Anti-aimbot angles", "Body yaw\n GS" .. var.player_states[i], { "Off", "Opposite", "Jitter", "Static" }),
gs_bodyyawadd = ui_new_slider("AA", "Anti-aimbot angles", "\nBody yaw add" .. var.player_states[i], -180, 180, 0),
bodyyaw = ui_new_combobox("AA", "Anti-aimbot angles", "Body yaw\n" .. var.player_states[i], { "Off", "Opposite", "Freestanding", "Reversed Freestanding", "Jitter", "Switch key"}),
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"}),
fakeyawlimit = ui_new_slider("AA", "Anti-aimbot angles", "Fake yaw limit\n" .. var.player_states[i], 0, 60, 60),
fakeyawmode = ui_new_combobox("AA", "Anti-aimbot angles", "Customize fake yaw limit\n" .. var.player_states[i], { "Off", "Jitter", "Random", "Custom right" }),
fakeyawamt = ui_new_slider("AA", "Anti-aimbot angles", "\nFake yaw randomization" .. var.player_states[i], 0, 60, 0),
}
end
ui_set(anti_aim[1].enable, true)
ui_set_visible(anti_aim[1].enable, false)
anti_aim[7] = {
tp_lethal = ui_new_checkbox("AA", "Fake lag", "Teleport on lethal"),
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", "Draw shot angle"}),
legit_sett = ui_new_multiselect("AA", "Fake lag", "Disable Anti-aim", { "High ping", "High loss", "High choke", "Low FPS", "Show values" }),
ping = ui_new_slider("AA", "Fake lag", "Disable if ping >", 0, 1000, 150),
choke = ui_new_slider("AA", "Fake lag", "Disable if choke >=", 0, 100, 1),
loss = ui_new_slider("AA", "Fake lag", "Disable if loss >=", 0, 100, 1),
fps = ui_new_slider("AA", "Fake lag", "Disable if fps <", 0, 300, 64),
manual_enable = ui_new_checkbox("AA", "Anti-aimbot angles", "Manual anti-aim"),
manual_left = ui_new_hotkey("AA", "Anti-aimbot angles", "Manual left"),
manual_right = ui_new_hotkey("AA", "Anti-aimbot angles", "Manual right"),
manual_back = ui_new_hotkey("AA", "Anti-aimbot angles", "Manual back"),
switch_k = ui_new_hotkey("AA", "Anti-aimbot angles", "Body yaw switch key"),
freestand = { ui_new_checkbox("AA", "Anti-aimbot angles", "Freestanding\nTS"),
ui_new_hotkey("AA", "Anti-aimbot angles", "Freestanding key", true),
ui_new_multiselect("AA", "Fake lag", "Disable freestanding", { "While slow walking", "In air", "While crouching", "While fakeducking" })
},
edge = { ui_new_checkbox("AA", "Anti-aimbot angles", "Edge yaw\nTS"),
ui_new_hotkey("AA", "Anti-aimbot angles", "Edge yaw key", true),
ui_new_multiselect("AA", "Fake lag", "Disable edye yaw", { "While slow walking", "In air", "While crouching", "While fakeducking" })
},
ind_set = ui_new_multiselect("AA", "Other", "Teamskeet ESP", {"Indicators", "Key states", "Anti-aim", "Clantag"}),
ind_sli = ui_new_multiselect("AA", "Other", "Indicator settings", {"Desync", "Fake lag", "Speed", "Gradient", "Show values", "Big", "Remove skeet indicators"}),
ind_clr = ui_new_color_picker("AA", "Other", "Indicator color picker", 175, 255, 0, 255),
aa_ind_type = ui_new_combobox("AA", "Other", "Anti-aim indicator type", {"Arrows", "Circle", "Static"}),
ind_clr2 = ui_new_color_picker("AA", "Other", "Indicator desync color", 0, 200, 255, 255),
pos_x = ui_new_slider("LUA", "B", "\nSaved Position X TS INDICATOR", 0, 10000, 10),
pos_y = ui_new_slider("LUA", "B", "\nSaved Position Y TS INDICATOR", 0, 10000, 420)
}
ui_set_visible(anti_aim[7].pos_x, false)
ui_set_visible(anti_aim[7].pos_y, false)
for i=1, 64 do
var.miss[i], var.hit[i], var.shots[i], var.last_hit[i], var.stored_misses[i], var.stored_shots[i] = {}, {}, {}, 0, 0, 0
for k=1, 3 do
var.miss[i][k], var.hit[i][k], var.shots[i][k] = {}, {}, {}
for j=1, 1000 do
var.miss[i][k][j], var.hit[i][k][j], var.shots[i][k][j] = 0, 0, 0
end
end
var.miss[i][4], var.hit[i][4], var.shots[i][4] = 0, 0, 0
end
local function contains(table, value)
if table == nil then
return false
end
table = ui_get(table)
for i=0, #table do
if table[i] == value then
return true
end
end
return false
end
local function set_og_menu(state)
ui_set_visible(ref.pitch, state)
ui_set_visible(ref.yawbase, state)
ui_set_visible(ref.yaw[1], state)
ui_set_visible(ref.yaw[2], state)
ui_set_visible(ref.yawjitter[1], state)
ui_set_visible(ref.yawjitter[2], state)
ui_set_visible(ref.bodyyaw[1], state)
ui_set_visible(ref.bodyyaw[2], state)
ui_set_visible(ref.fakeyawlimit, state)
ui_set_visible(ref.fsbodyyaw, state)
ui_set_visible(ref.edgeyaw, state)
ui_set_visible(ref.freestand[1], state)
ui_set_visible(ref.freestand[2], state)
ui_set_visible(ref.os[1], not contains(anti_aim[7].aa_settings, "Custom on-shot anti-aim"))
ui_set_visible(ref.os[2], not contains(anti_aim[7].aa_settings, "Custom on-shot anti-aim"))
end
local function handle_menu(hide_all)
var.active_i = var.state_to_idx[ui_get(anti_aim[0].player_state)]
set_og_menu(false)
local show_menu = tostring(hide_all) ~= "hide"
local sk = false
local rage = ui_get(anti_aim[0].anti_aim_mode) == "Rage"
local legit = ui_get(anti_aim[0].anti_aim_mode) == "Legit"
local auto = ui_get(anti_aim[0].anti_aim_mode) == "Automatic rage"
local selected = ui_get(ref.player_list)
ui_set_visible(anti_aim[0].player_state, not auto and show_menu)
if selected ~= var.last_selected and selected ~= nil then
ui_set_visible(plist_aa[selected], true)
if var.last_selected ~= 0 then
ui_set_visible(plist_aa[var.last_selected], false)
end
var.last_selected = selected
end
for i=1, 6 do
ui_set_visible(anti_aim[i].enable, var.active_i == i and i > 1 and show_menu)
ui_set_visible(anti_aim[i].pitch, rage and var.active_i == i and show_menu)
ui_set_visible(anti_aim[i].yawbase, rage and var.active_i == i and show_menu)
ui_set_visible(anti_aim[i].yaw, rage and var.active_i == i and show_menu)
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)
ui_set_visible(anti_aim[i].yawjitter,rage and var.active_i == i and show_menu)
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)
local gs_aa = ui_get(anti_aim[i].aa_mode) == "GameSense"
ui_set_visible(anti_aim[i].aa_mode, not auto and var.active_i == i and show_menu)
ui_set_visible(anti_aim[i].gs_bodyyaw, not auto and gs_aa and var.active_i == i and show_menu)
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)
ui_set_visible(anti_aim[i].bodyyaw, not auto and var.active_i == i and not gs_aa and show_menu)
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)
ui_set_visible(anti_aim[i].fakeyawlimit, not auto and var.active_i == i and show_menu)
ui_set_visible(anti_aim[i].fakeyawmode, not auto and var.active_i == i and show_menu)
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)
if ui_get(anti_aim[i].bodyyaw) == "Switch key" and ui_get(anti_aim[i].enable) then
sk = true
end
end
local show_legit = ui_get(anti_aim[0].anti_aim_mode) == "Legit" and show_menu
ui_set_visible(anti_aim[7].legit_sett, show_legit)
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"))
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"))
ui_set_visible(anti_aim[7].choke, show_legit and contains(anti_aim[7].legit_sett, "High choke") and contains(anti_aim[7].legit_sett, "Show values"))
ui_set_visible(anti_aim[7].loss, show_legit and contains(anti_aim[7].legit_sett, "High loss") and contains(anti_aim[7].legit_sett, "Show values"))
ui_set_visible(anti_aim[7].switch_k, ui_get(anti_aim[var.active_i].bodyyaw) == "Switch key" and show_menu)
ui_set_visible(anti_aim[7].aa_ind_type, contains(anti_aim[7].ind_set, "Anti-aim"))
ui_set_visible(anti_aim[7].ind_clr2, contains(anti_aim[7].ind_set, "Anti-aim"))
ui_set_visible(anti_aim[7].freestand[1], not legit)
ui_set_visible(anti_aim[7].edge[1], not legit)
ui_set_visible(anti_aim[7].freestand[2], not legit)
ui_set_visible(anti_aim[7].edge[2], not legit)
ui_set_visible(anti_aim[7].freestand[3], not legit and ui_get(anti_aim[7].freestand[1]))
ui_set_visible(anti_aim[7].edge[3], not legit and ui_get(anti_aim[7].edge[1]))
ui_set_visible(anti_aim[7].manual_enable, not legit)
ui_set_visible(anti_aim[7].manual_left, not legit and ui_get(anti_aim[7].manual_enable))
ui_set_visible(anti_aim[7].manual_right, not legit and ui_get(anti_aim[7].manual_enable))
ui_set_visible(anti_aim[7].manual_back, not legit and ui_get(anti_aim[7].manual_enable))
ui_set_visible(anti_aim[0].onshot_aa_settings, contains(anti_aim[7].aa_settings, "Custom on-shot anti-aim"))
ui_set_visible(anti_aim[0].onshot_aa_key, contains(anti_aim[7].aa_settings, "Custom on-shot anti-aim"))
end
handle_menu(nil)
local function normalize_yaw(yaw)
while yaw > 180 do yaw = yaw - 360 end
while yaw < -180 do yaw = yaw + 360 end
return yaw
end
local function round(num, decimals)
local mult = 10^(decimals or 0)
return math_floor(num * mult + 0.5) / mult
end
local function calc_angle(local_x, local_y, enemy_x, enemy_y)
local ydelta = local_y - enemy_y
local xdelta = local_x - enemy_x
local relativeyaw = math_atan( ydelta / xdelta )
relativeyaw = normalize_yaw( relativeyaw * 180 / math_pi )
if xdelta >= 0 then
relativeyaw = normalize_yaw(relativeyaw + 180)
end
return relativeyaw
end
local c_tag = {
i = 1,
a = 1,
c = 0
}
local function animate_string()
local str = ""
local cur = 0
if c_tag.i == 0 then
str = str .. "|"
end
for i in string.gmatch(var.ts_clantag, "%S+") do
cur = cur + 1
str = str .. i
if c_tag.i == cur then
str = str .. "|"
end
if cur > c_tag.c then
c_tag.c = cur
end
end
if c_tag.i >= c_tag.c then
c_tag.a = -1
elseif c_tag.i <= 0 then
c_tag.a = 1
end
c_tag.i = c_tag.i + c_tag.a
return str
end
local function arr_to_string(arr)
arr = ui_get(arr)
local str = ""
for i=1, #arr do
str = str .. arr[i] .. (i == #arr and "" or ",")
end
if str == "" then
str = "-"
end
return str
end
local function str_to_sub(input, sep)
local t = {}
for str in string_gmatch(input, "([^"..sep.."]+)") do
t[#t + 1] = string_gsub(str, "\n", "")
end
return t
end
local function to_boolean(str)
if str == "true" or str == "false" then
return (str == "true")
else
return str
end
end
local function get_key_mode(ref, secondary)
local k = { ui_get(ref) }
local hk_mode = k[2]
if hk_mode == nil then
return "nil"
end
return secondary == nil and var.hotkey_modes[hk_mode + 1] or var.hotkey_modes1[hk_mode + 1]
end
local function angle_vector(angle_x, angle_y)
local sy = math_sin(math_rad(angle_y))
local cy = math_cos(math_rad(angle_y))
local sp = math_sin(math_rad(angle_x))
local cp = math_cos(math_rad(angle_x))
return cp * cy, cp * sy, -sp
end
local function get_eye_pos(ent)
local x, y, z = entity_get_prop(ent, "m_vecOrigin")
local hx, hy, hz = entity_hitbox_position(ent, 0)
return x, y, hz
end
local function rotate_point(x, y, rot, size)
return math_cos(math_rad(rot)) * size + x, math_sin(math_rad(rot)) * size + y
end
local function renderer_arrow(x, y, r, g, b, a, rotation, size)
local x0, y0 = rotate_point(x, y, rotation, 45)
local x1, y1 = rotate_point(x, y, rotation + (size / 3.5), 45 - (size / 4))
local x2, y2 = rotate_point(x, y, rotation - (size / 3.5), 45 - (size / 4))
renderer_triangle(x0, y0, x1, y1, x2, y2, r, g, b, a)
end
local function calc_shit(xdelta, ydelta)
if xdelta == 0 and ydelta == 0 then
return 0
end
return math_deg(math_atan2(ydelta, xdelta))
end
local function get_damage(plocal, enemy, x, y,z)
local ex = { }
local ey = { }
local ez = { }
ex[0], ey[0], ez[0] = entity_hitbox_position(enemy, 1)
ex[1], ey[1], ez[1] = ex[0] + 40, ey[0], ez[0]
ex[2], ey[2], ez[2] = ex[0], ey[0] + 40, ez[0]
ex[3], ey[3], ez[3] = ex[0] - 40, ey[0], ez[0]
ex[4], ey[4], ez[4] = ex[0], ey[0] - 40, ez[0]
ex[5], ey[5], ez[5] = ex[0], ey[0], ez[0] + 40
ex[6], ey[6], ez[6] = ex[0], ey[0], ez[0] - 40
local ent, dmg = 0
for i=0, 6 do
if dmg == 0 or dmg == nil then
ent, dmg = client_trace_bullet(enemy, ex[i], ey[i], ez[i], x, y, z)
end
end
return ent == nil and client_scale_damage(plocal, 1, dmg) or dmg
end
local function get_nearest_enemy(plocal, enemies)
local lx, ly, lz = client_eye_position()
local view_x, view_y, roll = client_camera_angles()
local bestenemy = nil
local fov = 180
for i=1, #enemies do
local cur_x, cur_y, cur_z = entity_get_prop(enemies[i], "m_vecOrigin")
local cur_fov = math_abs(normalize_yaw(calc_shit(lx - cur_x, ly - cur_y) - view_y + 180))
if cur_fov < fov then
fov = cur_fov
bestenemy = enemies[i]
end
end
return bestenemy
end
local function is_valid(nn)
if nn == 0 then
return false
end
if not entity_is_alive(nn) then
return false
end
if entity_is_dormant(nn) then
return false
end
return true
end
local function get_best_desync()
local plocal = entity_get_local_player()
local lx, ly, lz = client_eye_position()
local view_x, view_y, roll = client_camera_angles()
if ui_get(anti_aim[var.p_state].bodyyaw) == "Switch key" and not var.auto_rage then
local should_flip = false
if var.flip_once and ui_get(anti_aim[7].switch_k) then
var.flip_value = var.flip_value == 90 and -90 or 90
var.flip_once = false
elseif not ui_get(anti_aim[7].switch_k) then
var.flip_once = true
end
end
local enemies = entity_get_players(true)
if #enemies == 0 then
if not var.auto_rage then
if ui_get(anti_aim[var.p_state].bodyyaw) == "Opposite" then
var.best_value = 180
elseif ui_get(anti_aim[var.p_state].bodyyaw) == "Jitter" then
var.best_value = 0
elseif ui_get(anti_aim[var.p_state].bodyyaw) == "Switch key" then
var.best_value = var.flip_value
else
var.best_value = 90
end
else
var.best_value = 90
end
return var.best_value
end
var.bestenemy = is_valid(var.last_nn) and var.last_nn or get_nearest_enemy(plocal, enemies)
if var.bestenemy ~= nil and var.bestenemy ~= 0 and entity_is_alive(var.bestenemy) then
local calc_hit = var.last_hit[var.bestenemy] ~= 0 and contains(anti_aim[var.p_state].bodyyaw_settings, "Anti-resolver")
local calc_miss = var.miss[var.bestenemy][4] > 0 and contains(anti_aim[var.p_state].bodyyaw_settings, "Anti-resolver")
if not calc_hit and not calc_miss then
local e_x, e_y, e_z = entity_hitbox_position(var.bestenemy, 0)
local yaw = calc_angle(lx, ly, e_x, e_y)
local rdir_x, rdir_y, rdir_z = angle_vector(0, (yaw + 90))
local rend_x = lx + rdir_x * 10
local rend_y = ly + rdir_y * 10
local ldir_x, ldir_y, ldir_z = angle_vector(0, (yaw - 90))
local lend_x = lx + ldir_x * 10
local lend_y = ly + ldir_y * 10
local r2dir_x, r2dir_y, r2dir_z = angle_vector(0, (yaw + 90))
local r2end_x = lx + r2dir_x * 100
local r2end_y = ly + r2dir_y * 100
local l2dir_x, l2dir_y, l2dir_z = angle_vector(0, (yaw - 90))
local l2end_x = lx + l2dir_x * 100
local l2end_y = ly + l2dir_y * 100
local ldamage = get_damage(plocal, var.bestenemy, rend_x, rend_y, lz)
local rdamage = get_damage(plocal, var.bestenemy, lend_x, lend_y, lz)
local l2damage = get_damage(plocal, var.bestenemy, r2end_x, r2end_y, lz)
local r2damage = get_damage(plocal, var.bestenemy, l2end_x, l2end_y, lz)
if not var.auto_rage and ldamage > 0 and rdamage > 0 and contains(anti_aim[var.p_state].bodyyaw_settings, "Jitter when vulnerable") then
var.best_value = 0
else
if not var.auto_rage then
if ui_get(anti_aim[var.p_state].bodyyaw) == "Opposite" then
var.best_value = 180
elseif ui_get(anti_aim[var.p_state].bodyyaw) == "Jitter" then
var.best_value = 0
elseif ui_get(anti_aim[var.p_state].bodyyaw) == "Switch key" then
var.best_value = var.flip_value
else
if l2damage > r2damage or ldamage > rdamage or l2damage > ldamage then
var.best_value = ui_get(anti_aim[var.p_state].bodyyaw) == "Freestanding" and -90 or 90
elseif r2damage > l2damage or rdamage > ldamage or r2damage > rdamage then
var.best_value = ui_get(anti_aim[var.p_state].bodyyaw) == "Freestanding" and 90 or -90
end
end
else
if l2damage > r2damage or ldamage > rdamage or l2damage > ldamage then
var.best_value = 90
elseif r2damage > l2damage or rdamage > ldamage or r2damage > rdamage then
var.best_value = -90
end
end
end
elseif calc_hit then
var.best_value = var.last_hit[var.bestenemy] == 90 and -90 or 90
elseif calc_miss then
if var.stored_misses[var.bestenemy] ~= var.miss[var.bestenemy][4] then
var.best_value = var.miss[var.bestenemy][2][var.miss[var.bestenemy][4]]
var.stored_misses[var.bestenemy] = var.miss[var.bestenemy][4]
end
end
else
if not var.auto_rage and ui_get(anti_aim[var.p_state].bodyyaw) == "Opposite" then
var.best_value = 180
elseif not var.auto_rage and ui_get(anti_aim[var.p_state].bodyyaw) == "Jitter" then
var.best_value = 0
elseif not var.auto_rage and ui_get(anti_aim[var.p_state].bodyyaw) == "Switch key" then
var.best_value = var.flip_value
else
var.best_value = 90
end
end
return var.best_value
end
local function run_direction()
ui_set(anti_aim[7].switch_k, "On hotkey")
ui_set(ref.freestand[2], "Always on")
ui_set(anti_aim[7].manual_back, "On hotkey")
ui_set(anti_aim[7].manual_left, "On hotkey")
ui_set(anti_aim[7].manual_right, "On hotkey")
local k = { ui_get(anti_aim[6].enable) }
if (k[1] and k[3] == 69) or ui_get(anti_aim[0].anti_aim_mode) == "Legit" then
ui_set(ref.freestand[1], "-")
ui_set(ref.edgeyaw, false)
if contains(anti_aim[7].aa_settings, "On-key resets manual AA") then
var.aa_dir = 0
var.last_press_t = globals_curtime()
end
return
end
local fs_e = ui_get(anti_aim[7].freestand[2]) and ui_get(anti_aim[7].freestand[1]) and not disable_fs
local edge_e = ui_get(anti_aim[7].edge[2]) and ui_get(anti_aim[7].edge[1]) and not disable_edge
ui_set(ref.freestand[1], fs_e and "Default" or "-")
ui_set(ref.edgeyaw, edge_e)
if fs_e or not ui_get(anti_aim[7].manual_enable) then
var.aa_dir = 0
var.last_press_t = globals_curtime()
else
if ui_get(anti_aim[7].manual_back) then
var.aa_dir = 0
elseif ui_get(anti_aim[7].manual_right) and var.last_press_t + 0.2 < globals_curtime() then
var.aa_dir = var.aa_dir == 90 and 0 or 90
var.last_press_t = globals_curtime()
elseif ui_get(anti_aim[7].manual_left) and var.last_press_t + 0.2 < globals_curtime() then
var.aa_dir = var.aa_dir == -90 and 0 or -90
var.last_press_t = globals_curtime()
elseif var.last_press_t > globals_curtime() then
var.last_press_t = globals_curtime()
end
end
end
local function run_shit(c)
local plocal = entity_get_local_player()
local vx, vy, vz = entity_get_prop(plocal, "m_vecVelocity")
local p_still = math_sqrt(vx ^ 2 + vy ^ 2) < 2
local on_ground = bit_band(entity_get_prop(plocal, "m_fFlags"), 1) == 1 and c.in_jump == 0
local p_slow = ui_get(ref.slow[1]) and ui_get(ref.slow[2])
local p_key = ui_get(anti_aim[6].enable) and not var.auto_rage
local wpn = entity_get_player_weapon(plocal)
local wpn_id = entity_get_prop(wpn, "m_iItemDefinitionIndex")
local m_item = bit_band(wpn_id, 0xFFFF)
local onshotaa = false
local doubletapping = ui_get(ref.dt[1]) and ui_get(ref.dt[2])
var.p_state = 1
disable_edge = false
disable_fs = false
if p_key then
var.p_state = 6
else
if not on_ground and ui_get(anti_aim[5].enable) then
var.p_state = 5
else
if p_slow and ui_get(anti_aim[4].enable) then
var.p_state = 4
else
if p_still and ui_get(anti_aim[2].enable) then
var.p_state = 2
elseif not p_still and ui_get(anti_aim[3].enable) then
var.p_state = 3
end
end
end
end
if not on_ground then
if contains(anti_aim[7].edge[3], "In air") then
disable_edge = true
end
if contains(anti_aim[7].freestand[3], "In air") then
disable_fs = true
end
onshotaa = contains(anti_aim[0].onshot_aa_settings, "In air")
var.on_shot_mode = contains(anti_aim[0].onshot_aa_settings, "In air") and "IN AIR" or var.on_shot_mode
else
if p_slow then
if contains(anti_aim[7].edge[3], "While slow walking") then
disable_edge = true
end
if contains(anti_aim[7].freestand[3], "While slow walking") then
disable_fs = true
end
onshotaa = contains(anti_aim[0].onshot_aa_settings, "On slow-mo")
var.on_shot_mode = contains(anti_aim[0].onshot_aa_settings, "On slow-mo") and "SLOW-MO" or var.on_shot_mode
else
if c.in_duck == 1 and not ui_get(ref.fakeduck) then
if contains(anti_aim[7].edge[3], "While crouching") then
disable_edge = true
end
if contains(anti_aim[7].freestand[3], "While crouching") then
disable_fs = true
end
onshotaa = contains(anti_aim[0].onshot_aa_settings, "While crouching")
var.on_shot_mode = contains(anti_aim[0].onshot_aa_settings, "While crouching") and "CROUCHING" or var.on_shot_mode
elseif not ui_get(ref.fakeduck) then
onshotaa = p_still and contains(anti_aim[0].onshot_aa_settings, "While standing") or contains(anti_aim[0].onshot_aa_settings, "While moving")
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
else
onshotaa = false
if contains(anti_aim[7].edge[3], "While fakeducking") then
disable_edge = true
end
if contains(anti_aim[7].freestand[3], "While fakeducking") then
disable_fs = true
end
end
end
end
if ui_get(anti_aim[0].onshot_aa_key) and not ui_get(ref.fakeduck) then
var.on_shot_mode = get_key_mode(anti_aim[0].onshot_aa_key, 1)
onshotaa = true
end
if contains(anti_aim[7].aa_settings, "Custom on-shot anti-aim") then
ui_set(ref.os[2], "Always on")
ui_set(ref.os[1], onshotaa and m_item ~= 64 and not ui_get(ref.dt[2]))
else
var.on_shot_mode = get_key_mode(ref.os[2], 1)
end
end
local function distance3d(x1, y1, z1, x2, y2, z2)
return math_sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) + (z2-z1)*(z2-z1))
end
local function entity_has_c4(ent)
local bomb = entity_get_all("CC4")[1]
return bomb ~= nil and entity_get_prop(bomb, "m_hOwnerEntity") == ent
end
local function scan_dmg(e, p, x, y, z)
for i=1, 6 do
local h = { entity_hitbox_position(e, i) }
local ent, dmg = client_trace_bullet(p, x, y, z, h[1], h[2], h[3], p)
if dmg ~= nil and dmg > 0 then
return dmg
end
end
return 0
end
local o_o = { 0, 0, 0 }
local last_shot = 0
local function tp_peek()
if not ui_get(ref.dt[2]) or not ui_get(anti_aim[7].tp_lethal) then
return
end
if last_shot + 1 > globals_curtime() then
ui_set(ref.dt[1], true)
return
end
local plocal = entity_get_local_player()
local o = { entity_get_prop(plocal, "m_vecOrigin") }
local eye = { client_eye_position() }
o[3] = eye[3]
if o == nil then
return
end
--movement per tick
local v = { o[1] - o_o[1], o[2] - o_o[2], o[3] - o_o[3] }
local tp_ticks = ui_get(ref.maxprocticks) - ui_get(ref.dt_limit)
v = {v[1]*tp_ticks, v[2]*tp_ticks, v[3]*tp_ticks}
p = { o[1] + v[1], o[2] + v[2], o[3] - v[3]}
o_o = o
if var.bestenemy == 0 or var.bestenemy == nil or not is_valid(var.bestenemy) then
ui_set(ref.dt[1], true)
return
end
local dmg = scan_dmg(var.bestenemy, plocal, p[1], p[2], p[3])
if dmg > entity_get_prop(var.bestenemy, "m_iHealth") then
ui_set(ref.dt[1], false)
return
end
ui_set(ref.dt[1], true)
end
client_set_event_callback("aim_fire", function(e)
last_shot = globals_curtime()
end)
local function aa_on_use(c)
if contains(anti_aim[7].aa_settings, "Anti-aim on use") then
local plocal = entity_get_local_player()
local distance = 100
local bomb = entity_get_all("CPlantedC4")[1]
local bomb_x, bomb_y, bomb_z = entity_get_prop(bomb, "m_vecOrigin")
if bomb_x ~= nil then
local player_x, player_y, player_z = entity_get_prop(plocal, "m_vecOrigin")
distance = distance3d(bomb_x, bomb_y, bomb_z, player_x, player_y, player_z)
end
local team_num = entity_get_prop(plocal, "m_iTeamNum")
local defusing = team_num == 3 and distance < 62
local on_bombsite = entity_get_prop(plocal, "m_bInBombZone")
local has_bomb = entity_has_c4(plocal)
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")
local px, py, pz = client_eye_position()
local pitch, yaw = client_camera_angles()
local sin_pitch = math_sin(math_rad(pitch))
local cos_pitch = math_cos(math_rad(pitch))
local sin_yaw = math_sin(math_rad(yaw))
local cos_yaw = math_cos(math_rad(yaw))
local dir_vec = { cos_pitch * cos_yaw, cos_pitch * sin_yaw, -sin_pitch }
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))
local using = true
if entindex ~= nil then
for i=0, #var.classnames do
if entity_get_classname(entindex) == var.classnames[i] then
using = false
end
end
end
if not using and not trynna_plant and not defusing then
c.in_use = 0
end
end
end
local function handle_shots()
local enemies = entity_get_players(true)
for i=1, #enemies do
local idx = enemies[i]
local s = var.shots[idx][4]
local h = var.hit[idx][4]
if s ~= var.stored_shots[idx] then
local missed = true
if var.shots[idx][1][s] == var.hit[idx][1][h] then
if var.hit[idx][2][h] ~= 0 and var.hit[idx][2][h] ~= 180 then
var.last_hit[idx] = var.hit[idx][2][h]
end
missed = false
end
if missed then
var.last_hit[idx] = 0
var.hit[idx][2][h] = 0
var.miss[idx][4] = var.miss[idx][4] + 1
var.miss[idx][2][var.miss[idx][4]] = var.shots[idx][2][s]
end
var.last_nn = idx
var.stored_shots[idx] = s
end
end
end
local frametimes = {}
local fps_prev = 0
local last_update_time = 0
local function get_fps()
local ft = globals_absoluteframetime()
if ft > 0 then
table_insert(frametimes, 1, ft)
end
local count = #frametimes
if count == 0 then
return 0
end
local i, accum = 0, 0
while accum < 0.5 do
i = i + 1
accum = accum + frametimes[i]
if i >= count then
break
end
end
accum = accum / i
while i < count do
i = i + 1
table_remove(frametimes)
end
local fps = 1 / accum
local rt = globals_realtime()
if math_abs(fps - fps_prev) > 4 or rt - last_update_time > 2 then
fps_prev = fps
last_update_time = rt
else
fps = fps_prev
end
return math_floor(fps + 0.5)
end
local function should_use_aa()
local ping = client.latency() * 1000
local choke = get_choke() * 100
local loss = get_loss() * 100
local fps = get_fps()
if contains(anti_aim[7].legit_sett, "High ping") and ping > ui_get(anti_aim[7].ping) then
return false
end
if contains(anti_aim[7].legit_sett, "High choke") and choke > ui_get(anti_aim[7].choke) then
return false
end