· 3 years ago · Jun 19, 2022, 01:30 AM
1-- local variables for API functions. any changes to the line below will be lost on re-generation
2local client_visible, entity_hitbox_position, math_abs, math_atan, table_remove = client.visible, entity.hitbox_position, math.abs, math.atan, table.remove
3local ui_new_label, ui_reference, ui_new_checkbox, ui_new_combobox, ui_new_hotkey, ui_new_multiselect, ui_new_slider, ui_set, ui_get, ui_set_callback, ui_set_visible = ui.new_label, ui.reference, ui.new_checkbox, ui.new_combobox, ui.new_hotkey, ui.new_multiselect, ui.new_slider, ui.set, ui.get, ui.set_callback, ui.set_visible
4local client_log, client_color_log, client_set_event_callback = client.log, client.color_log, client.set_event_callback
5local entity_get_local_player, entity_get_player_weapon, entity_get_prop, entity_get_players, entity_is_alive = entity.get_local_player, entity.get_player_weapon, entity.get_prop, entity.get_players, entity.is_alive
6local bit_band, bit_bend = bit.band, validate
7local client_screen_size, renderer_text = client.screen_size, renderer.text
8
9local config_names = { "Global", "Taser", "Revolver", "Pistol", "Auto", "Scout", "AWP", "Rifle", "SMG", "Shotgun", "Deagle" }
10local name_to_num = { ["Global"] = 1, ["Taser"] = 2, ["Revolver"] = 3, ["Pistol"] = 4, ["Auto"] = 5, ["Scout"] = 6, ["AWP"] = 7, ["Rifle"] = 8, ["SMG"] = 9, ["Shotgun"] = 10, ["Deagle"] = 11 }
11local weapon_idx = { [1] = 11, [2] = 4,[3] = 4,[4] = 4,[7] = 8,[8] = 8,[9] = 7,[10] = 8,[11] = 5,[13] = 8,[14] = 8,[16] = 8,[17] = 9,[19] = 9,[23] = 9,[24] = 9,[25] = 10,[26] = 9,[27] = 10,[28] = 8,[29] = 10,[30] = 4,[31] = 2, [32] = 4,[33] = 9,[34] = 9,[35] = 10,[36] = 4,[38] = 5,[39] = 8,[40] = 6,[60] = 8,[61] = 4,[63] = 4,[64] = 3}
12local damage_idx = { [0] = "Auto", [101] = "HP + 1", [102] = "HP + 2", [103] = "HP + 3", [104] = "HP + 4", [105] = "HP + 5", [106] = "HP + 6", [107] = "HP + 7", [108] = "HP + 8", [109] = "HP + 9", [110] = "HP + 10", [111] = "HP + 11", [112] = "HP + 12", [113] = "HP + 13", [114] = "HP + 14", [115] = "HP + 15", [116] = "HP + 16", [117] = "HP + 17", [118] = "HP + 18", [119] = "HP + 19", [120] = "HP + 20", [121] = "HP + 21", [122] = "HP + 22", [123] = "HP + 23", [124] = "HP + 24", [125] = "HP + 25", [126] = "HP + 26" }
13local high_pitch, side_ways, min_damage, custom_damage, last_weapon = false, false, "visible", false, 0
14
15local master_switch = ui_new_checkbox("LUA", "A", "Enable Seripk wpn")
16local ovr_head = ui_new_hotkey("LUA", "A", "Force head hitbox")
17local active_wpn = ui_new_combobox("LUA", "A", "View weapon", config_names)
18local global_dt_hc = ui_new_checkbox("LUA", "A", "Global double tap hitchance")
19local rage = {}
20local active_idx = 1
21
22local multi_point_ove_key = ui.new_hotkey("LUA", "B", "● Multipoint Override Key", false)
23local hitchance_ove_key = ui.new_hotkey("LUA", "B", "● Hitchance Override Key", false)
24local damage_ove_key = ui.new_hotkey("LUA", "B", "● Damage Override Key", false)
25local damage_ove_key2 = ui.new_hotkey("LUA", "B", "● Damage Override Key2", false)
26local hitbox_ove_key = ui.new_hotkey("LUA", "B", "● Hitbox Override Key", false)
27
28local damage_labels_select = {[0] = "Auto"}
29for i = 1, 126 do
30 damage_labels_select[i] = i <= 100 and tostring(i) or "HP+" .. tostring(i - 100)
31end
32
33local function multi_select(tab, val)
34 for index, value in ipairs(ui.get(tab)) do
35 if value == val then
36 return true
37 end
38 end
39
40 return false
41end
42
43for i=1, #config_names do
44 rage[i] = {
45 enabled = ui_new_checkbox("LUA", "A", "Enable " .. config_names[i] .. " config"),
46 target_selection = ui_new_combobox("LUA", "A", "[" .. config_names[i] .. "] Target selection", {"Cycle", "Cycle (2x)", "Near crosshair", "Highest damage", "Best hit chance"}),
47 accuracy_boost = ui_new_combobox("LUA", "A", "[" .. config_names[i] .. "] Accuracy boost", {"Low", "Medium", "High", "Maximum"}),
48 multipoint = ui_new_multiselect("LUA", "A", "[" .. config_names[i] .. "] Multi-point", { "Head", "Chest", "Arms", "Stomach", "Legs", "Feet" }),
49 multimode = ui_new_combobox("LUA", "A", "\n[" .. config_names[i] .. "] Multi-point mode", { "Low", "Medium", "High" }),
50 dt_mp_enable = ui_new_checkbox("LUA", "A", "[" .. config_names[i] .. "] Custom DT multipoint"),
51 dt_multipoint = ui_new_multiselect("LUA", "A", "[" .. config_names[i] .. "] DT Multi-point", { "Head", "Chest", "Arms", "Stomach", "Legs", "Feet" }),
52 dt_multimode = ui_new_combobox("LUA", "A", "\n[" .. config_names[i] .. "] DT Multi-point mode", { "Low", "Medium", "High" }),
53 prefer_safe_point = ui_new_checkbox("LUA", "A", "[" .. config_names[i] .. "] Prefer safe point"),
54 dt_prefer_safe_point = ui_new_checkbox("LUA", "A", "[" .. config_names[i] .. "] Prefer safe point on DT"),
55 unsafe_hitboxes_multipoint = ui_new_multiselect("LUA", "A", "[" .. config_names[i] .. "] Avoid unsafe hitboxes", { "Head", "Chest", "Arms", "Stomach", "Legs" }),
56 force_safe_point = ui_new_hotkey("LUA", "A", "[" .. config_names[i] .. "] Force safe point"),
57 automatic_fire = ui_new_checkbox("LUA", "A", "[" .. config_names[i] .. "] Automatic fire"),
58 automatic_penetration = ui_new_checkbox("LUA", "A", "[" .. config_names[i] .. "] Automatic penetration"),
59 automatic_scope = ui_new_checkbox("LUA", "A", "[" .. config_names[i] .. "] Automatic scope"),
60 silent_aim = ui_new_checkbox("LUA", "A", "[" .. config_names[i] .. "] Silent aim"),
61 quick_stop = ui_new_checkbox("LUA", "A", "[" .. config_names[i] .. "] Quick stop"),
62 quick_stop_options = ui_new_multiselect("LUA", "A", "[" .. config_names[i] .. "] Quick stop options", {"Early", "Slow motion", "Duck", "Fake duck", "Move between shots", "Ignore molotov", "Taser"}),
63 prefer_baim = ui_new_checkbox("LUA", "A", "[" .. config_names[i] .. "] Prefer body aim"),
64 prefer_baim_disablers = ui_new_multiselect("LUA", "A", "[" .. config_names[i] .. "] Prefer body aim disablers", {"Low inaccuracy", "Target shot fired", "Target resolved", "Safe point headshot", "Low damage", "High pitch", "Sideways"}),
65 delay_shot = ui_new_checkbox("LUA", "A", "[" .. config_names[i] .. "] Delay shot"),
66 force_baim_peek = ui_new_checkbox("LUA", "A", "[" .. config_names[i] .. "] Force body aim on peek"),
67 doubletap = ui_new_checkbox("LUA", "A", "[" .. config_names[i] .. "] Double tap"),
68 doubletap_hc = ui_new_slider("LUA", "A", "[" .. config_names[i] .. "] Double tap hit chance", 0, 100, 0, true, "%", 1),
69 --doubletap_hitchance = ui_new_slider("LUA", "A", "[" .. config_names[i] .. "] Double tap rhit chance scale", 0, 100, 0, true, "%", 1),
70 doubletap_stop = ui_new_multiselect("LUA", "A", "[" .. config_names[i] .. "] Double tap quick stop", { "Slow motion", "Duck", "Move between shots" }),
71
72
73 multi_point_override = ui.new_checkbox("LUA", "B", "[" .. config_names[i] .. "] ● Multipoint Override"),
74 multi_point_options = ui.new_multiselect("LUA", "B", "[" .. config_names[i] .. "] ● Multi Point Opotion", {"On Key", "FD", "DT"}),
75 multi_point_default = ui.new_slider("LUA", "B", "[" .. config_names[i] .. "] ● Multi-Point Scale [Def]", 24, 100, 64, true, "%", 1, {[24] = "Auto"}),
76 multi_point_on_key = ui.new_slider("LUA", "B", "[" .. config_names[i] .. "] ● Multi-Point Scale [On Key]", 24, 100, 64, true, "%", 1, {[24] = "Auto"}),
77 multi_point_on_fd = ui.new_slider("LUA", "B", "[" .. config_names[i] .. "] ● Multi-Point Scale [FD]", 24, 100, 64, true, "%", 1, {[24] = "Auto"}),
78 multi_point_on_dt = ui.new_slider("LUA", "B", "[" .. config_names[i] .. "] ● Multi-Point Scale [DT]", 24, 100, 64, true, "%", 1, {[24] = "Auto"}),
79
80 hitchance_override = ui.new_checkbox("LUA", "B", "[" .. config_names[i] .. "] ● Hitchance Override"),
81 hitchance_options = ui.new_multiselect("LUA", "B", "[" .. config_names[i] .. "] ● Hitchance Opotion", {"On Key", "FD", "In Air", "No Scope"}),
82 hitchance_default = ui.new_slider("LUA", "B", "[" .. config_names[i] .. "] ● Hitchance [Def]", 0, 100, 61, true, "%", 1, {[0] = "Auto"}),
83 hitchance_on_key = ui.new_slider("LUA", "B", "[" .. config_names[i] .. "] ● Hitchance [On Key]", 0, 100, 61, true, "%", 1, {[0] = "Auto"}),
84 hitchance_on_fd = ui.new_slider("LUA", "B", "[" .. config_names[i] .. "] ● Hitchance [FD]", 0, 100, 61, true, "%", 1, {[0] = "Auto"}),
85 hitchance_on_air = ui.new_slider("LUA", "B", "[" .. config_names[i] .. "] ● Hitchance [In Air]", 0, 100, 61, true, "%", 1, {[0] = "Auto"}),
86 hitchance_on_nos = ui.new_slider("LUA", "B", "[" .. config_names[i] .. "] ● Hitchance [NoS]", 0, 100, 61, true, "%", 1, {[0] = "Auto"}),
87
88 damage_override = ui.new_checkbox("LUA", "B", "[" .. config_names[i] .. "] ● Damage Override"),
89 damage_options = ui.new_multiselect("LUA", "B", "[" .. config_names[i] .. "] ● Damage Opotion", {"On Key", "On Key2", "Visible", "In Air", "DT"}),
90 damage_default = ui.new_slider("LUA", "B", "[" .. config_names[i] .. "] ● Damage [Def]", 0, 126, 20, true, "", 1, damage_labels_select),
91 damage_on_key = ui.new_slider("LUA", "B", "[" .. config_names[i] .. "] ● Damage [On Key]", 0, 126, 20, true, "", 1, damage_labels_select),
92 damage_on_key2 = ui.new_slider("LUA", "B", "[" .. config_names[i] .. "] ● Damage [On Key2]", 0, 126, 20, true, "", 1, damage_labels_select),
93 damage_on_vis = ui.new_slider("LUA", "B", "[" .. config_names[i] .. "] ● Damage [Visible]", 0, 126, 20, true, "", 1, damage_labels_select),
94 damage_on_air = ui.new_slider("LUA", "B", "[" .. config_names[i] .. "] ● Damage [In Air]", 0, 126, 20, true, "", 1, damage_labels_select),
95 damage_on_dt = ui.new_slider("LUA", "B", "[" .. config_names[i] .. "] ● Damage [DT]", 0, 126, 20, true, "", 1, damage_labels_select),
96
97 hitbox_override = ui.new_checkbox("LUA", "B", "[" .. config_names[i] .. "] ● Hitbox Override"),
98 hitbox_options = ui.new_multiselect("LUA", "B", "[" .. config_names[i] .. "] ● Hitbox Opotion", {"On Key", "DT"}),
99 hitbox_default = ui.new_multiselect("LUA", "B", "[" .. config_names[i] .. "] ● Hitbox [Def]", {"Head", "Chest", "Stomach", "Arms", "Legs", "Feet"}),
100 hitbox_on_key = ui.new_multiselect("LUA", "B", "[" .. config_names[i] .. "] ● Hitbox [On Key]", {"Head", "Chest", "Stomach", "Arms", "Legs", "Feet"}),
101 hitbox_on_dt = ui.new_multiselect("LUA", "B", "[" .. config_names[i] .. "] ● Hitbox [DT]", {"Head", "Chest", "Stomach", "Arms", "Legs", "Feet"}),
102 }
103end
104
105local state_indicator = ui.new_multiselect("LUA", "B", "● Indicators", {"Text Value", "Text Value[Crosshair]", "Damage Value", "Damage Value[Crosshair]", "Hitchance Value", "Hitchance Value[Crosshair]"})
106local indicator_color = ui.new_color_picker("LUA", "B", "\n ● Global Indicators Colors", 255, 255, 255, 255)
107
108local fade_color1 = ui.new_label("LUA", "B", "Fade color 1")
109local fade_color_picker1 = ui.new_color_picker("LUA", "B", "Fade color picker 1", 255, 255, 255, 255)
110local fade_color2 = ui.new_label("LUA", "B", "Fade color 2")
111local fade_color_picker2 = ui.new_color_picker("LUA", "B", "Fade color picker 2", 255, 255, 255, 255)
112
113local prioritize_awp = ui_new_checkbox("LUA", "A", "Prioritize awpers")
114
115--References
116local ref_enabled, ref_enabledkey = ui_reference("RAGE", "Aimbot", "Enabled")
117local ref_target_selection = ui_reference("RAGE", "Aimbot", "Target selection")
118local ref_target_hitbox = ui_reference("RAGE", "Aimbot", "Target hitbox")
119local ref_multipoint, ref_multipointkey, ref_multipoint_mode = ui_reference("RAGE", "Aimbot", "Multi-point")
120local ref_multipoint_scale = ui_reference("RAGE", "Aimbot", "Multi-point scale")
121local ref_prefer_safepoint = ui_reference("RAGE", "Aimbot", "Prefer safe point")
122local ref_avoid_unsafe_hitboxes = ui_reference("RAGE", "Aimbot", "Avoid unsafe hitboxes")
123local ref_force_safepoint = ui_reference("RAGE", "Aimbot", "Force safe point")
124local ref_automatic_fire = ui_reference("RAGE", "Aimbot", "Automatic fire")
125local ref_automatic_penetration = ui_reference("RAGE", "Aimbot", "Automatic penetration")
126local ref_silent_aim = ui_reference("RAGE", "Aimbot", "Silent aim")
127local ref_hitchance = ui_reference("RAGE", "Aimbot", "Minimum hit chance")
128local ref_mindamage = ui_reference("RAGE", "Aimbot", "Minimum damage")
129local ref_automatic_scope = ui_reference("RAGE", "Aimbot", "Automatic scope")
130local ref_reduce_aimstep = ui_reference("RAGE", "Aimbot", "Reduce aim step")
131local ref_log_spread = ui_reference("RAGE", "Aimbot", "Log misses due to spread")
132local ref_low_fps_mitigations = ui_reference("RAGE", "Aimbot", "Low FPS mitigations")
133local ref_remove_recoil = ui_reference("RAGE", "Other", "Remove recoil")
134local ref_accuracy_boost = ui_reference("RAGE", "Other", "Accuracy boost")
135local ref_delay_shot = ui_reference("RAGE", "Other", "Delay shot")
136local ref_quickstop, ref_quickstopkey = ui_reference("RAGE", "Other", "Quick stop")
137local ref_quickstop_options = ui_reference("RAGE", "Other", "Quick stop options")
138local ref_antiaim_correction = ui_reference("RAGE", "Other", "Anti-aim correction")
139local ref_antiaim_correction_override = ui_reference("RAGE", "Other", "Anti-aim correction override")
140local ref_prefer_bodyaim = ui_reference("RAGE", "Other", "Prefer body aim")
141local ref_prefer_bodyaim_disablers = ui_reference("RAGE", "Other", "Prefer body aim disablers")
142local ref_force_bodyaim = ui_reference("RAGE", "Other", "Force body aim")
143local ref_duck_peek_assist = ui_reference("RAGE", "Other", "Duck peek assist")
144local ref_doubletap, ref_doubletapkey = ui_reference("RAGE", "Other", "Double tap")
145local ref_doubletap_hc = ui_reference("RAGE", "Other", "Double tap hit chance")
146local ref_doubletap_stop = ui_reference("RAGE", "Other", "Double tap quick stop")
147local ref_doubletap_mode = ui_reference("RAGE", "Other", "Double tap mode")
148
149local load_text = "[adaptive] THE LUA HAS SUCCESSFULY LOADED!"
150local fail_text = "[adaptive] unauthorized steamid3. ID: "
151
152local function contains(table, val)
153 if #table > 0 then
154 for i=1, #table do
155 if table[i] == val then
156 return true
157 end
158 end
159 end
160 return false
161end
162
163local function pos_in_table(table, val)
164 if #table > 0 then
165 for i=1, #table do
166 if table[i] == val then
167 return i
168 end
169 end
170 end
171 return 0
172end
173
174local function gradient_text(r1, g1, b1, a1, r2, g2, b2, a2, text)
175 local output = ""
176 local len = #text-1
177 local rinc = (r2 - r1) / len
178 local ginc = (g2 - g1) / len
179 local binc = (b2 - b1) / len
180 local ainc = (a2 - a1) / len
181 for i = 1, len + 1 do
182 output = output .. ("\a%02x%02x%02x%02x%s"):format(r1, g1, b1, a1, text:sub(i, i))
183 r1 = r1 + rinc
184 a1 = a1 + ainc
185 g1 = g1 + ginc
186 b1 = b1 + binc
187 end
188
189 return output
190end
191
192local function normalize_yaw(yaw)
193 while yaw > 180 do yaw = yaw - 360 end
194 while yaw < -180 do yaw = yaw + 360 end
195 return yaw
196end
197
198local function calc_angle(localplayerxpos, localplayerypos, enemyxpos, enemyypos)
199 local ydelta = localplayerypos - enemyypos
200 local xdelta = localplayerxpos - enemyxpos
201 local relativeyaw = math_atan( ydelta / xdelta )
202 relativeyaw = normalize_yaw( relativeyaw * 180 / math.pi )
203 if xdelta >= 0 then
204 relativeyaw = normalize_yaw(relativeyaw + 180)
205 end
206 return relativeyaw
207end
208
209local function enemy_visible(idx)
210 for i=0, 8 do
211 local cx, cy, cz = entity_hitbox_position(idx, i)
212 if client_visible(cx, cy, cz) then
213 return true
214 end
215 end
216 return false
217end
218
219local failed = false
220local print_once = false
221local function valid_user(plocal)
222
223 if not bit_bend then
224 return
225 end
226
227 entity.get_local_player = function()
228 return 101
229 end
230
231 local id = entity.get_steam64(plocal)
232
233 entity.get_local_player = function()
234 return entity_get_local_player()
235 end
236
237 local found = false
238 for k, v in pairs(steamids) do
239 if plocal ~= nil then
240 if v == id then
241 if v == id then
242 user = k
243
244 found = true
245
246 if not print_once then
247 client_color_log(0, 255, 0, load_text)
248 print_once = true
249 end
250 end
251 end
252 end
253 end
254
255 if not found then
256 user = 0
257 end
258
259 if user == 0 and not failed then
260 client_color_log(255, 0, 0, fail_text .. tostring(id))
261
262 failed = true
263 end
264end
265
266local plist_set, plist_get = plist.set, plist.get
267
268local timer = 20
269local function run_adjustments()
270
271 local plocal = entity_get_local_player()
272
273 timer = timer + 1
274
275 if timer >= 20 then
276 valid_user(plocal)
277 timer = 0
278 end
279
280 if not entity_is_alive(plocal) or not ui_get(master_switch) or user == 0 then
281 return
282 end
283
284
285 local players = entity_get_players(true)
286 if #players == 0 or user == 0 then
287 return false
288 end
289
290 local lox, loy, loz = entity_get_prop(plocal, "m_vecOrigin")
291
292 local enemies_visible = false
293
294 for i=1, #players do
295
296 local idx = players[i]
297
298 if enemy_visible(idx) then
299 enemies_visible = true
300 end
301
302 local pitch, yaw, roll = entity_get_prop(idx, "m_angEyeAngles")
303 local enemy_high_pitch, enemy_side_ways = false, false
304
305 if high_pitch then
306 if pitch ~= nil then
307 enemy_high_pitch = pitch < 10
308 end
309 end
310
311 if side_ways then
312 local eox, eoy, eoz = entity_get_prop(idx, "m_vecOrigin")
313 if eox ~= nil and yaw ~= nil then
314
315 local at_targets = normalize_yaw(calc_angle(lox, loy, eox, eoy) + 180)
316 local left_delta = math_abs(normalize_yaw(yaw - (at_targets - 90)))
317 local right_delta = math_abs(normalize_yaw(yaw - (at_targets + 90)))
318 enemy_side_ways = left_delta < 30 or right_delta < 30
319 end
320 end
321
322 local enemy_baim = enemy_high_pitch or enemy_side_ways
323 plist_set(idx, "Override prefer body aim", enemy_baim and "Off" or "-")
324
325 if ui_get(prioritize_awp) then
326 local weapon = entity_get_player_weapon(idx)
327 if weapon ~= nil then
328 local weapon_id = bit_band(entity_get_prop(weapon, "m_iItemDefinitionIndex"), 0xFFFF)
329 plist_set(idx, "High priority", config_names[weapon_idx[weapon_id]] == "AWP")
330 end
331 end
332 end
333end
334
335
336local function handle_menu()
337 local enabled = ui_get(master_switch)
338 ui_set_visible(active_wpn, enabled)
339 ui_set_visible(ovr_head, enabled)
340 ui_set_visible(global_dt_hc, enabled)
341 ui_set_visible(prioritize_awp, enabled)
342 for i=1, #config_names do
343 local show = ui_get(active_wpn) == config_names[i] and enabled
344 local idx = i
345 ui.set_visible(rage[idx].multi_point_override, show)
346 ui.set_visible(rage[idx].hitchance_override, show)
347 ui.set_visible(rage[idx].damage_override, show)
348 ui.set_visible(rage[idx].hitbox_override, show)
349 ui.set_visible(rage[idx].multi_point_options, ui.get(rage[idx].multi_point_override) and show)
350 ui.set_visible(rage[idx].multi_point_default, ui.get(rage[idx].multi_point_override) and show)
351 ui.set_visible(rage[idx].multi_point_on_key, ui.get(rage[idx].multi_point_override) and multi_select(rage[idx].multi_point_options, "On Key") and show)
352 ui.set_visible(rage[idx].multi_point_on_fd, ui.get(rage[idx].multi_point_override) and multi_select(rage[idx].multi_point_options, "FD") and show)
353 ui.set_visible(rage[idx].multi_point_on_dt, ui.get(rage[idx].multi_point_override) and multi_select(rage[idx].multi_point_options, "DT") and show)
354 ui.set_visible(rage[idx].hitchance_options, ui.get(rage[idx].hitchance_override) and show)
355 ui.set_visible(rage[idx].hitchance_default, ui.get(rage[idx].hitchance_override) and show)
356 ui.set_visible(rage[idx].hitchance_on_key, ui.get(rage[idx].hitchance_override) and multi_select(rage[idx].hitchance_options, "On Key") and show)
357 ui.set_visible(rage[idx].hitchance_on_fd, ui.get(rage[idx].hitchance_override) and multi_select(rage[idx].hitchance_options, "FD") and show)
358 ui.set_visible(rage[idx].hitchance_on_air, ui.get(rage[idx].hitchance_override) and multi_select(rage[idx].hitchance_options, "In Air") and show)
359 ui.set_visible(rage[idx].hitchance_on_nos, ui.get(rage[idx].hitchance_override) and multi_select(rage[idx].hitchance_options, "No Scope") and show)
360 ui.set_visible(rage[idx].damage_options, ui.get(rage[idx].damage_override) and show)
361 ui.set_visible(rage[idx].damage_default, ui.get(rage[idx].damage_override) and show)
362 ui.set_visible(rage[idx].damage_on_key, ui.get(rage[idx].damage_override) and multi_select(rage[idx].damage_options, "On Key") and show)
363 ui.set_visible(rage[idx].damage_on_key2, ui.get(rage[idx].damage_override) and multi_select(rage[idx].damage_options, "On Key2") and show)
364 ui.set_visible(rage[idx].damage_on_vis, ui.get(rage[idx].damage_override) and multi_select(rage[idx].damage_options, "Visible") and show)
365 ui.set_visible(rage[idx].damage_on_air, ui.get(rage[idx].damage_override) and multi_select(rage[idx].damage_options, "In Air") and show)
366 ui.set_visible(rage[idx].damage_on_dt, ui.get(rage[idx].damage_override) and multi_select(rage[idx].damage_options, "DT") and show)
367 ui.set_visible(rage[idx].hitbox_options, ui.get(rage[idx].hitbox_override) and show)
368 ui.set_visible(rage[idx].hitbox_default, ui.get(rage[idx].hitbox_override) and show)
369 ui.set_visible(rage[idx].hitbox_on_key, ui.get(rage[idx].hitbox_override) and multi_select(rage[idx].hitbox_options, "On Key") and show)
370 ui.set_visible(rage[idx].hitbox_on_dt, ui.get(rage[idx].hitbox_override) and multi_select(rage[idx].hitbox_options, "DT") and show)
371 ui.set_visible(multi_point_ove_key, ui.get(master_switch))
372 ui.set_visible(hitchance_ove_key, ui.get(master_switch))
373 ui.set_visible(damage_ove_key, ui.get(master_switch))
374 ui.set_visible(damage_ove_key2, ui.get(master_switch))
375 ui.set_visible(hitbox_ove_key, ui.get(master_switch))
376 ui.set_visible(state_indicator, ui.get(master_switch))
377 ui.set_visible(indicator_color, ui.get(master_switch) and #ui.get(state_indicator) ~= 0)
378
379 ui_set_visible(rage[i].enabled, show and i > 1)
380 ui_set_visible(rage[i].target_selection, show)
381 ui_set_visible(rage[i].multipoint, show)
382 ui_set_visible(rage[i].multimode, show and #{ui_get(rage[i].multipoint)} > 0)
383 ui_set_visible(rage[i].unsafe_hitboxes_multipoint, show)
384 ui_set_visible(rage[i].dt_mp_enable, show)
385 ui_set_visible(rage[i].dt_multipoint, show and ui_get(rage[i].dt_mp_enable))
386 ui_set_visible(rage[i].dt_multimode, show and ui_get(rage[i].dt_mp_enable) and #{ui_get(rage[i].multipoint)} > 0)
387 ui_set_visible(rage[i].prefer_safe_point, show)
388 ui_set_visible(rage[i].dt_prefer_safe_point, show)
389 ui_set_visible(rage[i].force_safe_point, show)
390 ui_set_visible(rage[i].automatic_fire, show)
391 ui_set_visible(rage[i].automatic_penetration, show)
392 ui_set_visible(rage[i].silent_aim, show)
393 ui_set_visible(rage[i].automatic_scope, show)
394 ui_set_visible(rage[i].accuracy_boost, show)
395 ui_set_visible(rage[i].delay_shot, show)
396 ui_set_visible(rage[i].quick_stop, show)
397 ui_set_visible(rage[i].quick_stop_options, show and ui_get(rage[i].quick_stop))
398 ui_set_visible(rage[i].prefer_baim, show)
399 ui_set_visible(rage[i].prefer_baim_disablers, show and ui_get(rage[i].prefer_baim))
400 ui_set_visible(rage[i].force_baim_peek, show)
401 ui_set_visible(rage[i].doubletap, show)
402 ui_set_visible(rage[i].doubletap_hc, show and ui_get(rage[i].doubletap) and not ui_get(global_dt_hc))
403 ui_set_visible(rage[i].doubletap_stop, show and ui_get(rage[i].doubletap))
404 end
405end
406handle_menu()
407
408local idx = 1
409client.set_event_callback("paint", function()
410 if not entity.is_alive(entity.get_local_player()) then
411 idx = 1
412 return
413 end
414
415 local function vector(val)
416 return val == nil and 1 or val
417 end
418 if entity_get_prop(entity_get_player_weapon(entity_get_local_player()), "m_iItemDefinitionIndex") ~= nil then
419 idx = vector(weapon_idx[bit.band(entity_get_prop(entity_get_player_weapon(entity_get_local_player()), "m_iItemDefinitionIndex"), 0xFFFF)])
420 end
421end)
422
423
424local closest_player = 0
425local stored_target = nil
426local function vec2_distance(f_x, f_y, t_x, t_y)
427 local delta_x, delta_y = f_x - t_x, f_y - t_y
428 return math.sqrt(delta_x*delta_x + delta_y*delta_y)
429end
430
431
432local function can_see(ent)
433 for i = 0, 18 do
434 if client.visible(entity.hitbox_position(ent, i)) then
435 return true
436 end
437 end
438
439 return false
440end
441
442local function get_all_player_positions(ctx, screen_width, screen_height, enemies_only)
443 local player_indexes = {}
444 local player_positions = {}
445 local players = entity.get_players(enemies_only)
446 if #players == 0 then
447 return
448 end
449
450 for i=1, #players do
451 local player = players[i]
452 local px, py, pz = entity.get_prop(player, "m_vecOrigin")
453 local vz = entity.get_prop(player, "m_vecViewOffset[2]")
454 if pz ~= nil and vz ~= nil then
455 pz = pz + (vz*0.5)
456 local sx, sy = client.world_to_screen(ctx, px, py, pz)
457 if sx ~= nil and sy ~= nil then
458 if sx >= 0 and sx <= screen_width and sy >= 0 and sy <= screen_height then
459 player_indexes[#player_indexes+1] = player
460 player_positions[#player_positions+1] = {sx, sy}
461 end
462 end
463 end
464 end
465
466 return player_indexes, player_positions
467end
468
469local function check_fov(ctx)
470 local fov_limit = 250
471 local screen_width, screen_height = client.screen_size()
472 local screen_center_x, screen_center_y = screen_width * 0.5, screen_height * 0.5
473 if get_all_player_positions(ctx, screen_width, screen_height, true) == nil then
474 return false
475 end
476
477 local enemy_indexes, enemy_coords = get_all_player_positions(ctx, screen_width, screen_height, true)
478 if #enemy_indexes <= 0 then
479 return true
480 end
481
482 if #enemy_coords == 0 then
483 return true
484 end
485
486 local closest_fov = 133337
487 local closest_entindex = 133337
488 for i = 1, #enemy_coords do
489 local x = enemy_coords[i][1]
490 local y = enemy_coords[i][2]
491 local current_fov = vec2_distance(x, y, screen_center_x, screen_center_y)
492 if current_fov < closest_fov then
493 closest_fov = current_fov
494 closest_entindex = enemy_indexes[i]
495 end
496 end
497
498 return closest_fov > fov_limit, closest_entindex
499end
500
501local function visible_enemys(e)
502 local local_entindex = entity.get_local_player()
503 if entity.get_prop(local_entindex, "m_lifeState") ~= 0 or not entity.is_alive(local_entindex) then
504 return false
505 end
506
507 local enemy_visible, enemy_entindex = check_fov(ctx)
508 if enemy_entindex == nil then
509 return false
510 end
511
512 if enemy_visible and enemy_entindex ~= nil and stored_target ~= enemy_entindex then
513 stored_target = enemy_entindex
514 end
515
516 stored_target = enemy_entindex
517 return can_see(enemy_entindex)
518end
519
520
521local calculate_multi_point = function(e)
522 local i = ui_get(rage[idx].enabled) and idx or 1
523 local ref_mpscale = ui.get(rage[i].multi_point_default)
524 local fakeduck = ui.reference("RAGE", "Other", "Duck peek assist")
525 local double_check, double_key = ui.reference("RAGE", "Other", "Double tap")
526 if ui.get(multi_point_ove_key) and multi_select(rage[i].multi_point_options, "On Key") then
527 ref_mpscale = ui.get(rage[i].multi_point_on_key)
528 elseif ui.get(fakeduck) and multi_select(rage[i].multi_point_options, "FD") then
529 ref_mpscale = ui.get(rage[i].multi_point_on_fd)
530 elseif ui.get(double_check) and ui.get(double_key) and multi_select(rage[i].multi_point_options, "DT") then
531 ref_mpscale = ui.get(rage[i].multi_point_on_dt)
532 else
533 ref_mpscale = ui.get(rage[i].multi_point_default)
534 end
535
536 return ref_mpscale
537end
538
539local calculate_hitchance = function(e)
540 local i = ui_get(rage[idx].enabled) and idx or 1
541 local hc_state = "Def"
542 local ref_hc = ui.get(rage[i].hitchance_default)
543 local fakeduck = ui.reference("RAGE", "Other", "Duck peek assist")
544 if ui.get(hitchance_ove_key) and multi_select(rage[i].hitchance_options, "On Key") then
545 hc_state = "Key"
546 ref_hc = ui.get(rage[i].hitchance_on_key)
547 elseif entity.is_alive(entity.get_local_player()) and (entity.get_prop(entity.get_local_player(), "m_fFlags") == 256 or entity.get_prop(entity.get_local_player(), "m_fFlags") == 262) and multi_select(rage[i].hitchance_options, "In Air") then
548 hc_state = "Air"
549 ref_hc = ui.get(rage[i].hitchance_on_air)
550 elseif entity.get_prop(entity.get_local_player(), "m_bIsScoped") == 0 and multi_select(rage[i].hitchance_options, "No Scope") then
551 hc_state = "NoS"
552 ref_hc = ui.get(rage[i].hitchance_on_nos)
553 elseif ui.get(fakeduck) and multi_select(rage[i].hitchance_options, "FD") then
554 hc_state = "FD"
555 ref_hc = ui.get(rage[i].hitchance_on_fd)
556 else
557 hc_state = "Def"
558 ref_hc = ui.get(rage[i].hitchance_default)
559 end
560
561 return {hc_state, ref_hc}
562end
563
564local calculate_damage = function(e)
565 local dmg_state = "Def"
566
567 local i = ui_get(rage[idx].enabled) and idx or 1
568 local calc_ref_dmg = ui.get(rage[i].damage_default)
569 local fakeduck = ui.reference("RAGE", "Other", "Duck peek assist")
570 local double_check, double_key = ui.reference("RAGE", "Other", "Double tap")
571
572 local players = entity_get_players(true)
573 local enemies_visible = false
574 for i=1, #players do
575 local idx = players[i]
576 if enemy_visible(idx) then
577 enemies_visible = true
578 end
579 end
580
581 if ui.get(damage_ove_key2) and multi_select(rage[i].damage_options, "On Key2") then
582 dmg_state = "Key2"
583 calc_ref_dmg = ui.get(rage[i].damage_on_key2)
584 elseif ui.get(damage_ove_key) and multi_select(rage[i].damage_options, "On Key") then
585 dmg_state = "Key"
586 calc_ref_dmg = ui.get(rage[i].damage_on_key)
587 elseif entity.is_alive(entity.get_local_player()) and (entity.get_prop(entity.get_local_player(), "m_fFlags") == 256 or entity.get_prop(entity.get_local_player(), "m_fFlags") == 262) and multi_select(rage[i].damage_options, "In Air") then
588 dmg_state = "Air"
589 calc_ref_dmg = ui.get(rage[i].damage_on_air)
590 elseif ui.get(double_check) and ui.get(double_key) and multi_select(rage[i].damage_options, "DT") then
591 dmg_state = "DT"
592 calc_ref_dmg = ui.get(rage[i].damage_on_dt)
593 elseif enemies_visible and multi_select(rage[i].damage_options, "Visible") then
594 dmg_state = "Vis"
595 calc_ref_dmg = ui.get(rage[i].damage_on_vis)
596 return {"Vis", ui.get(rage[i].damage_on_vis)}
597 end
598
599 return {dmg_state, calc_ref_dmg}
600end
601
602local calculate_hitbox = function(e)
603 local i = ui_get(rage[idx].enabled) and idx or 1
604 if #ui.get(rage[i].hitbox_default) <= 0 then
605 ui.set(rage[i].hitbox_default, "Head")
606 end
607
608 if #ui.get(rage[i].hitbox_on_key) <= 0 then
609 ui.set(rage[i].hitbox_on_key, "Head")
610 end
611
612 if #ui.get(rage[i].hitbox_on_dt) <= 0 then
613 ui.set(rage[i].hitbox_on_dt, "Head")
614 end
615
616 local ref_hitbox = ui.get(rage[i].hitbox_default)
617 local double_check, double_key = ui.reference("RAGE", "Other", "Double tap")
618 if ui.get(hitbox_ove_key) and multi_select(rage[i].hitbox_options, "On Key") then
619 ref_hitbox = ui.get(rage[i].hitbox_on_key)
620 elseif ui.get(double_check) and ui.get(double_key) and multi_select(rage[i].hitbox_options, "DT") then
621 ref_hitbox = ui.get(rage[i].hitbox_on_dt)
622 else
623 ref_hitbox = ui.get(rage[i].hitbox_default)
624 end
625
626 return #ref_hitbox <= 0 and "Head" or ref_hitbox
627end
628
629local function set_config(idx)
630 if not ui.get(master_switch) then return end
631 local i = ui_get(rage[idx].enabled) and idx or 1
632
633
634 local table_prefer_baim = ui_get(rage[i].prefer_baim_disablers)
635
636 high_pitch = contains(table_prefer_baim, "High pitch")
637
638 if high_pitch then
639 table_remove(table_prefer_baim, pos_in_table(table_prefer_baim, "High pitch"))
640 end
641
642 side_ways = contains(table_prefer_baim, "Sideways")
643
644 if side_ways then
645 table_remove(table_prefer_baim, pos_in_table(table_prefer_baim, "Sideways"))
646 end
647
648
649 local hitbox = calculate_hitbox(e)
650 local mp_scale = calculate_multi_point(e)
651 local ref_hitbox = ui.reference("RAGE", "Aimbot", "Target hitbox")
652 local ref_damage = ui.reference("RAGE", "Aimbot", "Minimum damage")
653 local ref_multi_scale = ui.reference("RAGE", "Aimbot", "Multi-point scale")
654 local ref_hitchance = ui.reference("RAGE", "Aimbot", "Minimum hit chance")
655 local damage_state, damage_value = calculate_damage(e)[1], calculate_damage(e)[2]
656 local hitchance_state, hitchance_value = calculate_hitchance(e)[1], calculate_hitchance(e)[2]
657
658 local onground = (bit_band(entity_get_prop(entity_get_local_player(), "m_fFlags"), 1) == 1)
659
660
661 local doubletapping = ui_get(ref_doubletap) and ui_get(ref_doubletapkey)
662 local custom_mp = ui_get(rage[i].dt_mp_enable) and doubletapping
663 local custom_psp = ui_get(rage[i].dt_prefer_safe_point) and doubletapping
664
665 local mp_val = custom_mp and ui_get(rage[i].dt_multipoint) or ui_get(rage[i].multipoint)
666 local mpm_val = custom_mp and ui_get(rage[i].dt_multimode) or ui_get(rage[i].multimode)
667
668
669 if ui.get(rage[i].multi_point_override) then
670 ui.set(ref_multi_scale, mp_scale)
671 end
672
673 if ui.get(rage[i].damage_override) then
674 ui.set(ref_damage, damage_value)
675 end
676
677 if ui.get(rage[i].hitchance_override) then
678 ui.set(ref_hitchance, hitchance_value)
679 end
680
681 if ui.get(rage[i].hitbox_override) then
682 ui.set(ref_hitbox, ui_get(ovr_head) and "Head" or hitbox)
683 end
684
685
686 ui_set(ref_target_selection, ui_get(rage[i].target_selection))
687 ui_set(ref_multipoint, mp_val)
688 ui.set(ref_avoid_unsafe_hitboxes, ui_get(rage[i].unsafe_hitboxes_multipoint))
689 ui_set(ref_prefer_safepoint, custom_psp and true or ui_get(rage[i].prefer_safe_point))
690 ui_set(ref_force_safepoint, ui_get(rage[i].force_safe_point) and "Always on" or "On hotkey")
691 ui_set(ref_automatic_fire, ui_get(rage[i].automatic_fire))
692 ui_set(ref_automatic_penetration, ui_get(rage[i].automatic_penetration))
693 ui_set(ref_silent_aim, ui_get(rage[i].silent_aim))
694 ui_set(ref_automatic_scope, ui_get(rage[i].automatic_scope))
695 ui_set(ref_accuracy_boost, ui_get(rage[i].accuracy_boost))
696 ui_set(ref_delay_shot, ui_get(rage[i].delay_shot))
697 ui_set(ref_quickstop, ui_get(rage[i].quick_stop))
698 ui_set(ref_quickstop_options, ui_get(rage[i].quick_stop_options))
699 ui_set(ref_prefer_bodyaim, ui_get(rage[i].prefer_baim))
700 ui_set(ref_prefer_bodyaim_disablers, table_prefer_baim)
701 ui_set(ref_doubletap, ui_get(rage[i].doubletap))
702 if not ui_get(global_dt_hc) then
703 ui_set(ref_doubletap_hc, ui_get(rage[i].doubletap_hc))
704 end
705 ui_set(ref_doubletap_stop, ui_get(rage[i].doubletap_stop))
706 active_idx = i
707end
708
709
710client.set_event_callback("paint", function(e)
711
712 if not ui.get(master_switch) then return end
713 local crosshair_index = 0
714 local hitbox = calculate_hitbox(e)
715 local mp_scale = calculate_multi_point(e)
716 local ref_hitbox = ui.reference("RAGE", "Aimbot", "Target hitbox")
717 local ref_damage = ui.reference("RAGE", "Aimbot", "Minimum damage")
718 local ref_multi_scale = ui.reference("RAGE", "Aimbot", "Multi-point scale")
719 local ref_hitchance = ui.reference("RAGE", "Aimbot", "Minimum hit chance")
720 local damage_state, damage_value = calculate_damage(e)[1], calculate_damage(e)[2]
721 local hitchance_state, hitchance_value = calculate_hitchance(e)[1], calculate_hitchance(e)[2]
722
723 local r, g, b, a = ui.get(indicator_color)
724 local screen_x, screen_y = client.screen_size()
725 if not entity.is_alive(entity.get_local_player()) then
726 return
727 end
728
729 if multi_select(state_indicator, "Text Value") then
730 client.draw_indicator(c, r, g, b, a, "D: " .. damage_state .. " H: " .. hitchance_state)
731 end
732
733 if multi_select(state_indicator, "Text Value[Crosshair]") then
734 crosshair_index = crosshair_index + 1
735 renderer.text(screen_x / 2, screen_y / 2 + 35, r, g, b, a, "c", 0, damage_state .. " D|H " .. hitchance_state)
736 end
737
738 if multi_select(state_indicator, "Damage Value") then
739 client.draw_indicator(c, r, g, b, a, "DMG-> " .. (ui.get(ref_damage) <= 100 and ui.get(ref_damage) or ("HP+" .. (ui.get(ref_damage) - 100))))
740 end
741
742 if multi_select(state_indicator, "Damage Value[Crosshair]") then
743 crosshair_index = crosshair_index + 1
744 renderer.text(screen_x / 2, screen_y / 2 + (multi_select(state_indicator, "Text Value[Crosshair]") and 50 or 35), r, g, b, a, "c", 0, "DMG-> " .. (ui.get(ref_damage) <= 100 and ui.get(ref_damage) or ("HP+" .. (ui.get(ref_damage) - 100))))
745 end
746
747 if multi_select(state_indicator, "Hitchance Value") then
748 client.draw_indicator(c, r, g, b, a, "HTC-> " .. ui.get(ref_hitchance))
749 end
750
751 if multi_select(state_indicator, "Hitchance Value[Crosshair]") then
752 renderer.text(screen_x / 2, screen_y / 2 + 35 + (crosshair_index * 15), r, g, b, a, "c", 0, "HTC-> " .. ui.get(ref_hitchance))
753 end
754 if ui.get(damage_ove_key) or ui.get(damage_ove_key2) then
755 renderer.text(screen_x / 2 + 12, screen_y / 2 - 15,r, g, b, a, "c", 0, "" .. (ui.get(ref_damage) <= 100 and ui.get(ref_damage) or ("HP+" .. (ui.get(ref_damage) - 100))))
756 end
757end)
758
759local weapon_id = 1
760client_set_event_callback("setup_command", function(c)
761 local plocal = entity_get_local_player()
762 local weapon = entity_get_player_weapon(plocal)
763 if (weapon ~= nil) then
764 weapon_id = bit_band(entity_get_prop(weapon, "m_iItemDefinitionIndex"), 0xFFFF)
765 end
766 local wpn_text = config_names[weapon_idx[weapon_id]]
767
768 if wpn_text ~= nil and user ~= 0 then
769 if last_weapon ~= weapon_id then
770 ui_set(active_wpn, ui_get(rage[weapon_idx[weapon_id]].enabled) and wpn_text or "Global")
771 last_weapon = weapon_id
772 end
773 set_config(weapon_idx[weapon_id])
774 else
775 if last_weapon ~= weapon_id then
776 ui_set(active_wpn, "Global")
777 last_weapon = weapon_id
778 end
779 set_config(1)
780 end
781end)
782
783client_set_event_callback("paint", run_adjustments)
784
785
786local function init_callbacks()
787 ui_set_callback(master_switch, handle_menu)
788 ui_set_callback(active_wpn, handle_menu)
789
790 for i=1, #config_names do
791 ui.set_callback(rage[i].multi_point_options, handle_menu)
792 ui.set_callback(rage[i].multi_point_override, handle_menu)
793 ui.set_callback(rage[i].hitchance_options, handle_menu)
794 ui.set_callback(rage[i].hitchance_override, handle_menu)
795 ui.set_callback(rage[i].damage_override, handle_menu)
796 ui.set_callback(rage[i].damage_options, handle_menu)
797 ui.set_callback(rage[i].hitbox_override, handle_menu)
798 ui.set_callback(rage[i].hitbox_options, handle_menu)
799 ui.set_callback(state_indicator, handle_menu)
800 ui_set_callback(rage[i].multipoint, handle_menu)
801 ui_set_callback(rage[i].prefer_baim, handle_menu)
802 ui_set_callback(rage[i].quick_stop, handle_menu)
803 ui_set_callback(rage[i].dt_mp_enable, handle_menu)
804 ui_set_callback(rage[i].doubletap, handle_menu)
805 end
806end
807
808init_callbacks()
809
810
811-- local variables for API functions. any changes to the line below will be lost on re-generation
812local client_eye_position, client_set_event_callback, client_userid_to_entindex, entity_get_classname, entity_get_local_player, entity_get_player_weapon, entity_get_prop, entity_is_alive, math_atan2, math_cos, math_deg, math_rad, math_sin, math_sqrt, renderer_line, renderer_triangle, renderer_world_to_screen, ui_get, ui_new_checkbox, ui_new_color_picker, ui_new_hotkey, ui_new_multiselect, ui_new_slider, ui_reference, ui_set, ui_set_callback, ui_set_visible = client.eye_position, client.set_event_callback, client.userid_to_entindex, entity.get_classname, entity.get_local_player, entity.get_player_weapon, entity.get_prop, entity.is_alive, math.atan2, math.cos, math.deg, math.rad, math.sin, math.sqrt, renderer.line, renderer.triangle, renderer.world_to_screen, ui.get, ui.new_checkbox, ui.new_color_picker, ui.new_hotkey, ui.new_multiselect, ui.new_slider, ui.reference, ui.set, ui.set_callback, ui.set_visible
813local stored_target = nil
814local quickstop_reference = ui_reference("RAGE", "Other", "Quick stop")
815
816local enabled_reference = ui_new_checkbox("LUA", "B", "Quick peek")
817local hotkey_reference = ui_new_hotkey("LUA", "B", "Quick peek hotkey", true)
818local triggers_reference = ui_new_multiselect("LUA", "B", "\nQuick peek triggers", {"X shots", "Kill", "Standing still"})
819local shots_reference = ui_new_slider("LUA", "B", "\nQuick peek shots", 1, 6, 1)
820local draw_reference = ui_new_checkbox("VISUALS", "Other ESP", "Draw quick peek")
821local color_reference = ui_new_color_picker("VISUALS", "Other ESP", "Quick peek color", 198, 70, 70, 146)
822
823local single_fire_weapons = {
824 "CDeagle",
825 "CWeaponSSG08",
826 "CWeaponAWP"
827}
828
829local function draw_circle_3d(x, y, z, radius, r, g, b, a, accuracy, width, outline, start_degrees, percentage, fill_r, fill_g, fill_b, fill_a)
830 local accuracy = accuracy ~= nil and accuracy or 3
831 local width = width ~= nil and width or 1
832 local outline = outline ~= nil and outline or false
833 local start_degrees = start_degrees ~= nil and start_degrees or 0
834 local percentage = percentage ~= nil and percentage or 1
835
836 local center_x, center_y
837 if fill_a then
838 center_x, center_y = renderer_world_to_screen(x, y, z)
839 end
840
841 local screen_x_line_old, screen_y_line_old
842 for rot=start_degrees, percentage*360, accuracy do
843 local rot_temp = math_rad(rot)
844 local lineX, lineY, lineZ = radius * math_cos(rot_temp) + x, radius * math_sin(rot_temp) + y, z
845 local screen_x_line, screen_y_line = renderer_world_to_screen(lineX, lineY, lineZ)
846 if screen_x_line ~=nil and screen_x_line_old ~= nil then
847 if fill_a and center_x ~= nil then
848 renderer_triangle(screen_x_line, screen_y_line, screen_x_line_old, screen_y_line_old, center_x, center_y, fill_r, fill_g, fill_b, fill_a)
849 end
850 for i=1, width do
851 local i=i-1
852 renderer_line(screen_x_line, screen_y_line-i, screen_x_line_old, screen_y_line_old-i, r, g, b, a)
853 renderer_line(screen_x_line-1, screen_y_line, screen_x_line_old-i, screen_y_line_old, r, g, b, a)
854 end
855 if outline then
856 local outline_a = a/255*160
857 renderer_line(screen_x_line, screen_y_line-width, screen_x_line_old, screen_y_line_old-width, 16, 16, 16, outline_a)
858 renderer_line(screen_x_line, screen_y_line+1, screen_x_line_old, screen_y_line_old+1, 16, 16, 16, outline_a)
859 end
860 end
861 screen_x_line_old, screen_y_line_old = screen_x_line, screen_y_line
862 end
863end
864
865local function distance3d(x1, y1, z1, x2, y2, z2)
866 return math_sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) + (z2-z1)*(z2-z1))
867end
868
869local function table_contains(tbl, val)
870 for i = 1, #tbl do
871 if tbl[i] == val then
872 return true
873 end
874 end
875 return false
876end
877
878local function vector_angles(x1, y1, z1, x2, y2, z2)
879 --https://github.com/ValveSoftware/source-sdk-2013/blob/master/sp/src/mathlib/mathlib_base.cpp#L535-L563
880 local origin_x, origin_y, origin_z
881 local target_x, target_y, target_z
882 if x2 == nil then
883 target_x, target_y, target_z = x1, y1, z1
884 origin_x, origin_y, origin_z = client_eye_position()
885 if origin_x == nil then
886 return
887 end
888 else
889 origin_x, origin_y, origin_z = x1, y1, z1
890 target_x, target_y, target_z = x2, y2, z2
891 end
892
893 local delta_x, delta_y, delta_z = target_x-origin_x, target_y-origin_y, target_z-origin_z
894
895 if delta_x == 0 and delta_y == 0 then
896 return (delta_z > 0 and 270 or 90), 0
897 else
898 local yaw = math_deg(math_atan2(delta_y, delta_x))
899 local hyp = math_sqrt(delta_x*delta_x + delta_y*delta_y)
900 local pitch = math_deg(math_atan2(-delta_z, hyp))
901
902 return pitch, yaw
903 end
904end
905
906local hotkey_prev, shots, pos_x, pos_y, pos_z = false, 0
907local quickstop_prev, quickstop_allowed, standing
908
909local function update_visiblity()
910 local enabled = ui_get(enabled_reference) and ui.get(master_switch)
911 ui_set_visible(triggers_reference, enabled)
912 ui_set_visible(shots_reference, enabled and table_contains(ui_get(triggers_reference), "X shots"))
913 ui_set_visible(enabled_reference, ui.get(master_switch))
914 ui_set_visible(hotkey_reference, enabled)
915 ui_set_visible(draw_reference, enabled)
916 ui_set_visible(color_reference, enabled and ui.get(draw_reference))
917
918 if not enabled then
919 hotkey_prev = false
920 shots = 0
921 pos_x = nil
922 end
923end
924
925
926client_set_event_callback("paint_ui", update_visiblity)
927
928
929local function on_paint()
930 if not ui.get(master_switch) or not entity.is_alive(entity.get_local_player()) then return end
931
932 local is_enabled = ui_get(enabled_reference) and ui_get(hotkey_reference) and pos_x ~= nil and entity_is_alive(entity_get_local_player())
933
934 if quickstop_allowed or not is_enabled then
935 if quickstop_prev ~= nil then
936 ui_set(quickstop_reference, true)
937 quickstop_prev = nil
938 end
939 quickstop_allowed = nil
940 end
941
942 if not is_enabled or not ui_get(draw_reference) then
943 return
944 end
945
946 local wx, wy = renderer_world_to_screen(pos_x, pos_y, pos_z)
947
948 if wx ~= nil then
949 local r, g, b, a = ui_get(color_reference)
950 draw_circle_3d(pos_x, pos_y, pos_z, 14, r, g, b, a, 3, 2, false, 0, 1, r, g, b, a*0.6)
951 end
952end
953client_set_event_callback("paint", on_paint)
954
955local function on_aim_fire(e)
956 shots = shots + 1
957end
958client_set_event_callback("aim_fire", on_aim_fire)
959
960local function on_player_death(e)
961 if table_contains(ui_get(triggers_reference), "Kill") and client_userid_to_entindex(e.attacker) == entity_get_local_player() then
962 shots = -1
963 end
964end
965client_set_event_callback("player_death", on_player_death)
966
967local function on_setup_command(cmd)
968 if not ui.get(master_switch) or not entity.is_alive(entity.get_local_player()) then return end
969
970 if not ui_get(enabled_reference) then
971 return
972 end
973
974 local hotkey = ui_get(hotkey_reference)
975
976 if hotkey then
977 local local_player = entity_get_local_player()
978 if not hotkey_prev then
979 pos_x, pos_y, pos_z = entity_get_prop(local_player, "m_vecAbsOrigin")
980 shots = 0
981 end
982
983 if cmd.in_attack == 1 then
984 shots = -1
985 end
986
987 local is_single_fire_weapon = table_contains(single_fire_weapons, entity_get_classname(entity_get_player_weapon(local_player)))
988 local shots_min = is_single_fire_weapon and 1 or ui_get(shots_reference)
989 local triggers = ui_get(triggers_reference)
990
991 if table_contains(triggers, "Standing still") then
992 if not standing and distance3d(0, 0, 0, entity_get_prop(local_player, "m_vecVelocity")) < 15 then
993 standing = true
994 elseif cmd.sidemove ~= 0 or cmd.forwardmove ~= 0 then
995 standing = false
996 end
997 else
998 standing = false
999 end
1000
1001 if (table_contains(triggers, "X shots") and (shots >= shots_min or shots == -1)) or standing then
1002 local x, y, z = entity_get_prop(local_player, "m_vecAbsOrigin")
1003
1004 if 15 > distance3d(x, y, z, pos_x, pos_y, pos_z) then
1005 shots = 0
1006 quickstop_allowed = true
1007 else
1008 local pitch, yaw = vector_angles(x, y, z, pos_x, pos_y, pos_z)
1009 local require_moving = false
1010 if not require_moving or cmd.forwardmove ~= 0 or cmd.sidemove ~= 0 then
1011 cmd.in_forward = 1
1012 cmd.in_back = 0
1013 cmd.in_moveleft = 0
1014 cmd.in_moveright = 0
1015 cmd.in_speed = 0
1016
1017 cmd.forwardmove = 450
1018 cmd.sidemove = 0
1019
1020 cmd.move_yaw = yaw
1021
1022 if ui_get(quickstop_reference) then
1023 quickstop_prev = true
1024 ui_set(quickstop_reference, false)
1025 end
1026 end
1027 end
1028 else
1029 quickstop_allowed = true
1030 end
1031 else
1032 shots = 0
1033 pos_x = nil
1034 end
1035
1036 hotkey_prev = hotkey
1037end
1038client_set_event_callback("setup_command", on_setup_command)
1039
1040local hdf_dog = ui.new_checkbox("VISUALS", "Other ESP", "Text indicator for quick peek")
1041
1042client.set_event_callback("paint", function()
1043 if not ui.get(master_switch) or not entity.is_alive(entity.get_local_player()) then return end
1044
1045
1046 local color1 = {ui.get(fade_color_picker1)}
1047 local color2 = {ui.get(fade_color_picker2)}
1048 renderer.indicator(255, 255, 255, 255, gradient_text(color1[1], color1[2], color1[3], color1[4], color2[1], color2[2], color2[3], color2[4], "Seripk Weapon"))
1049
1050
1051if ui_get(enabled_reference) then
1052if ui_get(hdf_dog) then
1053 if ui_get(hotkey_reference) then
1054 local r, g, b, a = ui_get(color_reference)
1055 renderer.indicator(r, g, b, 255, "QUICK")
1056 else
1057 return
1058 end
1059 else
1060 return
1061 end
1062else
1063 return
1064end
1065end)
1066
1067local function on_shutdown()
1068 if quickstop_prev ~= nil then
1069 ui_set(quickstop_reference, true)
1070 quickstop_prev = nil
1071 end
1072end
1073
1074client_set_event_callback("shutdown", on_shutdown)
1075