forked from Syihabuddinsanni/gamesense-workshop-luas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Solus UI.lua
1546 lines (1186 loc) · 56 KB
/
Solus UI.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, bit_lshift, client_color_log, client_create_interface, client_delay_call, client_find_signature, client_key_state, client_reload_active_scripts, client_screen_size, client_set_event_callback, client_system_time, client_timestamp, client_unset_event_callback, database_read, database_write, entity_get_classname, entity_get_local_player, entity_get_origin, entity_get_player_name, entity_get_prop, entity_get_steam64, entity_is_alive, globals_framecount, globals_realtime, math_ceil, math_floor, math_max, math_min, panorama_loadstring, renderer_gradient, renderer_line, renderer_rectangle, table_concat, table_insert, table_remove, table_sort, ui_get, ui_is_menu_open, ui_mouse_position, ui_new_checkbox, ui_new_color_picker, ui_new_combobox, ui_new_slider, ui_set, ui_set_visible, setmetatable, pairs, error, globals_absoluteframetime, globals_curtime, globals_frametime, globals_maxplayers, globals_tickcount, globals_tickinterval, math_abs, type, pcall, renderer_circle_outline, renderer_load_rgba, renderer_measure_text, renderer_text, renderer_texture, tostring, ui_name, ui_new_button, ui_new_hotkey, ui_new_label, ui_new_listbox, ui_new_textbox, ui_reference, ui_set_callback, ui_update, unpack, tonumber = bit.band, bit.lshift, client.color_log, client.create_interface, client.delay_call, client.find_signature, client.key_state, client.reload_active_scripts, client.screen_size, client.set_event_callback, client.system_time, client.timestamp, client.unset_event_callback, database.read, database.write, entity.get_classname, entity.get_local_player, entity.get_origin, entity.get_player_name, entity.get_prop, entity.get_steam64, entity.is_alive, globals.framecount, globals.realtime, math.ceil, math.floor, math.max, math.min, panorama.loadstring, renderer.gradient, renderer.line, renderer.rectangle, table.concat, table.insert, table.remove, table.sort, ui.get, ui.is_menu_open, ui.mouse_position, ui.new_checkbox, ui.new_color_picker, ui.new_combobox, ui.new_slider, ui.set, ui.set_visible, setmetatable, pairs, error, globals.absoluteframetime, globals.curtime, globals.frametime, globals.maxplayers, globals.tickcount, globals.tickinterval, math.abs, type, pcall, renderer.circle_outline, renderer.load_rgba, renderer.measure_text, renderer.text, renderer.texture, tostring, ui.name, ui.new_button, ui.new_hotkey, ui.new_label, ui.new_listbox, ui.new_textbox, ui.reference, ui.set_callback, ui.update, unpack, tonumber
local ffi = require 'ffi'
local vector = require 'vector'
local images = require 'gamesense/images'
local anti_aim = require 'gamesense/antiaim_funcs'
local dragging_fn = function(name, base_x, base_y) return (function()local a={}local b,c,d,e,f,g,h,i,j,k,l,m,n,o;local p={__index={drag=function(self,...)local q,r=self:get()local s,t=a.drag(q,r,...)if q~=s or r~=t then self:set(s,t)end;return s,t end,set=function(self,q,r)local j,k=client_screen_size()ui_set(self.x_reference,q/j*self.res)ui_set(self.y_reference,r/k*self.res)end,get=function(self)local j,k=client_screen_size()return ui_get(self.x_reference)/self.res*j,ui_get(self.y_reference)/self.res*k end}}function a.new(u,v,w,x)x=x or 10000;local j,k=client_screen_size()local y=ui_new_slider('LUA','A',u..' window position',0,x,v/j*x)local z=ui_new_slider('LUA','A','\n'..u..' window position y',0,x,w/k*x)ui_set_visible(y,false)ui_set_visible(z,false)return setmetatable({name=u,x_reference=y,y_reference=z,res=x},p)end;function a.drag(q,r,A,B,C,D,E)if globals_framecount()~=b then c=ui_is_menu_open()f,g=d,e;d,e=ui_mouse_position()i=h;h=client_key_state(0x01)==true;m=l;l={}o=n;n=false;j,k=client_screen_size()end;if c and i~=nil then if(not i or o)and h and f>q and g>r and f<q+A and g<r+B then n=true;q,r=q+d-f,r+e-g;if not D then q=math_max(0,math_min(j-A,q))r=math_max(0,math_min(k-B,r))end end end;table_insert(l,{q,r,A,B})return q,r,A,B end;return a end)().new(name, base_x, base_y) end
local graphs = function()local a={}function a:renderer_line(b,c,d)renderer_line(b.x,b.y,c.x,c.y,d.r,d.g,d.b,d.a)end;function a:renderer_rectangle_outlined(b,c,d)renderer_line(b.x,b.y,b.x,c.y,d.r,d.g,d.b,d.a)renderer_line(b.x,b.y,c.x,b.y,d.r,d.g,d.b,d.a)renderer_line(c.x,b.y,c.x,c.y,d.r,d.g,d.b,d.a)renderer_line(b.x,c.y,c.x,c.y,d.r,d.g,d.b,d.a)end;function a:renderer_rectangle_filled(b,c,d)local e=c.x-b.x;local f=c.y-b.y;if e<0 then if f<0 then renderer_rectangle(c.x,c.y,-e,-f,d.r,d.g,d.b,d.a)else renderer_rectangle(c.x,b.y,-e,f,d.r,d.g,d.b,d.a)end else if f<0 then renderer_rectangle(b.x,c.y,e,-f,d.r,d.g,d.b,d.a)else renderer_rectangle(b.x,b.y,e,f,d.r,d.g,d.b,d.a)end end end;function a:renderer_rectangle_outlined(b,c,d)renderer_line(b.x,b.y,b.x,c.y,d.r,d.g,d.b,d.a)renderer_line(b.x,b.y,c.x,b.y,d.r,d.g,d.b,d.a)renderer_line(c.x,b.y,c.x,c.y,d.r,d.g,d.b,d.a)renderer_line(b.x,c.y,c.x,c.y,d.r,d.g,d.b,d.a)end;function a:renderer_rectangle_filled_gradient(b,c,g,h,i)local e=c.x-b.x;local f=c.y-b.y;if e<0 then if f<0 then renderer_gradient(c.x,c.y,-e,-f,g.r,g.g,g.b,g.a,h.r,h.g,h.b,h.a,i)else renderer_gradient(c.x,b.y,-e,f,g.r,g.g,g.b,g.a,h.r,h.g,h.b,h.a,i)end else if f<0 then renderer_gradient(b.x,c.y,e,-f,h.r,h.g,h.b,h.a,g.r,g.g,g.b,g.a,i)else renderer_gradient(b.x,b.y,e,f,h.r,h.g,h.b,h.a,g.r,g.g,g.b,g.a,i)end end end;function a:draw(j,k,l,m,n,o)local p=k;local q=n.clr_1;k=0;l=l-p;n.h=n.h-n.thickness;if o then a:renderer_rectangle_outlined({x=n.x,y=n.y},{x=n.x+n.w-1,y=n.y+n.h-1+n.thickness},{r=q[1],g=q[2],b=q[3],a=q[4]})end;if k==l then a:renderer_line({x=n.x,y=n.y+n.h},{x=n.x+n.w,y=n.y+n.h},{r=q[1],g=q[2],b=q[3],a=q[4]})return end;local r=n.w/(m-1)local s=l-k;for t=1,m-1 do local u={(j[t]-p)/s,(j[t+1]-p)/s}local v={{x=n.x+r*(t-1),y=n.y+n.h-n.h*u[1]},{x=n.x+r*t,y=n.y+n.h-n.h*u[2]}}for t=1,n.thickness do a:renderer_line({x=v[1].x,y=v[1].y+t-1},{x=v[2].x,y=v[2].y+t-1},{r=q[1],g=q[2],b=q[3],a=q[4]})end end end;function a:draw_histogram(j,k,l,m,n,o)local p=k;k=0;l=l-p;if o then a:renderer_rectangle_outlined({x=n.x,y=n.y},{x=n.x+n.w-1,y=n.y+n.h-1},{r=255,g=255,b=255,a=255})end;local r=n.w/(m-1)local s=l-k;for t=1,m-1 do local u={(j[t]-p)/s,(j[t+1]-p)/s}local v={{x=math_floor(n.x+r*(t-1)),y=math_floor(n.y+n.h-n.h*u[1])},{x=math_floor(n.x+r*t),y=math_floor(n.y+n.h)},isZero=math_floor(n.y+n.h)==math_floor(n.y+n.h-n.h*u[1])}if n.sDrawBar=="fill"then a:renderer_rectangle_filled({x=v[1].x,y=v[1].y},{x=v[2].x,y=v[2].y},{r=n.clr_1[1],g=n.clr_1[2],b=n.clr_1[3],a=n.clr_1[4]})elseif n.sDrawBar=="gradient_fadeout"then a:renderer_rectangle_filled_gradient({x=v[1].x,y=v[1].y},{x=v[2].x,y=v[2].y},{r=n.clr_1[1],g=n.clr_1[2],b=n.clr_1[3],a=0},{r=n.clr_1[1],g=n.clr_1[2],b=n.clr_1[3],a=n.clr_1[4]},false)elseif n.sDrawBar=="gradient_fadein"then a:renderer_rectangle_filled_gradient({x=v[1].x,y=v[1].y},{x=v[2].x,y=v[2].y},{r=n.clr_1[1],g=n.clr_1[2],b=n.clr_1[3],a=n.clr_1[4]},{r=n.clr_1[1],g=n.clr_1[2],b=n.clr_1[3],a=0},false)else end;if n.bDrawPeeks and not v.isZero then a:renderer_line({x=v[1].x,y=v[1].y},{x=v[2].x,y=v[1].y},{r=n.clr_2[1],g=n.clr_2[2],b=n.clr_2[3],a=n.clr_2[4]})end end end;return a end
local gram_create = function(value, count) local gram = { }; for i=1, count do gram[i] = value; end return gram; end
local gram_update = function(tab, value, forced) local new_tab = tab; if forced or new_tab[#new_tab] ~= value then table_insert(new_tab, value); table_remove(new_tab, 1); end; tab = new_tab; end
local get_average = function(tab) local elements, sum = 0, 0; for k, v in pairs(tab) do sum = sum + v; elements = elements + 1; end return sum / elements; end
local hsv_to_rgb = function(b,c,d,e)local f,g,h;local i=math_floor(b*6)local j=b*6-i;local k=d*(1-c)local l=d*(1-j*c)local m=d*(1-(1-j)*c)i=i%6;if i==0 then f,g,h=d,m,k elseif i==1 then f,g,h=l,d,k elseif i==2 then f,g,h=k,d,m elseif i==3 then f,g,h=k,l,d elseif i==4 then f,g,h=m,k,d elseif i==5 then f,g,h=d,k,l end;return f*255,g*255,h*255,e*255 end
local notes = function(b)local c=function(d,e)local f={}for g in pairs(d)do table_insert(f,g)end;table_sort(f,e)local h=0;local i=function()h=h+1;if f[h]==nil then return nil else return f[h],d[f[h]]end end;return i end;local j={get=function(k)local l,m=0,{}for n,o in c(package.solus_notes)do if o==true then l=l+1;m[#m+1]={n,l}end end;for p=1,#m do if m[p][1]==b then return k(m[p][2]-1)end end end,set_state=function(q)package.solus_notes[b]=q;table_sort(package.solus_notes)end,unset=function()client_unset_event_callback('shutdown',callback)end}client_set_event_callback('shutdown',function()if package.solus_notes[b]~=nil then package.solus_notes[b]=nil end end)if package.solus_notes==nil then package.solus_notes={}end;return j end
local item_count = function(b)if b==nil then return 0 end;if#b==0 then local c=0;for d in pairs(b)do c=c+1 end;return c end;return#b end
local contains = function(b,c)for d=1,#b do if b[d]==c then return true end end;return false end
local create_integer = function(b,c,d,e)return{min=b,max=c,init_val=d,scale=e,value=d}end
local read_database = function(script_name, db_name, original)
if (script_name == nil or script_name == '') or (db_name == nil or db_name == '') or (original == nil or original == { }) then
client_color_log(216, 181, 121, ('[%s] \1\0'):format(script_name))
client_color_log(255, 0, 0, 'Error occured while parsing data')
error()
end
local dbase = database_read(db_name)
local new_data, corrupted_data, missing_sectors =
false, false, { }
if dbase == nil then
dbase, new_data = original, true
else
for name in pairs(dbase) do
local found_sector = false
for oname in pairs(original) do
if name == oname then
found_sector = true
end
end
if not found_sector then
dbase[name] = nil
end
end
for name, val in pairs(original) do
if dbase[name] == nil then
dbase[name], corrupted_data = val, true
missing_sectors[#missing_sectors+1] = '*' .. name
else
local corrupted_sector = false
for sname, sdata in pairs(val) do
if sname ~= 'keybinds' and dbase[name][sname] == nil or type(sdata) ~= type(dbase[name][sname]) then
dbase[name][sname], corrupted_data = sdata, true
if not corrupted_sector then
missing_sectors[#missing_sectors+1] = '*' .. name
corrupted_sector = true
end
end
end
end
end
if #missing_sectors > 0 then
client_color_log(216, 181, 121, ('[%s] \1\0'):format(script_name))
client_color_log(255, 255, 255, ('Repairing %d sector(s) \1\0'):format(#missing_sectors))
client_color_log(155, 220, 220, ('[ %s ]'):format(table_concat(missing_sectors, ' ')))
end
end
if new_data or corrupted_data then
database_write(db_name, dbase)
end
return dbase, original
end
local script_name = 'solus'
local database_name = 'solus'
local menu_tab = { 'LUA', 'A', 'B' }
local menu_palette = { 'Solid', 'Fade', 'Dynamic fade' }
local m_hotkeys, m_hotkeys_update, m_hotkeys_create = { }, true
local ms_watermark = ui_new_checkbox('CONFIG', 'Presets', 'Watermark')
local ms_spectators = ui_new_checkbox('CONFIG', 'Presets', 'Spectators')
local ms_keybinds = ui_new_checkbox('CONFIG', 'Presets', 'Hotkey list')
local ms_antiaim = ui_new_checkbox('CONFIG', 'Presets', 'Anti-aimbot indication')
local ms_ieinfo = ui_new_checkbox('CONFIG', 'Presets', 'Frequency update information')
local ms_palette, ms_color =
ui_new_combobox('CONFIG', 'Presets', 'Solus Palette', menu_palette),
ui_new_color_picker('CONFIG', 'Presets', 'Solus Global color', 142, 165, 229, 85)
local ms_fade_offset = ui_new_slider('CONFIG', 'Presets', 'Fade offset', 1, 1000, 825, false, nil, 0.001)
local ms_fade_frequency = ui_new_slider('CONFIG', 'Presets', 'Fade frequency', 1, 100, 10, false, nil, 0.01)
local ms_fade_split_ratio = ui_new_slider('CONFIG', 'Presets', 'Fade split ratio', 0, 100, 100, false, nil, 0.01)
local script_db, original_db = read_database(script_name, database_name, {
watermark = {
nickname = '',
beta_status = true,
gc_state = true,
style = create_integer(1, 4, 1, 1),
suffix = nil,
},
spectators = {
avatars = true,
auto_position = true
},
keybinds = {
{
require = '',
reference = { 'legit', 'aimbot', 'Enabled' },
custom_name = 'Legit aimbot',
ui_offset = 2
},
{
require = '',
reference = { 'legit', 'triggerbot', 'Enabled' },
custom_name = 'Legit triggerbot',
ui_offset = 2
},
{
require = '',
reference = { 'rage', 'aimbot', 'Enabled' },
custom_name = 'Rage aimbot',
ui_offset = 2
},
{
require = '',
reference = { 'rage', 'aimbot', 'Force safe point' },
custom_name = 'Safe point',
ui_offset = 1
},
{
require = '',
reference = { 'rage', 'other', 'Quick stop' },
custom_name = '',
ui_offset = 2
},
{
require = '',
reference = { 'rage', 'other', 'Quick peek assist' },
custom_name = '',
ui_offset = 2
},
{
require = '',
reference = { 'rage', 'other', 'Force body aim' },
custom_name = '',
ui_offset = 1
},
{
require = '',
reference = { 'rage', 'other', 'Duck peek assist' },
custom_name = '',
ui_offset = 1
},
{
require = '',
reference = { 'rage', 'other', 'Double tap' },
custom_name = '',
ui_offset = 2
},
{
require = '',
reference = { 'rage', 'other', 'Anti-aim correction override' },
custom_name = 'Resolver override',
ui_offset = 1
},
{
require = '',
reference = { 'aa', 'anti-aimbot angles', 'Freestanding' },
custom_name = '',
ui_offset = 2
},
{
require = '',
reference = { 'aa', 'other', 'Slow motion' },
custom_name = '',
ui_offset = 2
},
{
require = '',
reference = { 'aa', 'other', 'On shot anti-aim' },
custom_name = '',
ui_offset = 2
},
{
require = '',
reference = { 'aa', 'other', 'Fake peek' },
custom_name = '',
ui_offset = 2
},
{
require = '',
reference = { 'misc', 'movement', 'Z-Hop' },
custom_name = '',
ui_offset = 2
},
{
require = '',
reference = { 'misc', 'movement', 'Pre-speed' },
custom_name = '',
ui_offset = 2
},
{
require = '',
reference = { 'misc', 'movement', 'Blockbot' },
custom_name = '',
ui_offset = 2
},
{
require = '',
reference = { 'misc', 'movement', 'Jump at edge' },
custom_name = '',
ui_offset = 2
},
{
require = '',
reference = { 'misc', 'miscellaneous', 'Last second defuse' },
custom_name = '',
ui_offset = 1
},
{
require = '',
reference = { 'misc', 'miscellaneous', 'Free look' },
custom_name = '',
ui_offset = 1
},
{
require = '',
reference = { 'misc', 'miscellaneous', 'Ping spike' },
custom_name = '',
ui_offset = 2
},
{
require = '',
reference = { 'misc', 'miscellaneous', 'Automatic grenade release' },
custom_name = 'Grenade release',
ui_offset = 2
},
{
require = '',
reference = { 'visuals', 'player esp', 'Activation type' },
custom_name = 'Visuals',
ui_offset = 1
},
},
})
local get_bar_color = function()
local r, g, b, a = ui_get(ms_color)
local palette = ui_get(ms_palette)
if palette ~= menu_palette[1] then
local rgb_split_ratio = ui_get(ms_fade_split_ratio) / 100
local h = palette == menu_palette[3] and
globals_realtime() * (ui_get(ms_fade_frequency) / 100) or
ui_get(ms_fade_offset) / 1000
r, g, b = hsv_to_rgb(h, 1, 1, 1)
r, g, b =
r * rgb_split_ratio,
g * rgb_split_ratio,
b * rgb_split_ratio
end
return r, g, b, a
end
local get_color = function(number, max, i)
local Colors = {
{ 255, 0, 0 },
{ 237, 27, 3 },
{ 235, 63, 6 },
{ 229, 104, 8 },
{ 228, 126, 10 },
{ 220, 169, 16 },
{ 213, 201, 19 },
{ 176, 205, 10 },
{ 124, 195, 13 }
}
local math_num = function(int, max, declspec)
local int = (int > max and max or int)
local tmp = max / int;
if not declspec then declspec = max end
local i = (declspec / tmp)
i = (i >= 0 and math_floor(i + 0.5) or math_ceil(i - 0.5))
return i
end
i = math_num(number, max, #Colors)
return
Colors[i <= 1 and 1 or i][1],
Colors[i <= 1 and 1 or i][2],
Colors[i <= 1 and 1 or i][3],
i
end
local ms_classes = {
watermark = function()
local note = notes 'a_watermark'
local cstyle = { [1] = 'gamesense', [2] = 'gamesense.pub', [3] = 'skeet', [4] = 'skeet.cc' }
local has_beta = pcall(ui_reference, 'misc', 'Settings', 'Crash logs')
local get_name = panorama_loadstring([[ return MyPersonaAPI.GetName() ]])
local get_gc_state = panorama_loadstring([[ return MyPersonaAPI.IsConnectedToGC() ]])
local classptr = ffi.typeof('void***')
local latency_ptr = ffi.typeof('float(__thiscall*)(void*, int)')
local rawivengineclient = client_create_interface('engine.dll', 'VEngineClient014') or error('VEngineClient014 wasnt found', 2)
local ivengineclient = ffi.cast(classptr, rawivengineclient) or error('rawivengineclient is nil', 2)
local is_in_game = ffi.cast('bool(__thiscall*)(void*)', ivengineclient[0][26]) or error('is_in_game is nil')
local g_paint_handler = function()
local state = ui_get(ms_watermark)
local r, g, b, a = get_bar_color()
note.set_state(state)
note.get(function(id)
local data_wm = script_db.watermark or { }
local data_nickname = data_wm.nickname and tostring(data_wm.nickname) or ''
local data_suffix = (data_wm.suffix and tostring(data_wm.suffix) or ''):gsub('beta', '')
if data_wm.beta_status and has_beta and (not data_suffix or #data_suffix < 1) then
data_suffix = 'beta'
end
local sys_time = { client_system_time() }
local actual_time = ('%02d:%02d:%02d'):format(sys_time[1], sys_time[2], sys_time[3])
local is_connected_to_gc = not data_wm.gc_state or get_gc_state()
local gc_state = not is_connected_to_gc and '\x20\x20\x20\x20\x20' or ''
local nickname = #data_nickname > 0 and data_nickname or get_name()
local suffix = ('%s%s'):format(
cstyle[data_wm.style and data_wm.style.value or 1] or cstyle[1],
#data_suffix > 0 and (' [%s]'):format(data_suffix) or ''
)
local text = ('%s%s | %s | %s'):format(gc_state, suffix, nickname, actual_time)
if is_in_game(is_in_game) == true then
local latency = client.latency()*1000
local latency_text = latency > 5 and (' | delay: %dms'):format(latency) or ''
text = ('%s%s | %s%s | %s'):format(gc_state, suffix, nickname, latency_text, actual_time)
end
local h, w = 18, renderer_measure_text(nil, text) + 8
local x, y = client_screen_size(), 10 + (25*id)
x = x - w - 10
if ui_get(ms_palette) == menu_palette[1] then
renderer_rectangle(x, y, w, 2, r, g, b, 255)
else
renderer_gradient(x, y, (w/2)+1, 2, g, b, r, 255, r, g, b, 255, true)
renderer_gradient(x + w/2, y, w-w/2, 2, r, g, b, 255, b, r, g, 255, true)
end
renderer_rectangle(x, y + 2, w, h, 17, 17, 17, a)
renderer_text(x+4, y + 4, 255, 255, 255, 255, '', 0, text)
if not is_connected_to_gc then
local realtime = globals_realtime()*1.5
if realtime%2 <= 1 then
renderer_circle_outline(x+10, y + 11, 89, 119, 239, 255, 5, 0, realtime%1, 2)
else
renderer_circle_outline(x+10, y + 11, 89, 119, 239, 255, 5, realtime%1*370, 1-realtime%1, 2)
end
end
end)
end
client_set_event_callback('paint_ui', g_paint_handler)
end,
spectators = function()
local screen_size = { client_screen_size() }
local screen_size = {
screen_size[1] - screen_size[1] * cvar.safezonex:get_float(),
screen_size[2] * cvar.safezoney:get_float()
}
local dragging = dragging_fn('Spectators', screen_size[1] / 1.385, screen_size[2] / 2)
local m_alpha, m_active, m_contents, unsorted = 0, {}, {}, {}
local get_spectating_players = function()
local me = entity_get_local_player()
local players, observing = { }, me
for i = 1, globals_maxplayers() do
if entity_get_classname(i) == 'CCSPlayer' then
local m_iObserverMode = entity_get_prop(i, 'm_iObserverMode')
local m_hObserverTarget = entity_get_prop(i, 'm_hObserverTarget')
if m_hObserverTarget ~= nil and m_hObserverTarget <= 64 and not entity_is_alive(i) and (m_iObserverMode == 4 or m_iObserverMode == 5) then
if players[m_hObserverTarget] == nil then
players[m_hObserverTarget] = { }
end
if i == me then
observing = m_hObserverTarget
end
table_insert(players[m_hObserverTarget], i)
end
end
end
return players, observing
end
local g_paint_handler = function()
local data_sp = script_db.spectators or { }
local master_switch = ui_get(ms_spectators)
local is_menu_open = ui_is_menu_open()
local frames = 8 * globals_frametime()
local latest_item = false
local maximum_offset = 85
local me = entity_get_local_player()
local spectators, player = get_spectating_players()
for i=1, 64 do
unsorted[i] = {
idx = i,
active = false
}
end
if spectators[player] ~= nil then
for _, spectator in pairs(spectators[player]) do
unsorted[spectator] = {
idx = spectator,
active = (function()
if spectator == me then
return false
end
return true
end)(),
avatar = (function()
if not data_sp.avatars then
return nil
end
local steam_id = entity_get_steam64(spectator)
local avatar = images.get_steam_avatar(steam_id)
if steam_id == nil or avatar == nil then
return nil
end
if m_contents[spectator] == nil or m_contents[spectator].conts ~= avatar.contents then
m_contents[spectator] = {
conts = avatar.contents,
texture = renderer_load_rgba(avatar.contents, avatar.width, avatar.height)
}
end
return m_contents[spectator].texture
end)()
}
end
end
for _, c_ref in pairs(unsorted) do
local c_id = c_ref.idx
local c_nickname = entity_get_player_name(c_ref.idx)
if c_ref.active then
latest_item = true
if m_active[c_id] == nil then
m_active[c_id] = {
alpha = 0, offset = 0, active = true
}
end
local text_width = renderer_measure_text(nil, c_nickname)
m_active[c_id].active = true
m_active[c_id].offset = text_width
m_active[c_id].alpha = m_active[c_id].alpha + frames
m_active[c_id].avatar = c_ref.avatar
m_active[c_id].name = c_nickname
if m_active[c_id].alpha > 1 then
m_active[c_id].alpha = 1
end
elseif m_active[c_id] ~= nil then
m_active[c_id].active = false
m_active[c_id].alpha = m_active[c_id].alpha - frames
if m_active[c_id].alpha <= 0 then
m_active[c_id] = nil
end
end
if m_active[c_id] ~= nil and m_active[c_id].offset > maximum_offset then
maximum_offset = m_active[c_id].offset
end
end
if is_menu_open and not latest_item then
local case_name = ' '
local text_width = renderer_measure_text(nil, case_name)
latest_item = true
maximum_offset = maximum_offset < text_width and text_width or maximum_offset
m_active[case_name] = {
name = '',
active = true,
offset = text_width,
alpha = 1
}
end
local text = 'spectators'
local x, y = dragging:get()
local r, g, b, a = get_bar_color()
local height_offset = 23
local w, h = 55 + maximum_offset, 50
w = w - (data_sp.avatars and 0 or 17)
local right_offset = data_sp.auto_position and (x+w/2) > (({ client_screen_size() })[1] / 2)
if ui_get(ms_palette) == menu_palette[1] then
renderer_rectangle(x, y, w, 2, r, g, b, m_alpha*255)
else
renderer_gradient(x, y, (w/2)+1, 2, g, b, r, m_alpha*255, r, g, b, m_alpha*255, true)
renderer_gradient(x + w/2, y, w-w/2, 2, r, g, b, m_alpha*255, b, r, g, m_alpha*255, true)
end
renderer_rectangle(x, y + 2, w, 18, 17, 17, 17, m_alpha*a)
renderer_text(x - renderer_measure_text(nil, text) / 2 + w/2, y + 4, 255, 255, 255, m_alpha*255, '', 0, text)
for c_name, c_ref in pairs(m_active) do
local _, text_h = renderer_measure_text(nil, c_ref.name)
renderer_text(x + ((c_ref.avatar and not right_offset) and text_h or -5) + 10, y + height_offset, 255, 255, 255, m_alpha*c_ref.alpha*255, '', 0, c_ref.name)
if c_ref.avatar ~= nil then
renderer_texture(c_ref.avatar, x + (right_offset and w - 15 or 5), y + height_offset, text_h, text_h, 255, 255, 255, m_alpha*c_ref.alpha*255, 'f')
end
height_offset = height_offset + 15
end
dragging:drag(w, (3 + (15 * item_count(m_active))) * 2)
if master_switch and item_count(m_active) > 0 and latest_item then
m_alpha = m_alpha + frames; if m_alpha > 1 then m_alpha = 1 end
else
m_alpha = m_alpha - frames; if m_alpha < 0 then m_alpha = 0 end
end
if is_menu_open then
m_active[' '] = nil
end
end
client_set_event_callback('paint', g_paint_handler)
end,
keybinds = function()
local screen_size = { client_screen_size() }
local screen_size = {
screen_size[1] - screen_size[1] * cvar.safezonex:get_float(),
screen_size[2] * cvar.safezoney:get_float()
}
local dragging = dragging_fn('Keybinds', screen_size[1] / 1.385, screen_size[2] / 2.5)
local m_alpha, m_active = 0, { }
local hotkey_modes = { 'holding', 'toggled', 'disabled' }
local elements = {
rage = { 'aimbot', 'other' },
aa = { 'anti-aimbot angles', 'fake lag', 'other' },
legit = { 'weapon type', 'aimbot', 'triggerbot', 'other' },
visuals = { 'player esp', 'colored models', 'other esp', 'effects' },
misc = { 'miscellaneous', 'movement', 'settings' },
skins = { 'knife options', 'glove options', 'weapon skin' },
players = { 'players', 'adjustments' },
config = { 'presets', 'lua' },
lua = { 'a', 'b' }
}
local reference_if_exists = function(...)
if pcall(ui_reference, ...) then
return true
end
end
local create_item = function(data)
local collected = { }
local cname = data.custom_name
local reference = { ui_reference(unpack(data.reference)) }
for i=1, #reference do
if i <= data.ui_offset then
collected[i] = reference[i]
end
end
cname = (cname and #tostring(cname) > 0) and cname or nil
data.reference[3] = data.ui_offset == 2 and ui_name(collected[1]) or data.reference[3]
m_hotkeys[cname or (data.reference[3] or '?')] = {
reference = data.reference,
ui_offset = data.ui_offset,
custom_name = cname,
custom_file = data.require,
collected = collected
}
return true
end
local create_custom_item = function(pdata)
local reference = pdata.reference
if reference == nil or elements[reference[1]:lower()] == nil or
not contains(elements[reference[1]:lower()], reference[2]:lower()) then
return false
end
if reference_if_exists(unpack(reference)) then
return create_item(pdata)
else
if pcall(require, pdata.require) and reference_if_exists(unpack(reference)) then
return create_item(pdata)
else
local name = (pdata.require and #pdata.require > 0) and (pdata.require .. '.lua') or '-'
client_color_log(216, 181, 121, ('[%s] \1\0'):format(script_name))
client_color_log(155, 220, 220, ('Unable to reference hotkey: %s [ %s ]'):format(reference[3], name))
end
end
return false
end
local g_paint_handler = function()
local master_switch = ui_get(ms_keybinds)
local is_menu_open = ui_is_menu_open()
local frames = 8 * globals_frametime()
local latest_item = false
local maximum_offset = 66
if m_hotkeys_update == true then
m_hotkeys = { }
m_active = { }
for _, item in pairs((script_db.keybinds or { })) do
create_custom_item({
reference = item.reference,
custom_name = item.custom_name,
ui_offset = item.ui_offset or 1,
require = item.require
})
end
m_hotkeys_update = false
end
for c_name, c_data in pairs(m_hotkeys) do
local item_active = true
local c_ref = c_data.collected
local items = item_count(c_ref)
local state = { ui_get(c_ref[items]) }
if items > 1 then
item_active = ui_get(c_ref[1])
end
if item_active and state[2] ~= 0 and (state[2] == 3 and not state[1] or state[2] ~= 3 and state[1]) then
latest_item = true
if m_active[c_name] == nil then
m_active[c_name] = {
mode = '', alpha = 0, offset = 0, active = true
}
end
local text_width = renderer_measure_text(nil, c_name)
m_active[c_name].active = true
m_active[c_name].offset = text_width
m_active[c_name].mode = hotkey_modes[state[2]]
m_active[c_name].alpha = m_active[c_name].alpha + frames
if m_active[c_name].alpha > 1 then
m_active[c_name].alpha = 1
end
elseif m_active[c_name] ~= nil then
m_active[c_name].active = false
m_active[c_name].alpha = m_active[c_name].alpha - frames
if m_active[c_name].alpha <= 0 then
m_active[c_name] = nil
end
end
if m_active[c_name] ~= nil and m_active[c_name].offset > maximum_offset then
maximum_offset = m_active[c_name].offset
end
end
if is_menu_open and not latest_item then
local case_name = 'Menu toggled'
local text_width = renderer_measure_text(nil, case_name)
latest_item = true
maximum_offset = maximum_offset < text_width and text_width or maximum_offset
m_active[case_name] = {
active = true,
offset = text_width,
mode = '~',
alpha = 1,
}
end
local text = 'keybinds'
local x, y = dragging:get()
local r, g, b, a = get_bar_color()
local height_offset = 23
local w, h = 75 + maximum_offset, 50
if ui_get(ms_palette) == menu_palette[1] then
renderer_rectangle(x, y, w, 2, r, g, b, m_alpha*255)
else
renderer_gradient(x, y, (w/2)+1, 2, g, b, r, m_alpha*255, r, g, b, m_alpha*255, true)
renderer_gradient(x + w/2, y, w-w/2, 2, r, g, b, m_alpha*255, b, r, g, m_alpha*255, true)
end
renderer_rectangle(x, y + 2, w, 18, 17, 17, 17, m_alpha*a)
renderer_text(x - renderer_measure_text(nil, text) / 2 + w/2, y + 4, 255, 255, 255, m_alpha*255, '', 0, text)
for c_name, c_ref in pairs(m_active) do
local key_type = '[' .. (c_ref.mode or '?') .. ']'
renderer_text(x + 5, y + height_offset, 255, 255, 255, m_alpha*c_ref.alpha*255, '', 0, c_name)
renderer_text(x + w - renderer_measure_text(nil, key_type) - 5, y + height_offset, 255, 255, 255, m_alpha*c_ref.alpha*255, '', 0, key_type)
height_offset = height_offset + 15
end
dragging:drag(w, (3 + (15 * item_count(m_active))) * 2)
if master_switch and item_count(m_active) > 0 and latest_item then
m_alpha = m_alpha + frames
if m_alpha > 1 then
m_alpha = 1
end
else
m_alpha = m_alpha - frames
if m_alpha < 0 then
m_alpha = 0
end
end
if is_menu_open then
m_active['Menu toggled'] = nil
end
end
m_hotkeys_create = create_custom_item
client_set_event_callback('paint', g_paint_handler)
end,
antiaim = function()
local note = notes 'a_wbantiaim'
local gram_fyaw = gram_create(0, 2)
local teleport_data = gram_create(0, 3)
local ind_phase, ind_num, ind_time = 0, 0, 0
local last_sent, current_choke = 0, 0
local teleport, last_origin = 0
local breaking_lc = 0
local g_setup_command = function(c)
local me = entity_get_local_player()
if c.chokedcommands == 0 then
local m_origin = vector(entity_get_origin(me))
if last_origin ~= nil then
teleport = (m_origin-last_origin):length2dsqr()
gram_update(teleport_data, teleport, true)
end
gram_update(gram_fyaw, math_abs(anti_aim.get_desync(1)), true)
last_sent = current_choke
last_origin = m_origin
end
breaking_lc =
get_average(teleport_data) > 3200 and 1 or
(anti_aim.get_tickbase_shifting() > 0 and 2 or 0)
current_choke = c.chokedcommands
end
local g_paint_handler = function()
note.set_state(false)
local me = entity_get_local_player()
if me == nil or not entity_is_alive(me) then
return
end
local state = ui_get(ms_antiaim)
local _, _, _, a = get_bar_color()
note.set_state(state)
note.get(function(id)
local ms_clr = { ui_get(ms_color) }
local addr, nval = '', false
local r, g, b = 150, 150, 150
local fr = globals_frametime() * 3.75
local min_offset = 1200+math_max(0, get_average(teleport_data)-3800)
local teleport_mt = math_abs(math_min(teleport-3800, min_offset) / min_offset * 100)
if ind_num ~= teleport_mt and ind_time < globals_realtime() then
ind_time = globals_realtime() + 0.005
ind_num = ind_num + (ind_num > teleport_mt and -1 or 1)
end
ind_phase = ind_phase + (breaking_lc == 1 and fr or -fr)
ind_phase = ind_phase > 1 and 1 or ind_phase
ind_phase = ind_phase < 0 and 0 or ind_phase
if breaking_lc == 2 then
addr, ind_phase, ind_num = ' | SHIFTING', 0, 0
r, g, b = 228, 126, 10
elseif ind_phase > 0.1 then
addr = ' | dst: \x20\x20\x20\x20\x20\x20\x20\x20\x20'
end
local text = ('FL: %s%s'):format(
(function()
if tonumber(last_sent) < 10 then
return '\x20\x20' .. last_sent
end
return last_sent
end)(),
addr)
local h, w = 17, renderer_measure_text(nil, text) + 8
local x, y = client_screen_size(), 10 + (25*id)
x = x - w - 10
renderer_gradient(x, y + h, w/2, 1, 0, 0, 0, 25, r, g, b, 255, true)
renderer_gradient(x + w/2, y + h, w - w/2, 1, r, g, b, 255, 0, 0, 0, 25, true)
renderer_rectangle(x, y, w, h, 17, 17, 17, a)
renderer_text(x+4, y + 2, 255, 255, 255, 255, '', 0, text)
if ind_phase > 0 then
renderer_gradient(
x + w - renderer_measure_text(nil, ' | dst: ') + 2,
y + 6, math_min(100, ind_num) / 100 * 24, 5,
ms_clr[1], ms_clr[2], ms_clr[3], ind_phase*220,
ms_clr[1], ms_clr[2], ms_clr[3], ind_phase * 25,
true
)
end
-- FAKE INDICATION
local lower_body = anti_aim.get_balance_adjust()
local r, g, b = get_color(math_abs(anti_aim.get_desync()), 30)
local timer = (lower_body.next_update - globals_curtime()) / 1.1 * 1
local add_text = (lower_body.updating and timer >= 0) and '\x20\x20\x20\x20\x20' or ''
local text = ('%sFAKE (%.1f°)'):format(add_text, get_average(gram_fyaw))
local h, w = 18, renderer_measure_text(nil, text) + 8
-- INDICATIN GRADIENT
local dec = { r - (r/100 * 50), g - (g/100 * 50), b - (b/100 * 50) }
renderer_gradient(x - w - 6, y, 2, h / 2, dec[1], dec[2], dec[3], 0, r, g, b, 255, false)
renderer_gradient(x - w - 6, y + h/2, 2, h / 2, r, g, b, 255, dec[1], dec[2], dec[3], 0, false)
-- BACKGROUND GRADIENT
renderer_gradient(x - w - 4, y, w / 2, h, 17, 17, 17, 25, 17, 17, 17, a, true)
renderer_gradient(x - w - 4 + w / 2, y, w / 2, h, 17, 17, 17, a, 17, 17, 17, 25, true)
renderer_text(x - w, y + 2, 255, 255, 255, 255, '', 0, text)
if lower_body.updating and timer >= 0 then
renderer_circle_outline(x - w + 6, y + 8.5, 89, 119, 239, 255, 5, 0, timer, 2)
end
end)
end
client_set_event_callback('setup_command', g_setup_command)
client_set_event_callback('paint_ui', g_paint_handler)
end,
ilstate = function()
local note = notes 'a_winput'
local graphics = graphs()
local formatting = (function(avg)
if avg < 1 then return ('%.2f'):format(avg) end
if avg < 10 then return ('%.1f'):format(avg) end
return ('%d'):format(avg)
end)
local jmp_ecx = client_find_signature('engine.dll', '\xFF\xE1')
local fnGetModuleHandle = ffi.cast('uint32_t(__fastcall*)(unsigned int, unsigned int, const char*)', jmp_ecx)
local fnGetProcAddress = ffi.cast('uint32_t(__fastcall*)(unsigned int, unsigned int, uint32_t, const char*)', jmp_ecx)
local pGetProcAddress = ffi.cast('uint32_t**', ffi.cast('uint32_t', client_find_signature('engine.dll', '\xFF\x15\xCC\xCC\xCC\xCC\xA3\xCC\xCC\xCC\xCC\xEB\x05')) + 2)[0][0]
local pGetModuleHandle = ffi.cast('uint32_t**', ffi.cast('uint32_t', client_find_signature('engine.dll', '\xFF\x15\xCC\xCC\xCC\xCC\x85\xC0\x74\x0B')) + 2)[0][0]
local BindExports = function(sModuleName, sFunctionName, sTypeOf) local ctype = ffi.typeof(sTypeOf) return function(...) return ffi.cast(ctype, jmp_ecx)(fnGetProcAddress(pGetProcAddress, 0, fnGetModuleHandle(pGetModuleHandle, 0, sModuleName), sFunctionName), 0, ...) end end
local fnEnumDisplaySettingsA = BindExports("user32.dll", "EnumDisplaySettingsA", "int(__fastcall*)(unsigned int, unsigned int, unsigned int, unsigned long, void*)");
local pLpDevMode = ffi.new("struct { char pad_0[120]; unsigned long dmDisplayFrequency; char pad_2[32]; }[1]")
local gram_create = function(value, count) local gram = { }; for i=1, count do gram[i] = value; end return gram; end
local gram_update = function(tab, value, forced) local new_tab = tab; if forced or new_tab[#new_tab] ~= value then table_insert(new_tab, value); table_remove(new_tab, 1); end; tab = new_tab; end
local get_average = function(tab) local elements, sum = 0, 0; for k, v in pairs(tab) do sum = sum + v; elements = elements + 1; end return sum / elements; end