-
Notifications
You must be signed in to change notification settings - Fork 0
/
interitus.lua
2155 lines (1897 loc) · 99.6 KB
/
interitus.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
-- @region LUASETTINGS start
local lua_name = "interitus"
local lua_color = {r = 222, g = 55, b = 55}
-- @region LUASETTINGS end
-- @region DEPENDENCIES start
local function try_require(module, msg)
local success, result = pcall(require, module)
if success then return result else return error(msg) end
end
local images = try_require("gamesense/images", "Download images library: https://gamesense.pub/forums/viewtopic.php?id=22917")
local bit = try_require("bit")
local base64 = try_require("gamesense/base64", "Download base64 encode/decode library: https://gamesense.pub/forums/viewtopic.php?id=21619")
local antiaim_funcs = try_require("gamesense/antiaim_funcs", "Download anti-aim functions library: https://gamesense.pub/forums/viewtopic.php?id=29665")
local ffi = try_require("ffi", "Failed to require FFI, please make sure Allow unsafe scripts is enabled!")
local vector = try_require("vector", "Missing vector")
local http = try_require("gamesense/http", "Download HTTP library: https://gamesense.pub/forums/viewtopic.php?id=21619")
local clipboard = try_require("gamesense/clipboard", "Download Clipboard library: https://gamesense.pub/forums/viewtopic.php?id=28678")
local ent = try_require("gamesense/entity", "Download Entity Object library: https://gamesense.pub/forums/viewtopic.php?id=27529")
local csgo_weapons = try_require("gamesense/csgo_weapons", "Download CS:GO weapon data library: https://gamesense.pub/forums/viewtopic.php?id=18807")
-- @region DEPENDENCIES end
-- @region USERDATA start
local obex_data = obex_fetch and obex_fetch() or {username = 'admin', build = 'nightly', discord=''}
local userdata = {
username = obex_data.username == nil or obex_data.username,
build = obex_data.build ~= nil and obex_data.build:gsub("Private", "nightly"):gsub("Beta", "beta"):gsub("User", "live")
}
client.exec("clear")
client.color_log(255, 255, 255, "Welcome to\0")
client.color_log(lua_color.r, lua_color.g, lua_color.b, " interitus\0")
client.color_log(255, 255, 255, ", " .. userdata.username)
local lua = {}
lua.database = {
configs = ":" .. lua_name .. "::configs:"
}
local presets = {}
-- @region USERDATA end
-- @region REFERENCES start
local refs = {
legit = ui.reference("LEGIT", "Aimbot", "Enabled"),
dmgOverride = {ui.reference("RAGE", "Aimbot", "Minimum damage override")},
fakeDuck = ui.reference("RAGE", "Other", "Duck peek assist"),
minDmg = ui.reference("RAGE", "Aimbot", "Minimum damage"),
hitChance = ui.reference("RAGE", "Aimbot", "Minimum hit chance"),
safePoint = ui.reference("RAGE", "Aimbot", "Force safe point"),
forceBaim = ui.reference("RAGE", "Aimbot", "Force body aim"),
dtLimit = ui.reference("RAGE", "Aimbot", "Double tap fake lag limit"),
quickPeek = {ui.reference("RAGE", "Other", "Quick peek assist")},
dt = {ui.reference("RAGE", "Aimbot", "Double tap")},
enabled = ui.reference("AA", "Anti-aimbot angles", "Enabled"),
pitch = {ui.reference("AA", "Anti-aimbot angles", "pitch")},
roll = ui.reference("AA", "Anti-aimbot angles", "roll"),
yawBase = ui.reference("AA", "Anti-aimbot angles", "Yaw base"),
yaw = {ui.reference("AA", "Anti-aimbot angles", "Yaw")},
flLimit = ui.reference("AA", "Fake lag", "Limit"),
fsBodyYaw = ui.reference("AA", "anti-aimbot angles", "Freestanding body yaw"),
edgeYaw = ui.reference("AA", "Anti-aimbot angles", "Edge yaw"),
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")},
fakeLag = {ui.reference("AA", "Fake lag", "Limit")},
legMovement = ui.reference("AA", "Other", "Leg movement"),
indicators = {ui.reference("VISUALS", "Other ESP", "Feature indicators")},
ping = {ui.reference("MISC", "Miscellaneous", "Ping spike")},
}
-- @region REFERENCES end
-- @region VARIABLES start
local vars = {
localPlayer = 0,
hitgroup_names = { 'Generic', 'Head', 'Chest', 'Stomach', 'Left arm', 'Right arm', 'Left leg', 'Right leg', 'Neck', '?', 'Gear' },
aaStates = {"Global", "Standing", "Moving", "Slowwalking", "Crouching", "Air", "Air-Crouching", "Crouch-Moving", "Fakelag"},
pStates = {"G", "S", "M", "SW", "C", "A", "AC", "CM", "FL"},
sToInt = {["Global"] = 1, ["Standing"] = 2, ["Moving"] = 3, ["Slowwalking"] = 4, ["Crouching"] = 5, ["Air"] = 6, ["Air-Crouching"] = 7, ["Crouch-Moving"] = 8 , ["Fakelag"] = 9},
intToS = {[1] = "Global", [2] = "Standing", [3] = "Moving", [4] = "Slowwalking", [5] = "Crouching", [6] = "Air", [7] = "Air-Crouching", [8] = "Crouch-Moving", [9] = "Fakelag"},
currentTab = 1,
activeState = 1,
pState = 1,
yaw = 0,
m1_time = 0,
choked = 0,
dt_state = 0,
doubletap_time = 0,
}
local js = panorama.open()
local MyPersonaAPI, LobbyAPI, PartyListAPI, SteamOverlayAPI = js.MyPersonaAPI, js.LobbyAPI, js.PartyListAPI, js.SteamOverlayAPI
-- @region VARIABLES end
-- @region FFI start
local angle3d_struct = ffi.typeof("struct { float pitch; float yaw; float roll; }")
local vec_struct = ffi.typeof("struct { float x; float y; float z; }")
local cUserCmd =
ffi.typeof(
[[
struct
{
uintptr_t vfptr;
int command_number;
int tick_count;
$ viewangles;
$ aimdirection;
float forwardmove;
float sidemove;
float upmove;
int buttons;
uint8_t impulse;
int weaponselect;
int weaponsubtype;
int random_seed;
short mousedx;
short mousedy;
bool hasbeenpredicted;
$ headangles;
$ headoffset;
bool send_packet;
}
]],
angle3d_struct,
vec_struct,
angle3d_struct,
vec_struct
)
local client_sig = client.find_signature("client.dll", "\xB9\xCC\xCC\xCC\xCC\x8B\x40\x38\xFF\xD0\x84\xC0\x0F\x85") or error("client.dll!:input not found.")
local get_cUserCmd = ffi.typeof("$* (__thiscall*)(uintptr_t ecx, int nSlot, int sequence_number)", cUserCmd)
local input_vtbl = ffi.typeof([[struct{uintptr_t padding[8];$ GetUserCmd;}]],get_cUserCmd)
local input = ffi.typeof([[struct{$* vfptr;}*]], input_vtbl)
local get_input = ffi.cast(input,ffi.cast("uintptr_t**",tonumber(ffi.cast("uintptr_t", client_sig)) + 1)[0])
-- @region FFI end
-- @region FUNCS start
local func = {
render_text = function(x, y, ...)
local x_Offset = 0
local args = {...}
for i, line in pairs(args) do
local r, g, b, a, text = unpack(line)
local size = vector(renderer.measure_text("-d", text))
renderer.text(x + x_Offset, y, r, g, b, a, "-d", 0, text)
x_Offset = x_Offset + size.x
end
end,
easeInOut = function(t)
return (t > 0.5) and 4*((t-1)^3)+1 or 4*t^3;
end,
rec = function(x, y, w, h, radius, color)
radius = math.min(x/2, y/2, radius)
local r, g, b, a = unpack(color)
renderer.rectangle(x, y + radius, w, h - radius*2, r, g, b, a)
renderer.rectangle(x + radius, y, w - radius*2, radius, r, g, b, a)
renderer.rectangle(x + radius, y + h - radius, w - radius*2, radius, r, g, b, a)
renderer.circle(x + radius, y + radius, r, g, b, a, radius, 180, 0.25)
renderer.circle(x - radius + w, y + radius, r, g, b, a, radius, 90, 0.25)
renderer.circle(x - radius + w, y - radius + h, r, g, b, a, radius, 0, 0.25)
renderer.circle(x + radius, y - radius + h, r, g, b, a, radius, -90, 0.25)
end,
rec_outline = function(x, y, w, h, radius, thickness, color)
radius = math.min(w/2, h/2, radius)
local r, g, b, a = unpack(color)
if radius == 1 then
renderer.rectangle(x, y, w, thickness, r, g, b, a)
renderer.rectangle(x, y + h - thickness, w , thickness, r, g, b, a)
else
renderer.rectangle(x + radius, y, w - radius*2, thickness, r, g, b, a)
renderer.rectangle(x + radius, y + h - thickness, w - radius*2, thickness, r, g, b, a)
renderer.rectangle(x, y + radius, thickness, h - radius*2, r, g, b, a)
renderer.rectangle(x + w - thickness, y + radius, thickness, h - radius*2, r, g, b, a)
renderer.circle_outline(x + radius, y + radius, r, g, b, a, radius, 180, 0.25, thickness)
renderer.circle_outline(x + radius, y + h - radius, r, g, b, a, radius, 90, 0.25, thickness)
renderer.circle_outline(x + w - radius, y + radius, r, g, b, a, radius, -90, 0.25, thickness)
renderer.circle_outline(x + w - radius, y + h - radius, r, g, b, a, radius, 0, 0.25, thickness)
end
end,
clamp = function(x, min, max)
return x < min and min or x > max and max or x
end,
table_contains = function(tbl, value)
for i = 1, #tbl do
if tbl[i] == value then
return true
end
end
return false
end,
setAATab = function(ref)
ui.set_visible(refs.enabled, ref)
ui.set_visible(refs.pitch[1], ref)
ui.set_visible(refs.pitch[2], ref)
ui.set_visible(refs.roll, ref)
ui.set_visible(refs.yawBase, ref)
ui.set_visible(refs.yaw[1], ref)
ui.set_visible(refs.yaw[2], ref)
ui.set_visible(refs.yawJitter[1], ref)
ui.set_visible(refs.yawJitter[2], ref)
ui.set_visible(refs.bodyYaw[1], ref)
ui.set_visible(refs.bodyYaw[2], ref)
ui.set_visible(refs.freeStand[1], ref)
ui.set_visible(refs.freeStand[2], ref)
ui.set_visible(refs.fsBodyYaw, ref)
ui.set_visible(refs.edgeYaw, ref)
end,
findDist = function (x1, y1, z1, x2, y2, z2)
return math.sqrt((x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2)
end,
resetAATab = function()
ui.set(refs.enabled, false)
ui.set(refs.pitch[1], "Off")
ui.set(refs.pitch[2], 0)
ui.set(refs.roll, 0)
ui.set(refs.yawBase, "local view")
ui.set(refs.yaw[1], "Off")
ui.set(refs.yaw[2], 0)
ui.set(refs.yawJitter[1], "Off")
ui.set(refs.yawJitter[2], 0)
ui.set(refs.bodyYaw[1], "Off")
ui.set(refs.bodyYaw[2], 0)
ui.set(refs.freeStand[1], false)
ui.set(refs.freeStand[2], "On hotkey")
ui.set(refs.fsBodyYaw, false)
ui.set(refs.edgeYaw, false)
end,
type_from_string = function(input)
if type(input) ~= "string" then return input end
local value = input:lower()
if value == "true" then
return true
elseif value == "false" then
return false
elseif tonumber(value) ~= nil then
return tonumber(value)
else
return tostring(input)
end
end,
lerp = function(start, vend, time)
return start + (vend - start) * time
end,
vec_angles = function(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,
hex = function(arg)
local result = "\a"
for key, value in next, arg do
local output = ""
while value > 0 do
local index = math.fmod(value, 16) + 1
value = math.floor(value / 16)
output = string.sub("0123456789ABCDEF", index, index) .. output
end
if #output == 0 then
output = "00"
elseif #output == 1 then
output = "0" .. output
end
result = result .. output
end
return result .. "FF"
end,
split = function( inputstr, sep)
if sep == nil then
sep = "%s"
end
local t={}
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
table.insert(t, str)
end
return t
end,
RGBAtoHEX = function(redArg, greenArg, blueArg, alphaArg)
return string.format('%.2x%.2x%.2x%.2x', redArg, greenArg, blueArg, alphaArg)
end,
create_color_array = function(r, g, b, string)
local colors = {}
for i = 0, #string do
local color = {r, g, b, 255 * math.abs(1 * math.cos(2 * math.pi * globals.curtime() / 4 + i * 5 / 30))}
table.insert(colors, color)
end
return colors
end,
textArray = function(string)
local result = {}
for i=1, #string do
result[i] = string.sub(string, i, i)
end
return result
end,
gradient_text = function(r1, g1, b1, a1, r2, g2, b2, a2, text)
local output = ''
local len = #text-1
local rinc = (r2 - r1) / len
local ginc = (g2 - g1) / len
local binc = (b2 - b1) / len
local ainc = (a2 - a1) / len
for i=1, len+1 do
output = output .. ('\a%02x%02x%02x%02x%s'):format(r1, g1, b1, a1, text:sub(i, i))
r1 = r1 + rinc
g1 = g1 + ginc
b1 = b1 + binc
a1 = a1 + ainc
end
return output
end
,
time_to_ticks = function(t)
return math.floor(0.5 + (t / globals.tickinterval()))
end,
headVisible = function(enemy)
local_player = entity.get_local_player()
if local_player == nil then return end
local ex, ey, ez = entity.hitbox_position(enemy, 1)
local hx, hy, hz = entity.hitbox_position(local_player, 1)
local head_fraction, head_entindex_hit = client.trace_line(enemy, ex, ey, ez, hx, hy, hz)
if head_entindex_hit == local_player or head_fraction == 1 then return true else return false end
end
}
local function get_velocity(player)
local x,y,z = entity.get_prop(player, "m_vecVelocity")
if x == nil then return end
return math.sqrt(x*x + y*y + z*z)
end
local function can_desync(cmd)
if entity.get_prop(entity.get_local_player(), "m_MoveType") == 9 then
return false
end
local client_weapon = entity.get_player_weapon(entity.get_local_player())
if client_weapon == nil then
return false
end
local weapon_classname = entity.get_classname(client_weapon)
local in_use = cmd.in_use == 1
local in_attack = cmd.in_attack == 1
local in_attack2 = cmd.in_attack2 == 1
if in_use then
return false
end
if in_attack or in_attack2 then
if weapon_classname:find("Grenade") then
vars.m1_time = globals.curtime() + 0.15
end
end
if vars.m1_time > globals.curtime() then
return false
end
if in_attack then
if client_weapon == nil then
return false
end
if weapon_classname then
return false
end
return false
end
return true
end
local function get_choke(cmd)
local fl_limit = ui.get(refs.flLimit)
local fl_p = fl_limit % 2 == 1
local chokedcommands = cmd.chokedcommands
local cmd_p = chokedcommands % 2 == 0
local doubletap_ref = ui.get(refs.dt[1]) and ui.get(refs.dt[2])
local osaa_ref = ui.get(refs.os[1]) and ui.get(refs.os[2])
local fd_ref = ui.get(refs.fakeDuck)
local velocity = get_velocity(entity.get_local_player())
if doubletap_ref then
if vars.choked > 2 then
if cmd.chokedcommands >= 0 then
cmd_p = false
end
end
end
vars.choked = cmd.chokedcommands
if vars.dt_state ~= doubletap_ref then
vars.doubletap_time = globals.curtime() + 0.25
end
if not doubletap_ref and not osaa_ref and not cmd.no_choke or fd_ref then
if not fl_p then
if vars.doubletap_time > globals.curtime() then
if cmd.chokedcommands >= 0 and cmd.chokedcommands < fl_limit then
cmd_p = chokedcommands % 2 == 0
else
cmd_p = chokedcommands % 2 == 1
end
else
cmd_p = chokedcommands % 2 == 1
end
end
end
vars.dt_state = doubletap_ref
return cmd_p
end
local function apply_desync(cmd, fake)
local usrcmd = get_input.vfptr.GetUserCmd(ffi.cast("uintptr_t", get_input), 0, cmd.command_number)
cmd.allow_send_packet = false
local pitch, yaw = client.camera_angles()
local can_desync = can_desync(cmd)
local is_choke = get_choke(cmd)
ui.set(refs.bodyYaw[1], is_choke and "Static" or "Off")
if cmd.chokedcommands == 0 then
vars.yaw = (yaw + 180) - fake*2;
end
if can_desync then
if not usrcmd.hasbeenpredicted then
if is_choke then
cmd.yaw = vars.yaw;
end
end
end
end
local color_text = function( string, r, g, b, a)
local accent = "\a" .. func.RGBAtoHEX(r, g, b, a)
local white = "\a" .. func.RGBAtoHEX(255, 255, 255, a)
local str = ""
for i, s in ipairs(func.split(string, "$")) do
str = str .. (i % 2 ==( string:sub(1, 1) == "$" and 0 or 1) and white or accent) .. s
end
return str
end
local animate_text = function(time, string, r, g, b, a)
local t_out, t_out_iter = { }, 1
local l = string:len( ) - 1
local r_add = (255 - r)
local g_add = (255 - g)
local b_add = (255 - b)
local a_add = (155 - a)
for i = 1, #string do
local iter = (i - 1)/(#string - 1) + time
t_out[t_out_iter] = "\a" .. func.RGBAtoHEX( r + r_add * math.abs(math.cos( iter )), g + g_add * math.abs(math.cos( iter )), b + b_add * math.abs(math.cos( iter )), a + a_add * math.abs(math.cos( iter )) )
t_out[t_out_iter + 1] = string:sub( i, i )
t_out_iter = t_out_iter + 2
end
return t_out
end
local glow_module = function(x, y, w, h, width, rounding, accent, accent_inner)
local thickness = 1
local Offset = 1
local r, g, b, a = unpack(accent)
if accent_inner then
func.rec(x, y, w, h + 1, rounding, accent_inner)
end
for k = 0, width do
if a * (k/width)^(1) > 5 then
local accent = {r, g, b, a * (k/width)^(2)}
func.rec_outline(x + (k - width - Offset)*thickness, y + (k - width - Offset) * thickness, w - (k - width - Offset)*thickness*2, h + 1 - (k - width - Offset)*thickness*2, rounding + thickness * (width - k + Offset), thickness, accent)
end
end
end
local function remap(val, newmin, newmax, min, max, clamp)
min = min or 0
max = max or 1
local pct = (val-min)/(max-min)
if clamp ~= false then
pct = math.min(1, math.max(0, pct))
end
return newmin+(newmax-newmin)*pct
end
local download
local function downloadFile()
http.get(string.format("https://flagcdn.com/w160/%s.png", MyPersonaAPI.GetMyCountryCode():lower()), function(success, response)
if not success or response.status ~= 200 then
print("couldnt fetch the flag image")
return
end
download = response.body
end)
end
downloadFile()
-- @region FUNCS end
-- @region UI_LAYOUT start
local tab, container = "AA", "Anti-aimbot angles"
local label = ui.new_label(tab, container, lua_name)
local tabPicker = ui.new_combobox(tab, container, "\nTab", "Anti-aim", "Visuals", "Misc", "Config")
local aaTabs = ui.new_combobox(tab, container, "\nAA Tabs", "Builder", "Keybinds")
local menu = {
aaTab = {
safeKnife = ui.new_checkbox(tab, container, "Safe Knife"),
manualsOverFs = ui.new_checkbox(tab, container, "Manuals over freestanding"),
legitAAHotkey = ui.new_hotkey(tab, container, "Legit AA"),
freestand = ui.new_combobox(tab, container, "Freestanding", "Default", "Static"),
freestandHotkey = ui.new_hotkey(tab, container, "Freestand", true),
manuals = ui.new_combobox(tab, container, "Manuals", "Off", "Default", "Static"),
manualTab = {
manualLeft = ui.new_hotkey(tab, container, "Manual " .. func.hex({200,200,200}) .. "left"),
manualRight = ui.new_hotkey(tab, container, "Manual " .. func.hex({200,200,200}) .. "right"),
manualForward = ui.new_hotkey(tab, container, "Manual " .. func.hex({200,200,200}) .. "forward"),
},
},
builderTab = {
state = ui.new_combobox(tab, container, "Anti-aim state", vars.aaStates)
},
visualsTab = {
indicatorsType = ui.new_combobox(tab, container, "Indicators", "-", "1", "2", "3"),
indicatorsClr = ui.new_color_picker(tab, container, "Main Color", lua_color.r, lua_color.g, lua_color.b, 255),
indicatorsStyle = ui.new_multiselect(tab, container, "\n indicator elements", "State", "Doubletap", "Hideshots", "Freestand", "Safepoint", "Body aim", "Fakeduck"),
arrowIndicatorStyle = ui.new_combobox(tab, container, "Arrows", "-", "TeamSkeet", "TeamSkeet Dynamic", "Modern"),
arrowClr = ui.new_color_picker(tab, container, "Arrow Color", lua_color.r, lua_color.g, lua_color.b, 255),
logs = ui.new_multiselect(tab, container, "Notifications", "Hit", "Miss", "Purchase"),
logsClr = ui.new_color_picker(tab, container, "Logs Color", lua_color.r, lua_color.g, lua_color.b, 255),
screenIndication = ui.new_multiselect(tab, container, "Screen indication", "Defensive Manager", "Slowdown", "Flag"),
screenClr = ui.new_color_picker(tab, container, "Screen Color", lua_color.r, lua_color.g, lua_color.b, 255),
},
miscTab = {
fixHideshots = ui.new_checkbox(tab, container, "Fix hideshots"),
avoidBackstab = ui.new_checkbox(tab, container, "Avoid Backstab"),
fastLadder = ui.new_multiselect(tab, container, "Fast ladder", "Ascending", "Descending"),
animations = ui.new_multiselect(tab, container, "Anim breakers", "Static legs", "Moonwalk", "Leg fucker", "0 pitch on landing"),
minDmgIndicator = ui.new_combobox(tab, container, "Minimum Damage Indicator", "-", "Bind", "Constant"),
},
configTab = {
list = ui.new_listbox(tab, container, "Configs", ""),
name = ui.new_textbox(tab, container, "Config name", ""),
load = ui.new_button(tab, container, "Load", function() end),
save = ui.new_button(tab, container, "Save", function() end),
delete = ui.new_button(tab, container, "Delete", function() end),
import = ui.new_button(tab, container, "Import", function() end),
export = ui.new_button(tab, container, "Export", function() end)
}
}
local aaBuilder = {}
local aaContainer = {}
for i=1, #vars.aaStates do
aaContainer[i] = func.hex({200,200,200}) .. "(" .. func.hex({222,55,55}) .. "" .. vars.pStates[i] .. "" .. func.hex({200,200,200}) .. ")" .. func.hex({155,155,155}) .. " "
aaBuilder[i] = {
enableState = ui.new_checkbox(tab, container, "Enable " .. func.hex({lua_color.r, lua_color.g, lua_color.b}) .. vars.aaStates[i] .. func.hex({200,200,200}) .. " state"),
forceDefensive = ui.new_checkbox(tab, container, "Force Defensive\n" .. aaContainer[i]),
stateDisablers = ui.new_multiselect(tab, container, "Disablers\n" .. aaContainer[i], "Standing", "Moving", "Slowwalking", "Crouching", "Air", "Air-Crouching", "Crouch-Moving"),
pitch = ui.new_combobox(tab, container, "Pitch\n" .. aaContainer[i], "Off", "Default", "Up", "Down", "Minimal", "Random", "Custom"),
pitchSlider = ui.new_slider(tab, container, "\nPitch add" .. aaContainer[i], -89, 89, 0, true, "°", 1),
yawBase = ui.new_combobox(tab, container, "Yaw base\n" .. aaContainer[i], "Local view", "At targets"),
yaw = ui.new_combobox(tab, container, "Yaw\n" .. aaContainer[i], "Off", "180", "180 Z", "Spin", "Slow Jitter", "Delay Jitter", "L&R"),
switchTicks = ui.new_slider(tab, container, "\nticks" .. aaContainer[i], 1, 14, 6, 0),
yawStatic = ui.new_slider(tab, container, "\nyaw" .. aaContainer[i], -180, 180, 0, true, "°", 1),
yawLeft = ui.new_slider(tab, container, "Left\nyaw" .. aaContainer[i], -180, 180, 0, true, "°", 1),
yawRight = ui.new_slider(tab, container, "Right\nyaw" .. aaContainer[i], -180, 180, 0, true, "°", 1),
yawJitter = ui.new_combobox(tab, container, "Yaw jitter\n" .. aaContainer[i], "Off", "Offset", "Center", "Skitter", "Random", "3-Way", "L&R"),
wayFirst = ui.new_slider(tab, container, "First\nyaw jitter" .. aaContainer[i], -180, 180, 0, true, "°", 1),
waySecond = ui.new_slider(tab, container, "Second\nyaw jitter" .. aaContainer[i], -180, 180, 0, true, "°", 1),
wayThird = ui.new_slider(tab, container, "Third\nyaw jitter" .. aaContainer[i], -180, 180, 0, true, "°", 1),
yawJitterStatic = ui.new_slider(tab, container, "\nyaw jitter" .. aaContainer[i], -180, 180, 0, true, "°", 1),
yawJitterLeft = ui.new_slider(tab, container, "Left\nyaw jitter" .. aaContainer[i], -180, 180, 0, true, "°", 1),
yawJitterRight = ui.new_slider(tab, container, "Right\nyaw jitter" .. aaContainer[i], -180, 180, 0, true, "°", 1),
bodyYaw = ui.new_combobox(tab, container, "Body yaw\n" .. aaContainer[i], "Off", "Custom Desync", "Opposite", "Jitter", "Static"),
bodyYawStatic = ui.new_slider(tab, container, "\nbody yaw" .. aaContainer[i], -180, 180, 0, true, "°", 1),
fakeYawLimit = ui.new_slider(tab, container, "Fake yaw limit\n" .. aaContainer[i], -59, 59, 0, true, "°", 1),
}
end
local function getConfig(name)
local database = database.read(lua.database.configs) or {}
for i, v in pairs(database) do
if v.name == name then
return {
config = v.config,
index = i
}
end
end
for i, v in pairs(presets) do
if v.name == name then
return {
config = v.config,
index = i
}
end
end
return false
end
local function saveConfig(name)
local db = database.read(lua.database.configs) or {}
local config = {}
if name:match("[^%w]") ~= nil then
return
end
for key, value in pairs(vars.pStates) do
config[value] = {}
for k, v in pairs(aaBuilder[key]) do
config[value][k] = ui.get(v)
end
end
local cfg = getConfig(name)
if not cfg then
table.insert(db, { name = name, config = config })
else
db[cfg.index].config = config
end
database.write(lua.database.configs, db)
end
local function deleteConfig(name)
local db = database.read(lua.database.configs) or {}
for i, v in pairs(db) do
if v.name == name then
table.remove(db, i)
break
end
end
for i, v in pairs(presets) do
if v.name == name then
return false
end
end
database.write(lua.database.configs, db)
end
local function getConfigList()
local database = database.read(lua.database.configs) or {}
local config = {}
for i, v in pairs(presets) do
table.insert(config, v.name)
end
for i, v in pairs(database) do
table.insert(config, v.name)
end
return config
end
local function typeFromString(input)
if type(input) ~= "string" then return input end
local value = input:lower()
if value == "true" then
return true
elseif value == "false" then
return false
elseif tonumber(value) ~= nil then
return tonumber(value)
else
return tostring(input)
end
end
local function loadSettings(config)
for key, value in pairs(vars.pStates) do
for k, v in pairs(aaBuilder[key]) do
if (config[value][k] ~= nil) then
ui.set(v, config[value][k])
end
end
end
end
local function importSettings()
loadSettings(json.parse(clipboard.get()))
end
local function exportSettings(name)
local config = {}
for key, value in pairs(vars.pStates) do
config[value] = {}
for k, v in pairs(aaBuilder[key]) do
config[value][k] = ui.get(v)
end
end
clipboard.set(json.stringify(config))
end
local function loadConfig(name)
local config = getConfig(name)
loadSettings(config.config)
end
local function initDatabase()
if database.read(lua.database.configs) == nil then
database.write(lua.database.configs, {})
end
local link = "https://pastebin.com/raw/Xsz8Vd56"
http.get(link, function(success, response)
if not success then
print("Failed to get presets")
return
end
data = json.parse(response.body)
for i, preset in pairs(data.presets) do
table.insert(presets, { name = "*"..preset.name, config = preset.config})
ui.set(menu.configTab.name, "*"..preset.name)
end
ui.update(menu.configTab.list, getConfigList())
end)
end
initDatabase()
-- @region UI_LAYOUT end
-- @region NOTIFICATION_ANIM start
local anim_time = 0.75
local max_notifs = 6
local data = {}
local notifications = {
new = function( string, r, g, b)
table.insert(data, {
time = globals.curtime(),
string = string,
color = {r, g, b, 255},
fraction = 0
})
local time = 5
for i = #data, 1, -1 do
local notif = data[i]
if #data - i + 1 > max_notifs and notif.time + time - globals.curtime() > 0 then
notif.time = globals.curtime() - time
end
end
end,
render = function()
local x, y = client.screen_size()
local to_remove = {}
local Offset = 0
for i = 1, #data do
local notif = data[i]
local data = {rounding = 8, size = 4, glow = 8, time = 5}
if notif.time + data.time - globals.curtime() > 0 then
notif.fraction = func.clamp(notif.fraction + globals.frametime() / anim_time, 0, 1)
else
notif.fraction = func.clamp(notif.fraction - globals.frametime() / anim_time, 0, 1)
end
if notif.fraction <= 0 and notif.time + data.time - globals.curtime() <= 0 then
table.insert(to_remove, i)
end
local fraction = func.easeInOut(notif.fraction)
local r, g, b, a = unpack(notif.color)
local string = color_text(notif.string, r, g, b, a * fraction)
local strw, strh = renderer.measure_text("", string)
local strw2 = renderer.measure_text("b", "")
local paddingx, paddingy = 7, data.size
data.rounding = 0
Offset = Offset + (strh + paddingy*2 + math.sqrt(data.glow/10)*10 + 5) * fraction
glow_module(x/2 - (strw + strw2)/2 - paddingx, y - 100 - strh/2 - paddingy - Offset, strw + strw2 + paddingx*2, strh + paddingy*2, data.glow, data.rounding, {r, g, b, 45 * fraction}, {25,25,25,140 * fraction})
renderer.text(x/2 + strw2/2, y - 100 - Offset, 255, 255, 255, 255 * fraction, "c", 0, string)
renderer.line(x/2 - (strw + strw2)/2 - paddingx - 1, y - 100 + strh/2 + paddingy - Offset, x/2 + (strw + strw2)/2 + paddingx + 1, y - 100 + strh/2 + paddingy - Offset, r, g, b, 255 * fraction)
-- renderer.text(x/2 - strw/2, y - 100 - Offset, 255, 255, 255, 255 * fraction, "cb", 0,color_text(" $interitus ", r, g, b, a * fraction))
end
for i = #to_remove, 1, -1 do
table.remove(data, to_remove[i])
end
end,
clear = function()
data = {}
end
}
local function onHit(e)
local group = vars.hitgroup_names[e.hitgroup + 1] or '?'
local r, g, b, a = ui.get(menu.visualsTab.logsClr)
notifications.new(string.format("Hit %s's $%s$ for $%d$ damage ($%d$ health remaining)", entity.get_player_name(e.target), group:lower(), e.damage, entity.get_prop(e.target, 'm_iHealth')), r, g, b)
end
local function onMiss(e)
local group = vars.hitgroup_names[e.hitgroup + 1] or '?'
local ping = math.min(999, client.real_latency() * 1000)
local ping_col = (ping >= 100) and { 255, 0, 0 } or { 150, 200, 60 }
local hc = math.floor(e.hit_chance + 0.5);
local hc_col = (hc < ui.get(refs.hitChance)) and { 255, 0, 0 } or { 150, 200, 60 };
e.reason = e.reason == "?" and "resolver" or e.reason
notifications.new(string.format("Missed %s's $%s$ due to $%s$", entity.get_player_name(e.target), group:lower(), e.reason), 255, 120, 120)
end
local function onPurchase(e)
local userid = e.userid
if userid == nil then return end
if e.team == entity.get_prop(vars.localPlayer, 'm_iTeamNum') then return end
local buyer = client.userid_to_entindex(userid)
if buyer == nil then return end
if e.weapon == "weapon_unknown" then return end
local item = e.weapon;
item = item:gsub('weapon_', '')
if item == 'item_assaultsuit' then
item = 'kevlar + helmet'
elseif item == 'item_kevlar' then
item = 'kevlar'
elseif item == 'item_defuser' then
item = 'defuser'
else
item = item:gsub('grenade', ' grenade');
end
local r, g, b, a = ui.get(menu.visualsTab.logsClr)
notifications.new(string.format('$%s$ purchased $%s$.', entity.get_player_name(buyer), item), r, g, b)
end
client.set_event_callback("client_disconnect", function() notifications.clear() end)
client.set_event_callback("level_init", function() notifications.clear() end)
client.set_event_callback('player_connect_full', function(e) if client.userid_to_entindex(e.userid) == entity.get_local_player() then notifications.clear() end end)
-- @region NOTIFICATION_ANIM end
-- @region AA_CALLBACKS start
local aa = {
ignore = false,
manualAA= 0,
input = 0,
}
client.set_event_callback("player_connect_full", function()
aa.ignore = false
aa.manualAA= 0
aa.input = 0
end)
local counter = 0
local switch = false
client.set_event_callback("setup_command", function(cmd)
vars.localPlayer = entity.get_local_player()
if not vars.localPlayer or not entity.is_alive(vars.localPlayer) then return end
local flags = entity.get_prop(vars.localPlayer, "m_fFlags")
local onground = bit.band(flags, 1) ~= 0 and cmd.in_jump == 0
local valve = entity.get_prop(entity.get_game_rules(), "m_bIsValveDS")
local origin = vector(entity.get_prop(vars.localPlayer, "m_vecOrigin"))
local camera = vector(client.camera_angles())
local eye = vector(client.eye_position())
local velocity = vector(entity.get_prop(vars.localPlayer, "m_vecVelocity"))
local weapon = entity.get_player_weapon()
local pStill = math.sqrt(velocity.x ^ 2 + velocity.y ^ 2) < 5
local bodyYaw = entity.get_prop(vars.localPlayer, "m_flPoseParameter", 11) * 120 - 60
local isSlow = ui.get(refs.slow[1]) and ui.get(refs.slow[2])
local isOs = ui.get(refs.os[1]) and ui.get(refs.os[2])
local isFd = ui.get(refs.fakeDuck)
local isDt = ui.get(refs.dt[1]) and ui.get(refs.dt[2])
local isFl = ui.get(ui.reference("AA", "Fake lag", "Enabled"))
local legitAA = false
local manualsOverFs = ui.get(menu.aaTab.manualsOverFs) == true and true or false
-- search for states
vars.pState = 1
if pStill then vars.pState = 2 end
if not pStill then vars.pState = 3 end
if isSlow then vars.pState = 4 end
if entity.get_prop(vars.localPlayer, "m_flDuckAmount") > 0.1 then vars.pState = 5 end
if not pStill and entity.get_prop(vars.localPlayer, "m_flDuckAmount") > 0.1 then vars.pState = 8 end
if not onground then vars.pState = 6 end
if not onground and entity.get_prop(vars.localPlayer, "m_flDuckAmount") > 0.1 then vars.pState = 7 end
if ui.get(aaBuilder[9].enableState) and not func.table_contains(ui.get(aaBuilder[9].stateDisablers), vars.intToS[vars.pState]) and isDt == false and isOs == false and isFl == true then
vars.pState = 9
end
if ui.get(aaBuilder[vars.pState].enableState) == false and vars.pState ~= 1 then
vars.pState = 1
end
if cmd.chokedcommands == 0 then
counter = counter + 1
end
if counter >= 8 then
counter = 0
end
if globals.tickcount() % ui.get(aaBuilder[vars.pState].switchTicks) == 1 then
switch = not switch
end
local nextAttack = entity.get_prop(vars.localPlayer, "m_flNextAttack")
local nextPrimaryAttack = entity.get_prop(entity.get_player_weapon(vars.localPlayer), "m_flNextPrimaryAttack")
local dtActive = false
if nextPrimaryAttack ~= nil then
dtActive = not (math.max(nextPrimaryAttack, nextAttack) > globals.curtime())
end
-- apply antiaim set
local side = bodyYaw > 0 and 1 or -1
-- manual aa
if ui.get(menu.aaTab.manuals) ~= "Off" then
ui.set(menu.aaTab.manualTab.manualLeft, "On hotkey")
ui.set(menu.aaTab.manualTab.manualRight, "On hotkey")
ui.set(menu.aaTab.manualTab.manualForward, "On hotkey")
if aa.input + 0.22 < globals.curtime() then
if aa.manualAA == 0 then
if ui.get(menu.aaTab.manualTab.manualLeft) then
aa.manualAA = 1
aa.input = globals.curtime()
elseif ui.get(menu.aaTab.manualTab.manualRight) then
aa.manualAA = 2
aa.input = globals.curtime()
elseif ui.get(menu.aaTab.manualTab.manualForward) then
aa.manualAA = 3
aa.input = globals.curtime()
end
elseif aa.manualAA == 1 then
if ui.get(menu.aaTab.manualTab.manualRight) then
aa.manualAA = 2
aa.input = globals.curtime()
elseif ui.get(menu.aaTab.manualTab.manualForward) then
aa.manualAA = 3
aa.input = globals.curtime()
elseif ui.get(menu.aaTab.manualTab.manualLeft) then
aa.manualAA = 0
aa.input = globals.curtime()
end
elseif aa.manualAA == 2 then
if ui.get(menu.aaTab.manualTab.manualLeft) then
aa.manualAA = 1
aa.input = globals.curtime()
elseif ui.get(menu.aaTab.manualTab.manualForward) then
aa.manualAA = 3
aa.input = globals.curtime()
elseif ui.get(menu.aaTab.manualTab.manualRight) then
aa.manualAA = 0
aa.input = globals.curtime()
end
elseif aa.manualAA == 3 then
if ui.get(menu.aaTab.manualTab.manualForward) then
aa.manualAA = 0
aa.input = globals.curtime()
elseif ui.get(menu.aaTab.manualTab.manualLeft) then
aa.manualAA = 1
aa.input = globals.curtime()
elseif ui.get(menu.aaTab.manualTab.manualRight) then
aa.manualAA = 2
aa.input = globals.curtime()
end
end
end
if aa.manualAA == 1 or aa.manualAA == 2 or aa.manualAA == 3 then
aa.ignore = true
if ui.get(menu.aaTab.manuals) == "Static" then
ui.set(refs.yawJitter[1], "Off")
ui.set(refs.yawJitter[2], 0)
ui.set(refs.bodyYaw[1], "Static")
ui.set(refs.bodyYaw[2], 180)