-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWraith beta.lua
More file actions
3127 lines (2969 loc) · 163 KB
/
Copy pathWraith beta.lua
File metadata and controls
3127 lines (2969 loc) · 163 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
-- Wraith Beta - improved readability
-- Libraries
local ffi = require 'ffi'
local bit = require 'bit'
local vector = require "vector"
local antiaim_funcs = require "gamesense/antiaim_funcs" or error "https://gamesense.pub/forums/viewtopic.php?id=29665"
local surface = require "gamesense/surface"
local base64 = require "gamesense/base64" or error("Base64 library required")
local clipboard = require "gamesense/clipboard" or error("Clipboard library required")
-- Global aliases
local require_fn, pcall_fn, ipairs_fn, pairs_fn, unpack_fn = require, pcall, ipairs, pairs, unpack
local tonumber_fn, tostring_fn, toticks_fn, totime_fn = tonumber, tostring, toticks, totime
-- FFI
local ffi_ns = {
new = ffi.new, typeof = ffi.typeof, cast = ffi.cast,
cdef = ffi.cdef, sizeof = ffi.sizeof, string = ffi.string
}
-- Panorama
local panorama_ns = {
loadstring = panorama.loadstring,
open = panorama.open
}
-- Plist
local plist_ns = {
get = plist.get,
set = plist.set
}
-- Config
local config_ns = {
export = config.export,
import = config.import,
load = config.load
}
-- Database
local database_ns = {
flush = database.flush,
read = database.read,
write = database.write
}
-- Bit operations
local bit_ns = {
arshift = bit.arshift, band = bit.band, bnot = bit.bnot,
bor = bit.bor, bswap = bit.bswap, bxor = bit.bxor,
lshift = bit.lshift, rol = bit.rol, ror = bit.ror,
rshift = bit.rshift, tobit = bit.tobit, tohex = bit.tohex
}
-- String
local string_ns = {
byte = string.byte, char = string.char, find = string.find,
format = string.format, gmatch = string.gmatch, gsub = string.gsub,
len = string.len, lower = string.lower, match = string.match,
rep = string.rep, reverse = string.reverse, sub = string.sub,
upper = string.upper
}
-- Math
local math_ns = {
abs = math.abs, acos = math.acos, asin = math.asin, atan = math.atan,
atan2 = math.atan2, ceil = math.ceil, cos = math.cos, cosh = math.cosh,
deg = math.deg, exp = math.exp, floor = math.floor, fmod = math.fmod,
frexp = math.frexp, ldexp = math.ldexp, log = math.log, log10 = math.log10,
max = math.max, min = math.min, modf = math.modf, pow = math.pow,
rad = math.rad, random = math.random, randomseed = math.randomseed,
sin = math.sin, sinh = math.sinh, sqrt = math.sqrt, tan = math.tan,
tanh = math.tanh, pi = math.pi
}
-- UI
local ui_ns = {
get = ui.get, is_menu_open = ui.is_menu_open, menu_size = ui.menu_size,
menu_position = ui.menu_position, mouse_position = ui.mouse_position,
name = ui.name, new_button = ui.new_button, new_checkbox = ui.new_checkbox,
new_color_picker = ui.new_color_picker, new_combobox = ui.new_combobox,
new_hotkey = ui.new_hotkey, new_label = ui.new_label, new_listbox = ui.new_listbox,
new_multiselect = ui.new_multiselect, new_slider = ui.new_slider,
new_string = ui.new_string, new_textbox = ui.new_textbox,
reference = ui.reference, set = ui.set, set_callback = ui.set_callback,
set_visible = ui.set_visible, update = ui.update
}
-- Renderer
local renderer_ns = {
blur = renderer.blur, circle = renderer.circle,
circle_outline = renderer.circle_outline, gradient = renderer.gradient,
indicator = renderer.indicator, line = renderer.line,
load_jpg = renderer.load_jpg, load_png = renderer.load_png,
load_rgba = renderer.load_rgba, load_svg = renderer.load_svg,
measure_text = renderer.measure_text, rectangle = renderer.rectangle,
text = renderer.text, texture = renderer.texture,
triangle = renderer.triangle, world_to_screen = renderer.world_to_screen
}
-- Globals
local globals_ns = {
absoluteframetime = globals.absoluteframetime,
chokedcommands = globals.chokedcommands,
commandack = globals.commandack,
curtime = globals.curtime,
framecount = globals.framecount,
frametime = globals.frametime,
lastoutgoingcommand = globals.lastoutgoingcommand,
mapname = globals.mapname,
maxplayers = globals.maxplayers,
oldcommandack = globals.oldcommandack,
realtime = globals.realtime,
tickcount = globals.tickcount,
tickinterval = globals.tickinterval
}
-- Entity
local entity_ns = {
get_all = entity.get_all,
get_bounding_box = entity.get_bounding_box,
get_classname = entity.get_classname,
get_esp_data = entity.get_esp_data,
get_game_rules = entity.get_game_rules,
get_local_player = entity.get_local_player,
get_origin = entity.get_origin,
get_player_name = entity.get_player_name,
get_player_resource = entity.get_player_resource,
get_player_weapon = entity.get_player_weapon,
get_players = entity.get_players,
get_prop = entity.get_prop,
get_steam64 = entity.get_steam64,
hitbox_position = entity.hitbox_position,
is_alive = entity.is_alive,
is_dormant = entity.is_dormant,
is_enemy = entity.is_enemy,
new_prop = entity.new_prop,
set_prop = entity.set_prop
}
-- Client
local client_ns = {
camera_angles = _G.client.camera_angles,
camera_position = _G.client.camera_position,
color_log = _G.client.color_log,
create_interface = _G.client.create_interface,
current_threat = _G.client.current_threat,
delay_call = _G.client.delay_call,
draw_debug_text = _G.client.draw_debug_text,
draw_hitboxes = _G.client.draw_hitboxes,
error_log = _G.client.error_log,
exec = _G.client.exec,
eye_position = _G.client.eye_position,
find_signature = _G.client.find_signature,
fire_event = _G.client.fire_event,
get_cvar = _G.client.get_cvar,
get_model_name = _G.client.get_model_name,
key_state = _G.client.key_state,
latency = _G.client.latency,
log = _G.client.log,
random_float = _G.client.random_float,
random_int = _G.client.random_int,
real_latency = _G.client.real_latency,
register_esp_flag = _G.client.register_esp_flag,
reload_active_scripts = _G.client.reload_active_scripts,
request_full_update = _G.client.request_full_update,
scale_damage = _G.client.scale_damage,
screen_size = _G.client.screen_size,
set_clan_tag = _G.client.set_clan_tag,
set_event_callback = _G.client.set_event_callback,
system_time = _G.client.system_time,
timestamp = _G.client.timestamp,
trace_bullet = _G.client.trace_bullet,
trace_line = _G.client.trace_line,
unix_time = _G.client.unix_time,
unset_event_callback = _G.client.unset_event_callback,
update_player_list = _G.client.update_player_list,
userid_to_entindex = _G.client.userid_to_entindex,
visible = _G.client.visible
}
-- Entity list interface
local void_ptr_type = ffi_ns.typeof('void***')
local entity_list_interface = client_ns.create_interface('client.dll', 'VClientEntityList003') or error('VClientEntityList003 wasnt found', 2)
local raw_entity_list = ffi_ns.cast(void_ptr_type, entity_list_interface) or error('rawientitylist is nil', 2)
local get_client_entity = ffi_ns.cast('void*(__thiscall*)(void*, int)', raw_entity_list[0][3]) or error('get_client_entity is nil', 2)
local get_client_networkable = ffi_ns.cast('void*(__thiscall*)(void*, int)', raw_entity_list[0][0]) or error('get_client_networkable_t is nil', 2)
-- FFI structures
ffi_ns.cdef([[
struct animation_layer_t {
char pad_0000[20];
uint32_t m_nOrder;
uint32_t m_nSequence;
float m_flPrevCycle;
float m_flWeight;
float m_flWeightDeltaRate;
float m_flPlaybackRate;
float m_flCycle;
void *m_pOwner;
char pad_0038[4];
};
struct animstate_t1 {
char pad[3];
char m_bForceWeaponUpdate;
char pad1[91];
void* m_pBaseEntity;
void* m_pActiveWeapon;
void* m_pLastActiveWeapon;
float m_flLastClientSideAnimationUpdateTime;
int m_iLastClientSideAnimationUpdateFramecount;
float m_flAnimUpdateDelta;
float m_flEyeYaw;
float m_flPitch;
float m_flGoalFeetYaw;
float m_flCurrentFeetYaw;
float m_flCurrentTorsoYaw;
float m_flUnknownVelocityLean;
float m_flLeanAmount;
char pad2[4];
float m_flFeetCycle;
float m_flFeetYawRate;
char pad3[4];
float m_fDuckAmount;
float m_fLandingDuckAdditiveSomething;
char pad4[4];
float m_vOriginX;
float m_vOriginY;
float m_vOriginZ;
float m_vLastOriginX;
float m_vLastOriginY;
float m_vLastOriginZ;
float m_vVelocityX;
float m_vVelocityY;
char pad5[4];
float m_flUnknownFloat1;
char pad6[8];
float m_flUnknownFloat2;
float m_flUnknownFloat3;
float m_flUnknown;
float m_flSpeed2D;
float m_flUpVelocity;
float m_flSpeedNormalized;
float m_flFeetSpeedForwardsOrSideWays;
float m_flFeetSpeedUnknownForwardOrSideways;
float m_flTimeSinceStartedMoving;
float m_flTimeSinceStoppedMoving;
bool m_bOnGround;
bool m_bInHitGroundAnimation;
char m_pad[2];
float m_flJumpToFall;
float m_flTimeSinceInAir;
float m_flLastOriginZ;
float m_flHeadHeightOrOffsetFromHittingGroundAnimation;
float m_flStopToFullRunningFraction;
char pad7[4];
float m_flMagicFraction;
char pad8[60];
float m_flWorldForce;
char pad9[462];
float m_flMaxYaw;
};
]])
database_ns.write("current_clip_board_to_save", "")
-- Filesystem
local filesystem_funcs = {}
local filesystem_signatures = {
{'remove_search_path', '\x55\x8B\xEC\x81\xEC\xCC\xCC\xCC\xCC\x8B\x55\x08\x53\x8B\xD9', 'void(__thiscall*)(void*, const char*, const char*)'},
{'remove_file', '\x55\x8B\xEC\x81\xEC\xCC\xCC\xCC\xCC\x8D\x85\xCC\xCC\xCC\xCC\x56\x50\x8D\x45\x0C', 'void(__thiscall*)(void*, const char*, const char*)'},
{'find_next', '\x55\x8B\xEC\x83\xEC\x0C\x53\x8B\xD9\x8B\x0D\xCC\xCC\xCC\xCC', 'const char*(__thiscall*)(void*, int)'},
{'find_is_directory', '\x55\x8B\xEC\x0F\xB7\x45\x08', 'bool(__thiscall*)(void*, int)'},
{'find_close', '\x55\x8B\xEC\x53\x8B\x5D\x08\x85', 'void(__thiscall*)(void*, int)'},
{'find_first', '\x55\x8B\xEC\x6A\x00\xFF\x75\x10\xFF\x75\x0C\xFF\x75\x08\xE8\xCC\xCC\xCC\xCC\x5D', 'const char*(__thiscall*)(void*, const char*, const char*, int*)'},
{'get_current_directory', '\x55\x8B\xEC\x56\x8B\x75\x08\x56\xFF\x75\x0C', 'bool(__thiscall*)(void*, char*, int)'}
}
local ffi_lib = require('ffi')
local function create_interface_function(dll_name, interface_name, signature, typedef)
local interface = client_ns.create_interface(dll_name, interface_name) or error("invalid interface", 2)
local sig_address = client_ns.find_signature(dll_name, signature) or error("invalid signature", 2)
local success, type_result = pcall_fn(ffi_lib.typeof, typedef)
if not success then
error(type_result, 2)
end
local func_ptr = ffi_lib.cast(type_result, sig_address) or error("invalid typecast", 2)
return function(...)
return func_ptr(interface, ...)
end
end
for i = 1, #filesystem_signatures do
local sig_data = filesystem_signatures[i]
filesystem_funcs[sig_data[1]] = create_interface_function('filesystem_stdio.dll', 'VFileSystem017', sig_data[2], sig_data[3])
end
local add_search_path = vtable_bind("filesystem_stdio.dll", "VFileSystem017", 11, "void(__thiscall*)(void*, const char*, const char*, int)")
local CONFIG_FOLDER = "WRAITH_CONFIGS"
local current_dir_buffer = ffi_ns.typeof("char[128]")()
filesystem_funcs.get_current_directory(current_dir_buffer, ffi_ns.sizeof(current_dir_buffer))
local current_directory = string_ns.format('%s', ffi_ns.string(current_dir_buffer))
add_search_path(current_directory, CONFIG_FOLDER, 0)
local function get_config_files()
local files, handle = {}, ffi_ns.typeof("int[1]")()
local first_file = filesystem_funcs.find_first("*", CONFIG_FOLDER, handle)
while first_file ~= nil do
local filename = ffi_ns.string(first_file)
if not filesystem_funcs.find_is_directory(handle[0]) and filename:find('2124089493w.cfg') then
files[#files + 1] = filename
end
first_file = filesystem_funcs.find_next(handle[0])
end
filesystem_funcs.find_close(handle[0])
return files
end
function update_cfg()
local config_files = get_config_files()
local config_names = {}
for i = 1, #config_files do
config_names[i] = config_files[i]:gsub('2124089493w.cfg', '')
end
return config_names
end
local is_command_line_param = vtable_bind("vgui2.dll", "VGUI_System010", 22, "bool(__thiscall*)(void*, const char*)")
-- User command structures
local button_flags = {
attack = bit_ns.lshift(1, 0),
use = bit_ns.lshift(1, 5)
}
local angle_struct = ffi_ns.typeof("struct { float pitch; float yaw; float roll; }")
local vector_struct = ffi_ns.typeof("struct { float x; float y; float z; }")
local usercmd_struct = ffi_ns.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;
}
]], angle_struct, vector_struct, angle_struct, vector_struct)
local usercmd_vftable = ffi_ns.typeof("$* (__thiscall*)(uintptr_t ecx, int nSlot, int sequence_number)", usercmd_struct)
local input_vtable = ffi_ns.typeof([[
struct {
uintptr_t padding[8];
$ GetUserCmd;
}
]], usercmd_vftable)
local input_ptr = ffi_ns.typeof([[
struct {
$* vfptr;
}*
]], input_vtable)
local input_interface = ffi_ns.cast(input_ptr, ffi_ns.cast("uintptr_t**", tonumber_fn(ffi_ns.cast("uintptr_t", client_ns.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."))) + 1)[0])
-- State
local wraith_state = {
reset_once = false,
hitgroup_names = {[0] = "body", "head", "chest", "stomach", "left arm", "right arm", "left leg", "right leg", "neck", "?", "gear"},
fire_total_hits = 0,
post_total_hits = 0,
current_condition = "",
mode = "back",
is_defensive_running = false,
banana = false,
old_tick_count = 0,
yaw_increment_spin = 0,
tickbase_max = nil,
tickbase_diff = nil,
current_cmd = nil,
bomb_defused = false,
bomb_exploded = false,
pulse = 240,
started = 10,
smooth_wraith = 0,
smooth_dt = 0,
smooth_os = 0,
smooth_pc = 0,
smooth_bo = 0,
current_desync = 0,
fake_fakelag = 0,
cur = 0,
is_defusing = false,
desync_rect_dist = 0,
dt_os_text_anim = 0,
current_cond_text_anim = 0,
smooth_wraith_recode = 0,
smooth_dt_2 = 0,
smooth_stance = 0,
dt_vertical_dist = 0,
jumping = false,
on_ground = false,
rage_fired = false,
last_jump_ducked = false,
landing = false,
waiting_scan_text = 0,
hittable = false,
defensive_risk = 0,
smooth_defensive_bar = 0,
smooth_left_arrow = 0,
smooth_right_arrow = 0,
smooth_up_arrow = 0,
smooth_arrow_alpha = 0
}
local player_data = {cur = {}, prev = {}, pre_prev = {}, pre_pre_prev = {}}
local anti_aim_data = {}
local player_aa_settings = {}
for player_idx = 1, 64 do
player_aa_settings[player_idx] = {stand = {}, stand_type = {}, run = {}, run_type = {}, air = {}, air_type = {}, duck = {}, duck_type = {}}
end
local script_info = {user = "Femboy", build = "beta"}
-- UI
local main_checkbox = ui_ns.new_checkbox("AA", "Anti-aimbot angles", "wraith - " .. string_ns.lower(script_info["user"]))
local selected_aa_type = nil
local selected_condition = nil
local current_aa_settings = nil
local current_wraith_settings = nil
local ui_elements = {}
local gamesense_aa_settings = {}
local wraith_aa_settings = {}
local tab_names = {"anti-aim", "anti-aim 2", "visuals", "misc", "config", "debug"}
local condition_names = {"global", "standing", "moving", "slow motion", "in air", "in air duck", "in duck", "in duck moving", "in fake duck", "fakelag", "manual", "freestanding", "backstab", "height", "high distance", "legit"}
local icons = {lua = "", star = "", lock = "", arrows = "", pizza = "", ["up arrow"] = "", cpu = "", smilie = "", heart = ""}
local menu_state = {
le_icon = "a",
tabs_names = {"", "⑵", "", "", "", "F"},
tab = {},
selected_tab = 0,
selected_color = {{20, 20, 20, 255}, {210, 210, 210, 255}},
is_open = true,
menu_alpha = 255,
is_hovered = false,
height = 68,
dpi_scaling_y = {{84, 149}, {100, 181}, {116, 213}, {132, 245}, {148, 277}},
selected_gs_tab = false,
mouse_press = false,
old_mpos = {0, 0}
}
local menu_key_pressed = false
local menu_initialized = false
local dpi_heights = {["100%"] = 68, ["125%"] = 75, ["150%"] = 85, ["175%"] = 95, ["200%"] = 105}
ui_elements = {
tab = ui_ns.new_combobox("AA", "Anti-aimbot angles", "\n", tab_names),
["anti-aim"] = {
[0] = ui_ns.new_combobox("AA", "Anti-aimbot angles", "type", "gamesense", "wraith (dont use)"),
[1] = ui_ns.new_combobox("AA", "Anti-aimbot angles", "condition", condition_names)
},
["anti-aim 2"] = {
[0] = ui_ns.new_multiselect("AA", "Anti-aimbot angles", "add features", "other anti-aim binds", "manual anti-aim"),
[1] = ui_ns.new_hotkey("AA", "Anti-aimbot angles", "edge-yaw"),
[2] = ui_ns.new_hotkey("AA", "Anti-aimbot angles", "freestanding"),
[3] = ui_ns.new_checkbox("AA", "Anti-aimbot angles", "manual anti-aim"),
[4] = ui_ns.new_hotkey("AA", "Anti-aimbot angles", "left"),
[8] = ui_ns.new_slider("AA", "Anti-aimbot angles", "\n left angle", 0, 145, 90, true, "°", 1, {}),
[5] = ui_ns.new_hotkey("AA", "Anti-aimbot angles", "right"),
[9] = ui_ns.new_slider("AA", "Anti-aimbot angles", "\n right angle", 0, 145, 90, true, "°", 1, {}),
[6] = ui_ns.new_hotkey("AA", "Anti-aimbot angles", "forward"),
[7] = ui_ns.new_hotkey("AA", "Anti-aimbot angles", "reset")
},
["visuals"] = {
[0] = ui_ns.new_combobox("AA", "Anti-aimbot angles", "indicators", "off", "minimal (og)", "anti urine", "recode alpha"),
[1] = ui_ns.new_color_picker("AA", "Anti-aimbot angles", "anti-aim indicators", 200, 200, 255, 255),
[6] = ui_ns.new_multiselect("AA", "Anti-aimbot angles", "indicator extras", "animations on scope", "lowercase", "min damage", "desync", "defensive"),
[3] = ui_ns.new_combobox("AA", "Anti-aimbot angles", "indicators size", "small", "thin", "bold", "blind"),
[2] = ui_ns.new_checkbox("AA", "Anti-aimbot angles", "watermark"),
[4] = ui_ns.new_combobox("AA", "Anti-aimbot angles", "size", "small", "thin", "bold", "blind"),
[7] = ui_ns.new_checkbox("AA", "Anti-aimbot angles", "notifications size"),
[5] = ui_ns.new_combobox("AA", "Anti-aimbot angles", "\n nigga", "small", "thin", "bold", "blind"),
[8] = ui_ns.new_combobox("AA", "Anti-aimbot angles", "extended teleport prediction", "off", "box", "circle"),
[9] = ui_ns.new_checkbox("AA", "Anti-aimbot angles", "manual anti-aim"),
[10] = ui_ns.new_color_picker("AA", "Anti-aimbot angles", "manual anti-aim", 200, 200, 200, 200)
},
["misc"] = {
[6] = ui_ns.new_hotkey("AA", "Anti-aimbot angles", "extended teleport"),
[7] = ui_ns.new_hotkey("AA", "Anti-aimbot angles", "extended teleport on hit"),
[8] = ui_ns.new_combobox("AA", "Anti-aimbot angles", "extended teleport hit risk", "high", "medium", "low", "safest"),
[1] = ui_ns.new_multiselect("AA", "Anti-aimbot angles", "custom animations", "pitch on land", "fallen legs", "moonwalk", "air walk", "blind", "fake walk", "earthquake", "slide", "fake duck", "smoothing"),
[2] = ui_ns.new_multiselect("AA", "Anti-aimbot angles", "notify", "fire", "damage", "miss", "hurt", "hurt self", "config changes"),
[3] = ui_ns.new_multiselect("AA", "Anti-aimbot angles", "type \n nots", "default", "center", "console"),
[4] = ui_ns.new_checkbox("AA", "Anti-aimbot angles", "trashtalk"),
[5] = ui_ns.new_checkbox("AA", "Anti-aimbot angles", "bypass anti trashtalk")
},
["config"] = {
[0] = ui_ns.new_label("AA", "Anti-aimbot angles", "config"),
[1] = ui_ns.new_listbox("AA", "Anti-aimbot angles", "config_board", ""),
[2] = ui_ns.new_textbox("AA", "Anti-aimbot angles", "config names"),
[8] = 0, [3] = 0, [4] = 0, [5] = 0, [6] = 0, [7] = 0
},
["debug"] = {
[0] = ui_ns.new_checkbox("AA", "Anti-aimbot angles", "alternative ui"),
[4] = ui_ns.new_combobox("AA", "Anti-aimbot angles", "debug tab icon", "lua", "star", "lock", "arrows", "pizza", "up arrow", "cpu", "smilie", "heart"),
[2] = ui_ns.new_checkbox("AA", "Anti-aimbot angles", "fps optimizations"),
[3] = ui_ns.new_multiselect("AA", "Anti-aimbot angles", "disable\n optiz", "3d sky", "fog", "shadows", "blood", "decals", "bloom", "other"),
[1] = ui_ns.new_combobox("AA", "Anti-aimbot angles", "anti-aim correction", "off", "desync"),
[5] = ui_ns.new_checkbox("AA", "Anti-aimbot angles", "on shot only (ragebot)"),
[6] = ui_ns.new_hotkey("AA", "Anti-aimbot angles", "\n on shot bind", true)
}
}
ui_ns.new_label("Players", "Adjustments", "wraith anti-aim stealer")
steal_aa_toggle = ui_ns.new_checkbox("Players", "Adjustments", "scan anti-aim")
steal_aa_ignore = ui_ns.new_checkbox("Players", "Adjustments", "ignore missing stances")
for condition_idx, condition_name in pairs_fn(condition_names) do
gamesense_aa_settings[condition_idx] = {
[0] = ui_ns.new_checkbox("AA", "Anti-aimbot angles", string_ns.format("[%s - gamesense]", condition_name)),
[1] = ui_ns.new_combobox("AA", "Anti-aimbot angles", string_ns.format("pitch \n %s", condition_name), {"off", "default", "up", "down", "minimal", "random", "custom"}),
[2] = ui_ns.new_slider("AA", "Anti-aimbot angles", string_ns.format("\n%s pitch slider", condition_name), -89, 89, 0, true, "°", 1, {}),
[3] = ui_ns.new_combobox("AA", "Anti-aimbot angles", string_ns.format("yaw base \n%s", condition_name), {"local view", "at targets"}),
[4] = ui_ns.new_combobox("AA", "Anti-aimbot angles", string_ns.format("yaw\n %s", condition_name), {"off", "180", "spin", "static", "180 Z", "crosshair"}),
[5] = ui_ns.new_slider("AA", "Anti-aimbot angles", string_ns.format("\n%s yaw add", condition_name), -180, 180, 0, true, "°", 1, {}),
[6] = ui_ns.new_combobox("AA", "Anti-aimbot angles", string_ns.format("yaw jitter\n%s", condition_name), {"off", "offset", "center", "random", "skitter", "slow"}),
[7] = ui_ns.new_slider("AA", "Anti-aimbot angles", string_ns.format("\n %s yaw jitter", condition_name), -180, 180, 0, true, "°", 1, {}),
[8] = ui_ns.new_combobox("AA", "Anti-aimbot angles", string_ns.format("body yaw\n %s", condition_name), {"off", "opposite", "jitter", "static"}),
[9] = ui_ns.new_slider("AA", "Anti-aimbot angles", string_ns.format("\n%s body yaw static side", condition_name), -180, 180, 0, true, "°", 1, {}),
[10] = ui_ns.new_checkbox("AA", "Anti-aimbot angles", string_ns.format("freestanding body yaw\n %s", condition_name)),
[11] = ui_ns.new_checkbox("AA", "Anti-aimbot angles", string_ns.format("edge yaw\n %s", condition_name)),
[12] = ui_ns.new_checkbox("AA", "Anti-aimbot angles", string_ns.format("freestanding\n %s", condition_name)),
[13] = ui_ns.new_slider("AA", "Anti-aimbot angles", string_ns.format("roll\n %s", condition_name), -45, 45, 0, true, "°", 1, {}),
[14] = ui_ns.new_checkbox("AA", "Anti-aimbot angles", string_ns.format("force defensive\n %s", condition_name)),
[15] = ui_ns.new_combobox("AA", "Anti-aimbot angles", string_ns.format("defensive pitch\n %s", condition_name), "off", "up", "random", "minimal", "zero"),
[16] = ui_ns.new_combobox("AA", "Anti-aimbot angles", string_ns.format("defensive yaw\n %s", condition_name), "off", "forward", "spin", "jitter", "opposite")
}
wraith_aa_settings[condition_idx] = {
[0] = ui_ns.new_checkbox("AA", "Anti-aimbot angles", string_ns.format("[%s - wraith] (incomplete)", condition_name)),
[1] = ui_ns.new_combobox("AA", "Anti-aimbot angles", string_ns.format("pitch\n %s w", condition_name), {"off", "emotion (89)", "up (-89)", "fake up (180)", "fake down (-180)", "fake zero (1080)", "fake down (-540)"}),
[2] = ui_ns.new_combobox("AA", "Anti-aimbot angles", string_ns.format("yaw jitter\n %s w", condition_name), {"off", "offset", "center", "random", "3 way", "5 way"}),
[3] = ui_ns.new_slider("AA", "Anti-aimbot angles", string_ns.format("\n %s yaw jitter w", condition_name), -180, 180, 0, true, "°", 1, {}),
[4] = ui_ns.new_combobox("AA", "Anti-aimbot angles", string_ns.format("body yaw\n %s w", condition_name), {"off", "opposite", "jitter", "static"})
}
end
-- Utility functions
local function table_to_string(tbl)
local result = "\n{"
for key, value in pairs_fn(tbl) do
if type(key) == "string" then
result = result .. "[\"" .. key .. "\"]" .. "="
end
if type(value) == "table" then
result = result .. table_to_string(value)
elseif type(value) == "boolean" then
result = result .. tostring_fn(value)
else
result = result .. "\"" .. value .. "\""
end
result = result .. ",\n"
end
if result ~= "" then
result = result:sub(1, result:len() - 1)
end
return result .. "}\n"
end
local function split_string(str, delimiter)
local result = {}
for match in string_ns.gmatch(str, "([^" .. delimiter .. "]+)") do
result[#result + 1] = string_ns.gsub(match, "\n", "")
end
return result
end
local function parse_value(value)
if value == "true" or value == "false" then
return value == "true"
else
return value
end
end
local function round(num)
return math_ns.floor(num + 0.5)
end
local function clamp(value, min_val, max_val)
return math_ns.max(math_ns.min(value, max_val), min_val)
end
local function rgba_to_hex(r, g, b, a)
return string_ns.format('%02x%02x%02x%02x', r, g, b, a)
end
local function count_occurrences(tbl)
local counts = {}
for _, value in ipairs_fn(tbl) do
counts[value] = (counts[value] or 0) + 1
end
return counts
end
local function get_most_common(counts)
local max_key = next(counts)
for key in pairs_fn(counts) do
if counts[max_key] < counts[key] then
max_key = key
end
end
return max_key
end
local function get_mode(tbl)
return get_most_common(count_occurrences(tbl))
end
-- Gamesense references
local gs_refs = {
rage = {
ref_doubletap = {ui_ns.reference("RAGE", "Aimbot", "Double tap")},
ref_safepoint = ui_ns.reference("RAGE", "Aimbot", "Force safe point"),
ref_baim = {ui_ns.reference("RAGE", "Aimbot", "Force body aim")},
ref_min_damage = {ui_ns.reference("RAGE", "Aimbot", "Minimum damage")},
ref_min_damage_override = {ui_ns.reference("RAGE", "Aimbot", "Minimum damage override")},
other = {ref_fakeduck = ui_ns.reference("RAGE", "Other", "Duck peek assist")}
},
anti_aim = {
anti_aimbot_angles = {
ref_aa_enabled = ui_ns.reference("AA", "Anti-aimbot angles", "Enabled"),
ref_pitch = {ui_ns.reference("AA", "Anti-aimbot angles", "Pitch")},
ref_yaw = {ui_ns.reference("AA", "Anti-aimbot angles", "Yaw")},
ref_yaw_base = ui_ns.reference("AA", "Anti-aimbot angles", "Yaw base"),
ref_body_yaw = {ui_ns.reference("AA", "Anti-aimbot angles", "Body yaw")},
ref_yaw_jitter = {ui_ns.reference("AA", "Anti-aimbot angles", "Yaw jitter")},
ref_freestand_body = ui_ns.reference("AA", "Anti-aimbot angles", "Freestanding body yaw"),
ref_edge_yaw = ui_ns.reference("AA", "Anti-aimbot angles", "Edge yaw"),
ref_freestand = {ui_ns.reference("AA", "Anti-aimbot angles", "Freestanding")},
ref_roll = ui_ns.reference("AA", "Anti-aimbot angles", "Roll")
},
fakelag = {},
other = {
ref_slowmotion = {ui_ns.reference("AA", "Other", "Slow motion")},
ref_onshotantiaim = {ui_ns.reference("AA", "Other", "On shot anti-aim")}
}
},
misc = {
settings = {
ref_dpiscale = ui_ns.reference("MISC", "Settings", "DPI scale"),
ref_menukey = ui_ns.reference("MISC", "Settings", "Menu key"),
ref_nadetoss = ui_ns.reference("MISC", "Settings", "Faster grenade toss")
},
movement = {ref_bhop = ui_ns.reference('MISC', 'Movement', 'Bunny hop')}
},
plist = {
players = ui_ns.reference("Players", "Players", "Player list"),
force_yaw = ui_ns.reference("Players", "Adjustments", "Force body yaw"),
force_yaw_value = ui_ns.reference("Players", "Adjustments", "Force body yaw value"),
force_body = ui_ns.reference("Players", "Adjustments", "Force body yaw"),
force_body_value = ui_ns.reference("Players", "Adjustments", "Force body yaw value"),
reset = ui_ns.reference("Players", "Players", "Reset all")
}
}
local function table_contains(tbl, value)
local found = false
for i = 1, #tbl do
if tbl[i] == value then
found = true
break
end
end
return found
end
local function lerp(start_val, end_val, t)
return start_val + (end_val - start_val) * t
end
local function normalize_angle(angle)
while angle > 180 do
angle = angle - 360
end
while angle < -180 do
angle = angle + 360
end
return angle
end
function calculate_angle(from_pos, to_pos)
local delta = to_pos - from_pos
local yaw = math_ns.atan(delta.y / delta.x)
yaw = normalize_angle(yaw * 180 / math_ns.pi)
if delta.x >= 0 then
yaw = normalize_angle(yaw + 180)
end
return yaw
end
local function is_scoped(player)
local scoped = entity_ns.get_prop(player, "m_bIsScoped")
if scoped == 1 then
return true
end
return false
end
local ignore_missing_stances = {}
local scan_aa_enabled = {}
ui_ns.set_callback(steal_aa_ignore, function()
if ui_ns.get(steal_aa_ignore) then
ignore_missing_stances[ui_ns.get(gs_refs.plist.players)] = true
else
if ignore_missing_stances[ui_ns.get(gs_refs.plist.players)] then
ignore_missing_stances[ui_ns.get(gs_refs.plist.players)] = nil
end
end
end)
ui_ns.set_callback(gs_refs.plist.players, function()
ui_ns.set(steal_aa_ignore, ignore_missing_stances[ui_ns.get(gs_refs.plist.players)] ~= nil)
end)
ui_ns.set_callback(gs_refs.plist.reset, function()
ignore_missing_stances = {}
ui_ns.set(steal_aa_ignore, false)
end)
ui_ns.set_callback(steal_aa_toggle, function()
if ui_ns.get(steal_aa_toggle) then
scan_aa_enabled[ui_ns.get(gs_refs.plist.players)] = true
else
if scan_aa_enabled[ui_ns.get(gs_refs.plist.players)] then
scan_aa_enabled[ui_ns.get(gs_refs.plist.players)] = nil
end
end
end)
ui_ns.set_callback(gs_refs.plist.players, function()
ui_ns.set(steal_aa_toggle, scan_aa_enabled[ui_ns.get(gs_refs.plist.players)] ~= nil)
end)
ui_ns.set_callback(gs_refs.plist.reset, function()
scan_aa_enabled = {}
ui_ns.set(steal_aa_toggle, false)
end)
local function reset_antiaim()
ui_ns.set(gs_refs.anti_aim.anti_aimbot_angles.ref_aa_enabled, false)
ui_ns.set(gs_refs.anti_aim.anti_aimbot_angles.ref_pitch[1], "Off")
ui_ns.set(gs_refs.anti_aim.anti_aimbot_angles.ref_pitch[2], 0)
ui_ns.set(gs_refs.anti_aim.anti_aimbot_angles.ref_yaw[1], "Off")
ui_ns.set(gs_refs.anti_aim.anti_aimbot_angles.ref_yaw[2], 0)
ui_ns.set(gs_refs.anti_aim.anti_aimbot_angles.ref_yaw_base, "Local view")
ui_ns.set(gs_refs.anti_aim.anti_aimbot_angles.ref_body_yaw[1], "Off")
ui_ns.set(gs_refs.anti_aim.anti_aimbot_angles.ref_body_yaw[2], 0)
ui_ns.set(gs_refs.anti_aim.anti_aimbot_angles.ref_yaw_jitter[1], "Off")
ui_ns.set(gs_refs.anti_aim.anti_aimbot_angles.ref_yaw_jitter[2], 0)
ui_ns.set(gs_refs.anti_aim.anti_aimbot_angles.ref_freestand_body, false)
ui_ns.set(gs_refs.anti_aim.anti_aimbot_angles.ref_edge_yaw, false)
ui_ns.set(gs_refs.anti_aim.anti_aimbot_angles.ref_freestand[1], false)
ui_ns.set(gs_refs.anti_aim.anti_aimbot_angles.ref_freestand[2], "Always on")
ui_ns.set(gs_refs.anti_aim.anti_aimbot_angles.ref_roll, 0)
end
local function set_aa_visibility(hide_aa)
for key, ref in pairs_fn(gs_refs.anti_aim.anti_aimbot_angles) do
if type(ref) ~= "table" then
ui_ns.set_visible(ref, not hide_aa)
if not hide_aa and ui_ns.get(gs_refs.anti_aim.anti_aimbot_angles.ref_body_yaw[1]) == "Off" then
ui_ns.set_visible(gs_refs.anti_aim.anti_aimbot_angles.ref_freestand_body, false)
end
else
for idx, sub_ref in ipairs_fn(ref) do
ui_ns.set_visible(sub_ref, not hide_aa)
if not hide_aa and ui_ns.get(gs_refs.anti_aim.anti_aimbot_angles.ref_body_yaw[1]) == "Opposite" then
ui_ns.set_visible(gs_refs.anti_aim.anti_aimbot_angles.ref_body_yaw[2], false)
end
if not hide_aa and ui_ns.get(ref[1]) == "Off" and key ~= "ref_pitch" then
ui_ns.set_visible(ref[2], false)
if ui_ns.get(gs_refs.anti_aim.anti_aimbot_angles.ref_yaw[1]) == "Off" then
ui_ns.set_visible(gs_refs.anti_aim.anti_aimbot_angles.ref_yaw_jitter[1], false)
end
end
if not hide_aa and ui_ns.get(gs_refs.anti_aim.anti_aimbot_angles.ref_pitch[1]) ~= "Custom" then
ui_ns.set_visible(gs_refs.anti_aim.anti_aimbot_angles.ref_pitch[2], false)
end
end
end
end
end
local screen_width, screen_height = client_ns.screen_size()
local watermark_pos = {
x = database_ns.read("x_82hdnujdsgfu") or screen_width - screen_width + 10,
y = database_ns.read("y_ajshdahjdjhn") or screen_height - screen_height + 550,
w = database_ns.read("w_akjdfsahsdff") or 100,
h = database_ns.read("h_pi2jpoaojkfs") or 100,
dragging = false
}
local function is_mouse_in_bounds(x, y, w, h)
local mouse_x, mouse_y = ui_ns.mouse_position()
return mouse_x >= x and mouse_x <= x + w and mouse_y >= y and mouse_y <= y + h
end
function watermark(local_player, font_size)
if not ui_ns.get(ui_elements["visuals"][2]) then
return
end
local font_flag = ""
local watermark_text = "WRAITH [" .. string_ns.upper(script_info["build"]) .. "]" .. " | " .. string_ns.upper(script_info["user"]) .. " | " .. math_ns.floor(client_ns.latency() * 1000) .. "MS"
if font_size == "small" then
font_flag = "-"
watermark_text = "WRAITH [" .. string_ns.upper(script_info["build"]) .. "]" .. " | " .. string_ns.upper(script_info["user"]) .. " | " .. math_ns.floor(client_ns.latency() * 1000) .. "MS"
elseif font_size == "thin" then
font_flag = ""
elseif font_size == "bold" then
font_flag = "b"
elseif font_size == "blind" then
font_flag = "+"
end
local scr_w, scr_h = client_ns.screen_size()
local mouse_pos = {ui_ns.mouse_position()}
local mouse_down = client_ns.key_state(0x01)
local text_size = {renderer_ns.measure_text(font_flag, watermark_text)}
if ui_ns.is_menu_open() then
if watermark_pos.dragging and not mouse_down then
watermark_pos.dragging = false
end
if watermark_pos.dragging and mouse_down then
watermark_pos.x = mouse_pos[1] - watermark_pos.drag_x
watermark_pos.y = mouse_pos[2] - watermark_pos.drag_y
end
if is_mouse_in_bounds(watermark_pos.x, watermark_pos.y, watermark_pos.w + text_size[1], watermark_pos.h + text_size[2]) and mouse_down then
watermark_pos.dragging = true
watermark_pos.drag_x = mouse_pos[1] - watermark_pos.x
watermark_pos.drag_y = mouse_pos[2] - watermark_pos.y
end
end
if watermark_pos.x + text_size[1] > scr_w then
watermark_pos.x = watermark_pos.x - 5
elseif watermark_pos.x + 20 < 0 then
watermark_pos.x = watermark_pos.x + 5
end
if watermark_pos.y + text_size[2] > scr_h then
watermark_pos.y = watermark_pos.y - 10
elseif watermark_pos.y + text_size[2] < 0 then
watermark_pos.y = watermark_pos.y + 10
end
local info_lines = {}
renderer_ns.gradient(watermark_pos.x, watermark_pos.y + text_size[2] + 8, text_size[1] / 1.5, 1, 0, 0, 0, 0, 220, 220, 220, 220, 255, true)
renderer_ns.gradient(watermark_pos.x + text_size[1] / 1.5, watermark_pos.y + text_size[2] + 8, text_size[1] / 1.5, 1, 220, 220, 220, 255, 0, 0, 0, 0, true)
renderer_ns.gradient(watermark_pos.x, watermark_pos.y, text_size[1] / 1.5, text_size[2] + 7, 12, 12, 12, 0, 12, 12, 12, 75, true)
renderer_ns.gradient(watermark_pos.x + text_size[1] / 1.5, watermark_pos.y, text_size[1] / 1.5, text_size[2] + 7, 12, 12, 12, 75, 12, 12, 12, 0, true)
renderer_ns.text(watermark_pos.x + 18, watermark_pos.y + 5, 255, 255, 255, 220, font_flag, 0, watermark_text)
if not entity_ns.is_alive(local_player) then
return
end
table.insert(info_lines, {text = "- CONDITION: " .. string_ns.upper(wraith_state.current_condition), r = 240, g = 240, b = 240, a = 220})
table.insert(info_lines, {text = "- TARGET: " .. string_ns.upper(client_ns.current_threat() == nil and "?" or string_ns.sub(entity_ns.get_player_name(client_ns.current_threat()), 0, 12)), r = 240, g = 240, b = 240, a = 220})
table.insert(info_lines, {text = "- EXPLOIT CHARGE: " .. (antiaim_funcs.get_double_tap() == false and "0" or "1"), r = 240, g = 240, b = 240, a = 220})
table.insert(info_lines, {text = "- DESYNC: " .. string_ns.upper(math_ns.abs(wraith_state.current_desync)) .. "*", r = 240, g = 240, b = 240, a = 220})
for idx, line in pairs_fn(info_lines) do
text_size2 = {renderer_ns.measure_text(font_flag, line.text)}
renderer_ns.text(watermark_pos.x + 18, 10 + watermark_pos.y + text_size2[2] * idx, line.r, line.g, line.b, line.a, font_flag, 0, line.text)
end
end
function draw_glow(x, y, w, h, color, glow_size)
renderer_ns.rectangle(x, y, w, h, color[1], color[2], color[3], color[4])
local glow_r = color[1] * glow_size
local glow_g = color[2] * glow_size
local glow_b = color[3] * glow_size
for i = 1, glow_size do
local alpha = color[4] * i / glow_size
local width = w + i * 2
local height = h + i * 2
local pos_x = x - i
local pos_y = y - i
renderer_ns.rectangle(pos_x, pos_y, width, height, glow_r, glow_g, glow_b, alpha)
end
end
local function draw_desync_bar(local_player, center_x, center_y, text_width, text_height)
if not table_contains(ui_ns.get(ui_elements["visuals"][6]), "desync") then
return
end
local dsy_rect = {255, 255, 255, 255}
text_height = text_height + 5
if is_scoped(local_player) and table_contains(ui_ns.get(ui_elements["visuals"][6]), "animations on scope") then
wraith_state.desync_rect_dist = lerp(wraith_state.desync_rect_dist, 21 + 2, globals_ns.frametime() * 15)
elseif not table_contains(ui_ns.get(ui_elements["visuals"][6]), "animations on scope") and ui_ns.get(ui_elements["visuals"][0]) == "recode alpha" then
wraith_state.desync_rect_dist = 21 + 2
else
wraith_state.desync_rect_dist = lerp(wraith_state.desync_rect_dist, 0, globals_ns.frametime() * 10)
end
renderer_ns.rectangle(center_x - 21 + round(wraith_state.desync_rect_dist), center_y + text_height, 21 * 2, 4, 15, 15, 15, 255)
renderer_ns.rectangle(center_x - (21 - 1) + round(wraith_state.desync_rect_dist), center_y + text_height + 1, clamp(math_ns.abs(wraith_state.current_desync) / 58 * (21 * 2 - 2), 0, 21 * 2 - 2), 2, dsy_rect[1], dsy_rect[2], dsy_rect[3], dsy_rect[4])
end
local function draw_manual_arrows(local_player, center_x, center_y)
if not ui_ns.get(ui_elements["visuals"][9]) or not ui_ns.get(ui_elements["anti-aim 2"][3]) then
return
end
wraith_state.smooth_left_arrow = is_scoped(local_player) and lerp(wraith_state.smooth_left_arrow, 80, globals_ns.frametime() * 15) or lerp(wraith_state.smooth_left_arrow, 60, globals_ns.frametime() * 15)
wraith_state.smooth_right_arrow = is_scoped(local_player) and lerp(wraith_state.smooth_right_arrow, 80, globals_ns.frametime() * 15) or lerp(wraith_state.smooth_right_arrow, 60, globals_ns.frametime() * 15)
wraith_state.smooth_up_arrow = is_scoped(local_player) and lerp(wraith_state.smooth_up_arrow, 80, globals_ns.frametime() * 15) or lerp(wraith_state.smooth_up_arrow, 60, globals_ns.frametime() * 15)
local arrow_positions = {
["left"] = {indicator = "", x_pos = -wraith_state.smooth_left_arrow, y_pos = -5},
["right"] = {indicator = "", x_pos = wraith_state.smooth_left_arrow, y_pos = -5},
["forward"] = {indicator = "", x_pos = 0, y_pos = -wraith_state.smooth_up_arrow}
}
local arrow_color = {ui_ns.get(ui_elements["visuals"][10])}
wraith_state.smooth_arrow_alpha = is_scoped(local_player) and lerp(wraith_state.smooth_arrow_alpha, clamp(arrow_color[4] - 100, 0, 235), globals_ns.frametime() * 15) or lerp(wraith_state.smooth_arrow_alpha, arrow_color[4], globals_ns.frametime() * 15)
for direction, arrow_data in pairs_fn(arrow_positions) do
if direction == wraith_state.mode then
renderer_ns.text(center_x + math_ns.ceil(arrow_data.x_pos), center_y + math_ns.ceil(arrow_data.y_pos), arrow_color[1], arrow_color[2], arrow_color[3], wraith_state.smooth_arrow_alpha, "c+", 0, arrow_data.indicator)
end
end
end
local function draw_defensive_indicator(local_player, center_x, center_y)
if not table_contains(ui_ns.get(ui_elements["visuals"][6]), "defensive") then
return
end
if wraith_state.tickbase_diff ~= nil and wraith_state.tickbase_diff <= -1 and wraith_state.tickbase_diff >= -14 then
defensive_size_x, defensive_size_y = renderer_ns.measure_text("c", "- defensive -")
defensive_size_x = defensive_size_x + 15
renderer_ns.rectangle(center_x - defensive_size_x / 2, center_y / 3 + defensive_size_y - 2, defensive_size_x, 4, 15, 15, 15, 150)
local tickbase_diff = wraith_state.tickbase_diff
local defensive_progress = math_ns.abs(-tickbase_diff - 15)
local smooth_progress = defensive_progress
if defensive_progress == smooth_progress and defensive_progress > 1 then
smooth_progress = smooth_progress - 1
end
wraith_state.smooth_defensive_bar = lerp(wraith_state.smooth_defensive_bar, smooth_progress, globals_ns.frametime() * 50)
local text_alpha = lerp(75, 200, (wraith_state.smooth_defensive_bar - 1) / 12)
renderer_ns.text(center_x, center_y / 3, 255, 255, 255, text_alpha, "c", 0, "- defensive -")
renderer_ns.rectangle(center_x + 1 - defensive_size_x / 2, center_y / 3 + 10, clamp(wraith_state.smooth_defensive_bar / 12 * defensive_size_x, 0, defensive_size_x) - 2, 2, 200, 200, 200, text_alpha)
else
wraith_state.smooth_defensive_bar = 0.5
end
end
local function predict_position_with_gravity(player, origin, ticks)
local tick_interval = globals_ns.tickinterval()
local gravity = cvar.sv_gravity:get_float() * tick_interval
local jump_impulse = cvar.sv_jump_impulse:get_float() * tick_interval
local predicted_pos = {origin[1], origin[2], origin[3]}
local velocity = {entity_ns.get_prop(player, 'm_vecVelocity')}
local vertical_impulse = velocity[3] > 0 and -gravity or jump_impulse
for tick = 1, ticks do
local old_pos = {predicted_pos[1], predicted_pos[2], predicted_pos[3]}
predicted_pos[1] = predicted_pos[1] + velocity[1] * tick_interval
predicted_pos[2] = predicted_pos[2] + velocity[2] * tick_interval
predicted_pos[3] = predicted_pos[3] + (velocity[3] + vertical_impulse) * tick_interval
local trace = client_ns.trace_line(old_pos[1], old_pos[2], old_pos[3], predicted_pos[1], predicted_pos[2], predicted_pos[3])
if trace.fraction <= 0.99 then
return old_pos
end
end
return predicted_pos
end
local function add_vectors(vec1, vec2)
return {vec1[1] + vec2[1], vec1[2] + vec2[2], vec1[3] + vec2[3]}
end
local function predict_player_position(player, ticks)
local tick_interval = globals_ns.tickinterval()
local gravity = cvar.sv_gravity:get_float() * tick_interval
local jump_impulse = cvar.sv_jump_impulse:get_float() * tick_interval
local current_pos = {entity_ns.get_origin(player)}
local predicted_pos = {entity_ns.get_origin(player)}
local velocity = {entity_ns.get_prop(player, 'm_vecVelocity')}
local vertical_impulse = velocity[3] > 0 and -gravity or jump_impulse
for tick = 1, ticks do
predicted_pos = current_pos
current_pos = {current_pos[1] + velocity[1] * tick_interval, current_pos[2] + velocity[2] * tick_interval, current_pos[3] + (velocity[3] + vertical_impulse) * tick_interval}
end