-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstellar.lua
More file actions
3142 lines (2294 loc) · 104 KB
/
Copy pathstellar.lua
File metadata and controls
3142 lines (2294 loc) · 104 KB
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 panorama_api = panorama.open()
-- #region : Libraries
local pui = require("gamesense/pui")
local csgo_weapons = require("gamesense/csgo_weapons")
local clipboard = require("gamesense/clipboard")
local base64 = require("gamesense/base64")
local vector = require("vector")
local ffi = require("ffi")
-- #endregion
local sc = vector(client.screen_size())
-- #region : lua data
local stellar = {} do
stellar.name = "Stellar"
stellar.user = "UwUbOY"
stellar.steam_name = panorama_api.MyPersonaAPI.GetName()
end
pui.macros.p = "\aCDCDCD40•\r"
pui.macros.accent = "\aCDCDCD40"
-- #endregion
-- #region : Math
math.clamp = function (x, a, b) if a > x then return a elseif b < x then return b else return x end end
math.lerp = function (a, b, w) return a + (b - a) * w end
math.normalize_yaw = function (yaw) return (yaw + 180) % -360 + 180 end
math.normalize_pitch = function (pitch) return math.clamp(pitch, -89, 89) end
-- #endregion
-- #region : Events
local events do
local event_mt = {
__call = function (self, fn, bool)
local action = bool and client.set_event_callback or client.unset_event_callback
action(self[1], fn)
end,
set = function (self, fn)
client.set_event_callback(self[1], fn)
end,
unset = function (self, fn)
client.unset_event_callback(self[1], fn)
end,
fire = function (self, ...)
client.fire_event(self[1], ...)
end,
} event_mt.__index = event_mt
events = setmetatable({}, {
__index = function (self, key)
self[key] = setmetatable({key}, event_mt)
return self[key]
end,
})
end
-- #endregion
-- #region : Color
local color do
local RGBtoHEX = function(col, short)
return string.format(short and "%02X%02X%02X" or "%02X%02X%02X%02X", col.r, col.g, col.b, col.a)
end
local HEXtoRGB = function(hex)
hex = string.gsub(hex, "^#", "")
return tonumber(string.sub(hex, 1, 2), 16), tonumber(string.sub(hex, 3, 4), 16), tonumber(string.sub(hex, 5, 6), 16), tonumber(string.sub(hex, 7, 8), 16) or 255
end
local create
local mt = {
__eq = function (a, b)
return a.r == b.r and a.g == b.g and a.b == b.b and a.a == b.a
end,
lerp = function (self, t, w)
return create(self.r + (t.r - self.r) * w, self.g + (t.g - self.g) * w, self.b + (t.b - self.b) * w, self.a + (t.a - self.a) * w)
end,
to_hex = RGBtoHEX,
alpha_modulate = function (self, a, r)
return create(self.r, self.g, self.b, r and a * self.a or a)
end,
unpack = function(self)
return self.r, self.g, self.b, self.a
end
} mt.__index = mt
create = ffi.metatype(ffi.typeof("struct { uint8_t r; uint8_t g; uint8_t b; uint8_t a; }"), mt)
color = function(r, g, b, a)
local col = {}
if type(r) == "string" then
local rh, gh, bh, ah = HEXtoRGB(r)
col = {
r = rh,
g = gh,
b = bh,
a = ah
}
else
col = {
r = r or 255,
g = b ~= nil and g or r or 255,
b = b or r or 255,
a = a or b == nil and g or 255
}
end
return create(col.r, col.g, col.b, col.a)
end
end
-- #endregion
-- #region : Render
local render do
local astack = {}
local alpha = 1
render = setmetatable({
push_alpha = function(v)
local len = #astack
astack[len+1] = v
alpha = alpha * astack[len+1] * (astack[len] or 1)
if len > 255 then error "alpha stack exceeded 255 objects, report to developers" end
end,
pop_alpha = function()
local len = #astack
astack[len], len = nil, len-1
alpha = len == 0 and 1 or astack[len] * (astack[len-1] or 1)
end,
get_alpha = function()
return alpha
end,
gradient = function (position, size, c1, c2, dir)
local x, y = position.x, position.y
local w, h = size.x, size.y
renderer.gradient(x, y, w, h, c1.r, c1.g, c1.b, c1.a * alpha, c2.r, c2.g, c2.b, c2.a * alpha, dir or false)
end,
line = function (xa, ya, xb, yb, c)
renderer.line(xa, ya, xb, yb, c.r, c.g, c.b, c.a * alpha)
end,
rectangle = function (x, y, w, h, c, n)
n = n or 0
local r, g, b, a = c.r, c.g, c.b, c.a * alpha
if n == 0 then
renderer.rectangle(x, y, w, h, r, g, b, a)
else
renderer.circle(x + n, y + n, r, g, b, a, n, 180, 0.25)
renderer.rectangle(x + n, y, w - n - n, n, r, g, b, a)
renderer.circle(x + w - n, y + n, r, g, b, a, n, 90, 0.25)
renderer.rectangle(x, y + n, w, h - n - n, r, g, b, a)
renderer.circle(x + n, y + h - n, r, g, b, a, n, 270, 0.25)
renderer.rectangle(x + n, y + h - n, w - n - n, n, r, g, b, a)
renderer.circle(x + w - n, y + h - n, r, g, b, a, n, 0, 0.25)
end
end,
rect_outline = function (x, y, w, h, c, n, t)
n, t = n or 0, t or 1
local r, g, b, a = c.r, c.g, c.b, c.a * alpha
if n == 0 then
renderer.rectangle(x, y, w - t, t, r, g, b, a)
renderer.rectangle(x, y + t, t, h - t, r, g, b, a)
renderer.rectangle(x + w - t, y, t, h - t, r, g, b, a)
renderer.rectangle(x + t, y + h - t, w - t, t, r, g, b, a)
else
renderer.circle_outline(x + n, y + n, r, g, b, a, n, 180, 0.25, t)
renderer.rectangle(x + n, y, w - n - n, t, r, g, b, a)
renderer.circle_outline(x + w - n, y + n, r, g, b, a, n, 270, 0.25, t)
renderer.rectangle(x, y + n, t, h - n - n, r, g, b, a)
renderer.circle_outline(x + n, y + h - n, r, g, b, a, n, 90, 0.25, t)
renderer.rectangle(x + n, y + h - t, w - n - n, t, r, g, b, a)
renderer.circle_outline(x + w - n, y + h - n, r, g, b, a, n, 0, 0.25, t)
renderer.rectangle(x + w - t, y + n, t, h - n - n, r, g, b, a)
end
end,
triangle = function (x1, y1, x2, y2, x3, y3, c)
renderer.triangle(x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a * alpha)
end,
circle = function (x, y, c, radius, start, percentage)
renderer.circle(x, y, c.r, c.g, c.b, c.a * alpha, radius, start or 0, percentage or 1)
end,
circle_outline = function (x, y, c, radius, start, percentage, thickness)
renderer.circle(x, y, c.r, c.g, c.b, c.a * alpha, radius, start or 0, percentage or 1, thickness)
end,
load_rgba = function (c, w, h) return renderer.load_rgba(c, w, h) end,
load_jpg = function (c, w, h) return renderer.load_jpg(c, w, h) end,
load_png = function (c, w, h) return renderer.load_png(c, w, h) end,
load_svg = function (c, w, h) return renderer.load_svg(c, w, h) end,
texture = function (id, x, y, w, h, c, mode)
if not id then return end
renderer.texture(id, x, y, w, h, c.r, c.g, c.b, c.a * alpha, mode or "f")
end,
colored_text = function(text, clr)
clr.a = clr.a * alpha
local hexed = clr:to_hex()
local default = color(200, clr.a):to_hex()
text = ("\a%s%s"):format(default, text)
local tmp = ("\a%s%%1\a%s"):format(hexed, default)
local result = text:gsub("%${(.-)}", tmp)
return result
end,
text = function (x, y, c, flags, width, ...)
renderer.text(x, y, c.r, c.g, c.b, c.a * alpha, (flags or ""), width or 0, ...)
end,
measure_text = function(flags, text)
if not text or text == "" then return vector(0, 0) end
flags = (flags or "")
return vector(renderer.measure_text(flags, text))
end,
}, {__index = renderer})
end
-- #endregion
-- #region : Anim
local anim = {} do
anim._list = {}
anim.lerp = function(start, end_pos, time)
time = time or 0.095
if math.abs(start - end_pos) < 1 then
return end_pos
end
time = math.clamp(globals.frametime() * time * 170, 0.01, 1)
return start + (end_pos - start) * time
end
anim.new = function(name, new_value, speed)
speed = speed or 0.095
if anim._list[name] == nil then
anim._list[name] = new_value
end
anim._list[name] = anim.lerp(anim._list[name], new_value, speed)
return anim._list[name]
end
end
-- #endregion
-- #region : print_raw
local print_raw do
local native_print = vtable_bind("vstdlib.dll", "VEngineCvar007", 25, "void(__cdecl*)(void*, const void*, const char*, ...)")
print_raw = function(...)
native_print(pui.macros.accent, (" %s "):format(stellar.name))
native_print(color(200), "· ")
local tmp = "\a(%x%x%x%x%x%x%x%x)([^\a]*)"
for k, v in pairs({...}) do
local msg = tostring(v)
if msg:find(tmp) then
for clr, text in msg:gmatch(tmp) do
native_print(color(clr:sub(1, 6)), text)
end
else
native_print(color(200), msg)
end
end
native_print(color(255), "\n")
end
end
-- #endregion
-- #region : Entity Helpers
do
local native_GetClientEntity = vtable_bind("client.dll", "VClientEntityList003", 3, "void*(__thiscall*)(void*, int)")
local native_GetHighestEntityIndex = vtable_bind("client.dll", "VClientEntityList003", 6, "int(__thiscall*)(void*)")
local native_GetClientNetworkable = vtable_bind("client.dll", "VClientEntityList003", 0, "void*(__thiscall*)(void*, int)")
local native_GetClientClass = vtable_thunk(2, "void*(__thiscall*)(void*)")
entity.get_all = function(optional_classname)
local entities = {}
for i = 0, native_GetHighestEntityIndex() do
local ent = native_GetClientEntity(i)
if ent == nil then
goto continue
end
local net = native_GetClientNetworkable(i)
if net == nil then
goto continue
end
local class = native_GetClientClass(net)
if class == nil then
goto continue
end
local classname = ffi.string(ffi.cast("const char**", ffi.cast("char*", class) + 8)[0])
if optional_classname == nil or classname == optional_classname then
table.insert(entities, i)
end
::continue::
end
return entities
end
entity.get_players = function(enemies_only, include_dormant, fn)
local results = {}
local players = entity.get_all("CCSPlayer")
for _, player in pairs(players) do
if (not enemies_only or entity.is_enemy(player)) and
(include_dormant or not entity.is_dormant(player)) then
if fn ~= nil then
fn(player)
end
table.insert(results, player)
end
end
return results
end
ffi.cdef[[
typedef struct {
char pad0[0x18];
float anim_update_timer;
char pad1[0xC];
float started_moving_time;
float last_move_time;
char pad2[0x10];
float last_lby_time;
char pad3[0x8];
float run_amount;
char pad4[0x10];
void* entity;
void* active_weapon;
void* last_active_weapon;
float last_client_side_animation_update_time;
int last_client_side_animation_update_framecount;
float eye_timer;
float eye_angles_y;
float eye_angles_x;
float goal_feet_yaw;
float current_feet_yaw;
float torso_yaw;
float last_move_yaw;
float lean_amount;
char pad5[0x4];
float feet_cycle;
float feet_yaw_rate;
char pad6[0x4];
float duck_amount;
float landing_duck_amount;
char pad7[0x4];
float current_origin[3];
float last_origin[3];
float velocity_x;
float velocity_y;
char pad8[0x4];
float unknown_float1;
char pad9[0x8];
float unknown_float2;
float unknown_float3;
float unknown;
float m_velocity;
float jump_fall_velocity;
float clamped_velocity;
float feet_speed_forwards_or_sideways;
float feet_speed_unknown_forwards_or_sideways;
float last_time_started_moving;
float last_time_stopped_moving;
bool on_ground;
bool hit_in_ground_animation;
char pad10[0x4];
float time_since_in_air;
float last_origin_z;
float head_from_ground_distance_standing;
float stop_to_full_running_fraction;
char pad11[0x4];
float magic_fraction;
char pad12[0x3C];
float world_force;
char pad13[0x1CA];
float min_yaw;
float max_yaw;
} CAnimationState;
typedef struct {
char pad_0000[20];
int m_nOrder;
int m_nSequence;
float m_flPrevCycle;
float m_flWeight;
float m_flWeightDeltaRate;
float m_flPlaybackRate;
float m_flCycle;
void *m_pOwner;
char pad_0038[4];
} CAnimationLayer;
]]
entity.get_animstate = function(ent)
local pointer = native_GetClientEntity(ent)
if pointer then
return ffi.cast("CAnimationState**", ffi.cast("char*", ffi.cast("void***", pointer)) + 0x9960)[0]
end
end
entity.get_animlayer = function(ent, layer)
local pointer = native_GetClientEntity(ent)
if pointer then
return ffi.cast("CAnimationLayer**", ffi.cast("char*", ffi.cast(ffi.typeof("void***"), pointer)) + 0x2990)[0][layer]
end
end
entity.get_simtime = function(ent)
local pointer = native_GetClientEntity(ent)
if pointer then return entity.get_prop(ent, "m_flSimulationTime"), ffi.cast("float*", ffi.cast("uintptr_t", pointer) + 0x26C)[0] else return 0 end
end
entity.get_max_desync = function(animstate)
local speedfactor = math.clamp(animstate.feet_speed_forwards_or_sideways, 0, 1)
local avg_speedfactor = (animstate.stop_to_full_running_fraction * -0.3 - 0.2) * speedfactor + 1
local duck_amount = animstate.duck_amount
if duck_amount > 0 then
local duck_speed = duck_amount * speedfactor
avg_speedfactor = avg_speedfactor + (duck_speed * (0.5 - avg_speedfactor))
end
return math.clamp(avg_speedfactor, .5, 1)
end
end
-- #endregion
-- #region : Database
local db = {
name = ("%s::data"):format(stellar.name:lower())
} do
db.data = database.read(db.name)
if not db.data then
db.data = {}
end
db.read = function(key)
return db.data[key]
end
db.write = function(key, value)
db.data[key] = value
end
end
-- #endregion
-- #region : Refs
local refs = {
antiaim = {
antiaim_enabled = pui.reference("AA", "Anti-Aimbot angles", "Enabled"),
pitch = (function()
local ref = {pui.reference("AA", "Anti-Aimbot angles", "Pitch")}
return ref[1]
end)(),
pitch_offset = (function()
local ref = {pui.reference("AA", "Anti-Aimbot angles", "Pitch")}
return ref[2]
end)(),
yaw_base = pui.reference("AA", "Anti-Aimbot angles", "Yaw base"),
yaw = (function()
local ref = {pui.reference("AA", "Anti-Aimbot angles", "Yaw")}
return ref[1]
end)(),
yaw_offset = (function()
local ref = {pui.reference("AA", "Anti-Aimbot angles", "Yaw")}
return ref[2]
end)(),
yaw_jitter = (function()
local ref = {pui.reference("AA", "Anti-Aimbot angles", "Yaw jitter")}
return ref[1]
end)(),
yaw_jitter_offset = (function()
local ref = {pui.reference("AA", "Anti-Aimbot angles", "Yaw jitter")}
return ref[2]
end)(),
body_yaw = (function()
local ref = {pui.reference("AA", "Anti-Aimbot angles", "Body yaw")}
return ref[1]
end)(),
body_yaw_offset = (function()
local ref = {pui.reference("AA", "Anti-Aimbot angles", "Body yaw")}
return ref[2]
end)(),
freestanding_body_yaw = pui.reference("AA", "Anti-Aimbot angles", "Freestanding body yaw"),
edge_yaw = pui.reference("AA", "Anti-Aimbot angles", "Edge yaw"),
freestanding = pui.reference("AA", "Anti-Aimbot angles", "Freestanding"),
roll = pui.reference("AA", "Anti-Aimbot angles", "Roll"),
fakelag = pui.reference("AA", "Fake lag", "Enabled"),
fakelag_amount = pui.reference("AA", "Fake lag", "Amount"),
fakelag_variance = pui.reference("AA", "Fake lag", "Variance"),
fakelag_limit = pui.reference("AA", "Fake lag", "Limit"),
limit = pui.reference("AA", "Fake lag", "Limit"),
leg_movement = pui.reference("AA", "Other", "Leg movement"),
fake_peek = pui.reference("AA", "Other", "Fake peek"),
slow_motion = pui.reference("AA", "Other", "Slow motion"),
onshot = pui.reference("AA", "Other", "On shot anti-aim")
},
other = {
aimbot = pui.reference("RAGE", "Aimbot", "Enabled"),
doubletap = pui.reference("RAGE", "Aimbot", "Double tap"),
doubletap_fakelag = pui.reference("RAGE", "Aimbot", "Double tap fake lag limit"),
fake_duck = pui.reference("RAGE", "Other", "Duck peek assist"),
min_damage = pui.reference("RAGE", "Aimbot", "Minimum damage"),
force_baim = pui.reference("RAGE", "Aimbot", "Force body aim"),
force_sp = pui.reference("RAGE", "Aimbot", "Force safe point"),
min_damage_override = {pui.reference("RAGE", "Aimbot", "Minimum damage override")},
remove_scope = pui.reference("VISUALS", "Effects", "Remove scope overlay")
}
}
-- #endregion
-- #region : My
local my = {
entity = entity.get_local_player(),
valid = false,
threat = client.current_threat(),
scoped = false,
weapon = nil,
side = 0,
origin = vector(),
velocity = -1,
movetype = -1,
jumping = false,
in_score = false,
command_number = 0,
state = -1,
states = {
unknown = -1,
standing = 2,
running = 3,
walking = 4,
crouching = 5,
sneaking = 6,
air = 7,
air_crouch = 8,
freestanding = 9,
manual_yaw = 10,
planting = 11
}
} do
events.paint_ui:set(function()
my.entity = entity.get_local_player()
my.valid = my.entity and entity.is_alive(my.entity)
end)
my.update_netvars = function(cmd)
my.entity = entity.get_local_player()
my.valid = my.entity and entity.is_alive(my.entity)
my.command_number = cmd.command_number
if my.valid then
local velocity = vector(entity.get_prop(my.entity, "m_vecVelocity"))
my.velocity = velocity:length2d()
my.origin = vector(entity.get_prop(my.entity, "m_vecOrigin"))
my.scoped = entity.get_prop(my.entity, "m_bIsScoped") == 1
my.weapon = entity.get_player_weapon(my.entity)
my.movetype = entity.get_prop(my.entity, "m_MoveType")
my.threat = client.current_threat()
my.jumping = cmd.in_jump == 1
my.in_score = cmd.in_score == 1
if my.side == 0 then
my.side = (cmd.sidemove > 0) and 1 or (cmd.sidemove < 0) and -1 or 0
end
if not my.scoped then
my.side = 0
end
end
end
my.update_state = function(cmd)
if not my.valid then
return
end
local flags = entity.get_prop(my.entity, "m_fFlags")
local on_ground = bit.band(flags, bit.lshift(1, 0)) == 1
local is_not_moving = my.velocity < 5
local is_walking = cmd.in_speed == 1
local is_crouching = cmd.in_duck == 1 or refs.other.fake_duck:get()
local in_air = not on_ground or cmd.in_jump == 1
if is_crouching and in_air then
my.state = my.states.air_crouch
return
end
if in_air then
my.state = my.states.air
return
end
if not is_crouching and is_not_moving then
my.state = my.states.standing
return
end
if is_walking then
my.state = my.states.walking
return
end
if is_crouching and not is_not_moving then
my.state = my.states.sneaking
return
end
if is_crouching and is_not_moving then
my.state = my.states.crouching
return
end
if not is_crouching and not is_not_moving and not is_walking then
my.state = my.states.running
return
end
my.state = my.states.unknown
end
events.setup_command:set(function(cmd)
my.update_netvars(cmd)
my.update_state(cmd)
end)
end
-- #endregion
-- #region : Exploit
local exploit = {
diff = 0,
defensive = false,
shift = false,
active = false
} do
local last_commandnumber = 0
local tickbase_max = 0
events.run_command:set(function(cmd)
if not my.valid then
return
end
local tickbase = entity.get_prop(my.entity, "m_nTickBase") or 0
local client_latency = client.latency()
local shift = math.floor(tickbase - globals.tickcount() - 3 - toticks(client_latency) * 0.5 + 0.5 * (client_latency * 10))
local wanted = -14 + (refs.other.doubletap_fakelag:get() - 1) + 3
exploit.shift = shift <= wanted
last_commandnumber = cmd.command_number
end)
events.predict_command:set(function(cmd)
if not my.valid then
return
end
if last_commandnumber ~= cmd.command_number then
return
end
exploit.active = refs.other.doubletap:get() and refs.other.doubletap.hotkey:get() or refs.antiaim.onshot:get() and refs.antiaim.onshot.hotkey:get()
local tickbase = entity.get_prop(my.entity, "m_nTickBase") or 0
if tickbase_max ~= nil then
exploit.diff = tickbase - tickbase_max
exploit.defensive = exploit.diff < -3
end
tickbase_max = math.max(tickbase, tickbase_max or 0)
last_commandnumber = nil
end)
events.level_init:set(function(cmd)
exploit.diff = 0
exploit.defensive = false
exploit.shift = false
exploit.active = false
end)
end
-- #endregion
-- #region : Menu
local menu = {
refs = {},
depends = {},
elements = {}
} do
menu.global_update_callback = function()
for k, v in pairs(menu.refs) do
for name, ref in pairs(v) do
if menu.depends[k] then
if menu.depends[k][name] then
ref:set_visible(menu.depends[k][name]())
end
end
end
end
end
menu.new = function(tab, name, cheat_var, depends)
if menu.refs[tab] == nil then
menu.refs[tab] = {}
menu.elements[tab] = {}
end
if menu.elements[tab][name] ~= nil then
error(("Element already exists: [%s][%s]"):format(tab, name))
end
menu.refs[tab][name] = cheat_var
local update = function()
if cheat_var.type == "color_picker" then
menu.elements[tab][name] = color(cheat_var:get())
elseif cheat_var.type == "multiselect" then
local value_list = cheat_var.value
local tmp = {}
for k, v in pairs(value_list) do
tmp[v] = true
end
menu.elements[tab][name] = tmp
else
menu.elements[tab][name] = cheat_var.value
end
end
if depends ~= nil then
if type(depends) == "function" then
if menu.depends[tab] == nil then
menu.depends[tab] = {}
end
menu.depends[tab][name] = depends
end
end
cheat_var:set_callback(update, true)
cheat_var:set_callback(menu.global_update_callback, true)
return cheat_var
end
local menu_mt = {
__index = function(self, index, args)
return (function(...)
local group = ...
return (function(...)
local item = group[index](group, ...)
return (function(tab, name, ...)
menu.new(tab, name, item, ...)
return item
end)
end)
end)
end
}
menu = setmetatable(menu, menu_mt)
end
-- #endregion
-- #region : groups
local groups = {
antiaim = pui.group("AA", "Anti-aimbot angles"),
fakelag = pui.group("AA", "Fake lag"),
other = pui.group("AA", "Other"),
}
-- #endregion
--\a373737FF‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
-- #region : Tab Selector
local ts = {} do
menu.label(groups.fakelag)(("\v%s.lua"):format(stellar.name))("main", "info_header")
menu.label(groups.fakelag)(("User: \v%s\r"):format(stellar.user))("main", "user")
menu.combobox(groups.fakelag)("\ntab_selector", {" Home", " Anti-Aim", " Other"}, nil, false)("main", "tab_selector")
menu.combobox(groups.antiaim)("\v•\r Anti-Aim", {"Settings", "Builder"}, nil, false)("main", "tab_selector_aa", function()
return menu.elements["main"]["tab_selector"] == " Anti-Aim"
end)
menu.combobox(groups.antiaim)("\v•\r Other", {"Indicators", "Miscellaneous", "Other"}, nil, false)("main", "tab_selector_other", function()
return menu.elements["main"]["tab_selector"] == " Other"
end)
menu.label(groups.antiaim)("\v•\r Accent Color")("visuals", "accent_color_label", function()
return menu.elements["main"]["tab_selector"] == " Other" and menu.elements["main"]["tab_selector_other"] == "Indicators"
end)
menu.color_picker(groups.antiaim)("\naccent_color", color("FFC1C1FF"))("visuals", "accent_color", function()
return menu.elements["main"]["tab_selector"] == " Other" and menu.elements["main"]["tab_selector_other"] == "Indicators"
end)
menu.refs["visuals"]["accent_color"]:set_callback(function(self)
pui.macros.accent = color(self:get())
end, true)
menu.label(groups.antiaim)("\ntab_selector_other_space")("main", "tab_selector_other_space", function()
return menu.elements["main"]["tab_selector"] == " Other"
end)
ts.is_home = function()
return menu.elements["main"]["tab_selector"] == " Home"
end
ts.is_antiaim = function()
return menu.elements["main"]["tab_selector"] == " Anti-Aim" and menu.elements["main"]["tab_selector_aa"] == "Settings"
end
ts.is_antiaim2 = function()
return menu.elements["main"]["tab_selector"] == " Anti-Aim" and menu.elements["main"]["tab_selector_aa"] == "Builder"
end
ts.is_indicators = function()
return menu.elements["main"]["tab_selector"] == " Other" and menu.elements["main"]["tab_selector_other"] == "Indicators"
end
ts.is_misc = function()
return menu.elements["main"]["tab_selector"] == " Other" and menu.elements["main"]["tab_selector_other"] == "Miscellaneous"
end
ts.is_other = function()
return menu.elements["main"]["tab_selector"] == " Other" and menu.elements["main"]["tab_selector_other"] == "Other"
end
menu.combobox(groups.antiaim)("\nstate_type", {"Legacy", "Defensive"}, nil, false)("antiaim", "state_type", ts.is_antiaim2)
menu.label(groups.antiaim)("\n")("main", "tab_selector_aa_space", function()
return menu.elements["main"]["tab_selector"] == " Anti-Aim"
end)
end
-- #endregion
-- #region : Configs
events.paint_ui:set(function()
pui.traverse(refs.antiaim, function(ref)
ref:set_visible(false)
end)
end)
-- #endregion
-- #region : Configs
local configs = {
db = db.read("configs") or {},
data = {},
maximum_count = 10
} do
configs.compile = function(data)
if data == nil then
print_raw("An error occured with config!")
client.exec("play resource\\warning.wav")
return
end
success, data = pcall(function()
return base64.encode(json.stringify(data))
end)
if not success then
print_raw("An error occured with config!")
client.exec("play resource\\warning.wav")
return
end
return ("%s::gs::%s"):format(stellar.name:lower(), data:gsub("=", "_"):gsub("+", "Z1337Z"))