├── README.md ├── aimware ├── color_corrector.lua └── crimsync.lua ├── gamesense ├── body_freestanding.lua └── dynamic_easing.lua ├── monolith └── scope_lines.as ├── onetap ├── advanced_freestanding.js ├── aimbot_log.js ├── better_rain │ ├── README.md │ ├── csgo │ │ └── sounds │ │ │ ├── rain_indoors.wav │ │ │ └── rain_outdoors.wav │ └── ot │ │ └── scripts │ │ └── better_rain.js ├── betterui.js ├── body_lean.js ├── custom_doubletap.js ├── customizable_accent.js ├── hit_circles.js ├── invert_on_hit.js ├── kill_effect.js ├── low_fps_mitigations.js ├── movement │ ├── README.md │ ├── csgo │ │ └── sound │ │ │ ├── godlike.wav │ │ │ ├── impressive.wav │ │ │ ├── ownage.wav │ │ │ └── perfect.wav │ └── ot │ │ └── scripts │ │ └── movement_pack.js ├── old_damage_system.js ├── old_speclist.js ├── ot_color_corrector.js ├── performance_graph.js ├── rare_animations.js ├── skin_changer_helper.js ├── standalone_rcs.js ├── vector_lib.js ├── visuals-rework │ ├── README.md │ └── kitkat_visuals.js └── zeus_bot.js └── onetap_v4 ├── advanced_freestanding.js ├── better_autostrafer.js ├── dark_nightmode.js ├── enemy_view.js ├── legit_esp.js ├── miss_log_framework.js └── snippets └── index.d.ts /README.md: -------------------------------------------------------------------------------- 1 | # Cheat scripting 2 | ###### Repository by april#0001 3 | 4 | ![GitHub forks](https://img.shields.io/github/forks/aprxl/lua-scripting?color=%23bffff1&label=Forks) ![Language](https://img.shields.io/badge/lang-javascript-%23bffff1) ![Language](https://img.shields.io/badge/lang-lua-%23bffff1) 5 | 6 | Here all of my scripts/plugins for *gamesense.pub*, *aimware.net*, *onetap.com* and *monolith.club* will be found. 7 | 8 | © aprxl, 2021. 9 | -------------------------------------------------------------------------------- /aimware/color_corrector.lua: -------------------------------------------------------------------------------- 1 | --- 2 | --- Title: Noble Color Corrector 3 | --- Author: april#0001 4 | --- Description: Creates a color correction effect in-game 5 | --- 6 | 7 | --region menu 8 | 9 | -- Our main reference 10 | local ref = gui.Reference("MISC", "GENERAL", "Extra") 11 | 12 | -- Creates our menu elements 13 | local enable = gui.Checkbox(ref, "noble_cc_enable", "Enable color correction", 0) 14 | local tint = gui.Slider(ref, "noble_cc_tint", "Tint", 50, 0, 100) 15 | local intensity = gui.Slider(ref, "noble_cc_int", "Intensity", 25, 0, 100) 16 | local saturation = gui.Slider(ref, "noble_cc_sat", "Saturation", 100, 0, 100) 17 | 18 | --endregion 19 | 20 | --region callbacks 21 | 22 | callbacks.Register("Draw", function() 23 | 24 | if not enable:GetValue() then 25 | return 26 | end 27 | 28 | -- Get drawing properties 29 | local x, y = draw.GetScreenSize() 30 | local value_sat = (saturation:GetValue() / 100) * 255 31 | local value_tint = tint:GetValue() * (value_sat / 100) 32 | local value_intensity = intensity:GetValue() * 0.75 33 | 34 | draw.Color( 35 | value_tint, 36 | 0, 37 | value_sat - value_tint, 38 | value_intensity 39 | ) 40 | 41 | draw.FilledRect(0, 0, x, y) 42 | 43 | end 44 | ) 45 | 46 | --endregion 47 | -------------------------------------------------------------------------------- /aimware/crimsync.lua: -------------------------------------------------------------------------------- 1 | 2 | --- 3 | --- Title: Crimsync 4 | --- Author: april#0001 5 | --- Description: Recreates onetap's anti-aimbot system, originally made by Salvatore#0850 6 | --- 7 | 8 | --region main 9 | local main_c = {} 10 | local main_mt = {__index = main_c} 11 | 12 | --- Instantiate a main object. 13 | --- @return table 14 | function main_c.new() 15 | local properties = { 16 | menu = true, 17 | 18 | modes = {"Desync", "Anti-balance adjust"}, 19 | 20 | manual_antiaiming = false, 21 | inverted = false 22 | } 23 | 24 | return properties 25 | end 26 | 27 | --- @class col_t 28 | local col_t = {} 29 | 30 | --- Creates a new color vector 31 | --- @param r 32 | --- @param g 33 | --- @param b 34 | --- @param a 35 | --- @return col_t 36 | function col_t.new(r, g, b, a) 37 | r = r or 255 38 | g = g or 255 39 | b = b or 255 40 | a = a or 255 41 | 42 | return {r = r, g = g, b = b, a = a} 43 | end 44 | 45 | -- Create our main class 46 | local main = main_c.new() 47 | 48 | -- Initiate our fonts 49 | local font_main = draw.CreateFont("Verdana", 30, 500) 50 | --endregion 51 | 52 | --region Menu 53 | 54 | -- Create color variables 55 | local clr_arrows = gui.ColorEntry("crimsync_arrows", "Crimsync arrows", 255, 255, 255, 125) 56 | local clr_outline_inv = gui.ColorEntry("crimsync_outline_inv", "Crimsync arrows desync", 50, 105, 170, 200) 57 | 58 | -- Create menu elements 59 | local window = gui.Window("crimsync", "Crimsync settings", 250, 500, 1265, 350) 60 | local standing = gui.Groupbox(window, "Standing", 15, 15, 235, 285) 61 | local running = gui.Groupbox(window, "Running", 265, 15, 235, 285) 62 | local slowwalk = gui.Groupbox(window, "Slow-walking", 515, 15, 235, 285) 63 | local manualaa = gui.Groupbox(window, "Manual anti-aiming", 765, 15, 235, 285) 64 | local options = gui.Groupbox(window, "Lean options", 1015, 15, 235, 285) 65 | 66 | local static_vars = gui.Groupbox(window, "static_vars", 0, 1020, 0, 0) 67 | 68 | local body_lean = { 69 | [1] = gui.Slider(standing, "standing_lean", "Body lean", 55, 0, 100), 70 | [2] = gui.Slider(running, "running_lean", "Body lean", 55, 0, 100), 71 | [3] = gui.Slider(slowwalk, "slowwalk_lean", "Body lean", 55, 0, 100), 72 | [4] = gui.Slider(manualaa, "manual_lean", "Body lean", 55, 0, 100) 73 | } 74 | 75 | local inverted_body_lean = { 76 | [1] = gui.Slider(standing, "standing_lean_inv", "Inverted body lean", 55, 0, 100), 77 | [2] = gui.Slider(running, "running_lean_inv", "Inverted body lean", 55, 0, 100), 78 | [3] = gui.Slider(slowwalk, "slowwalk_lean_inv", "Inverted body lean", 55, 0, 100), 79 | [4] = gui.Slider(manualaa, "manual_lean_inv", "Inverted body lean", 55, 0, 100) 80 | } 81 | 82 | local desync_boxes = { 83 | [1] = gui.Combobox(standing, "standing_crooked", "Crooked modes", "Eye yaw", "Desync", "Sway", "Jitter"), 84 | [2] = gui.Combobox(running, "running_crooked", "Crooked modes", "Eye yaw", "Desync", "Sway", "Jitter"), 85 | [3] = gui.Combobox(slowwalk, "slowwalk_crooked", "Crooked modes", "Eye yaw", "Desync", "Sway", "Jitter"), 86 | [4] = gui.Combobox(manualaa, "manual_crooked", "Crooked modes", "Eye yaw", "Desync", "Sway", "Jitter") 87 | } 88 | 89 | local choke_limit = { 90 | [1] = gui.Slider(standing, "standing_choke", "Choke limit", 1, 1, 4), 91 | [2] = gui.Slider(running, "running_choke", "Choke limit", 15, 1, 16), 92 | [3] = gui.Slider(slowwalk, "slowwalk_choke", "Choke limit", 10, 1, 16) 93 | } 94 | 95 | local options_elements = { 96 | [1] = gui.Slider(options, "crimsync_fakelimit", "Max lean", 60, 0, 60), 97 | [2] = gui.Checkbox(options, "crimsync_freestand", "Freestanding", 0) 98 | } 99 | 100 | local manual_hotkeys = { 101 | [1] = gui.Keybox( manualaa, "manual_left", "Override left", 0x5A ), 102 | [2] = gui.Keybox( manualaa, "manual_right", "Override right", 0x43 ), 103 | [3] = gui.Keybox( manualaa, "manual_back", "Override back", 0x58 ), 104 | [4] = gui.Keybox( options, "manual_inv", "Invert", 0x56 ) 105 | } 106 | 107 | --endregion 108 | 109 | --region Functions 110 | 111 | --region Locals 112 | 113 | --- Calculates the local_player velocity 114 | --- @return number 115 | local function velocity() 116 | 117 | local local_player = entities.GetLocalPlayer() 118 | 119 | local x, y, z = local_player:GetPropVector("localdata", "m_vecVelocity[0]") 120 | 121 | return math.sqrt(x*x + y*y) 122 | 123 | end 124 | 125 | --- Checks if a UI element exists 126 | --- @param var 127 | --- @param complement 128 | local function get_value(var, complement) 129 | 130 | if gui.GetValue( var .. complement ) ~= nil then 131 | return var .. complement 132 | end 133 | 134 | return nil 135 | 136 | end 137 | 138 | -- Creates our custom rendering system 139 | local render = {} 140 | 141 | --- Renders a new rectangle 142 | --- @param x 143 | --- @param y 144 | --- @param w 145 | --- @param h 146 | --- @param clr 147 | function render.rectangle(x, y, w, h, clr) 148 | draw.Color(clr.r, clr.g, clr.b, clr.a) 149 | draw.FilledRect(x, y, x + w, y + h) 150 | end 151 | 152 | --- Renders a new rectangle triangle 153 | --- @param x 154 | --- @param y 155 | --- @param w 156 | --- @param h 157 | --- @param clr 158 | function render.rect_triangle(x, y, w, h, clr) 159 | draw.Color(clr.r, clr.g, clr.b, clr.a) 160 | draw.Triangle(x, y, x + w, y + h, x, y + h) 161 | end 162 | 163 | --- Renders a new triangle pointing up 164 | --- @param x 165 | --- @param y 166 | --- @param l 167 | --- @param clr 168 | function render.eq_triangle_up(x, y, l, clr) 169 | draw.Color(clr.r, clr.g, clr.b, clr.a) 170 | draw.Triangle(x, y - l / 2, x + l / 2, y + l / 2, x - l / 2, y + l / 2) 171 | end 172 | 173 | --- Renders a new triangle pointing down 174 | --- @param x 175 | --- @param y 176 | --- @param l 177 | --- @param clr 178 | function render.eq_triangle_down(x, y, l, clr) 179 | draw.Color(clr.r, clr.g, clr.b, clr.a) 180 | draw.Triangle(x - l / 2, y - l / 2, x + l / 2, y - l / 2, x, y + l / 2) 181 | end 182 | 183 | --- Renders a new text 184 | --- @param x 185 | --- @param y 186 | --- @param centered 187 | --- @param shadow 188 | --- @param font 189 | --- @param clr 190 | --- @param text 191 | function render.text(x, y, centered, shadow, font, clr, text) 192 | draw.Color(clr.r, clr.g, clr.b, clr.a) 193 | draw.SetFont(font) 194 | 195 | local w, h = draw.GetTextSize(text) 196 | x = centered and x - w / 2 or x 197 | 198 | if shadow then 199 | draw.TextShadow(x, y, text) 200 | end 201 | 202 | draw.Text(x, y, text) 203 | end 204 | 205 | --- Renders a new circle 206 | --- @param x 207 | --- @param y 208 | --- @param radius 209 | --- @param outline 210 | --- @param clr 211 | function render.circle(x, y, radius, outline, clr) 212 | draw.Color(clr.r, clr.g, clr.b, clr.a) 213 | 214 | if outline then 215 | draw.OutlinedCircle(x, y, radius) 216 | return 217 | end 218 | 219 | draw.FilledCircle(x, y, radius) 220 | end 221 | 222 | --endregion 223 | 224 | --- Updates the antiaim type 225 | --- @return string 226 | function main.update_state() 227 | 228 | local local_player = entities.GetLocalPlayer() 229 | 230 | if not local_player or not local_player:IsAlive() then 231 | return 232 | end 233 | 234 | local vel = velocity() 235 | 236 | if main.manual_antiaiming then 237 | return "manual" 238 | end 239 | 240 | if gui.GetValue( "msc_slowwalk" ) ~= 0 and input.IsButtonDown( gui.GetValue( "msc_slowwalk" ) ) then 241 | return "slowwalk" 242 | end 243 | 244 | if vel > 0.01 then 245 | return "running" 246 | end 247 | 248 | return "standing" 249 | 250 | end 251 | 252 | 253 | local states = {left = false, right = false, back = false, inv = false} 254 | local m_state = gui.Slider(static_vars, "m_state", "m_state", 0, 0, 3) 255 | 256 | --- Handles the input system for the manual anti-aim binds 257 | function main.do_manualaa() 258 | 259 | if manual_hotkeys[1]:GetValue() == 0 or 260 | manual_hotkeys[1]:GetValue() == 0 or 261 | manual_hotkeys[1]:GetValue() == 0 or 262 | manual_hotkeys[1]:GetValue() == 0 then 263 | return 264 | end 265 | 266 | local input_left, input_right, input_back, input_inv, state = 267 | input.IsButtonDown( gui.GetValue("manual_left") ), 268 | input.IsButtonDown( gui.GetValue("manual_right") ), 269 | input.IsButtonDown( gui.GetValue("manual_back") ), 270 | input.IsButtonDown( gui.GetValue("manual_inv") ), 271 | gui.GetValue( "m_state" ) 272 | 273 | 274 | if input_left == states.left and 275 | input_right == states.right and 276 | input_back == states.back and 277 | input_inv == states.inv then 278 | return 279 | end 280 | 281 | states.left = input_left 282 | states.right = input_right 283 | states.back = input_back 284 | states.inv = input_inv 285 | 286 | if (input_inv) then 287 | main.inverted = not main.inverted 288 | end 289 | 290 | if (input_left and state == 1) or (input_right and state == 2) or (input_back and state == 3) then 291 | gui.SetValue( "m_state", 0 ) 292 | main.manual_antiaiming = false 293 | return 294 | end 295 | 296 | if (input_left and state ~= 1) then 297 | gui.SetValue( "m_state", 1 ) 298 | main.manual_antiaiming = true 299 | end 300 | 301 | if (input_right and state ~= 2) then 302 | gui.SetValue( "m_state", 2 ) 303 | main.manual_antiaiming = true 304 | end 305 | 306 | if (input_back and state ~= 3) then 307 | gui.SetValue( "m_state", 3 ) 308 | main.manual_antiaiming = true 309 | end 310 | 311 | end 312 | 313 | --- Handles your menu 314 | function main.menu_handle() 315 | window:SetActive(gui.Reference("MENU"):IsActive()) 316 | end 317 | 318 | --- Updates your anti-aim 319 | function main.do_antiaim() 320 | 321 | local local_player = entities.GetLocalPlayer() 322 | 323 | if not local_player or not local_player:IsAlive() then 324 | return 325 | end 326 | 327 | local current_type = main.update_state() 328 | local label_lean = main.inverted and get_value(current_type, "_lean_inv") or get_value(current_type, "_lean") 329 | local m_state = gui.GetValue("m_state") 330 | 331 | local lean = 59 - (0.59 * gui.GetValue(label_lean)) 332 | 333 | local directions = { 334 | [0] = lean, 335 | [1] = -90 + lean, 336 | [2] = 90 + lean, 337 | [3] = 0 + lean 338 | } 339 | 340 | -- Do freestanding 341 | if options_elements[2]:GetValue() then 342 | gui.SetValue("rbot_antiaim_autodir", main.manual_antiaiming and 0 or 1) 343 | end 344 | 345 | -- Set anti-aim values 346 | gui.SetValue("rbot_antiaim_stand_real_add", directions[m_state]) 347 | gui.SetValue("rbot_antiaim_move_real_add", directions[m_state]) 348 | gui.SetValue("rbot_antiaim_edge_real_add", directions[m_state]) 349 | 350 | -- Do choking 351 | -- Manual anti-aim doesn't have its own choke slider, so use current type's choke. 352 | local velocity = velocity() 353 | local choke_type = current_type == "manual" and ( ( gui.GetValue( "msc_slowwalk" ) ~= 0 and input.IsButtonDown( gui.GetValue( "msc_slowwalk" ) ) ) and "slowwalk" or (velocity > 0.01 and "running" or "standing") ) or current_type 354 | 355 | local choke_label = get_value(choke_type, "_choke") 356 | 357 | gui.SetValue("msc_fakelag_value", gui.GetValue(choke_label)) 358 | 359 | end 360 | 361 | --- Updates your body desync 362 | function main.do_desync() 363 | 364 | local local_player = entities.GetLocalPlayer() 365 | 366 | if not local_player or not local_player:IsAlive() then 367 | return 368 | end 369 | 370 | -- Invert desync 371 | gui.SetValue("rbot_antiaim_stand_desync", main.inverted and 2 or 3) 372 | gui.SetValue("rbot_antiaim_move_desync", main.inverted and 2 or 3) 373 | gui.SetValue("rbot_antiaim_edge_desync", main.inverted and 2 or 3) 374 | 375 | -- Fix lower body target 376 | local current_type = main.update_state() 377 | local desync_label = get_value(current_type, "_crooked") 378 | local max = options_elements[1]:GetValue() 379 | 380 | local target_angles = function(mode) 381 | if mode == 0 then -- Eye yaw 382 | return local_player:GetProp("m_angEyeAngles[1]") 383 | elseif mode == 1 then -- Desync 384 | return local_player:GetProp("m_angEyeAngles[1]") + (main.inverted and max or -max) 385 | elseif mode == 2 then -- Sway 386 | return local_player:GetProp("m_angEyeAngles[1]") + (-max + math.floor(globals.TickCount() % (max * 2))) 387 | elseif mode == 3 then -- Jitter 388 | return local_player:GetProp("m_angEyeAngles[1]") + ((globals.TickCount() % 30 > 15 ) and max or -max) 389 | end 390 | end 391 | 392 | local_player:SetProp("m_flLowerBodyYawTarget", target_angles(gui.GetValue(desync_label))) 393 | 394 | end 395 | 396 | local arrows = { [0] = {pos = {x = 0, y = 0}, text = ""}, [1] = {pos = {x = -50, y = 0}, text = "◄"}, [2] = {pos = {x = 50, y = 0}, text = "►"}, [3] = {pos = {x = 0, y = 50}, text = "▼"} } 397 | --- Draws the manual anti-aim indicators 398 | function main.draw_indicators() 399 | 400 | local local_player = entities.GetLocalPlayer() 401 | 402 | if not local_player or not local_player:IsAlive() then 403 | return 404 | end 405 | 406 | -- Get drawing properties 407 | local x, y = draw.GetScreenSize() 408 | local state = gui.GetValue("m_state") 409 | draw.SetFont(font_main) 410 | 411 | local offset = main.inverted and -50 or 50 412 | 413 | -- Draw dormant indicators 414 | -- Left 415 | render.text(x / 2 - 50, y / 2, true, false, font_main, col_t.new(125, 125, 125, 200), "◄") 416 | 417 | -- Center 418 | render.text(x / 2, y / 2 + 50, true, false, font_main, col_t.new(125, 125, 125, 200), "▼") 419 | 420 | -- Right 421 | render.text(x / 2 + 50, y / 2, true, false, font_main, col_t.new(125, 125, 125, 200), "►") 422 | 423 | -- Overlapping 424 | if (state == 1 and main.inverted) or (state == 2 and not main.inverted) then 425 | render.text(x / 2 + arrows[state].pos.x, y / 2 + arrows[state].pos.y, true, true, font_main, col_t.new(125, 0, 255, 200), arrows[state].text) 426 | return 427 | end 428 | 429 | -- Draw active indicator 430 | render.text(x / 2 + arrows[state].pos.x, y / 2 + arrows[state].pos.y, true, true, font_main, col_t.new(clr_arrows:GetValue()), arrows[state].text) 431 | 432 | -- Draw desync indicator 433 | render.text(x / 2 + offset, y / 2, true, false, font_main, col_t.new(clr_outline_inv:GetValue()), arrows[main.inverted and 1 or 2].text) 434 | 435 | end 436 | 437 | --endregion 438 | 439 | --region Callbacks 440 | 441 | callbacks.Register( "Draw", function() 442 | 443 | -- Do functions 444 | main.menu_handle() 445 | main.do_manualaa() 446 | main.do_antiaim() 447 | main.do_desync() 448 | 449 | local x, y = draw.GetScreenSize() 450 | local m_state = gui.GetValue("m_state") 451 | 452 | -- Draw our manual anti-aimbot indicators 453 | main.draw_indicators() 454 | 455 | end 456 | ) 457 | 458 | --endregion 459 | -------------------------------------------------------------------------------- /gamesense/body_freestanding.lua: -------------------------------------------------------------------------------- 1 | --- 2 | --- Title: Better body freestanding 3 | --- Description: A trace-based body freestanding with more customization. 4 | --- Author: april#0001 5 | --- 6 | 7 | ---region menu 8 | -- Create my menu elements 9 | local enable = ui.new_checkbox("AA", "Anti-aimbot angles", "Better body freestanding") 10 | local mode = ui.new_combobox("AA", "Anti-aimbot angles", "Body freestanding mode", { "Hide real", "Hide fake" }) 11 | local smart = ui.new_checkbox("AA", "Anti-aimbot angles", "Smart mode") 12 | local indicator = ui.new_checkbox("AA", "Anti-aimbot angles", "Show 'FAKE' indicator") 13 | 14 | -- And reference the ones I'll be using 15 | local ref_body_freestanding = ui.reference("AA", "Anti-aimbot angles", "Freestanding body yaw") 16 | local ref_body_yaw, ref_body_yaw_offset = ui.reference("AA", "Anti-aimbot angles", "Body yaw") 17 | local ref_fake_limit = ui.reference("AA", "Anti-aimbot angles", "Fake yaw limit") 18 | ---endregion 19 | 20 | ---region locals 21 | -- Create the table where all my info will be stored 22 | local data = { 23 | side = 1, 24 | last_side = 0, 25 | 26 | last_hit = 0, 27 | hit_side = 0 28 | } 29 | ---endregion 30 | 31 | ---region functions 32 | local on_setup_command = function(cmd) 33 | -- Get local player 34 | local me = entity.get_local_player() 35 | 36 | -- If our local player is invalid or if we're dead, return 37 | if not me or entity.get_prop(me, "m_lifeState") ~= 0 then 38 | return 39 | end 40 | 41 | -- Disable the cheat's built-in freestanding 42 | ui.set(ref_body_freestanding, false) 43 | 44 | -- Get the server's current time 45 | local now = globals.curtime() 46 | 47 | -- Check if our smart mode behaviour is done 48 | if data.hit_side ~= 0 and now - data.last_hit > 5 then 49 | -- If so, set the last side to '0' so the anti-aim updates 50 | data.last_side = 0 51 | 52 | -- And reset the smart mode info 53 | data.last_hit = 0 54 | data.hit_side = 0 55 | end 56 | 57 | -- Get what mode our freestanding is using 58 | local _mode = ui.get(mode) 59 | 60 | -- Get some properties 61 | local x, y, z = client.eye_position() 62 | local _, yaw = client.camera_angles() 63 | 64 | -- Create a table where the trace data will be stored 65 | local trace_data = {left = 0, right = 0} 66 | 67 | for i = yaw - 90, yaw + 90, 30 do 68 | -- I don't know an alternative for continue so.. 69 | -- Don't do any calculations if the current angle is equal to our yaw 70 | -- This means that this is the center point and thus it doesn't contribute to the calculations 71 | if i ~= yaw then 72 | -- Convert our yaw to radians in order to do further calculations 73 | local rad = math.rad(i) 74 | 75 | -- Calculate our destination point 76 | local px, py, pz = x + 256 * math.cos(rad), y + 256 * math.sin(rad), z 77 | 78 | -- Trace a line from our eye position to the previously calculated point 79 | local fraction = client.trace_line(me, x, y, z, px, py, pz) 80 | local side = i < yaw and "left" or "right" 81 | 82 | -- Add the trace's fraction to the trace table 83 | trace_data[side] = trace_data[side] + fraction 84 | end 85 | end 86 | 87 | -- Get which side has the lowest fraction amount, which means that it is closer to us. 88 | data.side = trace_data.left < trace_data.right and 1 or 2 89 | 90 | -- If our side didn't change from the last tick then there's no need to update our anti-aim 91 | if data.side == data.last_side then 92 | return 93 | end 94 | 95 | -- If it did change, then update our cached side to do further checks 96 | data.last_side = data.side 97 | 98 | -- Check if we should override our side due to the smart mode 99 | if data.hit_side ~= 0 then 100 | data.side = data.hit_side == 1 and 2 or 1 101 | end 102 | 103 | -- Get the fake angle's maximum length and calculate what our next body offset should be 104 | local limit = ui.get(ref_fake_limit) 105 | local lby = _mode == "Hide real" and (data.side == 1 and limit or -limit) or (data.side == 1 and -limit or limit) 106 | 107 | -- Update our body yaw settings 108 | ui.set(ref_body_yaw, "Static") 109 | ui.set(ref_body_yaw_offset, lby) 110 | end 111 | 112 | local on_paint = function() 113 | -- Check if we should draw the indicator 114 | if not ui.get(indicator) then 115 | return 116 | end 117 | 118 | -- Get local player 119 | local me = entity.get_local_player() 120 | 121 | -- If our local player is invalid or if we're dead, return 122 | if not me or entity.get_prop(me, "m_lifeState") ~= 0 then 123 | return 124 | end 125 | 126 | -- Calculate our desync length 127 | -- Thanks sapphyrus! 128 | local body = math.max(-60, math.min(60, entity.get_prop(me, "m_flPoseParameter", 11) or 0) * 120 - 60) 129 | local perc = math.abs(body) / 60 130 | 131 | -- Calculate the indicator's color based on our desync length 132 | local r, g, b = 192 - (perc * 71), 32 + (perc * 146), 28 133 | 134 | -- Render our indicator and get its vertical offset 135 | local y = renderer.indicator(r, g, b, 200, "FAKE") 136 | 137 | -- Render a circle indicator next to it just for that extra visual pleasure 138 | renderer.circle_outline(85, y + 20, 10, 10, 10, 125, 8, 0, 1, 3) 139 | renderer.circle_outline(85, y + 20, r, g, b, 200, 8, -90, perc, 3) 140 | end 141 | 142 | local on_player_hurt = function(e) 143 | -- Check if smart mode is disabled 144 | if not ui.get(smart) then 145 | return 146 | end 147 | 148 | -- Get the event's entities 149 | local me = entity.get_local_player() 150 | local userid, attacker = client.userid_to_entindex(e.userid), client.userid_to_entindex(e.attacker) 151 | 152 | -- Check if we're the one who got hurt and not the one who hurt us 153 | if me == userid and me ~= attacker then 154 | -- If so, set the last side to '0' so the anti-aim updates 155 | data.last_side = 0 156 | 157 | -- Update our smart mode info 158 | data.last_hit = globals.curtime() 159 | data.hit_side = data.side 160 | end 161 | end 162 | 163 | local handle_menu_visibility = function(self) 164 | -- Get if the script is enabled and determine if we should set or unset the callbacks 165 | local enabled = ui.get(self) 166 | local callback = enabled and client.set_event_callback or client.unset_event_callback 167 | 168 | -- Update the other elements' visibility 169 | ui.set_visible(mode, enabled) 170 | ui.set_visible(smart, enabled) 171 | 172 | ui.set_visible(ref_body_freestanding, not enabled) 173 | 174 | -- Register/Unregister our callbacks 175 | callback("setup_command", on_setup_command) 176 | callback("paint", on_paint) 177 | callback("player_hurt", on_player_hurt) 178 | end 179 | 180 | -- Execute this whenever the script is first enabled 181 | handle_menu_visibility(enable) 182 | ---endregion 183 | 184 | ---region callbacks 185 | -- Register the UI callbacks 186 | ui.set_callback(enable, handle_menu_visibility) 187 | ui.set_callback(mode, function(self) 188 | -- Set the last side to '0' so the anti-aim updates 189 | data.last_side = 0 190 | end) 191 | ---endregion 192 | -------------------------------------------------------------------------------- /gamesense/dynamic_easing.lua: -------------------------------------------------------------------------------- 1 | local pi, max = math.pi, math.max 2 | 3 | local dyn_variation_t = {} 4 | dyn_variation_t.__index = dyn_variation_t 5 | 6 | function dyn_variation_t.new(f, z, r, xi) 7 | f = max(f, 0.001) 8 | z = max(z, 0) 9 | 10 | local pif = pi * f 11 | local twopif = 2 * pif 12 | 13 | local a = z / pif 14 | local b = 1 / ( twopif * twopif ) 15 | local c = r * z / twopif 16 | 17 | return setmetatable({ 18 | a = a, 19 | b = b, 20 | c = c, 21 | 22 | px = xi, 23 | y = xi, 24 | dy = 0 25 | }, dyn_variation_t) 26 | end 27 | 28 | function dyn_variation_t:update(dt, x, dx) 29 | if dx == nil then 30 | dx = ( x - self.px ) / dt 31 | self.px = x 32 | end 33 | 34 | self.y = self.y + dt * self.dy 35 | self.dy = self.dy + dt * ( x + self.c * dx - self.y - self.a * self.dy ) / self.b 36 | return self 37 | end 38 | 39 | function dyn_variation_t:get() 40 | return self.y 41 | end 42 | 43 | return dyn_variation_t 44 | -------------------------------------------------------------------------------- /monolith/scope_lines.as: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Title: Custom scope lines 4 | * Author: april#0001 5 | * Description: Renders grandient 'lines' as scope lines. 6 | * 7 | */ 8 | 9 | //region Globals 10 | // Initialize our global interfaces. 11 | ISurface@ g_Surface = Interfaces.Surface; 12 | IEngineClient@ g_Engine = Interfaces.EngineClient; 13 | IClientEntityList@ g_EntityList = Interfaces.ClientEntityList; 14 | CGlobalVarsBase@ g_Globals = Interfaces.Globals; 15 | 16 | // Initialize our FrameStage_t enum. 17 | enum g_Stage { 18 | FRAME_UNDEFINED = -1, 19 | FRAME_START, 20 | FRAME_NET_UPDATE_START, 21 | FRAME_NET_UPDATE_POSTDATAUPDATE_START, 22 | FRAME_NET_UPDATE_POSTDATAUPDATE_END, 23 | FRAME_NET_UPDATE_END, 24 | 25 | FRAME_RENDER_START, 26 | FRAME_RENDER_END 27 | }; 28 | //endregion 29 | 30 | //region Functions 31 | //region UI 32 | namespace UI { 33 | // Handles the menu's open state 34 | bool m_Open = false; 35 | 36 | // Saves the script's settings 37 | bool m_Enabled = false; 38 | float m_Size = 5; 39 | float m_Offset = 1; 40 | 41 | // Saves the scope's color 42 | float m_ColorR = 255; 43 | float m_ColorG = 255; 44 | float m_ColorB = 255; 45 | 46 | void Render( ) { 47 | // Creates a new window 48 | if ( Menu::Begin( "Scope Lines", m_Open, 0 ) ) { 49 | // Adds the master switch 50 | Menu::Checkbox( "Enable", m_Enabled ); 51 | 52 | // Checks if the master switch is enabled in order to render the 53 | // rest of the elements 54 | if ( m_Enabled ) { 55 | // Render the other elements 56 | Menu::SliderFloat( "Size", m_Size, 1.f, 100.f, "%.1f%%", 2.f ); 57 | Menu::SliderFloat( "Offset", m_Offset, 0.f, 100.f, "%.1f%%", 2.f ); 58 | 59 | Menu::Text( "Color" ); 60 | 61 | Menu::SetNextItemWidth( 75.f ); 62 | Menu::SliderFloat( "Red", m_ColorR, 0.f, 255.f, "%.0f", 1.f ); 63 | Menu::SetNextItemWidth( 75.f ); 64 | Menu::SameLine( 0.f, 5.f ); 65 | Menu::SliderFloat( "Green", m_ColorG, 0.f, 255.f, "%.0f", 1.f ); 66 | Menu::SetNextItemWidth( 75.f ); 67 | Menu::SameLine( 0.f, 5.f ); 68 | Menu::SliderFloat( "Blue", m_ColorB, 0.f, 255.f, "%.0f", 1.f ); 69 | } 70 | 71 | // Ends the window 72 | Menu::End( ); 73 | } 74 | } 75 | } 76 | //endregion 77 | 78 | //region Scope 79 | namespace Scope { 80 | // Used to save the last state of the master switch so we can 81 | // update the 'fov_cs_debug' cvar 82 | bool m_LastEnabled = false; 83 | 84 | // Used to determine whether or not to render the scope lines 85 | bool m_Scoped = false; 86 | float m_AnimTime = 0.f; 87 | 88 | void RemoveScope( CBaseEntity& me ) { 89 | // Calculate the fraction which should be added/subtracted this frame 90 | const float increment = g_Globals.frametime * 8; 91 | 92 | // Check if the local player is scoped 93 | if ( me.IsScoped( ) ) { 94 | // If so, set 'm_bIsScoped' to false, causing the scope overlay to disappear. 95 | me.IsScoped( ) = false; 96 | 97 | // Tell the script we're scoped in and update the animation time. 98 | m_Scoped = true; 99 | m_AnimTime = Util.ClampFloat( m_AnimTime + increment, 0.f, 1.f ); 100 | return; 101 | } 102 | 103 | // Otherwise, tell the script we aren't scoped in and update the animation time. 104 | m_Scoped = false; 105 | m_AnimTime = Util.ClampFloat( m_AnimTime - increment, 0.f, 1.f ); 106 | } 107 | 108 | void PreserveViewModel( ) { 109 | // Check if the master switch's state has changed. 110 | if ( m_LastEnabled == UI::m_Enabled ) 111 | return; 112 | 113 | // Cache the current state for further checks. 114 | m_LastEnabled = UI::m_Enabled; 115 | 116 | // Set 'fov_cs_debug' to 90 if we enabled the script, or to 0 if we disabled it. 117 | UI::m_Enabled ? g_Engine.ClientCmd_Unrestricted( "fov_cs_debug 90", false ) : g_Engine.ClientCmd_Unrestricted( "fov_cs_debug 0", false ); 118 | } 119 | 120 | void Do( D3D9Renderer& ctx ) { 121 | // Check if we're scoped in and still animating. 122 | if ( !m_Scoped && m_AnimTime == 0 ) 123 | return; 124 | 125 | // Declare and get the screen's width and height. 126 | int w, h; 127 | 128 | g_Surface.GetScreenSize( w, h ); 129 | 130 | // Calculate the line's size and offset based on the user's settings. 131 | int size = int( UI::m_Size * w / 100 ); 132 | int offset = int( UI::m_Offset * w / 100 ); 133 | 134 | // Initialize the colors used on the scope lines. 135 | uint transparent_clr = Color( int( UI::m_ColorR ), int( UI::m_ColorG ), int( UI::m_ColorB ), 0 ).D3D( ); 136 | uint filled_clr = Color( int( UI::m_ColorR ), int( UI::m_ColorG ), int( UI::m_ColorB ), int( 255 * m_AnimTime ) ).D3D( ); 137 | 138 | // Render all four lines. 139 | ctx.FilledRect( Vec2( w / 2, h / 2 - offset - size ), 1, size, filled_clr, transparent_clr, filled_clr, transparent_clr ); 140 | ctx.FilledRect( Vec2( w / 2, h / 2 + offset ), 1, size, transparent_clr, filled_clr, transparent_clr, filled_clr ); 141 | ctx.FilledRect( Vec2( w / 2 - offset - size, h / 2 ), size, 1, transparent_clr, transparent_clr, filled_clr, filled_clr ); 142 | ctx.FilledRect( Vec2( w / 2 + offset, h / 2 ), size, 1, filled_clr, filled_clr, transparent_clr, transparent_clr ); 143 | } 144 | } 145 | //endregion 146 | 147 | //region Callbacks 148 | void onMenu( ) { 149 | // Checks whether or not the menu is open so we can render our window. 150 | if ( CheatVars.menuOpen ) 151 | UI::Render( ); 152 | } 153 | 154 | void onPaint( D3D9Renderer& ctx ) { 155 | // Check if the script is enabled. 156 | if ( !UI::m_Enabled ) 157 | return; 158 | 159 | // Check if we're in-game and connected to a server. 160 | if ( !g_Engine.IsInGame( ) || !g_Engine.IsConnected( ) ) { 161 | // Otherwise, reset the scope animation. Doing this so when you die/disconnect while scoped, 162 | // you don't render the scope the next time you play. 163 | Scope::m_AnimTime = 0.f; 164 | return; 165 | } 166 | 167 | // Get our local player. 168 | CBaseEntity@ me = g_EntityList.GetLocalPlayer( ); 169 | 170 | // Check if we're valid and alive. 171 | if ( me is null || !me.IsAlive( ) ) { 172 | // Otherwise, reset the scope animation. 173 | Scope::m_AnimTime = 0.f; 174 | return; 175 | } 176 | 177 | // Render the scope lines. 178 | Scope::Do( ctx ); 179 | } 180 | 181 | void onFSN( int stage ) { 182 | // Check if we're on the correct FrameStage. 183 | if ( stage != g_Stage::FRAME_RENDER_START ) 184 | return; 185 | 186 | // Enable/Disable the viewmodel when scopped. 187 | Scope::PreserveViewModel( ); 188 | 189 | // Check if the script is enabled. 190 | if ( !UI::m_Enabled ) 191 | return; 192 | 193 | // Get our local player. 194 | CBaseEntity@ me = g_EntityList.GetLocalPlayer( ); 195 | 196 | // Check if we're valid and alive. 197 | if ( me is null || !me.IsAlive( ) ) 198 | return; 199 | 200 | // Removes the scope overlay/lines. 201 | Scope::RemoveScope( me ); 202 | } 203 | 204 | void init( ) { 205 | // Register our callbacks. 206 | RegisterCallback( "OnPaint", onPaint ); 207 | RegisterCallback( "OnMenu", onMenu ); 208 | RegisterCallback( "OnFrameStagePre", onFSN ); 209 | } 210 | //endregion 211 | //endregion 212 | -------------------------------------------------------------------------------- /onetap/better_rain/README.md: -------------------------------------------------------------------------------- 1 | ## Better rain 2 | #### by april#0001 3 | --- 4 | 5 | ###### Installation 6 | 1. Download the files 7 | 2. Extract them into your CS:GO directory (where csgo.exe is located) 8 | 3. Execute `better_rain.js` script in-game 9 | -------------------------------------------------------------------------------- /onetap/better_rain/csgo/sounds/rain_indoors.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aprxl/scripting/bbd3b0a5ed1ab6ae2133b02f1a28df66d3fb4164/onetap/better_rain/csgo/sounds/rain_indoors.wav -------------------------------------------------------------------------------- /onetap/better_rain/csgo/sounds/rain_outdoors.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aprxl/scripting/bbd3b0a5ed1ab6ae2133b02f1a28df66d3fb4164/onetap/better_rain/csgo/sounds/rain_outdoors.wav -------------------------------------------------------------------------------- /onetap/better_rain/ot/scripts/better_rain.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Title: Better rain 4 | * Author: april#0001, kessie#0001 5 | * Description: A small visual and audio complement to the new weather feature. 6 | * 7 | */ 8 | 9 | //region api 10 | const global = [], globals = [], sound = [], cheat = [], local = [], world = [], input = [], render = [], ui = [], convar = [], event = [], entity = [], trace = [], usercmd = [], antiaim = [], exploit = [], ragebot = [], material = []; global.print = Global.Print, global.print_chat = Global.PrintChat, global.print_color = Global.PrintColor, global.register_callback = Global.RegisterCallback, global.execute_command = Global.ExecuteCommand, global.frame_stage = Global.FrameStage, global.tickcount = Global.Tickcount, global.tickrate = Global.Tickrate, global.tick_interval = Global.TickInterval, global.curtime = Global.Curtime, global.realtime = Global.Realtime, global.frametime = Global.Frametime, global.latency = Global.Latency, global.get_view_angles = Global.GetViewAngles, global.set_view_angles = Global.SetViewAngles, global.get_map_name = Global.GetMapName, global.is_key_pressed = Global.IsKeyPressed, global.get_screen_size = Global.GetScreenSize, global.get_cursor_position = Global.GetCursorPosition, global.play_sound = Global.PlaySound, global.play_microphone = Global.PlayMicrophone, global.stop_microphone = Global.StopMicrophone, global.get_username = Global.GetUsername, global.set_clan_tag = Global.SetClanTag, globals.tickcount = Globals.Tickcount, globals.tickrate = Globals.Tickrate, globals.tick_interval = Globals.TickInterval, globals.curtime = Globals.Curtime, globals.realtime = Globals.Realtime, globals.frametime = Globals.Frametime, sound.play = Sound.Play, sound.play_microphone = Sound.PlayMicrophone, sound.stop_microphone = Sound.StopMicrophone, cheat.get_username = Cheat.GetUsername, cheat.register_callback = function(c, f) { switch (c) { case 'create_move': Cheat.RegisterCallback("CreateMove", f); break; case 'paint': Cheat.RegisterCallback("Draw", f); break; case 'fsn': Cheat.RegisterCallback("FrameStageNotify", f); break; case 'shutdown': Cheat.RegisterCallback("Unload", f); break; default: Cheat.RegisterCallback(c, f); break; } }, cheat.execute_command = Cheat.ExecuteCommand, cheat.frame_stage = Cheat.FrameStage, cheat.print = Cheat.Print, cheat.print_chat = Cheat.PrintChat, cheat.print_color = Cheat.PrintColor, local.latency = Local.Latency, local.get_view_angles = Local.GetViewAngles, local.set_view_angles = Local.SetViewAngles, local.set_clan_tag = Local.SetClanTag, local.get_real_yaw = Local.GetRealYaw, local.get_fake_yaw = Local.GetFakeYaw, local.get_spread = Local.GetSpread, local.get_inaccuracy = Local.GetInaccuracy, world.get_map_name = World.GetMapName, world.get_server_string = World.GetServerString, input.get_cursor_position = Input.GetCursorPosition, input.is_key_pressed = Input.IsKeyPressed, render.string = Render.String, render.text_size = Render.TextSize, render.line = Render.Line, render.rect = Render.Rect, render.filled_rect = Render.FilledRect, render.gradient_rect = Render.GradientRect, render.circle = Render.Circle, render.filled_circle = Render.FilledCircle, render.polygon = Render.Polygon, render.world_to_screen = Render.WorldToScreen, render.add_font = Render.AddFont, render.find_font = Render.FindFont, render.string_custom = Render.StringCustom, render.textured_rect = Render.TexturedRect, render.add_texture = Render.AddTexture, render.text_size_custom = Render.TextSizeCustom, render.get_screen_size = Render.GetScreenSize, ui.get_value = UI.GetValue, ui.set_value = UI.SetValue, ui.add_checkbox = UI.AddCheckbox, ui.add_slider_int = UI.AddSliderInt, ui.add_slider_float = UI.AddSliderFloat, ui.add_hotkey = UI.AddHotkey, ui.add_label = UI.AddLabel, ui.add_dropdown = UI.AddDropdown, ui.add_multi_dropdown = UI.AddMultiDropdown, ui.add_color_picker = UI.AddColorPicker, ui.add_textbox = UI.AddTextbox, ui.set_enabled = UI.SetEnabled, ui.get_string = UI.GetString, ui.get_color = UI.GetColor, ui.set_color = UI.SetColor, ui.is_hotkey_active = UI.IsHotkeyActive, ui.toggle_hotkey = UI.ToggleHotkey, ui.is_menu_open = UI.IsMenuOpen, convar.get_int = Convar.GetInt, convar.set_int = Convar.SetInt, convar.get_float = Convar.GetFloat, convar.set_float = Convar.SetFloat, convar.get_string = Convar.GetString, convar.set_string = Convar.SetString, event.get_int = Event.GetInt, event.get_float = Event.GetFloat, event.get_string = Event.GetString, entity.get_entities = Entity.GetEntities, entity.get_entities_by_class_i_d = Entity.GetEntitiesByClassID, entity.get_players = Entity.GetPlayers, entity.get_enemies = Entity.GetEnemies, entity.get_teammates = Entity.GetTeammates, entity.get_local_player = Entity.GetLocalPlayer, entity.get_game_rules_proxy = Entity.GetGameRulesProxy, entity.get_entity_from_user_i_d = Entity.GetEntityFromUserID, entity.is_teammate = Entity.IsTeammate, entity.is_enemy = Entity.IsEnemy, entity.is_bot = Entity.IsBot, entity.is_local_player = Entity.IsLocalPlayer, entity.is_valid = Entity.IsValid, entity.is_alive = Entity.IsAlive, entity.is_dormant = Entity.IsDormant, entity.get_class_i_d = Entity.GetClassID, entity.get_class_name = Entity.GetClassName, entity.get_name = Entity.GetName, entity.get_weapon = Entity.GetWeapon, entity.get_weapons = Entity.GetWeapons, entity.get_render_origin = Entity.GetRenderOrigin, entity.get_render_box = Entity.GetRenderBox, entity.get_prop = Entity.GetProp, entity.set_prop = Entity.SetProp, entity.get_hitbox_position = Entity.GetHitboxPosition, entity.get_eye_position = Entity.GetEyePosition, trace.line = Trace.Line, trace.bullet = Trace.Bullet, usercmd.set_movement = UserCMD.SetMovement, usercmd.get_movement = UserCMD.GetMovement, usercmd.set_angles = UserCMD.SetAngles, usercmd.force_jump = UserCMD.ForceJump, usercmd.force_crouch = UserCMD.ForceCrouch, antiaim.get_override = AntiAim.GetOverride, antiaim.set_override = AntiAim.SetOverride, antiaim.set_real_offset = AntiAim.SetRealOffset, antiaim.set_fake_offset = AntiAim.SetFakeOffset, antiaim.set_l_b_y_offset = AntiAim.SetLBYOffset, exploit.get_charge = Exploit.GetCharge, exploit.recharge = Exploit.Recharge, exploit.disable_recharge = Exploit.DisableRecharge, exploit.enable_recharge = Exploit.EnableRecharge, ragebot.get_target = Ragebot.GetTarget, ragebot.ignore_target = Ragebot.IgnoreTarget, ragebot.force_target = Ragebot.ForceTarget, ragebot.force_target_safety = Ragebot.ForceTargetSafety, ragebot.force_target_hitchance = Ragebot.ForceTargetHitchance, ragebot.force_target_minimum_damage = Ragebot.ForceTargetMinimumDamage, ragebot.force_hitbox_safety = Ragebot.ForceHitboxSafety, material.create = Material.Create, material.destroy = Material.Destroy, material.get = Material.Get, material.set_key_value = Material.SetKeyValue, material.refresh = Material.Refresh 11 | //endregion 12 | 13 | //region dependencies 14 | 15 | /** 16 | * @title BetterUI 17 | * @version 2.1.0 18 | * @description A better UI system for Onetap 19 | */ 20 | 21 | var menu = {}; 22 | const menu_spacer = " "; 23 | 24 | /** 25 | * Concats two elements into an array without increasing the array length. 26 | * Prevents the memory leak in 2.0.0 from happening 27 | * 28 | * @param a {array} 29 | * @param b {any} 30 | */ 31 | menu.concat = function(a, b) 32 | { 33 | // Creates a new array. 34 | var arr = []; 35 | 36 | // Push all items from the array 'a' into our array. 37 | for (var c in a) 38 | { 39 | arr.push(a[c]); 40 | } 41 | 42 | // Push the value 'b' into our array. 43 | arr.push(b); 44 | 45 | // Return the new array. 46 | return arr; 47 | } 48 | 49 | /** 50 | * Creates a new menu label 51 | * 52 | * @param label {string} 53 | */ 54 | menu.label = function(label) 55 | { 56 | // Creates the label 57 | UI.AddLabel(label); 58 | }; 59 | 60 | /** 61 | * Creates a new menu element 62 | * 63 | * @param func {function} 64 | * @param name {string} 65 | * @param label {string}, 66 | * @param properties {array} 67 | */ 68 | menu.new = function(func, name, label, properties) 69 | { 70 | // Get properties 71 | const final_name = name + menu_spacer + label; 72 | var final_props = [final_name]; 73 | const element_info_t = { 74 | path: ["Misc", "JAVASCRIPT", "Script items", final_name] 75 | }; 76 | 77 | // If our properties aren't null, then pack them together. 78 | if (properties != null) 79 | { 80 | for (var i = 0; i < properties.length; i++) 81 | { 82 | final_props.push(properties[i]); 83 | } 84 | } 85 | 86 | // Create our menu element and return properties 87 | func.apply(null, final_props); 88 | return element_info_t; 89 | }; 90 | 91 | /** 92 | * Creates a new menu reference 93 | * 94 | * @param path {array} 95 | */ 96 | menu.reference = function(path) 97 | { 98 | return { 99 | path: path 100 | }; 101 | }; 102 | 103 | /** 104 | * Gets the value of a menu element 105 | * 106 | * @param elem {array} 107 | * @return {*} 108 | */ 109 | menu.get = function(elem) 110 | { 111 | // If the element doesn't exist 112 | if (!(elem.path)) 113 | throw new Error("[Menu] This element doesn't exist!"); 114 | 115 | // Returns the element's value 116 | return UI.GetValue.apply(null, elem.path); 117 | }; 118 | 119 | /** 120 | * Gets the value of a menu element 121 | * 122 | * @param elem {array} 123 | * @return {*} 124 | */ 125 | menu.get_hotkey = function(elem) 126 | { 127 | // If the label doesn't exist 128 | if (!(elem.path)) 129 | throw new Error("[Menu] This element doesn't exist!"); 130 | 131 | // Returns the element's value 132 | return UI.IsHotkeyActive.apply(null, elem.path); 133 | }; 134 | 135 | /** 136 | * Gets the value of a menu element 137 | * 138 | * @param elem {array} 139 | * @return {*} 140 | */ 141 | menu.get_color = function(elem) 142 | { 143 | // If the label doesn't exist 144 | if (!(elem.path)) 145 | throw new Error("[Menu] This element doesn't exist!"); 146 | 147 | // Returns the element's value 148 | return UI.GetColor.apply(null, elem.path); 149 | }; 150 | 151 | /** 152 | * Sets the value of a menu element 153 | * 154 | * @param elem {array} 155 | * @param value {*} 156 | */ 157 | menu.set = function(elem, value) 158 | { 159 | // If the label doesn't exist 160 | if (!(elem.path)) 161 | throw new Error("[Menu] This element doesn't exist!"); 162 | 163 | // Get properties 164 | const properties = elem; 165 | 166 | // Set the element's value 167 | UI.SetValue.apply(null, this.concat(properties.path, value)); 168 | }; 169 | 170 | /** 171 | * Sets the value of a color picker 172 | * 173 | * @param elem {array} 174 | * @param color {array|Color} 175 | */ 176 | menu.set_color = function(elem, color) 177 | { 178 | // If the label doesn't exist 179 | if (!(elem.path)) 180 | throw new Error("[Menu] This element doesn't exist!"); 181 | 182 | // Get properties 183 | const properties = elem; 184 | 185 | // Set the element's value 186 | UI.SetColor.apply(null, this.concat(properties.path, color)); 187 | }; 188 | 189 | /** 190 | * Toggles a hotkey 191 | * 192 | * @param elem {array} 193 | */ 194 | menu.toggle = function(elem) 195 | { 196 | // If the label doesn't exist 197 | if (!(elem.path)) 198 | throw new Error("[Menu] This element doesn't exist!"); 199 | 200 | // Set the element's value 201 | UI.ToggleHotkey.apply(null, elem.path); 202 | }; 203 | 204 | /** 205 | * Changes the visibility of a menu elements 206 | * 207 | * @param elem {array} 208 | * @param visible {boolean} 209 | */ 210 | menu.visibility = function(elem, visible) 211 | { 212 | // If the label doesn't exist 213 | if (!(elem.path)) 214 | throw new Error("[Menu] This element doesn't exist!"); 215 | 216 | // Get properties 217 | const properties = elem; 218 | 219 | // Change the element's visibility 220 | UI.SetEnabled.apply(null, this.concat(properties.path, visible)); 221 | }; 222 | 223 | //endregion 224 | 225 | //region locals 226 | 227 | // Create our locals variables 228 | var cache = { 229 | time: 0, 230 | outside: false, 231 | fraction: 0 232 | }; 233 | 234 | const paths = { 235 | sound_out: "rain_outdoors", 236 | sound_in: "rain_indoors" 237 | }; 238 | 239 | // Chat colours 240 | // by @csmit195 241 | const CHAT_COLOR = { 242 | WHITE: '\x01', 243 | RED: '\x02', 244 | LIGHT_PURPLE: '\x03', 245 | GREEN: '\x04', 246 | LIGHT_GREEN: '\x05', 247 | LIME: '\x06', 248 | GRAY: '\x08', 249 | YELLOW: '\x09', 250 | LIGHT_BLUE: '\x0A', 251 | CYAN: '\x0B', 252 | BLUE: '\x0C', 253 | MAGENTA: '\x0D', 254 | PINK: '\x0E', 255 | LIGHT_RED: '\x0F', 256 | GOLD: '\x10', 257 | }; 258 | 259 | //endregion 260 | 261 | //region menu 262 | // Create our menu elements 263 | const override = menu.new(ui.add_checkbox, "| Override world settings", "br_ovr", []); 264 | 265 | // And reference the already existing ones. 266 | const ref_skybox = menu.reference(["Visual", "WORLD", "Map", "Skybox"]); 267 | const ref_weather = menu.reference(["Visual", "WORLD", "Map", "Weather"]); 268 | const ref_nightmode_amount = menu.reference(["Visual", "WORLD", "Map", "Nightmode"]); 269 | 270 | const ref_force_cheat = menu.reference(["Misc", "GENERAL", "Miscellaneous", "Force sv_cheats"]); 271 | //endregion 272 | 273 | //region functions 274 | 275 | /** 276 | * This will play the rain sounds according to whether or not we're outside. 277 | * 278 | * @param {number} frac 279 | */ 280 | function play_soundscape(frac) 281 | { 282 | // Get our current time and whether or not we're outside. 283 | const now = globals.curtime(); 284 | const outside = frac > 0.87; 285 | 286 | // If it has been 4 seconds since we last played a sound and if our position hasn't changed in the last frame, return. 287 | if (now - cache.time < 4 && outside === cache.outside) 288 | return; 289 | 290 | // Otherwise, something changed and we need to update our soundspace. 291 | // So, we cache our current time so we can do further checks. 292 | cache.time = now; 293 | 294 | // Check if we are currently outside 295 | if (outside) 296 | { 297 | // If so, set our current state to outside and play the outdoors soundscape. 298 | cache.outside = true; 299 | cheat.execute_command("playvol " + paths.sound_out + " 1"); 300 | 301 | // Return after that so we don't execute the other stuff. 302 | // This is just a silly way of simulating an 'else' statement. 303 | return; 304 | } 305 | 306 | // If we didn't return, it means we're indoors. So let's play the indoors soundscape and update our current state. 307 | cache.outside = false; 308 | cheat.execute_command("playvol " + paths.sound_in + " 1"); 309 | } 310 | /** 311 | * Just applies the fog effect. 312 | */ 313 | function apply_fog() 314 | { 315 | // Enable the fog and override its settings to allow us to change it. 316 | cheat.execute_command("fog_enable 1"); 317 | cheat.execute_command("fog_override 1"); 318 | 319 | // Change the fog's radius. 320 | cheat.execute_command("fog_start 1"); 321 | cheat.execute_command("fog_end 100"); 322 | 323 | // Change the fog's color. 324 | cheat.execute_command("fog_color 12 10 15"); 325 | cheat.execute_command("fog_maxdensity 0.8"); 326 | } 327 | 328 | // Apply the fog whenever we first execute the script. 329 | apply_fog(); 330 | 331 | /** 332 | * Where the magic happens. 333 | * 334 | * @callback Draw 335 | */ 336 | function on_paint() 337 | { 338 | // Check if we're overriding the world settings. 339 | if (menu.get(override)) 340 | { 341 | // If so, set our override switch to false since we only want to execute this once. 342 | menu.set(override, false); 343 | 344 | // Force sv_cheat so our fog settings work. 345 | menu.set(ref_force_cheat, true); 346 | 347 | // Update the world settings. 348 | menu.set(ref_weather, 2); 349 | menu.set(ref_nightmode_amount, 0.15); 350 | menu.set(ref_skybox, 6); 351 | 352 | // And print something to chat just to indicate we did something. 353 | cheat.print_chat("[" + CHAT_COLOR.CYAN + "Weather" + CHAT_COLOR.WHITE + "] " + CHAT_COLOR.GRAY + "Your world settings have been successfully overwritten!"); 354 | } 355 | 356 | // Play the soundscape. 357 | play_soundscape(cache.fraction); 358 | } 359 | 360 | /** 361 | * Handles the tracing. 362 | * 363 | * @callback CreateMove 364 | */ 365 | function on_create_move() 366 | { 367 | // Get our local player. 368 | const me = entity.get_local_player(); 369 | 370 | // If our local player isn't valid, then we're not in-game. 371 | // So, there's no need to do anything. 372 | if (!me || !entity.is_alive(me)) 373 | return; 374 | 375 | // Get some vectors.. 376 | const origin = entity.get_render_origin(me); 377 | const destination = [origin[0], origin[1], origin[2] + 1028]; 378 | 379 | // And use them to check if there's anything above us. 380 | cache.fraction = trace.line(me, origin, destination)[1]; 381 | } 382 | 383 | /** 384 | * Disables the fog whenever the script is unloaded. 385 | * 386 | * @callback Unload 387 | */ 388 | function on_shutdown() 389 | { 390 | // Stop overriding the fog. 391 | cheat.execute_command("fog_override 0"); 392 | } 393 | 394 | //endregion 395 | 396 | //region callbacks 397 | 398 | // Create our callbacks. 399 | cheat.register_callback("shutdown", "on_shutdown"); 400 | cheat.register_callback("paint", "on_paint"); 401 | cheat.register_callback("create_move", "on_create_move"); 402 | //endregion 403 | -------------------------------------------------------------------------------- /onetap/betterui.js: -------------------------------------------------------------------------------- 1 | // THIS IS A LIBRARY AND NOT A STANDALONE SCRIPT. 2 | // HAVING SAID SO, THIS WILL NOT WORK OR DO A THING IF EXECUTED. 3 | 4 | //region dependencies 5 | 6 | /** 7 | * @title BetterUI 8 | * @version 2.2.0 9 | * @description A better UI system for Onetap 10 | */ 11 | 12 | var menu = {}; 13 | var menu_elements = {}; 14 | const menu_spacer = " "; 15 | 16 | /** 17 | * Concats two elements into an array without increasing the array length. 18 | * Prevents the memory leak in 2.0.0 from happening 19 | * 20 | * @param a {array} 21 | * @param b {any} 22 | */ 23 | menu.concat = function(a, b) 24 | { 25 | // Creates a new array. 26 | var arr = []; 27 | 28 | // Push all items from the array 'a' into our array. 29 | for (var c in a) 30 | { 31 | arr.push(a[c]); 32 | } 33 | 34 | // Push the value 'b' into our array. 35 | arr.push(b); 36 | 37 | // Return the new array. 38 | return arr; 39 | } 40 | 41 | /** 42 | * Creates a new menu label 43 | * 44 | * @param label {string} 45 | */ 46 | menu.label = function(label) 47 | { 48 | // Creates the label 49 | UI.AddLabel(label); 50 | }; 51 | 52 | /** 53 | * Creates a new menu element 54 | * 55 | * @param func {function} 56 | * @param name {string} 57 | * @param label {string}, 58 | * @param properties {array} 59 | */ 60 | menu.new = function(func, name, label, properties, initial_value) 61 | { 62 | // Fix values 63 | properties = properties || []; 64 | initial_value = initial_value || undefined; 65 | 66 | // Get properties 67 | const final_name = name + menu_spacer + label; 68 | var final_props = [final_name]; 69 | 70 | const element_info_t = { 71 | path: ["Misc", "JAVASCRIPT", "Script Items", final_name], 72 | cache: initial_value, 73 | func: func 74 | }; 75 | 76 | // If our properties aren't null, then pack them together. 77 | if (properties != null) 78 | { 79 | for (var i = 0; i < properties.length; i++) 80 | { 81 | final_props.push(properties[i]); 82 | } 83 | } 84 | 85 | // Create our menu element and return properties 86 | func.apply(null, final_props); 87 | 88 | // Initialize our menu element if it has an initializer. 89 | if (initial_value) 90 | { 91 | switch (func) 92 | { 93 | case UI.AddColorPicker: 94 | UI.SetColor.apply(null, this.concat(element_info_t.path, initial_value)); 95 | break; 96 | 97 | case UI.AddHotkey: 98 | break; 99 | 100 | default: 101 | UI.SetValue.apply(this, this.concat(element_info_t.path, initial_value)); 102 | break; 103 | } 104 | } 105 | 106 | menu_elements[label] = element_info_t; 107 | 108 | return element_info_t; 109 | }; 110 | 111 | /** 112 | * Creates a new menu reference 113 | * 114 | * @param path {array} 115 | */ 116 | menu.reference = function(path) 117 | { 118 | return { 119 | path: path 120 | }; 121 | }; 122 | 123 | /** 124 | * Gets the value of a menu element 125 | * 126 | * @param elem {array} 127 | * @return {*} 128 | */ 129 | menu.get = function(elem) 130 | { 131 | // If the element doesn't exist 132 | if (!(elem.path)) 133 | throw new Error("[Menu] This element doesn't exist!"); 134 | 135 | // Returns the element's value 136 | switch (elem.func) 137 | { 138 | case UI.AddColorPicker: 139 | return UI.GetColor.apply(null, elem.path); 140 | 141 | case UI.AddHotkey: 142 | return UI.IsHotkeyActive.apply(null, elem.path); 143 | 144 | default: 145 | return UI.GetValue.apply(null, elem.path); 146 | } 147 | }; 148 | 149 | /** 150 | * Sets the value of a menu element 151 | * 152 | * @param elem {array} 153 | * @param value {*} 154 | */ 155 | menu.set = function(elem, value) 156 | { 157 | // If the label doesn't exist 158 | if (!(elem.path)) 159 | throw new Error("[Menu] This element doesn't exist!"); 160 | 161 | // Set the element's value 162 | switch (elem.func) 163 | { 164 | case UI.AddColorPicker: 165 | UI.SetColor.apply(null, this.concat(elem.path, value)); 166 | break; 167 | 168 | case UI.AddHotkey: 169 | if (menu.get(elem) !== value) 170 | UI.ToggleHotkey.apply(null, elem.path); 171 | break; 172 | 173 | default: 174 | UI.SetValue.apply(null, this.concat(elem.path, value)); 175 | break; 176 | } 177 | }; 178 | 179 | /** 180 | * Changes the visibility of a menu elements 181 | * 182 | * @param elem {array} 183 | * @param visible {boolean} 184 | */ 185 | menu.visibility = function(elem, visible) 186 | { 187 | // If the label doesn't exist 188 | if (!(elem.path)) 189 | throw new Error("[Menu] This element doesn't exist!"); 190 | 191 | // Change the element's visibility 192 | UI.SetEnabled.apply(null, this.concat(elem.path, visible)); 193 | }; 194 | 195 | /** 196 | * Adds an event to a menu element which is triggered everytime this element's value is changed. 197 | * 198 | * @param elem {array} 199 | * @param func {function} 200 | */ 201 | menu.add_event = function(elem, func) 202 | { 203 | if (!elem.path) 204 | throw new Error("[Menu] This element doesn't exist!"); 205 | 206 | elem.callback = func; 207 | } 208 | 209 | /** 210 | * Handles the menu elements' events. Call this inside a Draw or FSN callback. 211 | */ 212 | menu.handle_events = function() 213 | { 214 | for (var label in menu_elements) 215 | { 216 | const elem = menu_elements[label]; 217 | 218 | if (!elem.path || !elem.callback) 219 | continue; 220 | 221 | const value = menu.get(elem); 222 | 223 | if (elem.cache === undefined) 224 | elem.cache = value; 225 | 226 | if (elem.cache !== value) 227 | { 228 | elem.callback.apply(null, [elem]); 229 | elem.cache = value; 230 | } 231 | } 232 | } 233 | 234 | //endregion 235 | -------------------------------------------------------------------------------- /onetap/body_lean.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Title: Old body lean 4 | * Author: april#0001 5 | * Description: Recreates the body lean from V2 6 | * 7 | */ 8 | 9 | //region main 10 | 11 | // Our main variables 12 | var main = { 13 | condition: 0, 14 | last_condition: -1, 15 | 16 | jittering: false 17 | }; 18 | 19 | //endregion 20 | 21 | //region menu 22 | 23 | // :eyes: 24 | //const indicator = UI.AddCheckbox("Desync length indicator"); 25 | 26 | // Creates our condition selector 27 | const current_condition = UI.AddDropdown("Condition", ["Standing", "Moving", "Slow-walking", "Jumping"]); 28 | 29 | // Create the rest of the elements 30 | const normal = { 31 | 0: UI.AddSliderInt("Standing body lean", 0, 150), 32 | 1: UI.AddSliderInt("Moving body lean", 0, 150), 33 | 2: UI.AddSliderInt("Slow-walking body lean", 0, 150), 34 | 3: UI.AddSliderInt("Jumping body lean", 0, 150) 35 | }; 36 | 37 | const inverted = { 38 | 0: UI.AddSliderInt("Standing inverted body lean", 0, 150), 39 | 1: UI.AddSliderInt("Moving inverted body lean", 0, 150), 40 | 2: UI.AddSliderInt("Slow-walking inverted body lean", 0, 150), 41 | 3: UI.AddSliderInt("Jumping inverted body lean", 0, 150) 42 | }; 43 | 44 | const jitter_type = { 45 | 0: UI.AddDropdown("Standing jitter mode", ["Offset", "Circular", "Random"]), 46 | 1: UI.AddDropdown("Moving jitter mode", ["Offset", "Circular", "Random"]), 47 | 2: UI.AddDropdown("Slow-walking jitter mode", ["Offset", "Circular", "Random"]), 48 | 3: UI.AddDropdown("Jumping jitter mode", ["Offset", "Circular", "Random"]) 49 | }; 50 | 51 | const jitter_ranges = { 52 | 0: UI.AddSliderInt("Standing jitter range", 0, 58), 53 | 1: UI.AddSliderInt("Moving jitter range", 0, 58), 54 | 2: UI.AddSliderInt("Slow-walking jitter range", 0, 58), 55 | 3: UI.AddSliderInt("Jumping jitter range", 0, 58) 56 | }; 57 | 58 | // Group our condition's names to make our lives easier 59 | const conditions = { 60 | 0: "Standing", 61 | 1: "Moving", 62 | 2: "Slow-walking", 63 | 3: "Jumping" 64 | }; 65 | 66 | //endregion 67 | 68 | //region functions 69 | 70 | //region utilities 71 | 72 | /** 73 | * Gets the horizontal velocity of a player entity 74 | * 75 | * @param player 76 | * @returns {number} 77 | */ 78 | const velocity = function(player) { 79 | const vel = Entity.GetProp(player, "CBasePlayer", "m_vecVelocity[0]"); 80 | return ( 81 | Math.sqrt(vel[0] * vel[0] + vel[1] * vel[1]) 82 | ) 83 | }; 84 | 85 | /** 86 | * Checks if a player entity is jumping 87 | * 88 | * @param player 89 | * @returns {*} 90 | */ 91 | const is_jumping = function(player) { 92 | return ( 93 | // s/o @leed 94 | Entity.GetProp(player, "CBasePlayer", "m_hGroundEntity") 95 | ) 96 | }; 97 | 98 | //endregion 99 | 100 | /** 101 | * Updates the visibility of our menu elements 102 | */ 103 | function update_visibility() 104 | { 105 | // Get our selected condition 106 | const _cond = UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Condition"); 107 | 108 | // If we didn't change between conditions, then no need to update our menu 109 | if (_cond === main.last_condition) 110 | return; 111 | 112 | // Otherwise, cache our current condition to do the check later on 113 | main.last_condition = _cond; 114 | 115 | // Loop between every condition 116 | for (i = 0; i < 4; i++) 117 | { 118 | // Get our properties 119 | const normal_label = conditions[i] + " body lean"; 120 | const inverted_label = conditions[i] + " inverted body lean"; 121 | const jitter_cond_label = conditions[i] + " jitter mode"; 122 | const jitter_val_label = conditions[i] + " jitter range"; 123 | const enabled = i === _cond; 124 | 125 | // Update menu elements 126 | UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", normal_label, enabled); 127 | UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", inverted_label, enabled); 128 | UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", jitter_cond_label, enabled); 129 | UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", jitter_val_label, enabled); 130 | } 131 | } 132 | 133 | // Update the visibility whenever the script is first loaded. 134 | update_visibility(); 135 | 136 | /** 137 | * Updates the condition of our player 138 | */ 139 | function update_condition() 140 | { 141 | // Gets the local player 142 | const player = Entity.GetLocalPlayer(); 143 | 144 | // If our local player is invalid or isn't alive, then reset. 145 | if (!player || !Entity.IsAlive(player)) 146 | { 147 | main.condition = 0; 148 | return; 149 | } 150 | 151 | // Get slow-walk state 152 | const slowwalk = UI.IsHotkeyActive("Anti-Aim", "Extra", "Slow walk"); 153 | 154 | // If it's jumping, then return "Jumping" 155 | if (is_jumping(player)) {main.condition = 3; return;} else { 156 | 157 | // Otherwise, check for player's velocity 158 | if (velocity(player) > 2) { 159 | // If we're moving and pressing the slow-walk key, then return "Slow-walking" 160 | if (slowwalk) { 161 | main.condition = 2; 162 | return; 163 | } 164 | 165 | //Otherwise, return "Moving" 166 | main.condition = 1; 167 | return; 168 | } 169 | 170 | } 171 | 172 | // If we're on the ground and not moving, then return "Standing" 173 | main.condition = 0; 174 | } 175 | 176 | function get_jitter_values() 177 | { 178 | // Gets the local player 179 | const player = Entity.GetLocalPlayer(); 180 | 181 | // If our local player is invalid or isn't alive, then return 0. 182 | if (!player || !Entity.IsAlive(player)) 183 | { 184 | return 0; 185 | } 186 | 187 | // Get our current jitter info 188 | const _mode = UI.GetValue("Misc", "JAVASCRIPT", "Script items", conditions[main.condition] + " jitter mode"); 189 | const _range = UI.GetValue("Misc", "JAVASCRIPT", "Script items", conditions[main.condition] + " jitter range"); 190 | 191 | // If our range is 0, then no need to jitter. 192 | if (_range === 0) { 193 | return 0; 194 | } 195 | 196 | // Offset 197 | if (_mode === 0) { 198 | main.jittering = !main.jittering; 199 | return main.jittering ? _range : 0; 200 | } 201 | 202 | // Circular 203 | if (_mode === 1) { 204 | return (Globals.Tickcount() / 2) % _range; 205 | } 206 | 207 | // Random 208 | if (_mode === 2) { 209 | return Math.random() * _range; 210 | } 211 | } 212 | 213 | /** 214 | * Do the anti-aim calculations and updates 215 | */ 216 | function do_anti_aim() 217 | { 218 | // Callback our functions 219 | update_condition(); 220 | update_visibility(); 221 | 222 | // Get our current lean values 223 | const leans = { 224 | normal: UI.GetValue("Misc", "JAVASCRIPT", "Script items", conditions[main.condition] + " body lean"), 225 | inv: UI.GetValue("Misc", "JAVASCRIPT", "Script items", conditions[main.condition] + " inverted body lean") 226 | }; 227 | 228 | // Switch between inverted and normal lean 229 | const yaw = UI.IsHotkeyActive("Anti-Aim", "Fake angles", "Inverter") ? leans.inv : leans.normal; 230 | const jitter_offset = get_jitter_values(); 231 | 232 | // Update our anti-aim 233 | UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Yaw offset", 234 | 59 - (yaw * 0.59) + jitter_offset 235 | ); 236 | } 237 | 238 | //endregion 239 | 240 | //region callbacks 241 | 242 | // Callback our main function 243 | Cheat.RegisterCallback("CreateMove", "do_anti_aim"); 244 | 245 | //endregion 246 | -------------------------------------------------------------------------------- /onetap/custom_doubletap.js: -------------------------------------------------------------------------------- 1 | //region menu 2 | UI.AddSliderInt("Tolerance", 0, 8); 3 | UI.AddSliderInt("Shift", 1, 14); 4 | //endregion 5 | 6 | //region main 7 | function _FrameNetUpdateStart( ) 8 | { 9 | Exploit.OverrideTolerance(UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Tolerance")); 10 | Exploit.OverrideShift(UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Shift")); 11 | } 12 | //endregion 13 | 14 | //region callbacks 15 | Cheat.RegisterCallback("FRAME_NET_UPDATE_START", "_FrameNetUpdateStart"); 16 | //endregion 17 | -------------------------------------------------------------------------------- /onetap/customizable_accent.js: -------------------------------------------------------------------------------- 1 | // Deleted due to malicious use of this script. 2 | -------------------------------------------------------------------------------- /onetap/hit_circles.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Title: Hit circles 4 | * Author: april#0001 5 | * Description: Draws a circle indicator on top of the hitbox of a recently shot player. 6 | * 7 | */ 8 | 9 | //region dependencies 10 | function safe_concat(a, b) 11 | { 12 | var arr = []; 13 | 14 | for (var k in a) 15 | arr.push(a[k]); 16 | 17 | if (b instanceof Array) 18 | { 19 | for (var k in b) 20 | arr.push(b[k]); 21 | 22 | return arr; 23 | } 24 | 25 | arr.push(b); 26 | return arr; 27 | } 28 | 29 | function call(func, name, props) 30 | { 31 | func.apply(null, safe_concat([name], props)); 32 | return name; 33 | } 34 | 35 | function get(path, is_color) 36 | { 37 | is_color = is_color || false; 38 | const func = is_color ? UI.GetColor : UI.GetValue; 39 | 40 | if (path instanceof Array) 41 | return func.apply(null, path); 42 | 43 | return func.apply(null, ["Script items", path]); 44 | } 45 | 46 | function set(path, value) 47 | { 48 | const func = (value instanceof Array) ? UI.SetColor : UI.SetValue; 49 | 50 | if (path instanceof Array) 51 | return func.apply(null, safe_concat(path, value)); 52 | 53 | func.apply(null, safe_concat(path, value)); 54 | } 55 | 56 | function visible(path, value) 57 | { 58 | if (path instanceof Array) 59 | return UI.SetEnabled.apply(null, safe_concat(path, value)); 60 | 61 | UI.SetEnabled.apply(null, safe_concat(["Script items", path], value)); 62 | } 63 | //endregion 64 | 65 | //region api 66 | // Localize the functions I'm using throughout the script. 67 | const callback = Cheat.RegisterCallback; 68 | const get_int = Event.GetInt, get_float = Event.GetFloat; 69 | const entity_from_userid = Entity.GetEntityFromUserID, local_player = Entity.GetLocalPlayer, hitbox_position = Entity.GetHitboxPosition, alive = Entity.IsAlive; 70 | const render_circle = Render.FilledCircle, to_screen = Render.WorldToScreen; 71 | const frametime = Globals.Frametime, tickcount = Globals.Tickcount; 72 | const max = Math.max, sqrt = Math.sqrt; 73 | //endregion 74 | 75 | //region menu 76 | // Create my menu elements 77 | const enable = call(UI.AddCheckbox, "| Hit circles", []); 78 | const color = call(UI.AddColorPicker, "| Hit circle color", []); 79 | //endregion 80 | 81 | //region locals 82 | // Map for converting hitgroups to hitboxes. 83 | const hitgroup_to_hitbox = { 84 | 1: [0, 1], 85 | 2: [4, 5, 6], 86 | 3: [2, 3], 87 | 4: [13, 15, 16], 88 | 5: [14, 17, 18], 89 | 6: [7, 9, 11], 90 | 7: [8, 10, 12] 91 | } 92 | 93 | // Localize our data array where our bullet impacts will be stored. 94 | var data = {}; 95 | //endregion 96 | 97 | //region functions 98 | function render_faded_circle(x, y, radius, color) { 99 | // Calculate how much should be decremented from our alpha on each radius. 100 | // This is responsible for the fade effect. 101 | const step = color[3] / radius; 102 | 103 | // Renders multiple circles, each one with a lower alpha. 104 | for (var i = 0; i <= radius; i++) { 105 | render_circle(x, y, i, [color[0], color[1], color[2], color[3] - step * i]); 106 | } 107 | } 108 | 109 | function on_bullet_impact() { 110 | // If the script isn't enabled, return. 111 | if (!get(enable)) 112 | return; 113 | 114 | // Get our entities 115 | const userid = entity_from_userid(get_int("userid")); 116 | const me = local_player(); 117 | 118 | // Check if we're the one who fired a bullet 119 | if (userid === me) { 120 | // Get more event stuff. 121 | const pos = [get_float("x"), get_float("y"), get_float("z")]; 122 | const tick = tickcount(); 123 | 124 | // Insert our bullet impact data into the data array. 125 | data[tick] = { 126 | pos: pos, 127 | alpha: get(color, true)[3], 128 | hit: false 129 | }; 130 | } 131 | } 132 | 133 | function on_player_hurt() { 134 | // If the script isn't enabled, return. 135 | if (!get(enable)) 136 | return; 137 | 138 | // Get our entities. 139 | const userid = entity_from_userid(get_int("userid")), attacker = entity_from_userid(get_int("attacker")); 140 | const me = local_player(); 141 | 142 | // Check if this player_hurt event has anything to do with us. 143 | if (attacker !== me || userid === me) 144 | return; 145 | 146 | // Get the current tick count. 147 | const tick = tickcount(); 148 | 149 | // If there's no data in this tick, it means that our bullet_impact wasn't registered and, thus, there's nothing we should do. 150 | if (data[tick] == undefined) 151 | return; 152 | 153 | // Get the hitgroup our bullet hit. 154 | const hitgroup = get_int("hitgroup"); 155 | 156 | // Get some more data and convert our hitgroup into an array of hitboxes. 157 | const current = data[tick]; 158 | const hitboxes = hitgroup_to_hitbox[hitgroup]; 159 | 160 | // Setup a variable to do distance-based calculations 161 | // 8192 is the maximum distance a bullet can travel in CS:GO. 162 | var min_distance = 8192; 163 | 164 | // Loop through all of the converted hitboxes. 165 | for (var i in hitboxes) { 166 | // Get the current hitbox and it's position. 167 | const hitbox = hitboxes[i]; 168 | const hitbox_position = Entity.GetHitboxPosition(userid, hitbox); 169 | 170 | // Calculate the distance between our bullet_impact position and this hitbox's position. 171 | const distance = sqrt((current.pos[0] - hitbox_position[0]) ** 2 + (current.pos[1] - hitbox_position[1]) ** 2 + (current.pos[2] - hitbox_position[2]) ** 2); 172 | 173 | // If the distance is lower than the previous one, this means that this hitbox has a 174 | // higher chance of being the hitbox our bullet hit. 175 | if (distance < min_distance) 176 | { 177 | // If so, update our data array to use this hitbox's position instead. 178 | current.hit = true; 179 | current.pos = hitbox_position; 180 | 181 | // Update our 'min_distance' variable to do further calculations 182 | min_distance = distance; 183 | } 184 | } 185 | } 186 | 187 | function draw() { 188 | // If the script isn't enabled, return. 189 | if (!get(enable)) 190 | return; 191 | 192 | // Get some of our drawing info. 193 | const selected_color = get(color, true); 194 | const inc = 0.25 * frametime() * selected_color[3]; 195 | 196 | // Loop for every element inside our data array. 197 | for (var tick in data) 198 | { 199 | // Transform 'tick' into an integer because JS doesn't do that apparently. 200 | tick = parseInt(tick); 201 | 202 | // Get our current tick's data. 203 | const draw_info = data[tick]; 204 | 205 | // Transform our impact's position into screen coordinates. 206 | const wts = to_screen(draw_info.pos); 207 | 208 | // Update our alpha to create a smooth fade out effect. 209 | draw_info.alpha = max(draw_info.alpha - inc, 0); 210 | 211 | // If our alpha is 0, then it means our animations is over. 212 | // Thus, there's no need to render this impact. 213 | if (draw_info.alpha === 0) 214 | continue; 215 | 216 | // Render our sexy impact indicator. 217 | render_faded_circle(wts[0], wts[1], draw_info.hit ? 20 : 15, [selected_color[0], selected_color[1], selected_color[2], draw_info.alpha]); 218 | } 219 | } 220 | 221 | function reset_data() { 222 | // Reset our data array every round or server switch. 223 | data = []; 224 | } 225 | 226 | callback("bullet_impact", "on_bullet_impact"); 227 | callback("player_hurt", "on_player_hurt"); 228 | callback("round_prestart", "reset_data"); 229 | callback("player_connect_full", "reset_data"); 230 | callback("Draw", "draw"); 231 | //endregion 232 | -------------------------------------------------------------------------------- /onetap/invert_on_hit.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Title: Last hit lower body 4 | * Author: april#0001 5 | * Description: Renders a indicator that represents whether your current lower body angle is safe or not. 6 | * 7 | */ 8 | 9 | //region api 10 | 11 | // Localizing all of the functions in snake_case because why not. 12 | const global_print = Global.Print, global_print_chat = Global.PrintChat, global_print_color = Global.PrintColor, global_register_callback = Global.RegisterCallback, global_execute_command = Global.ExecuteCommand, global_frame_stage = Global.FrameStage, global_tickcount = Global.Tickcount, global_tickrate = Global.Tickrate, global_tick_interval = Global.TickInterval, global_curtime = Global.Curtime, global_realtime = Global.Realtime, global_frametime = Global.Frametime, global_latency = Global.Latency, global_get_view_angles = Global.GetViewAngles, global_set_view_angles = Global.SetViewAngles, global_get_map_name = Global.GetMapName, global_is_key_pressed = Global.IsKeyPressed, global_get_screen_size = Global.GetScreenSize, global_get_cursor_position = Global.GetCursorPosition, global_play_sound = Global.PlaySound, global_play_microphone = Global.PlayMicrophone, global_stop_microphone = Global.StopMicrophone, global_get_username = Global.GetUsername, global_set_clan_tag = Global.SetClanTag, globals_tickcount = Globals.Tickcount, globals_tickrate = Globals.Tickrate, globals_tick_interval = Globals.TickInterval, globals_curtime = Globals.Curtime, globals_realtime = Globals.Realtime, globals_frametime = Globals.Frametime, sound_play = Sound.Play, sound_play_microphone = Sound.PlayMicrophone, sound_stop_microphone = Sound.StopMicrophone, cheat_get_username = Cheat.GetUsername, cheat_register_callback = cheat_register_callback = new Proxy(Cheat.RegisterCallback, { apply: function(_, _, args) { switch(args[0]) { case 'paint': Cheat.RegisterCallback('Draw', args[1]); break; case 'create_move': Cheat.RegisterCallback('CreateMove', args[1]); break; case 'fsn': Cheat.RegisterCallback('FrameStageNotify', args[1]); break; default: Cheat.RegisterCallback(args[0], args[1]); break; } } }), cheat_execute_command = Cheat.ExecuteCommand, cheat_frame_stage = Cheat.FrameStage, cheat_print = Cheat.Print, cheat_print_chat = Cheat.PrintChat, cheat_print_color = Cheat.PrintColor, local_latency = Local.Latency, local_get_view_angles = Local.GetViewAngles, local_set_view_angles = Local.SetViewAngles, local_set_clan_tag = Local.SetClanTag, local_get_real_yaw = Local.GetRealYaw, local_get_fake_yaw = Local.GetFakeYaw, local_get_spread = Local.GetSpread, local_get_inaccuracy = Local.GetInaccuracy, world_get_map_name = World.GetMapName, world_get_server_string = World.GetServerString, input_get_cursor_position = Input.GetCursorPosition, input_is_key_pressed = Input.IsKeyPressed, render_string = Render.String, render_text_size = Render.TextSize, render_line = Render.Line, render_rect = Render.Rect, render_filled_rect = Render.FilledRect, render_gradient_rect = Render.GradientRect, render_circle = Render.Circle, render_filled_circle = Render.FilledCircle, render_polygon = Render.Polygon, render_world_to_screen = Render.WorldToScreen, render_add_font = Render.AddFont, render_find_font = Render.FindFont, render_string_custom = Render.StringCustom, render_textured_rect = Render.TexturedRect, render_add_texture = Render.AddTexture, render_text_size_custom = Render.TextSizeCustom, render_get_screen_size = Render.GetScreenSize, ui_get_value = UI.GetValue, ui_set_value = UI.SetValue, ui_add_checkbox = UI.AddCheckbox, ui_add_slider_int = UI.AddSliderInt, ui_add_slider_float = UI.AddSliderFloat, ui_add_hotkey = UI.AddHotkey, ui_add_label = UI.AddLabel, ui_add_dropdown = UI.AddDropdown, ui_add_multi_dropdown = UI.AddMultiDropdown, ui_add_color_picker = UI.AddColorPicker, ui_add_textbox = UI.AddTextbox, ui_set_enabled = UI.SetEnabled, ui_get_string = UI.GetString, ui_get_color = UI.GetColor, ui_set_color = UI.SetColor, ui_is_hotkey_active = UI.IsHotkeyActive, ui_toggle_hotkey = UI.ToggleHotkey, ui_is_menu_open = UI.IsMenuOpen, convar_get_int = Convar.GetInt, convar_set_int = Convar.SetInt, convar_get_float = Convar.GetFloat, convar_set_float = Convar.SetFloat, convar_get_string = Convar.GetString, convar_set_string = Convar.SetString, event_get_int = Event.GetInt, event_get_float = Event.GetFloat, event_get_string = Event.GetString, entity_get_entities = Entity.GetEntities, entity_get_entities_by_class_i_d = Entity.GetEntitiesByClassID, entity_get_players = Entity.GetPlayers, entity_get_enemies = Entity.GetEnemies, entity_get_teammates = Entity.GetTeammates, entity_get_local_player = Entity.GetLocalPlayer, entity_get_game_rules_proxy = Entity.GetGameRulesProxy, entity_get_entity_from_user_i_d = Entity.GetEntityFromUserID, entity_is_teammate = Entity.IsTeammate, entity_is_enemy = Entity.IsEnemy, entity_is_bot = Entity.IsBot, entity_is_local_player = Entity.IsLocalPlayer, entity_is_valid = Entity.IsValid, entity_is_alive = Entity.IsAlive, entity_is_dormant = Entity.IsDormant, entity_get_class_i_d = Entity.GetClassID, entity_get_class_name = Entity.GetClassName, entity_get_name = Entity.GetName, entity_get_weapon = Entity.GetWeapon, entity_get_weapons = Entity.GetWeapons, entity_get_render_origin = Entity.GetRenderOrigin, entity_get_prop = Entity.GetProp, entity_set_prop = Entity.SetProp, entity_get_hitbox_position = Entity.GetHitboxPosition, entity_get_eye_position = Entity.GetEyePosition, trace_line = Trace.Line, trace_bullet = Trace.Bullet, usercmd_set_movement = UserCMD.SetMovement, usercmd_get_movement = UserCMD.GetMovement, usercmd_set_angles = UserCMD.SetAngles, usercmd_force_jump = UserCMD.ForceJump, usercmd_force_crouch = UserCMD.ForceCrouch, antiaim_get_override = AntiAim.GetOverride, antiaim_set_override = AntiAim.SetOverride, antiaim_set_real_offset = AntiAim.SetRealOffset, antiaim_set_fake_offset = AntiAim.SetFakeOffset, antiaim_set_l_b_y_offset = AntiAim.SetLBYOffset, exploit_get_charge = Exploit.GetCharge, exploit_recharge = Exploit.Recharge, exploit_disable_recharge = Exploit.DisableRecharge, exploit_enable_recharge = Exploit.EnableRecharge, ragebot_override_minimum_damage = Ragebot.OverrideMinimumDamage, ragebot_override_hitchance = Ragebot.OverrideHitchance, ragebot_override_accuracy_boost = Ragebot.OverrideAccuracyBoost, ragebot_override_multipoint_scale = Ragebot.OverrideMultipointScale, ragebot_force_safety = Ragebot.ForceSafety; 13 | 14 | //endregion 15 | 16 | //region dependencies 17 | 18 | /** 19 | * @title BetterUI 20 | * @version 2.0.0 21 | * @description A better UI system for Onetap 22 | */ 23 | 24 | var menu = []; 25 | const menu_spacer = " "; 26 | 27 | /** 28 | * Creates a new menu label 29 | * 30 | * @param label {string} 31 | */ 32 | menu.label = function(label) 33 | { 34 | // Creates the label 35 | UI.AddLabel(label); 36 | }; 37 | 38 | /** 39 | * Creates a new menu element 40 | * 41 | * @param func {function} 42 | * @param name {string} 43 | * @param label {string}, 44 | * @param properties {array} 45 | */ 46 | menu.call = function(func, name, label, properties) 47 | { 48 | // Get properties 49 | const final_name = name + menu_spacer + label; 50 | var final_props = [final_name]; 51 | const element_info_t = { 52 | path: ["Misc", "JAVASCRIPT", "Script Items", final_name] 53 | }; 54 | 55 | // If our properties aren't null, then pack them together. 56 | if (properties != null) 57 | { 58 | for (var i = 0; i < properties.length; i++) 59 | { 60 | final_props.push(properties[i]); 61 | } 62 | } 63 | 64 | // Create our menu element and return properties 65 | func.apply(null, final_props); 66 | return element_info_t; 67 | }; 68 | 69 | /** 70 | * Creates a new menu reference 71 | * 72 | * @param path {array} 73 | */ 74 | menu.reference = function(path) 75 | { 76 | const element_info_t = { 77 | path: path 78 | }; 79 | 80 | return element_info_t; 81 | }; 82 | 83 | /** 84 | * Gets the value of a menu element 85 | * 86 | * @param elem {array} 87 | * @return {*} 88 | */ 89 | menu.get = function(elem) 90 | { 91 | // If the element doesn't exist 92 | if (!(elem.path)) 93 | throw new Error("[Menu] This element doesn't exist!"); 94 | 95 | // Returns the element's value 96 | return UI.GetValue.apply(null, elem.path); 97 | }; 98 | 99 | /** 100 | * Gets the value of a menu element 101 | * 102 | * @param elem {array} 103 | * @return {*} 104 | */ 105 | menu.get_hotkey = function(elem) 106 | { 107 | // If the label doesn't exist 108 | if (!(elem.path)) 109 | throw new Error("[Menu] This element doesn't exist!"); 110 | 111 | // Returns the element's value 112 | return UI.IsHotkeyActive.apply(null, elem.path); 113 | }; 114 | 115 | /** 116 | * Gets the value of a menu element 117 | * 118 | * @param elem {array} 119 | * @return {*} 120 | */ 121 | menu.get_color = function(elem) 122 | { 123 | // If the label doesn't exist 124 | if (!(elem.path)) 125 | throw new Error("[Menu] This element doesn't exist!"); 126 | 127 | // Returns the element's value 128 | return UI.GetColor.apply(null, elem.path); 129 | }; 130 | 131 | /** 132 | * Sets the value of a menu element 133 | * 134 | * @param elem {array} 135 | * @param value {any} 136 | */ 137 | menu.set = function(elem, value) 138 | { 139 | // If the label doesn't exist 140 | if (!(elem.path)) 141 | throw new Error("[Menu] This element doesn't exist!"); 142 | 143 | // Get properties 144 | const properties = elem; 145 | properties.path.push(value); 146 | 147 | // Set the element's value 148 | UI.SetValue.apply(null, properties.path); 149 | }; 150 | 151 | /** 152 | * Sets the value of a color picker 153 | * 154 | * @param elem {array} 155 | * @param color {array|Color} 156 | */ 157 | menu.set_color = function(elem, color) 158 | { 159 | // If the label doesn't exist 160 | if (!(elem.path)) 161 | throw new Error("[Menu] This element doesn't exist!"); 162 | 163 | // Get properties 164 | const properties = elem; 165 | properties.path.push(color); 166 | 167 | // Set the element's value 168 | UI.SetColor.apply(null, properties.path); 169 | }; 170 | 171 | /** 172 | * Sets the value of a color picker 173 | * 174 | * @param elem {array} 175 | */ 176 | menu.toggle = function(elem) 177 | { 178 | // If the label doesn't exist 179 | if (!(elem.path)) 180 | throw new Error("[Menu] This element doesn't exist!"); 181 | 182 | // Set the element's value 183 | UI.ToggleHotkey.apply(null, elem.path); 184 | }; 185 | 186 | /** 187 | * Changes the visibility of a menu elements 188 | * 189 | * @param elem {array} 190 | * @param visible {boolean} 191 | */ 192 | menu.visibility = function(elem, visible) 193 | { 194 | // If the label doesn't exist 195 | if (!(elem.path)) 196 | throw new Error("[Menu] This element doesn't exist!"); 197 | 198 | // Get properties 199 | const properties = elem; 200 | properties.path.push(visible); 201 | 202 | // Change the element's visibility 203 | UI.SetEnabled.apply(null, properties.path); 204 | }; 205 | 206 | 207 | 208 | //endregion 209 | 210 | //region main 211 | 212 | // Create our main instance 213 | var plugin = { 214 | _info: { 215 | _title: "Last hit lower body", 216 | _version: "1.0.0", 217 | _author: "april#0001" 218 | }, 219 | 220 | last_hit_lby: undefined 221 | }; 222 | 223 | //endregion 224 | 225 | //region menu 226 | 227 | // Create our menu elements 228 | const enable = menu.call(ui_add_checkbox, "Show lower body status", "lby_enable", []); 229 | const auto_invert = menu.call(ui_add_checkbox, "Invert lower body when hit", "lby_invert", []); 230 | 231 | // Declare our references 232 | const ref_inverter = menu.reference(["Anti-Aim", "Fake angles", "Inverter"]); 233 | 234 | //endregion 235 | 236 | //region functions 237 | 238 | /** 239 | * @callback paint 240 | * @brief Handles our plugin's rendering. 241 | */ 242 | function on_paint( ) 243 | { 244 | // Checks whether or not our script is enabled. 245 | if (!(menu.get(enable))) 246 | return; 247 | 248 | // Get some properties. 249 | const height = render_get_screen_size( )[1]; 250 | const current_lby = menu.get_hotkey(ref_inverter); 251 | 252 | // Render the shadow 253 | render_string( 254 | 10, 255 | height - 74, 256 | 0, 257 | "FAKE", 258 | [10, 10, 10, 225], 259 | 4 260 | ); 261 | 262 | // Render the indicator. 263 | render_string( 264 | 10, 265 | height - 75, 266 | 0, 267 | "FAKE", 268 | (current_lby === plugin.last_hit_lby) ? [195, 18, 18, 200] : [108, 195, 18, 200], 269 | 4 270 | ); 271 | } 272 | 273 | /** 274 | * @callback player_hurt 275 | * @brief Handles the plugin's logic. 276 | */ 277 | function on_player_hurt( ) 278 | { 279 | // Get the event's entities. 280 | const me = entity_get_local_player( ); 281 | const attacker = entity_get_entity_from_user_i_d(event_get_int("attacker")); 282 | const userid = entity_get_entity_from_user_i_d(event_get_int("userid")); 283 | 284 | // Checks if our local player was the one getting hurt and not the one attacking. 285 | // Or, in other words, check if we got hurt. 286 | if (me !== attacker && me === userid) 287 | { 288 | // Update the last hit lower body global. 289 | plugin.last_hit_lby = menu.get_hotkey(ref_inverter); 290 | 291 | // Check if we have the auto inverter on. 292 | if (menu.get(auto_invert)) 293 | { 294 | // If so, toggle the inverter key. 295 | menu.toggle(ref_inverter); 296 | } 297 | } 298 | } 299 | 300 | /** 301 | * @callback round_start, player_connect_full 302 | * @brief Resets the last lower body state whenever the round ends or you switch servers. 303 | */ 304 | function reset( ) 305 | { 306 | // Reset the last lower body state. 307 | plugin.last_hit_lby = undefined; 308 | } 309 | 310 | 311 | //endregion 312 | 313 | //region callbacks 314 | 315 | // Register our 'paint' callback. 316 | cheat_register_callback( 317 | 'paint', 'on_paint' 318 | ); 319 | 320 | // Register our 'player_hurt' callback. 321 | cheat_register_callback( 322 | 'player_hurt', 'on_player_hurt' 323 | ); 324 | 325 | // Register our 'round_start' callback. 326 | cheat_register_callback( 327 | 'round_start', 'reset' 328 | ); 329 | 330 | // Register our 'player_connect_full' callback. 331 | cheat_register_callback( 332 | 'player_connect_full', 'reset' 333 | ); 334 | 335 | //endregion 336 | -------------------------------------------------------------------------------- /onetap/kill_effect.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Title: Healthshot effect on kill 4 | * Author: april#0001 5 | * Description: Plugin that apparently every cheat needs! 6 | * 7 | */ 8 | 9 | //region main 10 | 11 | // Our rendering data 12 | var alpha = 0; 13 | var size = 0; 14 | 15 | //endregion 16 | 17 | //region menu 18 | 19 | // Creates our time slider 20 | const time = UI.AddSliderFloat("Effect duration", 0, 2); 21 | 22 | //endregion 23 | 24 | //region functions 25 | 26 | /** 27 | * Clamps a value between two other numbers 28 | * 29 | * @param v 30 | * @param min 31 | * @param max 32 | * @returns {number} 33 | */ 34 | function clamp(v, min, max) 35 | { 36 | return Math.max(Math.min(v, max), min); 37 | } 38 | 39 | /** 40 | * Returns the value of a script menu element 41 | * 42 | * @param element 43 | * @returns {*} 44 | */ 45 | function get(element) 46 | { 47 | return UI.GetValue("Misc", "JAVASCRIPT", "Script items", element); 48 | } 49 | 50 | /** 51 | * Renders the effect 52 | */ 53 | function render_effect() 54 | { 55 | if (alpha === 0) 56 | return; 57 | 58 | const inc_alpha = ((1 / get("Effect duration")) * Global.Frametime()) * 255 59 | const inc_size = ((1 / get("Effect duration")) * Global.Frametime()) * 360 60 | 61 | alpha = clamp(alpha - inc_alpha, 0, 255); 62 | size = clamp(size - inc_size, 0, 360); 63 | 64 | const x = Global.GetScreenSize()[0], y = Global.GetScreenSize()[1]; 65 | 66 | Render.GradientRect(0, 0, x, size, 0, [128, 195, 255, alpha], [128, 195, 255, 0]); 67 | Render.GradientRect(0, y - size, x, size, 0, [128, 195, 255, 0], [128, 195, 255, alpha]); 68 | Render.GradientRect(x - size, 0, size, y, 1, [128, 195, 255, 0], [128, 195, 255, alpha]); 69 | Render.GradientRect(0, 0, size, y, 1, [128, 195, 255, alpha], [128, 195, 255, 0]); 70 | } 71 | 72 | /** 73 | * Updates rendering data 74 | */ 75 | function on_death() 76 | { 77 | const attacker = Entity.GetEntityFromUserID(Event.GetInt("attacker")); 78 | const userid = Entity.GetEntityFromUserID(Event.GetInt("userid")); 79 | const player = Entity.GetLocalPlayer(); 80 | 81 | if (attacker === player && userid != player) 82 | { 83 | alpha = 255; 84 | size = 360; 85 | } 86 | } 87 | 88 | //endregion 89 | 90 | //region callbacks 91 | 92 | // Callbacks our functions 93 | Global.RegisterCallback("player_death", "on_death"); 94 | Global.RegisterCallback("Draw", "render_effect"); 95 | 96 | //endregion 97 | 98 | -------------------------------------------------------------------------------- /onetap/low_fps_mitigations.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Title: Low FPS mitigations 4 | * Author: april#0001 5 | * Description: A script meant to disable certain features to improve FPS. 6 | * 7 | */ 8 | 9 | //region dependencies 10 | function safe_concat(x, y) 11 | { 12 | var arr = []; 13 | 14 | for (var k in x) 15 | { 16 | arr.push(x[k]); 17 | } 18 | 19 | arr.push(y); 20 | 21 | return arr; 22 | } 23 | 24 | const CHAT_COLOR = { 25 | WHITE: '\x01', 26 | RED: '\x02', 27 | LIGHT_PURPLE: '\x03', 28 | GREEN: '\x04', 29 | LIGHT_GREEN: '\x05', 30 | LIME: '\x06', 31 | GRAY: '\x08', 32 | YELLOW: '\x09', 33 | LIGHT_BLUE: '\x0A', 34 | CYAN: '\x0B', 35 | BLUE: '\x0C', 36 | MAGENTA: '\x0D', 37 | PINK: '\x0E', 38 | LIGHT_RED: '\x0F', 39 | GOLD: '\x10', 40 | }; 41 | //endregion 42 | 43 | //region api 44 | const callback = Cheat.RegisterCallback, log = Cheat.PrintChat; 45 | //endregion 46 | 47 | //region locals 48 | const weapons = [ 49 | "GENERAL", 50 | "PISTOL", 51 | "HEAVY PISTOL", 52 | "SCOUT", 53 | "AWP", 54 | "AUTOSNIPER" 55 | ]; 56 | 57 | const paths = [ 58 | [ 59 | ["Rage", "GENERAL", "General", "Team check"], 60 | ["Visual", "SELF", "ESP", "Taser range"], 61 | ["Visual", "SELF", "ESP", "Knife range"], 62 | ["Visual", "SELF", "Chams", "Visible override"], 63 | ["Visual", "SELF", "Chams", "Attachment override"], 64 | ["Visual", "SELF", "Chams", "Desync override"], 65 | ["Visual", "SELF", "Chams", "Fakelag override"], 66 | ["Visual", "SELF", "Chams", "Arms override"], 67 | ["Visual", "SELF", "Chams", "Weapon override"], 68 | ["Visual", "ENEMIES", "HUD", "Footsteps"], 69 | ["Visual", "ENEMIES", "Chams", "Hidden override"], 70 | ["Visual", "ENEMIES", "Chams", "History override"], 71 | ["Visual", "FRIENDLIES", "ESP", "Box"], 72 | ["Visual", "FRIENDLIES", "ESP", "Glow"], 73 | ["Visual", "FRIENDLIES", "ESP", "Name"], 74 | ["Visual", "FRIENDLIES", "ESP", "Health"], 75 | ["Visual", "FRIENDLIES", "ESP", "Weapon"], 76 | ["Visual", "FRIENDLIES", "ESP", "Ammo"], 77 | ["Visual", "FRIENDLIES", "Chams", "Visible override"], 78 | ["Visual", "FRIENDLIES", "Chams", "Hidden override"], 79 | ["Visual", "FRIENDLIES", "Chams", "Attachment override"], 80 | ["Visual", "WORLD", "Entities", "Weapons"], 81 | ["Visual", "WORLD", "Entities", "Bullet impacts (client)"], 82 | ["Visual", "WORLD", "Entities", "Bullet tracers"], 83 | ["Visual", "WORLD", "Entities", "Penetration crosshair"], 84 | ["Misc", "GENERAL", "Matchmaking", "Auto accept"], 85 | ["Misc", "GENERAL", "Matchmaking", "Rank revealer"], 86 | ["Misc", "GENERAL", "Movement", "Slide walk"], 87 | ["Misc", "GENERAL", "Miscellaneous", "Ragdoll force"], 88 | ["Misc", "GENERAL", "Miscellaneous", "Ragdoll gravity"], 89 | ["Misc", "PERFORMANCE & INFORMATION", "Information", "Watermark"], 90 | ["Misc", "PERFORMANCE & INFORMATION", "Information", "Spectators list"], 91 | ["Misc", "PERFORMANCE & INFORMATION", "Information", "Team damage list"], 92 | ["Misc", "PERFORMANCE & INFORMATION", "Information", "Spectators list"] 93 | ], 94 | 95 | [ 96 | ["Misc", "PERFORMANCE & INFORMATION", "Performance", "Disable post processing"], 97 | ["Misc", "PERFORMANCE & INFORMATION", "Performance", "Disable fog"], 98 | ["Misc", "PERFORMANCE & INFORMATION", "Performance", "Disable shadows"], 99 | ["Misc", "PERFORMANCE & INFORMATION", "Performance", "Disable blood"], 100 | ["Misc", "PERFORMANCE & INFORMATION", "Performance", "Disable teammate"] 101 | ] 102 | ]; 103 | 104 | var cache = []; 105 | //endregion 106 | 107 | //region functions 108 | function update_features(override) { 109 | for (var i = 0; i < paths.length; i++) { 110 | for (var j = 0; j < paths[i].length; j++) { 111 | UI.SetEnabled.apply(null, safe_concat(paths[i][j], override ? true : (i ? true : false))); 112 | UI.SetValue.apply(null, safe_concat(paths[i][j], i ? true : false)); 113 | } 114 | } 115 | } 116 | 117 | function update_cache() { 118 | for (var i = 0; i < weapons.length; i++) { 119 | const hitboxes = UI.GetValue("Rage", weapons[i], "Targeting", "Hitboxes"); 120 | const multipoint = UI.GetValue("Rage", weapons[i], "Targeting", "Multipoint hitboxes"); 121 | 122 | cache[i] = {hitboxes: hitboxes, multipoint: multipoint}; 123 | } 124 | } 125 | 126 | function update_configuration(disable) { 127 | for (var i = 0; i < weapons.length; i++) { 128 | const hitboxes = UI.GetValue("Rage", weapons[i], "Targeting", "Hitboxes"); 129 | const multipoint = UI.GetValue("Rage", weapons[i], "Targeting", "Multipoint hitboxes"); 130 | 131 | UI.SetValue("Rage", weapons[i], "Targeting", "Hitboxes", disable ? (hitboxes & ~((1 << 1) | (1 << 6) | (1 << 7))) : cache[i].hitboxes); 132 | UI.SetValue("Rage", weapons[i], "Targeting", "Multipoint hitboxes", disable ? (multipoint & ~((1 << 1) | (1 << 6) | (1 << 7))) : cache[i].multipoint); 133 | } 134 | } 135 | 136 | update_features(false); 137 | update_cache(); 138 | update_configuration(true); 139 | 140 | log(" " + CHAT_COLOR.GRAY + "[" + CHAT_COLOR.YELLOW + "FPS" + CHAT_COLOR.GRAY + "] Your settings have been successfully updated."); 141 | 142 | function on_unload() { 143 | update_features(true); 144 | update_configuration(false); 145 | } 146 | //endregion 147 | 148 | //region callbacks 149 | callback("Unload", "on_unload"); 150 | //endregion 151 | -------------------------------------------------------------------------------- /onetap/movement/README.md: -------------------------------------------------------------------------------- 1 | How to install: 2 | 3 | 1. Open your CSGO's directory (where csgo.exe is located). 4 | 2. Select the downloaded folders. 5 | 3. Drag/Extract them inside CSGO's directory. 6 | 4. Setup your keybinds (otherwise, some features might not work) 7 | 5. Have fun! 8 | 9 | DISCLAIMER: Some of the features need sv_cheats to be set to 1! Jumpbug and crouchbug are not 100% consistent. 10 | 11 | Movement pack 2.0 12 | made by April 13 | 14 | Changelogs: 15 | - Made colors customizable 16 | - Added keystatus visualizer 17 | - See which keys you're pressing 18 | - Added jumpstats 19 | - Print more info about your jumps 20 | - Added practice mode 21 | - Save and set position (like KZTimer) 22 | - Added movement mode 23 | - Quickly switch between movement modes 24 | - Currently supporting: Vanilla, Vanilla KZ, NoPre KZ / HNS. 25 | -------------------------------------------------------------------------------- /onetap/movement/csgo/sound/godlike.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aprxl/scripting/bbd3b0a5ed1ab6ae2133b02f1a28df66d3fb4164/onetap/movement/csgo/sound/godlike.wav -------------------------------------------------------------------------------- /onetap/movement/csgo/sound/impressive.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aprxl/scripting/bbd3b0a5ed1ab6ae2133b02f1a28df66d3fb4164/onetap/movement/csgo/sound/impressive.wav -------------------------------------------------------------------------------- /onetap/movement/csgo/sound/ownage.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aprxl/scripting/bbd3b0a5ed1ab6ae2133b02f1a28df66d3fb4164/onetap/movement/csgo/sound/ownage.wav -------------------------------------------------------------------------------- /onetap/movement/csgo/sound/perfect.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aprxl/scripting/bbd3b0a5ed1ab6ae2133b02f1a28df66d3fb4164/onetap/movement/csgo/sound/perfect.wav -------------------------------------------------------------------------------- /onetap/old_speclist.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Title: Old spectators list 4 | * Author: april#0001 5 | * Description: Recreates the V1's spectators list 6 | * 7 | */ 8 | 9 | //region menu 10 | 11 | // Backups our positions 12 | const window_x = UI.AddSliderInt("window_x", 0, Global.GetScreenSize()[0]) 13 | const window_y = UI.AddSliderInt("window_y", 0, Global.GetScreenSize()[1]) 14 | 15 | //endregion 16 | 17 | //region functions 18 | 19 | /** 20 | * Updates the visibility of our menu elements 21 | */ 22 | function update_menu() 23 | { 24 | UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "window_x", false) 25 | UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "window_y", false) 26 | } 27 | 28 | // Update it whenever the script is activated. 29 | update_menu(); 30 | 31 | /** 32 | * Gets the names of the players spectating you 33 | * 34 | * @returns {[]} 35 | */ 36 | function get_spectators() 37 | { 38 | var specs = []; 39 | const players = Entity.GetPlayers(); 40 | 41 | for (i = 0; i < players.length; i++) 42 | { 43 | const cur = players[i]; 44 | 45 | if (Entity.GetProp(cur, "CBasePlayer", "m_hObserverTarget") != "m_hObserverTarget") { 46 | const obs = Entity.GetProp(cur, "CBasePlayer", "m_hObserverTarget") 47 | 48 | if (obs === Entity.GetLocalPlayer()) 49 | { 50 | const name = Entity.GetName(cur); 51 | specs.push(name); 52 | } 53 | } 54 | } 55 | 56 | return specs; 57 | } 58 | 59 | /** 60 | * Checks if a point is inside a perimeter 61 | * 62 | * @param vec 63 | * @param x 64 | * @param y 65 | * @param x2 66 | * @param y2 67 | * @returns {boolean} 68 | */ 69 | function in_bounds(vec, x, y, x2, y2) 70 | { 71 | return (vec[0] > x) && (vec[1] > y) && (vec[0] < x2) && (vec[1] < y2) 72 | } 73 | 74 | /** 75 | * Where the magic happens 76 | */ 77 | function main() 78 | { 79 | // Get our drawing properties 80 | const names = get_spectators(); 81 | const x = UI.GetValue("Misc", "JAVASCRIPT", "Script items", "window_x"), 82 | y = UI.GetValue("Misc", "JAVASCRIPT", "Script items", "window_y"); 83 | 84 | // Rainbow color for our bar 85 | const rainbow = [ 86 | Math.floor(Math.sin(Global.Realtime() * 2) * 127 + 128), 87 | Math.floor(Math.sin(Global.Realtime() * 2 + 2) * 127 + 128), 88 | Math.floor(Math.sin(Global.Realtime() * 2 + 4) * 127 + 128), 89 | 255 90 | ]; 91 | 92 | // Draw the spectators list 93 | Render.Rect(x - 1, y - 1, 202, 61 + 15 * (names.length - 1), [2, 2, 2, 100]); 94 | Render.FilledRect(x, y, 200, 60 + 15 * (names.length - 1), [55, 55, 55, 200]); 95 | Render.Rect(x + 5, y + 5, 190, 50 + 15 * (names.length - 1), [2, 2, 2, 100]); 96 | Render.FilledRect(x + 5, y + 5, 190, 50 + 15 * (names.length - 1), [25, 25, 25, 200]); 97 | Render.FilledRect(x + 9, y + 25, 181, 3, rainbow); 98 | Render.String(x + 100, y + 10, 1, "spectators (" + names.length + ")", [200, 200, 200, 200], 3); 99 | 100 | // For each player who's spectating us, draw their names 101 | for (i = 0; i < names.length; i++) 102 | { 103 | Render.String(x + 100, y + 35 + 15 * i, 1, names[i], [200, 200, 200, 200], 3); 104 | } 105 | 106 | // Handles the drag function 107 | if (Global.IsKeyPressed(1)) { 108 | // Getting our mouse pos 109 | const mouse_pos = Global.GetCursorPosition(); 110 | 111 | // Check if we're clicking and if we're in bounds of the drag area 112 | if (in_bounds(mouse_pos, x, y, x + 200, y + 30)) { 113 | 114 | // Update values (not the most efficient way to do it but wtvr) 115 | UI.SetValue("Misc", "JAVASCRIPT", "Script items", "window_x", mouse_pos[0] - 100); 116 | UI.SetValue("Misc", "JAVASCRIPT", "Script items", "window_y", mouse_pos[1] - 20); 117 | } 118 | } 119 | 120 | } 121 | //endregion 122 | 123 | //region callbacks 124 | 125 | // Callback our main function 126 | Global.RegisterCallback("Draw", "main") 127 | 128 | //endregion 129 | 130 | -------------------------------------------------------------------------------- /onetap/ot_color_corrector.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Title: Color enhancements 4 | * Author: april#0001 5 | * Description: Enhances the color of your game 6 | * 7 | */ 8 | 9 | //region menu 10 | 11 | // Our main switch 12 | const enable = UI.AddCheckbox("Enable color enhancement"); 13 | 14 | // Our menu elements 15 | const cc = UI.AddCheckbox("Color correction"); 16 | const cc_tint = UI.AddSliderInt("Tint", 0, 100); 17 | const cc_intensity = UI.AddSliderInt("Intensity", 0, 100); 18 | 19 | const fog = UI.AddCheckbox("Fog correction"); 20 | const fog_color = UI.AddColorPicker("Color"); 21 | const fog_distance = UI.AddSliderInt("Distance", 0, 2500); 22 | const fog_density = UI.AddSliderInt("Density", 0, 100); 23 | 24 | //endregion 25 | 26 | //region functions 27 | 28 | /** 29 | * Handles the visibility of our menu elements 30 | */ 31 | const handle_visibility = function() 32 | { 33 | // Get booleans to make our life easier 34 | const main = UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Enable color enhancement"); 35 | const cc = UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Color correction"); 36 | const fog = UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Fog correction"); 37 | 38 | // Our main switch should always be visible 39 | UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Enable color enhancement", true); 40 | 41 | // Update other elements based on their parents 42 | UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Color correction", main); 43 | UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Tint", cc); 44 | UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Intensity", cc); 45 | 46 | UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Fog correction", main); 47 | UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Color", fog); 48 | UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Distance", fog); 49 | UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Density", fog); 50 | }; 51 | 52 | /** 53 | * Updates the fog values 54 | */ 55 | const update_fog = function() 56 | { 57 | // Check if Fog correction is enabled 58 | if (!UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Fog correction")) 59 | { 60 | // Check if the fog isn't already disabled (optimization) 61 | if (Convar.GetString("fog_override") !== "0") 62 | { 63 | Convar.SetString("fog_override", "0"); 64 | } 65 | 66 | return; 67 | } 68 | 69 | // Check if the fog isn't already enabled (optimization) 70 | if (Convar.GetString("fog_override") !== "1") 71 | { 72 | Convar.SetString("fog_override", "1"); 73 | } 74 | 75 | 76 | // Get our fog properties 77 | const clr = UI.GetColor("Misc", "JAVASCRIPT", "Script items", "Color"); 78 | const clr_value = clr[0] + " " + clr[1] + " " + clr[2]; 79 | 80 | const dist = UI.GetString("Misc", "JAVASCRIPT", "Script items", "Distance"); 81 | const dens = (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Density") / 100).toString(); 82 | 83 | // Check if the fog's color isn't the same as our desired color 84 | if (Convar.GetString("fog_color") !== clr_value) 85 | { 86 | // Update color 87 | Convar.SetString("fog_color", clr_value); 88 | } 89 | 90 | // Check if the fog's end distance isn't the same as our desired end distance 91 | if (Convar.GetString("fog_end") !== dist) 92 | { 93 | // Update distance 94 | Convar.SetString("fog_start", "0"); 95 | Convar.SetString("fog_end", dist); 96 | } 97 | 98 | // Check if the fog's density isn't the same as our desired density 99 | if (Convar.GetString("fog_maxdensity") !== dens) 100 | { 101 | // Update density 102 | Convar.SetString("fog_maxdensity", dens); 103 | } 104 | 105 | } 106 | 107 | const draw_cc = function() 108 | { 109 | // Check if Color correction isn't on 110 | if (!UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Color correction")) 111 | return; 112 | 113 | // Get our drawing properties 114 | const tint = UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Tint"); 115 | const intensity = UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Intensity"); 116 | 117 | const x = Global.GetScreenSize()[0], y = Global.GetScreenSize()[1]; 118 | 119 | // Draw our color correction layer 120 | Render.FilledRect( 121 | 0, 122 | 0, 123 | x, 124 | y, 125 | [tint, 126 | 0, 127 | 255 - tint, 128 | intensity 129 | ] 130 | ); 131 | 132 | } 133 | 134 | // Handles the visibility whenever the script is loaded 135 | handle_visibility(); 136 | 137 | // Disables the 3D skybox for better looking fog 138 | Convar.SetString("r_3dsky", "0"); 139 | 140 | function main() 141 | { 142 | 143 | // Callback our functions 144 | handle_visibility(); 145 | update_fog(); 146 | draw_cc(); 147 | 148 | } 149 | 150 | //endregion 151 | 152 | //region callbacks 153 | 154 | // Register our callbacks 155 | Global.RegisterCallback("Draw", "main"); 156 | 157 | //endregion 158 | 159 | -------------------------------------------------------------------------------- /onetap/performance_graph.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Title: Performance graph 4 | * Author: april#0001 5 | * Description: Draws a graph showcasing your performance 6 | * 7 | */ 8 | 9 | //region main 10 | 11 | // Creates our main variables 12 | var fps_info = []; 13 | var ping_info = []; 14 | 15 | var last_time = Global.Curtime(); 16 | 17 | //endregion 18 | 19 | //region menu 20 | 21 | // Backups our window position 22 | const window_x = UI.AddSliderInt("performance_window_x", 0, Global.GetScreenSize()[0]); 23 | const window_y = UI.AddSliderInt("performance_window_y", 0, Global.GetScreenSize()[1]); 24 | 25 | //endregion 26 | 27 | //region functions 28 | 29 | /** 30 | * Converts a hexadecimal value into ASCII 31 | * 32 | * @param str1 33 | * @returns {string} 34 | */ 35 | function hex_to_ascii(str1) 36 | { 37 | var hex = str1.toString(); 38 | var str = ''; 39 | for (var n = 0; n < hex.length; n += 2) { 40 | str += String.fromCharCode(parseInt(hex.substr(n, 2), 16)); 41 | } 42 | return str; 43 | } 44 | 45 | /** 46 | * Handles the visibility of our menu elements 47 | */ 48 | function handle_visibility() 49 | { 50 | UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "performance_window_x", false); 51 | UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "performance_window_y", false); 52 | } 53 | 54 | // Updates the visibility whenever the script is loaded 55 | handle_visibility(); 56 | 57 | /** 58 | * Gets the value of a script menu element 59 | * 60 | * @param element 61 | * @returns {*} 62 | */ 63 | function get(element) 64 | { 65 | return UI.GetValue("Misc", "JAVASCRIPT", "Script items", element); 66 | } 67 | 68 | /** 69 | * Sets the value of a script menu element 70 | * 71 | * @param element 72 | * @param value 73 | * @returns {*} 74 | */ 75 | function set(element, value) 76 | { 77 | return UI.SetValue("Misc", "JAVASCRIPT", "Script items", element, value); 78 | } 79 | 80 | /** 81 | * Handles the dragging feature of our window 82 | */ 83 | function handle_dragging() 84 | { 85 | var in_bounds = function(vec, x1, y1, x2, y2){ 86 | return (vec[0] > x1) && (vec[1] > y1) && (vec[0] < x2) && (vec[1] < y2); 87 | }; 88 | 89 | if (Global.IsKeyPressed(1)) 90 | { 91 | const x = get("performance_window_x"), y = get("performance_window_y"); 92 | const mouse_pos = Global.GetCursorPosition(); 93 | 94 | if (in_bounds(mouse_pos, x, y, x + 300, y + 130)) 95 | { 96 | set("performance_window_x", mouse_pos[0] - 150); 97 | set("performance_window_y", mouse_pos[1] - 30); 98 | } 99 | } 100 | } 101 | 102 | /** 103 | * Draws the performance window (you're welcome duk ♥) 104 | */ 105 | function draw_container() 106 | { 107 | // Creating our variables 108 | const x = get("performance_window_x"), y = get("performance_window_y"); 109 | var avg = {'fps': 0, 'ping': 0}; 110 | 111 | // Draw outline 112 | Render.Rect(x - 1, y - 1, 302, 142, [2, 2, 2, 125]); 113 | 114 | // Draw container 115 | Render.FilledRect(x, y, 300, 20, [10, 10, 10, 255]); 116 | Render.FilledRect(x, y + 20, 300, 115, [15, 15, 15, 255]); 117 | Render.FilledRect(x + 149, y + 26, 1, 100, [25, 25, 25, 125]); 118 | Render.FilledRect(x, y + 130, 300, 15, [8, 8, 8, 255]); 119 | 120 | // Draw texts 121 | Render.String(x + 5, y + 4, 0, hex_to_ascii(0xE6), [200, 200, 200, 200], 6); 122 | Render.String(x + 20, y + 3, 0, "Performance", [200, 200, 200, 200], 10); 123 | Render.String(x + 75, y + 30, 1, "FPS", [200, 200, 200, 125], 3); 124 | Render.String(x + 225, y + 30, 1, "PING", [200, 200, 200, 125], 3); 125 | Render.String(x + 75, y + 45, 1, Math.floor(1 / Global.Frametime() + 0.5).toString(), [100, 100, 100, 125], 2); 126 | Render.String(x + 225, y + 45, 1, Math.floor(Global.Latency() + 0.5).toString(), [100, 100, 100, 125], 2); 127 | 128 | // Updates our fps/ping info every half a second 129 | if (Global.Curtime() - last_time > 0.5) { 130 | // Reset our timer 131 | last_time = Global.Curtime(); 132 | 133 | // Update values 134 | fps_info.unshift(1 / Global.Frametime()); 135 | ping_info.unshift(Global.Latency() + 5); 136 | } 137 | 138 | // If our arrays reached their limit, then remove the last value 139 | if (fps_info.length > 30) 140 | fps_info.pop(); 141 | 142 | if (ping_info.length > 30) 143 | ping_info.pop(); 144 | 145 | // Draw fps graph 146 | for (i = 0; i < fps_info.length; i++) 147 | { 148 | avg.fps += fps_info[i] 149 | Render.GradientRect( 150 | x + 150 - i * 5 - 5, 151 | y + 130 - fps_info[i] / Convar.GetInt("fps_max") * 70, 152 | 5, 153 | fps_info[i] / Convar.GetInt("fps_max") * 70, 154 | 0, 155 | [35, 35, 95, 0], 156 | [35, 35, 95, 255] 157 | ); 158 | } 159 | 160 | // Draw latency graph 161 | for (i = 0; i < ping_info.length; i++) 162 | { 163 | avg.ping += ping_info[i] 164 | Render.GradientRect( 165 | x + 300 - i * 5 - 5, 166 | y + 130 - ping_info[i] / 100 * 70, 167 | 5, 168 | ping_info[i] / 100 * 70, 169 | 0, 170 | [95, 35, 35, 0], 171 | [95, 35, 35, 255] 172 | ); 173 | } 174 | 175 | // Calculate averages 176 | avg.fps /= (fps_info.length === 0) ? 1 : fps_info.length; 177 | avg.ping /= (ping_info.length === 0) ? 1 : ping_info.length; 178 | 179 | // Draw averages 180 | Render.String(x + 5, y + 45, 0, "AVG: " + Math.floor(avg.fps + 0.5).toString(), [125, 100, 100, 55], 2); 181 | Render.String(x + 155, y + 45, 0, "AVG: " + Math.floor(avg.ping - 4.5).toString(), [125, 100, 100, 55], 2); 182 | 183 | // Draw additional info 184 | Render.String(x + 5, y + 60, 0, "VAR: " + Math.floor((fps_info[1] / fps_info[0] - 1) * 100).toString(), [200, 200, 200, 55], 2); 185 | Render.String(x + 155, y + 60, 0, "VAR: " + Math.floor((ping_info[1] / ping_info[0] - 1) * 100).toString(), [200, 200, 200, 55], 2); 186 | 187 | } 188 | 189 | /** 190 | * Where the magic happens (haha re-used meme) 191 | */ 192 | function main() 193 | { 194 | // Callback functions 195 | draw_container(); 196 | handle_dragging(); 197 | } 198 | 199 | function reset() 200 | { 201 | last_time = Global.Curtime(); 202 | fps_info = []; 203 | ping_info = []; 204 | } 205 | 206 | //endregion 207 | 208 | //region callbacks 209 | 210 | // Register our callbacks 211 | Global.RegisterCallback("Draw", "main"); 212 | Global.RegisterCallback("player_connect_full", "reset"); 213 | 214 | //endregion 215 | -------------------------------------------------------------------------------- /onetap/rare_animations.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Title: Rare animations 4 | * Author: april#0001 5 | * Description: Forces all rare inspect animations 6 | * 7 | */ 8 | 9 | //region dependencies 10 | 11 | /** 12 | * @title BetterUI 13 | * @version 2.2.0 14 | * @description A better UI system for Onetap 15 | */ 16 | 17 | var menu = {}; 18 | var menu_elements = {}; 19 | const menu_spacer = " "; 20 | 21 | /** 22 | * Concats two elements into an array without increasing the array length. 23 | * Prevents the memory leak in 2.0.0 from happening 24 | * 25 | * @param a {array} 26 | * @param b {any} 27 | */ 28 | menu.concat = function(a, b) 29 | { 30 | // Creates a new array. 31 | var arr = []; 32 | 33 | // Push all items from the array 'a' into our array. 34 | for (var c in a) 35 | { 36 | arr.push(a[c]); 37 | } 38 | 39 | // Push the value 'b' into our array. 40 | arr.push(b); 41 | 42 | // Return the new array. 43 | return arr; 44 | } 45 | 46 | /** 47 | * Creates a new menu label 48 | * 49 | * @param label {string} 50 | */ 51 | menu.label = function(label) 52 | { 53 | // Creates the label 54 | UI.AddLabel(label); 55 | }; 56 | 57 | /** 58 | * Creates a new menu element 59 | * 60 | * @param func {function} 61 | * @param name {string} 62 | * @param label {string}, 63 | * @param properties {array} 64 | */ 65 | menu.new = function(func, name, label, properties, initial_value) 66 | { 67 | // Fix values 68 | properties = properties || []; 69 | initial_value = initial_value || undefined; 70 | 71 | // Get properties 72 | const final_name = name + menu_spacer + label; 73 | var final_props = [final_name]; 74 | 75 | const element_info_t = { 76 | path: ["Misc", "JAVASCRIPT", "Script Items", final_name], 77 | cache: initial_value, 78 | func: func 79 | }; 80 | 81 | // If our properties aren't null, then pack them together. 82 | if (properties != null) 83 | { 84 | for (var i = 0; i < properties.length; i++) 85 | { 86 | final_props.push(properties[i]); 87 | } 88 | } 89 | 90 | // Create our menu element and return properties 91 | func.apply(null, final_props); 92 | 93 | // Initialize our menu element if it has an initializer. 94 | if (initial_value) 95 | { 96 | switch (func) 97 | { 98 | case UI.AddColorPicker: 99 | UI.SetColor.apply(null, this.concat(element_info_t.path, initial_value)); 100 | break; 101 | 102 | case UI.AddHotkey: 103 | break; 104 | 105 | default: 106 | UI.SetValue.apply(this, this.concat(element_info_t.path, initial_value)); 107 | break; 108 | } 109 | } 110 | 111 | menu_elements[label] = element_info_t; 112 | 113 | return element_info_t; 114 | }; 115 | 116 | /** 117 | * Creates a new menu reference 118 | * 119 | * @param path {array} 120 | */ 121 | menu.reference = function(path, func) 122 | { 123 | return { 124 | path: path, 125 | func: func 126 | }; 127 | }; 128 | 129 | /** 130 | * Gets the value of a menu element 131 | * 132 | * @param elem {array} 133 | * @return {*} 134 | */ 135 | menu.get = function(elem) 136 | { 137 | // If the element doesn't exist 138 | if (!(elem.path)) 139 | throw new Error("[Menu] This element doesn't exist!"); 140 | 141 | // Returns the element's value 142 | switch (elem.func) 143 | { 144 | case UI.AddColorPicker: 145 | return UI.GetColor.apply(null, elem.path); 146 | 147 | case UI.AddHotkey: 148 | return UI.IsHotkeyActive.apply(null, elem.path); 149 | 150 | default: 151 | return UI.GetValue.apply(null, elem.path); 152 | } 153 | }; 154 | 155 | /** 156 | * Sets the value of a menu element 157 | * 158 | * @param elem {array} 159 | * @param value {*} 160 | */ 161 | menu.set = function(elem, value) 162 | { 163 | // If the label doesn't exist 164 | if (!(elem.path)) 165 | throw new Error("[Menu] This element doesn't exist!"); 166 | 167 | // Set the element's value 168 | switch (elem.func) 169 | { 170 | case UI.AddColorPicker: 171 | UI.SetColor.apply(null, this.concat(elem.path, value)); 172 | break; 173 | 174 | case UI.AddHotkey: 175 | if (menu.get(elem) !== value) 176 | UI.ToggleHotkey.apply(null, elem.path); 177 | break; 178 | 179 | default: 180 | UI.SetValue.apply(null, this.concat(elem.path, value)); 181 | break; 182 | } 183 | }; 184 | 185 | /** 186 | * Changes the visibility of a menu elements 187 | * 188 | * @param elem {array} 189 | * @param visible {boolean} 190 | */ 191 | menu.visibility = function(elem, visible) 192 | { 193 | // If the label doesn't exist 194 | if (!(elem.path)) 195 | throw new Error("[Menu] This element doesn't exist!"); 196 | 197 | // Change the element's visibility 198 | UI.SetEnabled.apply(null, this.concat(elem.path, visible)); 199 | }; 200 | 201 | /** 202 | * Adds an event to a menu element which is triggered everytime this element's value is changed. 203 | * 204 | * @param elem {array} 205 | * @param func {function} 206 | */ 207 | menu.add_event = function(elem, func) 208 | { 209 | if (!elem.path) 210 | throw new Error("[Menu] This element doesn't exist!"); 211 | 212 | if (!elem.func) 213 | throw new Errror("[Menu] This element does not have a valid type. Please, specify one."); 214 | 215 | elem.callback = func; 216 | } 217 | 218 | /** 219 | * Handles the menu elements' events. Call this inside a Draw or FSN callback. 220 | */ 221 | menu.handle_events = function() 222 | { 223 | for (var label in menu_elements) 224 | { 225 | const elem = menu_elements[label]; 226 | 227 | if (!elem.path || !elem.callback) 228 | continue; 229 | 230 | const value = menu.get(elem); 231 | 232 | if (elem.cache === undefined) 233 | elem.cache = value; 234 | 235 | if (elem.cache !== value) 236 | { 237 | elem.callback.apply(null, [elem]); 238 | elem.cache = value; 239 | } 240 | } 241 | } 242 | 243 | const is_selected = function(id, mask, tbl) { 244 | var i = 0; 245 | 246 | // Loop thru all weapons. 247 | for (var k in tbl) { 248 | // Checks if our current weapon is selected. 249 | // If so, return true. 250 | // This works because the dropdown's array is correspondent to the sequence id enum. 251 | if (k == id && mask & (1 << i)) 252 | return true; 253 | 254 | // Otherwise increment 'i'. 255 | i++; 256 | } 257 | 258 | // If we our current weapon is not selected, return false. 259 | return false; 260 | } 261 | 262 | //endregion 263 | 264 | //region locals 265 | const weapons = [ 266 | "Desert eagle", 267 | "R8 Revolver", 268 | "Falchion knife", 269 | "Butterfly knife", 270 | "Paracord knife", 271 | "Survival knife", 272 | "Ursus knife", 273 | "Nomad knife", 274 | "Stiletto knife", 275 | "Talon knife", 276 | "Skeleton knife" 277 | ]; 278 | 279 | const sequence_ids = { 280 | // Desert eagle 281 | 1: {7: 8}, 282 | // Revolver 283 | 64: {3: 4}, 284 | // Falchion 285 | 512: {12: 13}, 286 | // Butterfly 287 | 515: {1: 0, 13: 15, 14: 15}, 288 | // Paracord 289 | 517: {0: 1, 14: 13}, 290 | // Survival 291 | 518: {0: 1, 14: 13}, 292 | // Ursus 293 | 519: {0: 1, 14: 13}, 294 | // Nomad 295 | 521: {14: 13}, 296 | // Stiletto 297 | 522: {13: 12}, 298 | // Talon 299 | 523: {14: 15}, 300 | // Skeleton 301 | 525: {0: 1, 13: 14} 302 | }; 303 | //endregion 304 | 305 | //region api 306 | const m_dropdown = UI.AddMultiDropdown, local_player = Entity.GetLocalPlayer, is_alive = Entity.IsAlive, get_prop = Entity.GetProp, set_prop = Entity.SetProp, frame_stage = Cheat.FrameStage, callback = Cheat.RegisterCallback; 307 | //endregion 308 | 309 | //region menu 310 | const overrides = menu.new(m_dropdown, "| Rare animations", "", [weapons]); 311 | //endregion 312 | 313 | //region functions 314 | function on_net_update_start() { 315 | // Get the value of our multi dropdown. 316 | const active = menu.get(overrides); 317 | 318 | // Only do this in NET_UPDATE_START. 319 | if (frame_stage() !== 1) return; 320 | 321 | // If the script is not active, return. 322 | if (!active) return; 323 | 324 | // Get our local player 325 | const me = local_player(); 326 | 327 | // If our local player isn't valid or if we're not alive, return. 328 | if (!me || !is_alive(me)) return; 329 | 330 | // Get our viewmodel handle and check if it is valid. 331 | const viewmodel = get_prop(me, "CBasePlayer", "m_hViewModel[0]"); 332 | if (!viewmodel) return; 333 | 334 | // Get our weapon handle and check if it is valid. 335 | const wpn = get_prop(me, "CBasePlayer", "m_hActiveWeapon"); 336 | if (!wpn) return; 337 | 338 | // Get our weapon item definition index and get it's sequence ids. 339 | const index = get_prop(wpn, "CBaseAttributableItem", "m_iItemDefinitionIndex") & 0xffff; 340 | const sequence_tbl = sequence_ids[index]; 341 | 342 | // If this weapon has no sequences to override, return. 343 | if (!sequence_tbl) return; 344 | 345 | // Check if we should override this weapon's sequences. 346 | if (!is_selected(index, active, sequence_ids)) return; 347 | 348 | // Get the viewmodel's current sequence. 349 | const sequence = get_prop(viewmodel, "CBaseViewModel", "m_nSequence"); 350 | 351 | // If we shouldn't override this sequence, return. 352 | if (!sequence_tbl[sequence]) return; 353 | 354 | // Override the sequence. 355 | set_prop(viewmodel, "CBaseViewModel", "m_nSequence", sequence_tbl[sequence]); 356 | } callback("FrameStageNotify", "on_net_update_start"); 357 | 358 | //endregion 359 | -------------------------------------------------------------------------------- /onetap/skin_changer_helper.js: -------------------------------------------------------------------------------- 1 | //region main 2 | 3 | // Cache our old weapon index for optimization purposes 4 | var old_index = -1; 5 | 6 | // Combobox indexes based on our weapon indexes 7 | // For further info, access tf2b.com/itemlist.php?gid=730 8 | const weapons = { 9 | 1: 5, 10 | 2: 6, 11 | 3: 8, 12 | 4: 11, 13 | 7: 0, 14 | 8: 1, 15 | 9: 2, 16 | 10: 7, 17 | 11: 9, 18 | 13: 10, 19 | 14: 13, 20 | 16: 14, 21 | 17: 16, 22 | 19: 24, 23 | 23: 19, 24 | 24: 31, 25 | 25: 33, 26 | 26: 3, 27 | 27: 17, 28 | 28: 21, 29 | 29: 26, 30 | 30: 30, 31 | 32: 12, 32 | 33: 18, 33 | 34: 20, 34 | 35: 22, 35 | 36: 23, 36 | 38: 27, 37 | 39: 28, 38 | 40: 29, 39 | 60: 15, 40 | 61: 32, 41 | 63: 4, 42 | 64: 25, 43 | 500: 34, 44 | 503: 48, 45 | 505: 35, 46 | 506: 36, 47 | 507: 37, 48 | 508: 38, 49 | 509: 45, 50 | 512: 40, 51 | 514: 44, 52 | 515: 39, 53 | 516: 42, 54 | 519: 47, 55 | 520: 41, 56 | 522: 43, 57 | 523: 46, 58 | 517: 49, 59 | 518: 50, 60 | 521: 51, 61 | 525: 52 62 | } 63 | 64 | //endregion 65 | 66 | //region functions 67 | 68 | /** 69 | * Where the magic happens 70 | * 71 | * @return {void} 72 | */ 73 | function main() 74 | { 75 | // Get our properties 76 | const player = Entity.GetLocalPlayer(); 77 | 78 | const wpn_index = Entity.GetProp(Entity.GetWeapon(player), "CBaseAttributableItem", "m_iItemDefinitionIndex") & 0xFFFF; 79 | 80 | // If our weapon hasn't changed then no need to update 81 | if (wpn_index === old_index) 82 | return; 83 | 84 | // Otherwise, cache our weapon index 85 | old_index = wpn_index; 86 | 87 | // If our current weapon index is inside our weapons table, then it is valid for skins. 88 | if (wpn_index in weapons) 89 | { 90 | // Get the checkbox index that matches our weapon index 91 | const menu = weapons[wpn_index]; 92 | 93 | // Update the menu 94 | UI.SetValue("Misc", "SKINS", "Skins", "Weapon", menu); 95 | } 96 | } 97 | 98 | //endregion 99 | 100 | //region callbacks 101 | 102 | // Callback our main function 103 | Cheat.RegisterCallback("CreateMove", "main"); 104 | 105 | //endregion 106 | -------------------------------------------------------------------------------- /onetap/standalone_rcs.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Title: Standalone RCS 4 | * Author: april#0001 5 | * Description: Automatically controls your recoil even while your aimbot isn't enabled. 6 | * 7 | */ 8 | 9 | //region main 10 | 11 | // Caches our old values 12 | var old_condition = -1; 13 | var old_angles = [0, 0, 0]; 14 | var old_index = -1; 15 | 16 | // Caches our current weapon category 17 | var condition = 0; 18 | 19 | // Holds the IDs for each weapon in each category 20 | const weapons = [ 21 | [1, 2, 3, 4, 30, 32, 36, 61, 63, 64], 22 | [7, 8, 10, 13, 14, 16, 28, 39, 60], 23 | [9, 11, 38, 40], 24 | [17, 19, 23, 24, 26, 33, 34] 25 | ] 26 | 27 | //endregion 28 | 29 | //region dependencies 30 | 31 | /** 32 | * @title BetterUI 33 | * @version 1.0.0 34 | * @description A better UI system for Onetap 35 | */ 36 | 37 | var menu_elements_t = []; 38 | var menu_c = []; 39 | const menu_spacer = " "; 40 | 41 | 42 | /** 43 | * Creates a new menu label 44 | * 45 | * @param label {string} 46 | */ 47 | menu_c.label = function(label) 48 | { 49 | // Creates the label 50 | UI.AddLabel(label); 51 | } 52 | 53 | 54 | /** 55 | * Creates a new menu element 56 | * 57 | * @param func {function} 58 | * @param name {string} 59 | * @param label {string}, 60 | * @param properties {array} 61 | */ 62 | menu_c.call = function(func, name, label, properties) 63 | { 64 | // If the label isn't unique 65 | if (label in menu_elements_t) 66 | throw new Error("[Menu] The label must be unique!"); 67 | 68 | // Get properties 69 | const final_name = name + menu_spacer + label; 70 | var final_props = [final_name]; 71 | const element_info_t = { 72 | name: name, 73 | label: label, 74 | properties: properties 75 | }; 76 | 77 | // If our properties aren't null, then pack them together. 78 | if (properties !== null) 79 | { 80 | for (var i = 0; i < properties.length; i++) 81 | { 82 | final_props.push(properties[i]); 83 | } 84 | } 85 | 86 | // Create our menu element and return properties 87 | func.apply(null, final_props); 88 | menu_elements_t[label] = element_info_t; 89 | } 90 | 91 | /** 92 | * Gets the value of a menu element 93 | * 94 | * @param label {string} 95 | * @return {any} 96 | */ 97 | menu_c.get = function(label) 98 | { 99 | // If the label doesn't exist 100 | if (!(label in menu_elements_t)) 101 | throw new Error("[Menu] This element's label doesn't exist!"); 102 | 103 | // Get properties 104 | const properties = menu_elements_t[label]; 105 | const final_name = properties.name + menu_spacer + properties.label; 106 | 107 | // Returns the element's value 108 | return UI.GetValue("Misc", "JAVASCRIPT", "Script items", final_name); 109 | } 110 | 111 | /** 112 | * Sets the value of a menu element 113 | * 114 | * @param label {string} 115 | * @param value {any} 116 | */ 117 | menu_c.set = function(label, value) 118 | { 119 | // If the label doesn't exist 120 | if (!(label in menu_elements_t)) 121 | throw new Error("[Menu] This element's label doesn't exist!"); 122 | 123 | // Get properties 124 | const properties = menu_elements_t[label]; 125 | const final_name = properties.name + menu_spacer + properties.label; 126 | 127 | // Set the element's value 128 | UI.SetValue("Misc", "JAVASCRIPT", "Script items", final_name, value); 129 | } 130 | 131 | /** 132 | * Changes the visibility of a menu elements 133 | * 134 | * @param label {string} 135 | * @param visible {boolean} 136 | */ 137 | menu_c.visibility = function(label, visible) 138 | { 139 | // If the label doesn't exist 140 | if (!(label in menu_elements_t)) 141 | throw new Error("[Menu] This element's label doesn't exist!"); 142 | 143 | // Get properties 144 | const properties = menu_elements_t[label]; 145 | const final_name = properties.name + menu_spacer + properties.label; 146 | 147 | // Change the element's visibility 148 | UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", final_name, visible); 149 | } 150 | 151 | //endregion 152 | 153 | //region menu 154 | 155 | // Creates our menu elements 156 | const title = menu_c.label("Standalone RCS"); 157 | const current_condition = menu_c.call(UI.AddDropdown, "Current configuration", "rcs_cond", [["Default", "Pistol", "Rifle", "Sniper", "SMG"]]); 158 | const rcs_x = [ 159 | menu_c.call(UI.AddSliderInt, "Pitch control", "rcs_pitch_value[0]", [0, 100]), 160 | menu_c.call(UI.AddSliderInt, "Pitch control", "rcs_pitch_value[1]", [0, 100]), 161 | menu_c.call(UI.AddSliderInt, "Pitch control", "rcs_pitch_value[2]", [0, 100]), 162 | menu_c.call(UI.AddSliderInt, "Pitch control", "rcs_pitch_value[3]", [0, 100]), 163 | menu_c.call(UI.AddSliderInt, "Pitch control", "rcs_pitch_value[4]", [0, 100]) 164 | ]; 165 | const rcs_y = [ 166 | menu_c.call(UI.AddSliderInt, "Yaw control", "rcs_yaw_value[0]", [0, 100]), 167 | menu_c.call(UI.AddSliderInt, "Yaw control", "rcs_yaw_value[1]", [0, 100]), 168 | menu_c.call(UI.AddSliderInt, "Yaw control", "rcs_yaw_value[2]", [0, 100]), 169 | menu_c.call(UI.AddSliderInt, "Yaw control", "rcs_yaw_value[3]", [0, 100]), 170 | menu_c.call(UI.AddSliderInt, "Yaw control", "rcs_yaw_value[4]", [0, 100]) 171 | ]; 172 | const shots = menu_c.call(UI.AddSliderInt, "After x shots fired", "rcs_aftershots", [0, 5]); 173 | 174 | //endregion 175 | 176 | //region function 177 | 178 | /** 179 | * Clamps a value between two extremes 180 | * 181 | * @param v {number} 182 | * @param min {number} 183 | * @param max {number} 184 | * @return {number} 185 | */ 186 | const clamp = function(v, min, max) 187 | { 188 | return Math.min(Math.max(v, min), max); 189 | } 190 | 191 | const table_contains = function(table, value) 192 | { 193 | // Loops for each value inside the array 194 | for (var i in table) { 195 | // If the table's value matches our value, then return true 196 | if (value === table[i]) 197 | return true; 198 | } 199 | 200 | // Otherwise, we didn't find anything so, return false 201 | return false; 202 | } 203 | 204 | /** 205 | * Normalizes a vector of angles 206 | * 207 | * @param {array} angle 208 | * @return {array} 209 | */ 210 | function normalize_angles(angle) 211 | { 212 | // Clamps our angles 213 | angle[0] = clamp(angle[0], -89, 89); 214 | angle[1] = clamp(angle[1], -180, 180); 215 | angle[2] = 0; 216 | 217 | // Return clamped angles 218 | return angle; 219 | } 220 | 221 | 222 | /** 223 | * Disables Onetap's RCS system to not cause any glitches 224 | */ 225 | function disable_rcs() 226 | { 227 | // Disable Onetap's RCS 228 | UI.SetValue("Legit", "GENERAL", "Default config", "Recoil control", 0); 229 | UI.SetValue("Legit", "PISTOL", "Pistol config", "Recoil control", 0); 230 | UI.SetValue("Legit", "RIFLE", "Rifle config", "Recoil control", 0); 231 | UI.SetValue("Legit", "SNIPER", "Sniper config", "Recoil control", 0); 232 | UI.SetValue("Legit", "SMG", "SMG config", "Recoil control", 0); 233 | } 234 | 235 | 236 | /** 237 | * Updates the visibility of our menu elements 238 | */ 239 | function update_visibility() 240 | { 241 | // Gets the current configuration 242 | const _cond = menu_c.get("rcs_cond"); 243 | 244 | // If the configuration hasn't been switched then no need to update the visibility 245 | if (_cond === old_condition) 246 | return; 247 | 248 | // Otherwise, cache the current condition 249 | old_condition = _cond; 250 | 251 | // Loops between every condition 252 | for (var i = 0; i < 5; i++) 253 | { 254 | // Check if we should enable it or not 255 | const enabled = _cond === i; 256 | 257 | // Update the element's visibility 258 | menu_c.visibility("rcs_pitch_value[" + i + "]", enabled); 259 | menu_c.visibility("rcs_yaw_value[" + i + "]", enabled); 260 | } 261 | } 262 | 263 | 264 | /** 265 | * Updates the current condition 266 | */ 267 | function get_weapon() 268 | { 269 | // Get our local player 270 | const player = Entity.GetLocalPlayer(); 271 | 272 | // If our player ins't valid or if we're dead, return 273 | if (!player || !Entity.IsAlive(player)) 274 | return; 275 | 276 | // Get the weapon's ID 277 | const weapon_id = Entity.GetProp(Entity.GetWeapon(player), "CBaseAttributableItem", "m_iItemDefinitionIndex") & 0xFFFF; 278 | 279 | // If we didn't switch between weapons, then no need to update 280 | if (weapon_id === old_index) 281 | return; 282 | 283 | // Otherwise, cache our current condition 284 | old_index = weapon_id; 285 | 286 | // Loops between our unique conditions 287 | for (var i = 0; i < weapons.length; i++) 288 | { 289 | // Checks if our weapon ID matches with any of the other IDs 290 | if (table_contains(weapons[i], weapon_id)) 291 | { 292 | // If it does, then update our condition 293 | condition = i + 1; 294 | return; 295 | } 296 | } 297 | 298 | // Otherwise, return default condition 299 | condition = 0; 300 | 301 | } 302 | 303 | // Run these whenever the script is first loaded 304 | update_visibility(); 305 | disable_rcs(); 306 | 307 | /** 308 | * Where the magic happens. 309 | * 310 | * @return {void} 311 | */ 312 | function main() 313 | { 314 | // Execute functions 315 | get_weapon(); 316 | update_visibility(); 317 | 318 | // Gets the properties needed 319 | const player = Entity.GetLocalPlayer() 320 | 321 | const amounts = [ 322 | menu_c.get("rcs_pitch_value[" + condition + "]") / 50, 323 | menu_c.get("rcs_yaw_value[" + condition + "]") / 50 324 | ]; 325 | 326 | const shots = menu_c.get("rcs_aftershots"); 327 | 328 | // If our player isn't valid or if we're dead 329 | if (!player || !Entity.IsAlive(player)) 330 | return; 331 | 332 | // If both RCS values are off 333 | if (amounts[0] === 0 && amounts[1] === 0) 334 | return; 335 | 336 | // Get more properties 337 | var angles = Local.GetViewAngles(); 338 | var punch = Entity.GetProp(player, "CBasePlayer", "m_aimPunchAngle"); 339 | var fired = Entity.GetProp(player, "CCSPlayer", "m_iShotsFired"); 340 | 341 | // If we haven't shot the minimum amount of bullets 342 | if (fired <= shots) 343 | { 344 | // Cache our angles anyways so our aim doesn't flick 345 | old_angles = punch; 346 | return; 347 | } 348 | 349 | // If there's no recoil to compensate 350 | if (punch[0] === 0 && punch[1] === 0) 351 | return; 352 | 353 | // Compensate angles 354 | angles[0] -= (punch[0] - old_angles[0]) * amounts[0]; 355 | angles[1] -= (punch[1] - old_angles[1]) * amounts[1]; 356 | 357 | // And then, normalize them 358 | angles = normalize_angles(angles); 359 | 360 | // Cache our final angle so we can do our next calculations based on it 361 | old_angles = punch; 362 | 363 | // Do recoil compensation 364 | UserCMD.SetAngles(angles); 365 | } 366 | 367 | //endregion 368 | 369 | //region callbacks 370 | 371 | // Callback our main function 372 | Cheat.RegisterCallback("CreateMove", "main"); 373 | 374 | //endregion 375 | -------------------------------------------------------------------------------- /onetap/visuals-rework/README.md: -------------------------------------------------------------------------------- 1 | ## Kitkat visuals 2 | --- 3 | 4 | #### Disclaimer 5 | 6 | This plugin was not made with the intentions of re-creating another 7 | software provider's visuals but, instead, to revamp Onetap's visuals 8 | with a more minimalistic look. In order to not disobey the forum's rules, 9 | the script automatically renders a watermark (in the top right corner), 10 | containing the name of the software, your forum username and more additional 11 | info. 12 | 13 | THIS WATERMARK SHOULD NOT BE EDITED OR REMOVED UNDER ANY CIRCUMSTANCES AND 14 | DOING SO WILL PUT YOURSELF IN RISK OF GETTING BANNED FOR PASSING AS ANOTHER 15 | SOFTWARE PROVIDER. 16 | 17 | More info at https://www.onetap.com/threads/rules-scripts-releases.12549/ 18 | 19 | #### Terms of usage 20 | - This plugin's watermark must not be removed or modified in a way that makes the average 21 | viewer not distinguish Onetap from another cheat provider. 22 | - This plugin must not be released in the forums, specially under someone else's name. 23 | - This plugin must not be commercialized under any circumstances. Including it in a javascript pack is 24 | tolerable, as long as the pack itself isn't the product. 25 | -------------------------------------------------------------------------------- /onetap/zeus_bot.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Title: Zeusbot 4 | * Author: april#0001 5 | * Description: An automatic zeus aimbot for legit play. 6 | * 7 | */ 8 | 9 | /** 10 | * @title BetterUI 11 | * @version 1.0.2 12 | * @description A better UI system for Onetap 13 | */ 14 | 15 | var menu_elements_t = []; 16 | var menu_c = []; 17 | const menu_spacer = " "; 18 | 19 | /** 20 | * Creates a new menu label 21 | * 22 | * @param label {string} 23 | */ 24 | menu_c.label = function(label) 25 | { 26 | // Creates the label 27 | UI.AddLabel(label); 28 | } 29 | 30 | /** 31 | * Creates a new menu element 32 | * 33 | * @param func {function} 34 | * @param name {string} 35 | * @param label {string}, 36 | * @param properties {array} 37 | */ 38 | menu_c.call = function(func, name, label, properties) 39 | { 40 | // If the label isn't unique 41 | if (label in menu_elements_t) 42 | throw new Error("[Menu] The label must be unique!"); 43 | 44 | // Get properties 45 | const final_name = name + menu_spacer + label; 46 | var final_props = [final_name]; 47 | const element_info_t = { 48 | name: name, 49 | label: label, 50 | properties: properties 51 | }; 52 | 53 | // If our properties aren't null, then pack them together. 54 | if (properties !== null) 55 | { 56 | for (var i = 0; i < properties.length; i++) 57 | { 58 | final_props.push(properties[i]); 59 | } 60 | } 61 | 62 | // Create our menu element and return properties 63 | func.apply(null, final_props); 64 | menu_elements_t[label] = element_info_t; 65 | return label; 66 | } 67 | 68 | /** 69 | * Gets the value of a menu element 70 | * 71 | * @param label {string} 72 | * @return {any} 73 | */ 74 | menu_c.get = function(label) 75 | { 76 | // If the label doesn't exist 77 | if (!(label in menu_elements_t)) 78 | throw new Error("[Menu] This element's label doesn't exist!"); 79 | 80 | // Get properties 81 | const properties = menu_elements_t[label]; 82 | const final_name = properties.name + menu_spacer + properties.label; 83 | 84 | // Returns the element's value 85 | return UI.GetValue("Misc", "JAVASCRIPT", "Script items", final_name); 86 | } 87 | 88 | /** 89 | * Gets the value of a menu element 90 | * 91 | * @param label {string} 92 | * @return {any} 93 | */ 94 | menu_c.get_hotkey = function(label) 95 | { 96 | // If the label doesn't exist 97 | if (!(label in menu_elements_t)) 98 | throw new Error("[Menu] This element's label doesn't exist!"); 99 | 100 | // Get properties 101 | const properties = menu_elements_t[label]; 102 | const final_name = properties.name + menu_spacer + properties.label; 103 | 104 | // Returns the element's value 105 | return UI.IsHotkeyActive("Misc", "JAVASCRIPT", "Script items", final_name); 106 | } 107 | 108 | /** 109 | * Gets the value of a menu element 110 | * 111 | * @param label {string} 112 | * @return {any} 113 | */ 114 | menu_c.get_color = function(label) 115 | { 116 | // If the label doesn't exist 117 | if (!(label in menu_elements_t)) 118 | throw new Error("[Menu] This element's label doesn't exist!"); 119 | 120 | // Get properties 121 | const properties = menu_elements_t[label]; 122 | const final_name = properties.name + menu_spacer + properties.label; 123 | 124 | // Returns the element's value 125 | return UI.GetColor("Misc", "JAVASCRIPT", "Script items", final_name); 126 | } 127 | 128 | /** 129 | * Sets the value of a menu element 130 | * 131 | * @param label {string} 132 | * @param value {any} 133 | */ 134 | menu_c.set = function(label, value) 135 | { 136 | // If the label doesn't exist 137 | if (!(label in menu_elements_t)) 138 | throw new Error("[Menu] This element's label doesn't exist!"); 139 | 140 | // Get properties 141 | const properties = menu_elements_t[label]; 142 | const final_name = properties.name + menu_spacer + properties.label; 143 | 144 | // Set the element's value 145 | UI.SetValue("Misc", "JAVASCRIPT", "Script items", final_name, value); 146 | } 147 | 148 | /** 149 | * Changes the visibility of a menu elements 150 | * 151 | * @param label {string} 152 | * @param visible {boolean} 153 | */ 154 | menu_c.visibility = function(label, visible) 155 | { 156 | // If the label doesn't exist 157 | if (!(label in menu_elements_t)) 158 | throw new Error("[Menu] This element's label doesn't exist!"); 159 | 160 | // Get properties 161 | const properties = menu_elements_t[label]; 162 | const final_name = properties.name + menu_spacer + properties.label; 163 | 164 | // Change the element's visibility 165 | UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", final_name, visible); 166 | } 167 | 168 | 169 | /** 170 | * Creates a new 3D Vector instance from an array 171 | * 172 | * @param {array} array Our base array 173 | * @return {Vector3D} 174 | */ 175 | function vec3(array) 176 | { 177 | return { 178 | x: array[0], 179 | y: array[1], 180 | z: array[2] 181 | }; 182 | } 183 | 184 | /** 185 | * Adds a 3D Vector to another 3D Vector 186 | * 187 | * @param {Vector} vec Our first vector parameter 188 | * @param {Vector} vec2 Our second vector parameter 189 | * @return {Vector} 190 | */ 191 | function vec_add(vec, vec2) 192 | { 193 | return { 194 | x: vec.x + vec2.x, 195 | y: vec.y + vec2.y, 196 | z: vec.z + vec2.z 197 | }; 198 | } 199 | 200 | /** 201 | * Substracts a 3D Vector from another 3D Vector 202 | * 203 | * @param {Vector} vec Our first vector parameter 204 | * @param {Vector} vec2 Our second vector parameter 205 | * @return {Vector} 206 | */ 207 | function vec_sub(vec, vec2) 208 | { 209 | return { 210 | x: vec.x - vec2.x, 211 | y: vec.y - vec2.y, 212 | z: vec.z - vec2.z 213 | }; 214 | } 215 | 216 | /** 217 | * Multiplies a 3D Vector to another 3D Vector 218 | * 219 | * @param {Vector} vec Our first vector parameter 220 | * @param {Vector} vec2 Our second vector parameter 221 | * @return {Vector} 222 | */ 223 | function vec_mult(vec, vec2) 224 | { 225 | return { 226 | x: vec.x * vec2.x, 227 | y: vec.y * vec2.y, 228 | z: vec.z * vec2.z 229 | }; 230 | } 231 | 232 | 233 | /** 234 | * Converts a radian value to a degree 235 | * 236 | * @param {number} rad Our initial radian 237 | * @return {number} 238 | */ 239 | const rad_deg = function(rad) 240 | { 241 | return rad * 180 / Math.PI; 242 | } 243 | 244 | 245 | /** 246 | * Gets the distance between two 3D vectors 247 | * 248 | * @param {Vector} vec 249 | * @param {Vector} vec2 250 | * @return {number} 251 | */ 252 | const distance3d = function(vec, vec2) 253 | { 254 | // Substract the initial vector from the final vector 255 | const sub = vec_sub(vec2, vec); 256 | 257 | // Calculate and return distance 258 | return Math.sqrt(sub.x * sub.x + sub.y * sub.y + sub.z * sub.z); 259 | } 260 | 261 | 262 | /** 263 | * Unpacks an array into another array without values 264 | * 265 | * @param {Array} Array 266 | * @return {Array} 267 | */ 268 | const unpack = function(array) 269 | { 270 | // Create the array we'll be pushing our elements into 271 | var final = []; 272 | 273 | // Loops for every element inside our parameter array 274 | for (var i in array) 275 | { 276 | // Push values 277 | final.push(array[i]); 278 | } 279 | 280 | // Return final array 281 | return final; 282 | } 283 | //endregion 284 | 285 | //region main 286 | 287 | // Create our variables 288 | var old_index = -1; 289 | var shot = false; 290 | var is_zeus = false; 291 | 292 | //endregion 293 | 294 | //region menu 295 | 296 | // Create our main switch 297 | const enable = menu_c.call(UI.AddCheckbox, "Zeusbot", "zeus_enable", null); 298 | 299 | //endregion 300 | 301 | //region functions 302 | 303 | // Create our target system instance 304 | const target = {}; 305 | 306 | 307 | /** 308 | * Calculates the FOV distance, nearest hitbox and angles of an Entity 309 | * 310 | * @param {Entity | Number} ent The entity our calculation will be based on 311 | * @param {Vector} eye_pos Our local player's eye position 312 | * @param {Vector} angles Our local player's eye angles 313 | * @return {Array} 314 | */ 315 | target.calculate_fov = function(ent, eye_pos, angles) 316 | { 317 | // Create the array we're our data will be saved 318 | var data = {fov: 360, hitbox: -1, angles: []}; 319 | 320 | // Loops between body, pelvis and chest 321 | for (var i = 2; i < 7; i++) 322 | { 323 | // Get our vectors 324 | const hitbox = vec3(Entity.GetHitboxPosition(ent, i)); 325 | const sub = vec_sub(hitbox, eye_pos); 326 | 327 | // Calculate our angles based on the previously calculated vectors 328 | const yaw = rad_deg(Math.atan2(sub.y, sub.x)); 329 | const pitch = -rad_deg(Math.atan2(sub.z, Math.sqrt(sub.x * sub.x + sub.y * sub.y))); 330 | 331 | // Calculate the difference between our local angles and the calculated angles 332 | const yaw_dif = Math.abs(angles.y % 360 - yaw % 360) % 360; 333 | const pitch_dif = Math.abs(angles.x - pitch) % 360; 334 | 335 | // Normalize the yaw 336 | if (yaw_dif > 180) 337 | yaw_dif = 360 - yaw_dif; 338 | 339 | // Calculate the FOV 340 | const distance = Math.sqrt(pitch_dif * pitch_dif + yaw_dif * yaw_dif); 341 | 342 | // If this FOV is lower than our cached FOV, then update our data 343 | if (distance < data.fov) 344 | { 345 | // Update our data 346 | data.fov = distance; 347 | data.hitbox = i; 348 | data.angles = [pitch, yaw]; 349 | } 350 | } 351 | 352 | // Return gathered data 353 | return data; 354 | } 355 | 356 | 357 | /** 358 | * Gets the entity index of our target 359 | * 360 | * @return {Void} 361 | */ 362 | target.get_target = function() 363 | { 364 | // Get our properties 365 | const player = Entity.GetLocalPlayer(); 366 | const eye_pos = vec3(Entity.GetEyePosition(player)); 367 | const eye_angles = vec3(Local.GetViewAngles()); 368 | 369 | // Get our enemies 370 | const enemies = Entity.GetEnemies(); 371 | 372 | // Create the array we're our data will be saved 373 | const data = {fov: 360, id: -1, hitbox: -1, angles: []}; 374 | 375 | // Loops for every enemy 376 | for (var i = 0; i < enemies.length; i++) 377 | { 378 | // Our current enemy 379 | const ent = enemies[i]; 380 | 381 | // Check if our enemy is valid for our purposes 382 | if (Entity.IsValid(ent) && Entity.IsAlive(ent) && !Entity.GetProp(ent, "CCSPlayer", "m_bGunGameImmunity")) 383 | { 384 | // Calculate the FOV 385 | const fov_info = target.calculate_fov(ent, eye_pos, eye_angles); 386 | 387 | // If our calculated FOV is lower than the cached FOV, then update data 388 | if (fov_info.fov < data.fov) 389 | { 390 | // Update data 391 | data.fov = fov_info.fov; 392 | data.id = ent; 393 | data.hitbox = fov_info.hitbox; 394 | data.angles = fov_info.angles; 395 | } 396 | } 397 | } 398 | 399 | // Return gathered target and data 400 | return data; 401 | } 402 | 403 | target.is_zeus = function() 404 | { 405 | // Gets our properties 406 | const player = Entity.GetLocalPlayer(); 407 | const weapon_id = Entity.GetProp(Entity.GetWeapon(player), "CBaseAttributableItem", "m_iItemDefinitionIndex") & 0xFFFF; 408 | 409 | // If our current weapon index is the same as the cached one, then we didn't swap between weapons 410 | if (weapon_id === old_index) 411 | return; 412 | 413 | // Otherwise, cache our weapon index for further calculations 414 | old_index = weapon_id; 415 | 416 | // If our weapon is a zeus, then set is_zeus to true. Otherwise, set it to false. 417 | if (weapon_id === 31) 418 | is_zeus = true; 419 | else 420 | is_zeus = false; 421 | } 422 | 423 | // Create our aiming system instance 424 | var aim = {}; 425 | 426 | 427 | /** 428 | * Where the aimbot magic happens (I love this meme.) 429 | * 430 | * @return {Void} 431 | */ 432 | aim.do = function() 433 | { 434 | // If the zeusbot isn't enable, then no need to do the aimbot 435 | if (!menu_c.get(enable)) 436 | return; 437 | 438 | // Checks if we did shoot 439 | if (shot) 440 | { 441 | // If we did, then update buttons, set shot to false and return, otherwise, we won't be able to shoot again. 442 | Cheat.ExecuteCommand("-attack"); 443 | shot = false; 444 | return; 445 | } 446 | 447 | // If our current weapon ins't a zeus, then no need to do aimbot 448 | if (!is_zeus) 449 | return; 450 | 451 | // Get our local player 452 | const player = Entity.GetLocalPlayer(); 453 | 454 | // If our local player insn't valid or if we're dead, return 455 | if (!player || !Entity.IsAlive(player)) 456 | return; 457 | 458 | // Get our target and its info 459 | const data = target.get_target(); 460 | 461 | // If there's no target, then return 462 | if (data.id === -1) 463 | return; 464 | 465 | // Get our propeties 466 | const eye_pos = vec3(Entity.GetEyePosition(player)); 467 | const hitbox = vec3(Entity.GetHitboxPosition(data.id, data.hitbox)); 468 | 469 | // Do checks 470 | const trace = Trace.Line(player, unpack(eye_pos), unpack(hitbox)); 471 | const dst = distance3d(eye_pos, hitbox); 472 | 473 | // If our checks are true then... 474 | if (dst < 150 && !shot && trace[1] > 0.88) 475 | { 476 | // Do aimbot, fire and update data 477 | Local.SetViewAngles([data.angles[0], data.angles[1], 0]); 478 | Cheat.ExecuteCommand("+attack"); 479 | shot = true; 480 | } 481 | 482 | } 483 | 484 | //endregion 485 | 486 | //region callbacks 487 | 488 | // Callback our functions otherwise nothing will happen 489 | // Haha, another PaintTraverse aimbot. 490 | Cheat.RegisterCallback("Draw", "target.is_zeus"); 491 | Cheat.RegisterCallback("Draw", "aim.do"); 492 | 493 | //endregion 494 | -------------------------------------------------------------------------------- /onetap_v4/advanced_freestanding.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Title: Advanced freestanding 4 | * Author: april#0001 5 | * Description: A rework of my body freestanding script made for v3. 6 | * 7 | */ 8 | 9 | //region Dependencies 10 | //region Menu 11 | // Dependencies that makes UI.Add... elements return their respective paths. 12 | function fixUIBehaviour() { 13 | for(var i in UI) { 14 | if(!~i.indexOf("Add")) 15 | continue; 16 | 17 | (function(cur) { 18 | UI[i] = function() { 19 | cur.apply(this, Array.prototype.slice.call(arguments)); 20 | return arguments[0].concat(arguments[1]); 21 | } 22 | }(UI[i])); 23 | } 24 | } 25 | 26 | // Call this whenever the script first loads. 27 | fixUIBehaviour( ); 28 | //endregion 29 | 30 | //region Render 31 | /** 32 | * Renders a shadowed string 33 | * @param Number x 34 | * @param Number y 35 | * @param Number a 36 | * @param Number l 37 | * @param Number c 38 | * @param Number f 39 | */ 40 | Render.ShadowString = function(x, y, a, l, c, f) { 41 | // Get the minimum alpha. 42 | const alpha = Math.min(c[3], 235); 43 | 44 | Render.String(x, y + 1, a, l, [10, 10, 10, alpha], f); 45 | Render.String(x, y, a, l, c, f); 46 | } 47 | 48 | /** 49 | * Renders an outlined string 50 | * @param Number x 51 | * @param Number y 52 | * @param Number a 53 | * @param Number l 54 | * @param Number c 55 | * @param Number f 56 | */ 57 | Render.OutlineString = function(x, y, a, s, c, f) { 58 | // Get the minimum alpha. 59 | const alpha = Math.min(235, c[3]); 60 | 61 | Render.String(x - 1, y - 1, a, s, [10, 10, 10, alpha], f); 62 | Render.String(x - 1, y + 1, a, s, [10, 10, 10, alpha], f); 63 | Render.String(x + 1, y - 1, a, s, [10, 10, 10, alpha], f); 64 | Render.String(x + 1, y + 1, a, s, [10, 10, 10, alpha], f); 65 | Render.String(x, y, a, s, c, f); 66 | } 67 | //endregion 68 | 69 | //region Math 70 | /** 71 | * Subtracts two 3D vectors. 72 | * @param Number[3] vec 73 | * @param Number[3] vec2 74 | */ 75 | function subtract(vec, vec2) 76 | { 77 | return [ 78 | vec[ 0 ] - vec2[ 0 ], 79 | vec[ 1 ] - vec2[ 1 ], 80 | vec[ 2 ] - vec2[ 2 ] 81 | ]; 82 | }; 83 | 84 | /** 85 | * Subtracts two 3D vectors. 86 | * @param Number[3] vec 87 | * @param Number[3] vec2 88 | */ 89 | function multiply(vec, vec2) 90 | { 91 | return [ 92 | vec[ 0 ] * vec2[ 0 ], 93 | vec[ 1 ] * vec2[ 1 ], 94 | vec[ 2 ] * vec2[ 2 ] 95 | ]; 96 | }; 97 | 98 | /** 99 | * Normalizes an angle. 100 | * @param Number angle 101 | */ 102 | function normalize( angle ) { 103 | // If angle is lower than 180, adds 360. 104 | while ( angle < -180 ) 105 | angle += 360; 106 | 107 | // If angle is greater than 180, subtract 360. 108 | while ( angle > 180 ) 109 | angle -= 360; 110 | 111 | // Return normalized angle. 112 | return angle; 113 | } 114 | 115 | /** 116 | * Extrapolates an vector by an entity's velocity. 117 | * @param Number entity 118 | * @param Number[] position 119 | * @param Number ticks 120 | */ 121 | function extrapolate( entity, position, ticks ) { 122 | // Get this entity's velocity. 123 | const velocity = Entity.GetProp( entity, "CBasePlayer", "m_vecVelocity[0]" ); 124 | 125 | // Get the server's tick interval. 126 | const interval = Globals.TickInterval( ); 127 | 128 | // Extrapolate the position by the velocity. 129 | // In this case, we're 'predicting' where this entity will be in one second. 130 | position[ 0 ] += velocity[ 0 ] * interval * ticks; 131 | position[ 1 ] += velocity[ 1 ] * interval * ticks; 132 | position[ 2 ] += velocity[ 2 ] * interval * ticks; 133 | 134 | // Return the extrapolated position. 135 | return position; 136 | }; 137 | 138 | /** 139 | * Converts degrees into radians. 140 | * @param Number degree 141 | */ 142 | function degree_to_radian( degree ) { 143 | return degree * Math.PI / 180; 144 | } 145 | 146 | /** 147 | * Converts angles into a direction vector 148 | * @param Number[] angles 149 | */ 150 | function angle_to_vector( angles ) { 151 | // Calculate sines and cosines. 152 | const sp = Math.sin( degree_to_radian( angles[ 0 ] ) ); 153 | const cp = Math.cos( degree_to_radian( angles[ 0 ] ) ); 154 | const sy = Math.sin( degree_to_radian( angles[ 1 ] ) ); 155 | const cy = Math.cos( degree_to_radian( angles[ 1 ] ) ); 156 | 157 | // Return the calculated direction vector. 158 | return [ cp * cy, cp * sy, -sp ] 159 | } 160 | //endregion 161 | //endregion 162 | 163 | //region Locals 164 | // Create a global object where we will be storing our cached values. 165 | var cache = { 166 | active: false, 167 | reference: false 168 | }; 169 | 170 | // Create a global object where we will store shared information. 171 | var shared = { 172 | create_fonts: true, 173 | fonts: { default: null, small: null }, 174 | 175 | target: null, 176 | 177 | side: 0, 178 | last_side: 0 179 | }; 180 | //endregion 181 | 182 | //region Menu 183 | // Reference our menu's path. 184 | const path = [ "Rage", "Anti Aim", "Fake" ]; 185 | 186 | // Create our menu elements 187 | const mode = UI.AddDropdown( path, "Body yaw freestanding", [ "Off", "Hide real", "Hide fake" ], 0 ); 188 | const fs_target = UI.AddDropdown( path, "Freestanding target", [ "Crosshair", "Distance" ], 0 ); 189 | 190 | // Reference the necessary menu elements. 191 | const ref_body_freestanding = [ "Rage", "Anti Aim", "Fake", "Hide real angle" ]; 192 | const ref_inverter = [ "Rage", "Anti Aim", "General", "Key assignment", "AA Direction inverter" ]; 193 | //endregion 194 | 195 | //region Functions 196 | //region Targeting 197 | /** 198 | * Gets the distance from a player's origin to a 3D point. 199 | * @param Number me 200 | * @param Number[] pos 201 | */ 202 | function getDistance( me, pos ) { 203 | // Get the specified entity's origin. 204 | const origin = Entity.GetRenderOrigin( me ); 205 | 206 | // Calculate the difference between the destination and origin. 207 | const sub = subtract( pos, origin ); 208 | 209 | // Calculate the distance. 210 | const distance = Math.sqrt( sub[ 0 ] * sub[ 0 ] + sub[ 1 ] * sub[ 1 ] + sub[ 2 ] * sub[ 2 ] ); 211 | 212 | // Return distance. 213 | return distance; 214 | } 215 | 216 | /** 217 | * Gets the FOV delta from a player's eye position to a 3D point. 218 | * @param Number me 219 | * @param Number[] pos 220 | */ 221 | function getFOV( me, pos ) { 222 | // Get entity properties. 223 | const eye_pos = Entity.GetEyePosition( me ); 224 | const viewangles = Local.GetViewAngles( ); 225 | 226 | // Calculate the difference between the desired position and our eye position. 227 | const sub = subtract( pos, eye_pos ); 228 | 229 | // Calculate yaw and pitch. 230 | const yaw = Math.atan2( sub[ 1 ], sub[ 0 ] ) * 180 / Math.PI; 231 | const pitch = -Math.atan2( sub[ 2 ], Math.sqrt( sub[ 0 ] ** 2 + sub[ 1 ] ** 2 ) ) * 180 / Math.PI; 232 | 233 | // Calculate yaw and pitch delta. 234 | var yaw_delta = ( ( viewangles[ 1 ] % 360 - yaw % 360 ) % 360 ); 235 | const pitch_delta = viewangles[ 0 ] - pitch; 236 | 237 | // Normalize our yaw delta so it doesn't exceed source engine's mins and maxs. 238 | yaw_delta = normalize( yaw_delta ); 239 | 240 | // Calculate the FOV. 241 | // Return the calculated fov. 242 | return Math.sqrt(yaw_delta * yaw_delta + pitch_delta * pitch_delta); 243 | } 244 | 245 | /** 246 | * Calculates the best target for freestanding. 247 | * @param Number me 248 | */ 249 | function getBestTarget( me ) { 250 | 251 | /** 252 | * Checks if an entity is invalid. 253 | * @param Number entity 254 | */ 255 | const sanitize = function( entity ) { 256 | return Entity.IsDormant( entity ) || !Entity.IsAlive( entity ); 257 | } 258 | 259 | // Get our freestanding mode. 260 | const distance_based = UI.GetValue( fs_target ); 261 | 262 | // Get enemies. 263 | const enemies = Entity.GetEnemies( ); 264 | 265 | // Initialize the object where our data will be stored. 266 | var data = { target: null, fov: 180, distance: 8192 }; 267 | 268 | // Loop through every single enemy. 269 | for ( var i = 0; i < enemies.length; i++ ) { 270 | // Get our current enemy. 271 | const entity = enemies[ i ]; 272 | 273 | // Check if this enemy is valid. 274 | if ( sanitize( entity ) ) 275 | return; 276 | 277 | // Check if we are not using 'Distance' targeting mode, thus, we're using 'Crosshair'. 278 | if ( !distance_based ) { 279 | // Get the enemy's head position. 280 | const head_position = Entity.GetHitboxPosition( entity, 0 ); 281 | 282 | // Calculate the FOV. 283 | const fov = getFOV( me, head_position ); 284 | 285 | // Check if this FOV is lower than the stored FOV. 286 | // This means that this enemy is closer to our crosshair than the 287 | // previous ones. 288 | if ( fov < data.fov ) { 289 | // Update our target and save changes. 290 | data.fov = fov; 291 | data.target = entity; 292 | } 293 | } 294 | 295 | // Otherwise, we're using 'Distance' mode. 296 | else { 297 | // Get the enemy's origin. 298 | const origin = Entity.GetRenderOrigin( entity ); 299 | 300 | // Calculate the distance. 301 | const distance = getDistance( me, origin ); 302 | 303 | // Check if this distance is lower than the stored distance. 304 | // Same logic as FOV. 305 | if ( distance < data.distance ) { 306 | // Update our target and save changes. 307 | data.distance = distance; 308 | data.target = entity; 309 | } 310 | } 311 | } 312 | 313 | // Update our global target variable. 314 | shared.target = data.target; 315 | } 316 | //endregion 317 | 318 | //region Logic 319 | /** 320 | * Calculates the best freestanding side. 321 | * @param Number me 322 | */ 323 | function getFreestandingSide( me ) { 324 | // Get local properties. 325 | const eye_position = Entity.GetEyePosition( me ); 326 | const eye_angles = Local.GetViewAngles( )[ 1 ]; 327 | 328 | // Initialize the object where our data will be stored. 329 | var data = { 330 | damages: [ 0, 0 ], 331 | fractions: { left: 0, right: 0 } 332 | }; 333 | 334 | // Reset freestanding side. 335 | shared.side = 0; 336 | 337 | // Check if we have a valid target. 338 | if ( shared.target ) { 339 | // Get this target's head position. 340 | const head_position = Entity.GetHitboxPosition( shared.target, 0 ); 341 | 342 | // Initialize arrays used for calculations. 343 | const multiplier = [ 32, 32, 32 ]; 344 | const angles = [ -90, 90 ]; 345 | 346 | // Loop through every freestanding angle. 347 | for ( var i = 0; i < angles.length; i++ ) { 348 | // Get the current angle. 349 | const current = angles[ i ]; 350 | 351 | // Calculate the extrapolated point. 352 | const direction = multiply( angle_to_vector( [ 0, eye_angles + current, 0 ] ), multiplier ); 353 | const point = extrapolate( me, [ 354 | eye_position[ 0 ] + direction[ 0 ], 355 | eye_position[ 1 ] + direction[ 1 ], 356 | eye_position[ 2 ] + direction[ 2 ], 357 | ], 4 ); 358 | 359 | // Trace a bullet from the extrapolated point to the target's head. 360 | // These points are extrapolated 32 units to the right and left. 361 | const bullet = Trace.Bullet( me, shared.target, point, head_position ); 362 | 363 | // Check if our bullet data is valid. 364 | // Prevents rare case where it returns null. 365 | if ( !bullet ) 366 | continue; 367 | 368 | // Update our damage data. 369 | data.damages[ i ] = bullet[ 1 ]; 370 | } 371 | 372 | // If the left damage is lower than the right one, we 373 | // want to put our head there. 374 | if ( data.damages[ 0 ] < data.damages[ 1 ] ) { 375 | // Update freestanding side to left. 376 | shared.side = 1; 377 | } 378 | 379 | // If the left damage is greather than the right one, we 380 | // want to put our head to the other way. 381 | else if ( data.damages[ 0 ] > data.damages[ 1 ] ) { 382 | // Update freestanding side to right. 383 | shared.side = 2; 384 | } 385 | } 386 | 387 | // If none of those conditions are met, it means we didn't have accurate damage information 388 | // to freestand. So, proceed with normal trace freestanding. 389 | if ( shared.side ) 390 | return; 391 | 392 | // Start from your backwards angle and do a 360. 393 | for ( var i = eye_angles - 180; i < eye_angles + 180; i += 180 / 12 ) { 394 | // Check if our current angle is equals our eye angle. 395 | // If so continue because the center point can't be right or left. 396 | if ( i === eye_angles ) 397 | continue; 398 | 399 | // Convert this angle into radians. 400 | const rotation = degree_to_radian( i ); 401 | 402 | // Calculate the extrapolated point once again. 403 | const point = [ 404 | eye_position[ 0 ] + Math.cos( rotation ) * 256, 405 | eye_position[ 1 ] + Math.sin( rotation ) * 256, 406 | eye_position[ 2 ] 407 | ]; 408 | 409 | // Trace a line from our eye position to the extrapolated point. 410 | // These points are making a circle around you with a 256u radius. 411 | const line = Trace.Line( me, eye_position, point ); 412 | 413 | // Check if our trace data is valid. 414 | // Prevents rare case where it returns null. 415 | if ( !line ) 416 | continue; 417 | 418 | // Update our trace data. 419 | data.fractions[ i > eye_angles ? "right" : "left" ] += line[ 1 ]; 420 | } 421 | 422 | // If the left walls are closer than the right ones, 423 | // put our head to the left. 424 | if ( data.fractions.left < data.fractions.right ) { 425 | // Update freestanding side to left. 426 | shared.side = 1; 427 | } 428 | 429 | // If the left walls are further away than the right ones, 430 | // put our head to the right. 431 | else if ( data.fractions.left > data.fractions.right ) { 432 | // Update freestanding side to right. 433 | shared.side = 2; 434 | } 435 | } 436 | 437 | function updateFreestandingData( ) { 438 | // Get local player. 439 | const me = Entity.GetLocalPlayer( ); 440 | 441 | // Update freestanding data. 442 | getBestTarget( me ); 443 | getFreestandingSide( me ); 444 | } 445 | //endregion 446 | 447 | //region Update 448 | function updateSettings( ) { 449 | // Get current freestanding mode. 450 | const current_mode = UI.GetValue( mode ); 451 | 452 | // Check if our freestanding side changed. 453 | if ( shared.side === shared.last_side ) 454 | return; 455 | 456 | // Save this side for further checks. 457 | shared.last_side = shared.side; 458 | 459 | // Check if the script is enabled. 460 | if ( !current_mode ) 461 | return; 462 | 463 | // Get inverted states. 464 | const inverted = UI.GetValue( ref_inverter ); 465 | const desired = current_mode == 1 ? shared.side == 1 : shared.side == 2; 466 | 467 | // Check if our inverter hotkey is bound. If not, 468 | // force bind it. 469 | if ( !UI.GetHotkey( ref_inverter ) ) 470 | UI.SetValue( ref_inverter, 100 ); 471 | 472 | // Check if our inverter hotkey is on Toggle. If not, 473 | // force it to Toggle. 474 | if ( UI.GetHotkeyState( ref_inverter ) != "Toggle" ) 475 | UI.SetHotkeyState( ref_inverter, "Toggle" ); 476 | 477 | // Check if we should update our inverter. 478 | if ( inverted != desired ) 479 | // Toggle / Untoggle the inverter. 480 | UI.ToggleHotkey( ref_inverter ); 481 | } 482 | //endregion 483 | 484 | //region Callbacks 485 | //region Menu 486 | function onEnable( ) { 487 | // Get current freestanding mode. 488 | const value = UI.GetValue( mode ); 489 | 490 | // Reset the cached freestanding side. 491 | // Do this so our freestanding updates. 492 | shared.last_side = 0; 493 | 494 | // Check if this is the first time activating the script. 495 | if ( value && !cache.active ) { 496 | // Cache values. 497 | cache.active = true; 498 | cache.reference = UI.GetValue( ref_body_freestanding ); 499 | 500 | // Disable the cheat's freestanding as we'll be handling it via the script. 501 | UI.SetValue( ref_body_freestanding, 0 ); 502 | } 503 | 504 | // Check if we just disabled the script. 505 | else if ( !value && cache.active ) { 506 | // Reset cache. 507 | cache.active = false; 508 | 509 | // Revert the cheat's freestanding to original state. 510 | UI.SetValue( ref_body_freestanding, cache.reference ); 511 | } 512 | 513 | // Handle visibility. 514 | UI.SetEnabled( fs_target, +value ); 515 | UI.SetEnabled( ref_body_freestanding, +!value ); 516 | } 517 | 518 | // Register the UI callbacks. 519 | UI.RegisterCallback( mode, 'onEnable' ); 520 | //endregion 521 | 522 | function onCreateMove( ) { 523 | // Do freestanding. 524 | updateFreestandingData( ); 525 | updateSettings( ); 526 | } 527 | 528 | function onDraw( ) { 529 | // Check if we should create our fonts. 530 | if ( shared.create_fonts ) { 531 | // Create fonts on script load. 532 | shared.create_fonts = false; 533 | shared.fonts.default = Render.AddFont( "segoeuib", 30, 0 ); 534 | shared.fonts.small = Render.AddFont( "segoeuib", 9, 0 ); 535 | } 536 | 537 | // Check if we're in game by checking if the local player is valid. 538 | if ( !Entity.IsValid( Entity.GetLocalPlayer( ) ) ) 539 | return; 540 | 541 | // Check if the script is enabled. 542 | if ( !UI.GetValue( mode ) ) 543 | return; 544 | 545 | // Get rendering position. 546 | const x = 15, y = Render.GetScreenSize( )[ 1 ] - 150; 547 | 548 | // Get anti-aim data. 549 | const real = Local.GetRealYaw( ), fake = Local.GetFakeYaw( ); 550 | const delta = normalize( real - fake ) / 2; 551 | 552 | // Render the main indicator. 553 | Render.ShadowString( x, y, 0, "FAKE", [ 235, 235, 235, 225 ], shared.fonts.default ); 554 | Render.OutlineString( x + 34, y + 45, 1, delta.toFixed( 1 ).toString( ), [ 200, 200, 200, 225 ], shared.fonts.small ); 555 | Render.FilledRect( x, y + 40, 72, 4, [ 10, 10, 10, 200 ] ); 556 | 557 | // Render the delta bar. 558 | if ( delta > 0 ) 559 | Render.FilledRect( x + 36, y + 41, 36 * Math.abs( delta ) / 60, 2, [ 235, 235, 235, 225 ] ); 560 | 561 | else 562 | Render.FilledRect( x + 36 - ( 36 * Math.abs( delta ) / 60 ), y + 41, 36 * Math.abs( delta ) / 60, 2, [ 235, 235, 235, 225 ] ); 563 | 564 | } 565 | 566 | // Call this on script load. 567 | onEnable( ); 568 | 569 | // Register normal callbacks. 570 | Cheat.RegisterCallback( 'CreateMove', 'onCreateMove' ); 571 | Cheat.RegisterCallback( 'Draw', 'onDraw' ); 572 | //endregion 573 | //endregion 574 | -------------------------------------------------------------------------------- /onetap_v4/better_autostrafer.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Title: Better auto strafer 4 | * Author: april#0001 5 | * Description: Overrides auto strafer velocity to make it more responsive on high air accelerate servers. 6 | * 7 | */ 8 | 9 | //region Locals 10 | // Create our cache object where cached variables will be stored. 11 | var cache = { 12 | turn_speed: 0 13 | } 14 | //endregion 15 | 16 | //region Menu 17 | // Create references to the menu elements I'll be using. 18 | const ref_autostrafe = [ "Misc.", "Movement", "General", "Auto strafe" ]; 19 | const ref_turnspeed = [ "Misc.", "Movement", "General", "Turn speed" ]; 20 | //endregion 21 | 22 | //region Functions 23 | //region Math 24 | /** 25 | * Clamps a value between a lower and upper limit. 26 | * @param number value 27 | * @param number min 28 | * @param number max 29 | */ 30 | function clamp( value, min, max ) { 31 | return Math.min( Math.max( value, min ), max ); 32 | } 33 | //endregion 34 | 35 | //region Others 36 | /** 37 | * Gets the horizontal speed of an entity. 38 | * @param number entity 39 | */ 40 | function getEntitySpeed( entity ) { 41 | // Get the velocity vector. 42 | const velocity = Entity.GetProp( entity, "CBasePlayer", "m_vecVelocity[0]" ); 43 | 44 | // Calculate speed and return it. 45 | return Math.sqrt( velocity[ 0 ] * velocity[ 0 ] + velocity[ 1 ] * velocity[ 1 ] ); 46 | } 47 | //endregion 48 | 49 | //region Callbacks 50 | function onLoad( ) { 51 | // Hide the 'Turn speed' slider so the user doesn't try to change it. 52 | // It's not like they'd be able to either way. 53 | UI.SetEnabled( ref_turnspeed, 0 ); 54 | 55 | // Cache our turn speed so we can restore it on unload. 56 | cache.turn_speed = UI.GetValue( ref_turnspeed ); 57 | } 58 | 59 | function onUnload( ) { 60 | // Restore our turn speed whenever the script is unloaded. 61 | UI.SetValue( ref_turnspeed, cache.turn_speed ); 62 | } 63 | 64 | function onCreateMove( ) { 65 | 66 | // Check if our auto stafer is on 'Directional' mode. 67 | if (UI.GetValue( ref_autostrafe ) != 3 ) 68 | return; 69 | 70 | // Get our local player and its speed. 71 | const me = Entity.GetLocalPlayer( ); 72 | const speed = getEntitySpeed( me ); 73 | 74 | // Calculate our air acceleration multiplier. This is calculated in a way that 75 | // sv_airaccelerate 12, the default value, is 0 and sv_airaccelerate 100, the 76 | // most common used value on HvH servers, is 1. 77 | const air_accel = clamp( -0.12 + Convar.GetFloat( "sv_airaccelerate" ) * 0.01, 0, 1 ); 78 | 79 | // Calculate the base turn speed that the auto strafer will be 80 | // working with. 81 | const base_speed = 10 + air_accel * 90; 82 | 83 | // Calculate our speed multiplier. This is calculated in a way that 0 speed is 84 | // 0 and 320 speed, default value of sv_maxspeed, is 1. 85 | const speed_multiplier = clamp( speed / 320, 0, 1 ); 86 | 87 | // Calculate the additional turn speed. This is makes so the higher our speed 88 | // and the higher the sv_airaccelerate, the faster we'll turn. 89 | const additional_speed = 200 * air_accel * speed_multiplier; 90 | 91 | // Override our 'Turn speed' slider's value. 92 | UI.SetValue( ref_turnspeed, base_speed + additional_speed ); 93 | } 94 | 95 | // Call this once whenever the script first loads. 96 | onLoad( ); 97 | 98 | // Register our other callbacks. 99 | Cheat.RegisterCallback( "CreateMove", "onCreateMove" ); 100 | Cheat.RegisterCallback( "Unload", "onUnload" ); 101 | //endregion 102 | //endregion 103 | -------------------------------------------------------------------------------- /onetap_v4/dark_nightmode.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Title: Dark night mode 4 | * Author: april#0001 5 | * Description: Makes your night mode darker 6 | * 7 | */ 8 | 9 | //region Locals 10 | //region Consts 11 | // Declare our CEnvTonemapController's ClassID. 12 | const CEnvTonemapController = 69; 13 | //endregion 14 | 15 | // Create a cache object to store our cached variables. 16 | var cache = { 17 | amount: -1 18 | }; 19 | 20 | // Create a global variable to save our last CEnvTonemapController. 21 | var tonemap_controller = null 22 | //endregion 23 | 24 | //region Menu 25 | // Create a reference to the night mode slider. 26 | const ref_night_mode = [ "Visuals", "World", "General", "Night mode" ]; 27 | //endregion 28 | 29 | //region Functions 30 | //region Other 31 | /** 32 | * Updates the CEnvTonemapController's props. 33 | * @param number entity 34 | * @param number min 35 | * @param number max 36 | */ 37 | function updateAutoExposure( entity, active, min, max ) { 38 | 39 | // Check if our CEnvTonemapController is not null. 40 | if ( !entity ) 41 | return; 42 | 43 | // Force the entity to use our custom values for auto exposure 44 | Entity.SetProp( entity, "CEnvTonemapController", "m_bUseCustomAutoExposureMin", active ); 45 | Entity.SetProp( entity, "CEnvTonemapController", "m_bUseCustomAutoExposureMax", active ); 46 | 47 | // And bloom. 48 | Entity.SetProp( entity, "CEnvTonemapController", "m_bUseCustomBloomScale", active ); 49 | 50 | // Override the custom values. 51 | Entity.SetProp( entity, "CEnvTonemapController", "m_flCustomAutoExposureMin", min ); 52 | Entity.SetProp( entity, "CEnvTonemapController", "m_flCustomAutoExposureMax", max ); 53 | 54 | Entity.SetProp( entity, "CEnvTonemapController", "m_flBloomSaturation", 5 ); 55 | Entity.SetProp( entity, "CEnvTonemapController", "m_flCustomBloomScaleMinimum", min / 0.1 * 5 ); 56 | Entity.SetProp( entity, "CEnvTonemapController", "m_flCustomBloomScale", max / 0.1 * 5 ); 57 | } 58 | //endregion 59 | 60 | //region Callbacks 61 | // Hana forced me into naming the callback MSPaint uwu 62 | function msPaint( ) { 63 | 64 | // Check if our local player is a valid entity. 65 | // Do this to check if we're connected to a game. 66 | if ( !Entity.IsValid( Entity.GetLocalPlayer( ) ) ) 67 | return; 68 | 69 | // Get our current CEnvTonemapController. 70 | tonemap_controller = Entity.GetEntitiesByClassID( CEnvTonemapController )[ 0 ]; 71 | 72 | // Check if our CEnvTonemapController is valid. 73 | if ( !Entity.IsValid( tonemap_controller ) ) 74 | return; 75 | 76 | // Get our night mode amount. 77 | const amount = UI.GetValue( ref_night_mode ); 78 | 79 | // Check if our value has changed from the last frame to this frame. 80 | // Doing this for better performance as we don't need to change 81 | // the props every frame. 82 | if ( cache.amount === amount ) 83 | return; 84 | 85 | // Cache our current amount for further checks. 86 | cache.amount = amount; 87 | 88 | // Update the auto exposure and bloom. 89 | updateAutoExposure( 90 | tonemap_controller, 91 | true, 92 | 0.1 - amount * 0.099, 93 | 0.1 - amount * 0.099 94 | ); 95 | } 96 | 97 | function onRoundPreStart( ) { 98 | // Reset the cached amount on round start, forcing the application of the auto exposure. 99 | cache.amount = -1; 100 | } 101 | 102 | function onPlayerConnectFull( ) { 103 | // Reset the cached amount on connect, forcing the application of the auto exposure. 104 | cache.amount = -1; 105 | } 106 | 107 | function onUnload( ) { 108 | // Reset the auto exposure. 109 | updateAutoExposure( 110 | tonemap_controller, 111 | false, 112 | 0, 113 | 0 114 | ); 115 | } 116 | 117 | // Register our Draw callback 118 | // Global just to piss everyone off ( also Hana's idea ). 119 | Global.RegisterCallback( 'Draw', 'msPaint' ); 120 | Global.RegisterCallback( 'Unload', 'onUnload' ); 121 | Global.RegisterCallback( 'round_prestart', 'onRoundPreStart' ); 122 | Global.RegisterCallback( 'player_connect_full', 'onPlayerConnectFull' ); 123 | //endregion 124 | //endregion 125 | -------------------------------------------------------------------------------- /onetap_v4/enemy_view.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Title: Enemy view 4 | * Author: april#0001 5 | * Description: Renders a camera on your screen that represents the 3rd person view of the nearest target. 6 | * 7 | */ 8 | 9 | //region Locals 10 | // Create our view and store its index. 11 | const view = View.Create(); 12 | 13 | // Create a global variable for our current targeted entity. 14 | var target = null; 15 | 16 | // Create an object to store our dragging-related info. 17 | var drag = { 18 | // The window's position. 19 | x: 100, 20 | y: 100, 21 | 22 | difference: { 23 | x: 0, 24 | y: 0 25 | }, 26 | 27 | dragging: false 28 | }; 29 | //endregion 30 | 31 | //region Menu 32 | // Create our hotkey. 33 | UI.AddHotkey(["Misc.", "Keys", "General", "Key assignment"], "Enemy view", "Enemy view"); 34 | 35 | // Also create invisible sliders to store the X and Y positions of our window. 36 | UI.AddSliderInt(["Config", "Cheat", "General"], "pos_x", 100, 2560); 37 | UI.AddSliderInt(["Config", "Cheat", "General"], "pos_y", 100, 1440); 38 | //endregion 39 | 40 | //region Dependencies 41 | 42 | /** 43 | * @description Converts an Angle object into a 3D world vector. 44 | * @param {Number[3]} x 45 | */ 46 | function AngleVector(x) { 47 | 48 | /** 49 | * @description Convert degrees into radians. 50 | * @param {Number} deg 51 | */ 52 | const DegreeToRadian = function(deg) { 53 | return deg * Math.PI / 180; 54 | } 55 | 56 | // Calculate the sines and cosines of the X and Y angles. 57 | const sp = Math.sin(DegreeToRadian(x[0])); 58 | const cp = Math.cos(DegreeToRadian(x[0])); 59 | const sy = Math.sin(DegreeToRadian(x[1])); 60 | const cy = Math.cos(DegreeToRadian(x[1])); 61 | 62 | // Convert the angles into an unitary vector. 63 | return [cp * cy, cp * sy, -sp] 64 | } 65 | 66 | /** 67 | * @description Calculates the angle from one point to another. 68 | * @param {Number[3]} from 69 | * @param {Number[3]} to 70 | */ 71 | function CalculateAngles(from, to) { 72 | 73 | /** 74 | * @description Converts radians into degrees. 75 | * @param {Number} rad 76 | */ 77 | const RadianToDegree = function(rad) { 78 | return rad * 180 / Math.PI; 79 | } 80 | 81 | // Calculate the difference between 'to' and 'from'. 82 | const sub = [to[0] - from[0], to[1] - from[1], to[2] - from[2]]; 83 | 84 | // Calculate the hypotenuse. 85 | const hyp = Math.sqrt(sub[0] ** 2 + sub[1] ** 2); 86 | 87 | // Calculate the angles and convert them into degrees. 88 | const yaw = RadianToDegree(Math.atan2(sub[1], sub[0])); 89 | const pitch = RadianToDegree(-Math.atan2(sub[2], hyp)); 90 | 91 | // Return an Angle object. 92 | return [pitch, yaw, 0]; 93 | } 94 | 95 | /** 96 | * @description Calculates the FOV delta from one point to another. 97 | * @param {Number[3]} from 98 | * @param {Number[3]} to 99 | * @param {Number[3]} angles 100 | */ 101 | function CalculateFOV(from, to, angles) { 102 | // Calculate the angles from the origin point to the destination. 103 | const calculated = CalculateAngles(from, to); 104 | 105 | // Calculate the delta between the calculated angles and our view angles. 106 | const yaw_delta = angles[1] - calculated[1]; 107 | const pitch_delta = angles[0] - calculated[0]; 108 | 109 | // Normalize our yaw. 110 | if (yaw_delta > 180) 111 | yaw_delta -= 360; 112 | 113 | if (yaw_delta < -180) 114 | yaw_delta += 360; 115 | 116 | // Calculate the FOV and return it. 117 | return Math.sqrt(yaw_delta ** 2 + pitch_delta ** 2); 118 | } 119 | //endregion 120 | 121 | //region Functions 122 | //region Miscellaneous 123 | function GetCrosshairTarget() { 124 | // Get our local player and enemies. 125 | const me = Entity.GetLocalPlayer(); 126 | const enemies = Entity.GetEnemies(); 127 | 128 | // Get our eye position and eye angles. 129 | const eye_pos = Entity.GetEyePosition(me); 130 | const eye_angles = Local.GetViewAngles(); 131 | 132 | // Initialize an object where our data will be stored. 133 | var data = {target: null, fov: 180}; 134 | 135 | // Loop through every enemy. 136 | for (var i = 0; i < enemies.length; i++) { 137 | // Get our current enemy's entity index. 138 | const ent = enemies[i]; 139 | 140 | // Do sanity checks to make sure he's alive and not dormant. 141 | if (!Entity.IsAlive(ent) || Entity.IsDormant(ent)) 142 | continue; 143 | 144 | // Get the enemy's head position. 145 | // This is my preferred hitbox to calculate FOV with. 146 | const head_pos = Entity.GetHitboxPosition(ent, 0); 147 | 148 | // Calculate the FOV delta from our eye position to the enemy's head position. 149 | const fov = CalculateFOV(eye_pos, head_pos, eye_angles); 150 | 151 | // Check if the calculated FOV is lower than the stored one. 152 | // When true, it means that this enemy is closer to our crosshair than the previous ones. 153 | if (data.fov > fov) { 154 | // Update our data for further calculations. 155 | data.fov = fov; 156 | data.target = ent; 157 | } 158 | } 159 | 160 | // Return the target closest to our crosshair or null. 161 | return data.target; 162 | } 163 | 164 | function HandleDragging() { 165 | // Get our input information. 166 | const cursor = Input.GetCursorPosition(); 167 | const is_pressed = Input.IsKeyPressed(1); 168 | 169 | // Get our screen size. 170 | const size = Render.GetScreenSize(); 171 | 172 | // If we aren't pressing Mouse1 then we can't be dragging. 173 | if (!is_pressed) 174 | drag.dragging = false; 175 | 176 | // Check if we're pressing Mouse1 and if our cursor is inside the top bar of the window, or, if we were dragging the window in the last frame. 177 | if (is_pressed && cursor[0] >= drag.x && cursor[1] >= drag.y - 42 && cursor[0] <= drag.x + size[0] / 4 && cursor[1] <= drag.y - 10 || drag.dragging) { 178 | // We are dragging, so set this boolean to true. 179 | drag.dragging = true; 180 | 181 | // Update our window's position. 182 | drag.x = cursor[0] - drag.difference.x; 183 | drag.y = cursor[1] - drag.difference.y; 184 | 185 | // Save the new position on our sliders. 186 | UI.SetValue( ["Config", "Cheat", "General", "pos_x"], drag.x ); 187 | UI.SetValue( ["Config", "Cheat", "General", "pos_y"], drag.y ); 188 | } 189 | 190 | // If we're not dragging. 191 | else { 192 | // Update the difference between our cursor's position and the window's position. 193 | // This allows us to properly drag the window. 194 | drag.difference.x = cursor[0] - drag.x; 195 | drag.difference.y = cursor[1] - drag.y; 196 | } 197 | } 198 | //endregion 199 | 200 | //region Callbacks 201 | 202 | /** 203 | * @callback None 204 | * @description Hides the invisible sliders and updates our window's position on load. 205 | */ 206 | function fetchPositions() { 207 | // Hide our sliders 208 | UI.SetEnabled( ["Config", "Cheat", "General", "pos_x"], 0 ); 209 | UI.SetEnabled( ["Config", "Cheat", "General", "pos_y"], 0 ); 210 | 211 | // Updates our positions 212 | drag.x = Math.max( UI.GetValue( ["Config", "Cheat", "General", "pos_x"] ), 100 ); 213 | drag.y = Math.max( UI.GetValue( ["Config", "Cheat", "General", "pos_y"] ), 100 ); 214 | } 215 | 216 | /** 217 | * @callback CreateMove 218 | * @description Handles our targeting system. 219 | */ 220 | function onCreateMove() { 221 | // Gets our target and updates the global variable. 222 | target = GetCrosshairTarget(); 223 | } 224 | 225 | /** 226 | * @callback FRAME_RENDER_START 227 | * @description Handles the updating of our view. 228 | */ 229 | function onFrameRenderStart() { 230 | // Check if we're in-game. 231 | // Otherwise, there's no need to update. 232 | if (!Entity.IsValid(Entity.GetLocalPlayer())) 233 | return; 234 | 235 | // Check if there's a valid target. 236 | if (!target) 237 | return; 238 | 239 | // Get our local player 240 | const me = Entity.GetLocalPlayer() 241 | 242 | // Get some entity-related properties. 243 | const head_pos = Entity.GetHitboxPosition(me, 0); 244 | const camera_pos = Entity.GetEyePosition(target); 245 | 246 | // Calculate the angle from the target's eye position to our head position. 247 | // Pretty much inverted aimbot logic here. 248 | const camera_angles = CalculateAngles(camera_pos, head_pos); 249 | 250 | // Convert those camera angles into a unitary vector. 251 | const vector = AngleVector(camera_angles); 252 | 253 | // Create a new vector and initialize it with our target's eye position. 254 | const end_pos = [camera_pos[0], camera_pos[1], camera_pos[2]]; 255 | 256 | // Extends the camera position to simulate a third-person view. 257 | end_pos[0] -= vector[0] * 64; 258 | end_pos[1] -= vector[1] * 64; 259 | end_pos[2] -= vector[2] * 64; 260 | 261 | // Do a trace from the target's eye position to his third-person camera position. 262 | const trace = Trace.Line(target, camera_pos, end_pos) 263 | 264 | // Check if the trace is valid. 265 | // It can rarely return undefined. 266 | if (!trace) 267 | return; 268 | 269 | // Get our screen size. 270 | const size = Render.GetScreenSize(); 271 | 272 | // Calculate the new third-person view position using the trace's info. 273 | // Doing this so the camera doesn't go inside a wall. 274 | camera_pos[0] -= vector[0] * 64 * trace[1]; 275 | camera_pos[1] -= vector[1] * 64 * trace[1]; 276 | camera_pos[2] -= vector[2] * 64 * trace[1]; 277 | 278 | // Update our view using the new camera position and angles, at half the resolution for better performance. 279 | View.Update( view, size[0] / 2, size[1] / 2, camera_pos, camera_angles ); 280 | } 281 | 282 | /** 283 | * @callback Draw 284 | * @description Handles the rendering and dragging of the window. 285 | */ 286 | function onDraw() { 287 | // Get whether or not the menu is open. 288 | const is_menu_open = UI.IsMenuOpen(); 289 | 290 | // Get whether or not our local player is valid. 291 | const is_local_player_valid = Entity.IsValid(Entity.GetLocalPlayer()); 292 | 293 | // If it is, then handle the window's dragging. 294 | if (is_menu_open) 295 | HandleDragging(); 296 | 297 | // Check if we're holding the hotkey or if the menu is open. 298 | // Otherwise, we don't want to render the Enemy view window, so, return. 299 | if (!(UI.GetValue(["Misc.", "Keys", "General", "Key assignment", "Enemy view"]) && is_local_player_valid) && !is_menu_open) 300 | return; 301 | 302 | // Get the screen size and create a new font. 303 | const size = Render.GetScreenSize(); 304 | const font = Render.AddFont("segoeuib", 20, 0); 305 | 306 | // Get the X and Y positions used to render our window. 307 | // This is mostly me being lazy and not wanting to add 'drag.' before every 'x' and 'y'. 308 | const x = drag.x, y = drag.y; 309 | 310 | // Render the background 311 | Render.FilledRect( x - 4, y - 42, size[0] / 4 + 8, 32, [35, 35, 40, 255] ); 312 | Render.FilledRect( x - 4, y - 4, size[0] / 4 + 8, size[1] / 4 + 8, [35, 35, 40, 255] ); 313 | 314 | // Render the yellow bar on top. 315 | Render.FilledRect( x - 4, y - 42, size[0] / 4 + 8, 4, [250, 166, 24, 255] ); 316 | 317 | // Render the window's title. 318 | Render.String( x - 4 + size[0] / 8, y - 40, 1, "Enemy view", [235, 235, 235, 255], font ); 319 | 320 | // Check if our target and local player are valid and, then, render the enemy's third-person view. 321 | if (is_local_player_valid && target) 322 | View.Render( view, drag.x, drag.y, size[0] / 4, size[1] / 4 ); 323 | 324 | // Otherwise, render a black screen saying that the camera is unavailable. 325 | else { 326 | // Calculate a breathing alpha for the aesthetics. 327 | const alpha = Math.sin(Globals.Tickcount() * Globals.TickInterval() * 2) * 127 + 128; 328 | 329 | // Render the black rectangle and the 'Camera unavailable' text. 330 | Render.FilledRect( drag.x, drag.y, size[0] / 4, size[1] / 4, [10, 10, 10, 255] ); 331 | Render.String( drag.x + size[0] / 8, drag.y + size[1] / 8 - 24, 1, "Camera unavailable.", [235, 235, 235, alpha], font ); 332 | } 333 | } 334 | 335 | // Fetch our menu positions and hide our sliders. 336 | // Call this once on load. 337 | fetchPositions(); 338 | 339 | // Register the callbacks. 340 | Cheat.RegisterCallback("FRAME_RENDER_START", "onFrameRenderStart"); 341 | Cheat.RegisterCallback("Draw", "onDraw"); 342 | Cheat.RegisterCallback("CreateMove", "onCreateMove"); 343 | //endregion 344 | //endregion 345 | -------------------------------------------------------------------------------- /onetap_v4/legit_esp.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Title: Legit ESP 4 | * Author: april#0001 5 | * Description: Toggles ESP on certain players according to selected events/conditions. 6 | * uwu im helpful - Hana 7 | * 8 | */ 9 | 10 | //region Dependencies 11 | //region Menu 12 | // Dependencies that makes UI.Add... elements return their respective paths. 13 | function fixUIBehaviour() { 14 | for(var i in UI) { 15 | if(!~i.indexOf("Add")) 16 | continue; 17 | 18 | (function(cur) { 19 | UI[i] = function() { 20 | cur.apply(this, Array.prototype.slice.call(arguments)); 21 | return arguments[0].concat(arguments[1]); 22 | } 23 | }(UI[i])); 24 | } 25 | } 26 | 27 | // Call this whenever the script first loads. 28 | fixUIBehaviour( ); 29 | //endregion 30 | //endregion 31 | 32 | //region Locals 33 | //region Consts 34 | // Declare our flag constants. 35 | const Flags = { 36 | ON_GROUND: (1 << 0) 37 | }; 38 | //endregion 39 | 40 | // Initialize the array where our entity data will be stored. 41 | var data = [ ]; 42 | //endregion 43 | 44 | //region Menu 45 | // Create a constant for our menu path. 46 | const path = [ "Visuals", "ESP", "Enemy" ]; 47 | 48 | // Create our menu elements 49 | const enable = UI.AddCheckbox( path, "Legit ESP" ); 50 | const triggers = UI.AddMultiDropdown( path, "Triggers", [ "On spotted", "On sound", "On visible", "On visible + peek", "On proximity", "On FOV" ], 0 ); 51 | const proximity = UI.AddSliderInt( path, "Maximum distance", 100, 1000 ); 52 | const duration = UI.AddSliderFloat( path, "Duration", 1, 10 ); 53 | const max_fov = UI.AddSliderFloat( path, "Maximum field of view", 0, 60 ); /* we should have an option for step :c */ 54 | //endregion 55 | 56 | //region Functions 57 | //region Math 58 | /** 59 | * Clamps a value between a lower and upper limit. 60 | * @param number value 61 | * @param number min 62 | * @param number max 63 | */ 64 | function clamp( value, min, max ) { 65 | return Math.min( Math.max( value, min ), max ); 66 | } 67 | 68 | /** 69 | * Calculates the distance between two 3D points. 70 | * @param Number[3] a 71 | * @param Number[3] b 72 | */ 73 | function distance( a, b ) { 74 | // Calculate the difference between b and a. 75 | const sub = [ b[ 0 ] - a[ 0 ], b[ 0 ] - a[ 0 ], b[ 0 ] - a[ 0 ] ]; 76 | 77 | // Return the length of the subtracted vector, i.e. our distance. 78 | return Math.sqrt( sub[ 0 ] * sub[ 0 ] + sub[ 1 ] * sub[ 1 ] + sub[ 2 ] * sub[ 2 ] ); 79 | } 80 | 81 | /** 82 | * Normalizes an angle. 83 | * @param Number angle 84 | */ 85 | function normalize( angle ) { 86 | // If angle is lower than 180, adds 360. 87 | if ( angle < -180 ) 88 | angle += 360; 89 | 90 | // If angle is greater than 180, subtract 360. 91 | if ( angle > 180 ) 92 | angle -= 360; 93 | 94 | // Return normalized angle. 95 | return angle; 96 | } 97 | //endregion 98 | 99 | //region Menu 100 | function handleMenuEvents( ) { 101 | // Get our menu element's values. 102 | const enabled = UI.GetValue( enable ); 103 | const value = UI.GetValue( triggers ); 104 | 105 | // Updates our menu's visibility 106 | UI.SetEnabled( triggers, enabled ); 107 | UI.SetEnabled( duration, enabled && value ); 108 | UI.SetEnabled( proximity, enabled && value & ( 1 << 4 ) ); 109 | UI.SetEnabled( max_fov, enabled && value & ( 1 << 5 ) ); 110 | 111 | // Check if the 'On visible + peek' trigger is enabled without 'On visible' being enabled. 112 | // If so, disable 'On visible + peek' because it is part of 'On visible'. 113 | if ( !( value & ( 1 << 2 ) ) && value & ( 1 << 3 ) ) 114 | UI.SetValue( triggers, value & ~( 1 << 3 ) ); 115 | } 116 | //endregion 117 | 118 | //region Visibility 119 | /** 120 | * Checks if an entity is visible. 121 | * @param Number me 122 | * @param Number entity 123 | * @param Boolean extrapolate 124 | */ 125 | function isEntityVisible( me, entity, extrapolate ) { 126 | 127 | /** 128 | * Extrapolates an vector by an entity's velocity. 129 | * @param Number entity 130 | * @param Number[3] position 131 | */ 132 | const extrapolate = function( entity, position ) { 133 | // Get this entity's velocity. 134 | const velocity = Entity.GetProp( entity, "CBasePlayer", "m_vecVelocity[0]" ); 135 | 136 | // Extrapolate the position by the velocity. 137 | // In this case, we're 'predicting' where this entity will be in one second. 138 | position[ 0 ] += velocity[ 0 ]; 139 | position[ 1 ] += velocity[ 1 ]; 140 | position[ 2 ] += velocity[ 2 ]; 141 | 142 | // Return the extrapolated position. 143 | return position; 144 | }; 145 | 146 | // Create an array to store hitbox positions. Doing this just for better performance. 147 | const hitbox_positions = [ ]; 148 | 149 | // Create an array containing the hitboxes we want to loop through. In this case: head, 150 | // stomach, chest, feet and hands. 151 | const hitboxes = [ 0, 3, 5, 11, 12, 13, 14 ]; 152 | 153 | // Get our local player's eye position. 154 | const origin = Entity.GetEyePosition( me ); 155 | 156 | // Loop through every hitbox. 157 | for ( var i = 0; i < hitboxes.length; i++ ) { 158 | // Get our current hitbox. 159 | const hitbox = hitboxes[ i ]; 160 | 161 | // Get this hitbox's position and store it in case we need to use it later. 162 | hitbox_positions[ hitbox ] = Entity.GetHitboxPosition( entity, hitbox ); 163 | 164 | // Calculate the trace fraction from our local player's eye to this hitbox. 165 | const trace = Trace.Line( me, origin, hitbox_positions[ hitbox ] ); 166 | const smoke = Trace.Smoke( origin, hitbox_positions[ hitbox ] ); 167 | 168 | // If the trace fraction is greater than 0.95, it's safe to assume that it is visible. 169 | // In this case, return true because entity is partially (or fully) visible. 170 | if ( trace[1] > 0.95 && !smoke ) 171 | return true; 172 | } 173 | 174 | // If none of the entity's hitboxes is visible then the entity isn't on our screen. However, 175 | // we still need to predict if it'll be visible in one second. 176 | 177 | // If we don't want to predict, then just return false because entity isn't visible. 178 | if ( !extrapolate ) 179 | return false; 180 | 181 | // Create an array containing the hitboxes we want to loop through. In this case only head, stomach and chest, 182 | // because we don't need to be as accurate as before. 183 | const extrapolate_hitboxes = [ 0, 3, 5 ]; 184 | 185 | // Loop through every new hitbox. 186 | for ( var i = 0; i < extrapolate_hitboxes.length; i++ ) { 187 | // Get our current hitbox. 188 | const hitbox = extrapolate_hitboxes[ i ]; 189 | 190 | // Get our extrapolated hitbox position. 191 | const extrapolated = extrapolate( entity, hitbox_positions[ hitbox ] ); 192 | 193 | // Calculate the trace fraction from our local player's eye to the predicted hitbox position. 194 | const trace = Trace.Line( me, origin, extrapolated ); 195 | const smoke = Trace.Smoke( origin, extrapolated ); 196 | 197 | // If the trace fraction is greater than 0.95, it's safe to assume that it is visible. 198 | // In this case, return true because entity will be peeking. 199 | if ( trace[1] > 0.95 && !smoke ) 200 | return true; 201 | } 202 | 203 | // If none of the checks above went through, it means that this entity is not visible and won't be peeking 204 | // in the next second, so, return false. 205 | return false; 206 | } 207 | 208 | function calculateFOV( me, pos ) { /* snake case superior uwu */ 209 | // Get entity properties. 210 | const eye_pos = Entity.GetEyePosition( me ); 211 | const viewangles = Local.GetViewAngles( ); 212 | 213 | // Get maximum FOV. 214 | const max = UI.GetValue( max_fov ) 215 | 216 | /** 217 | * Subtracts two 3D vectors. 218 | * @param Number[3] vec 219 | * @param Number[3] vec2 220 | */ 221 | const subtract = function(vec, vec2) 222 | { 223 | return [ 224 | vec[ 0 ] - vec2[ 0 ], 225 | vec[ 1 ] - vec2[ 1 ], 226 | vec[ 2 ] - vec2[ 2 ] 227 | ]; 228 | }; 229 | 230 | /* **REDACTED** - Hana */ 231 | const sub = subtract( pos, eye_pos ); 232 | 233 | // Calculate yaw and pitch. 234 | const yaw = Math.atan2( sub[ 1 ], sub[ 0 ] ) * 180 / Math.PI; 235 | const pitch = -Math.atan2( sub[ 2 ], Math.sqrt( sub[ 0 ] ** 2 + sub[ 1 ] ** 2 ) ) * 180 / Math.PI; 236 | 237 | // Calculate yaw and pitch delta. 238 | const yaw_delta = ( ( viewangles[ 1 ] % 360 - yaw % 360 ) % 360 ); 239 | const pitch_delta = viewangles[ 0 ] - pitch; 240 | 241 | // Normalize our yaw delta so it doesn't exceed source engine's mins and maxs. 242 | yaw_delta = normalize( yaw_delta ); 243 | 244 | // Calculate the FOV. 245 | const fov = Math.sqrt( yaw_delta ** 2 + pitch_delta ** 2 ) 246 | 247 | // Return whether or not point is within desired FOV. 248 | return fov < max; 249 | } 250 | //endregion 251 | 252 | //region Data 253 | /** 254 | * Resets an entity's data. 255 | * @param Number entity 256 | */ 257 | function resetData( entity ) { 258 | // Reset (or initialize) the data array. 259 | data[ entity ] = { 260 | time: 0, 261 | last_flags: -1 262 | }; 263 | } 264 | 265 | /** 266 | * Do calculations and checks to see if any conditions are met on this entity. 267 | * @param Number me 268 | * @param Number entity 269 | * @param Object data 270 | */ 271 | function doTriggers( me, entity, data, enemies, dur ) { 272 | // Get our current active triggers. 273 | const active = UI.GetValue( triggers ); 274 | 275 | // Get some entity props. 276 | const flags = Entity.GetProp( entity, "CBasePlayer", "m_fFlags" ); 277 | const spotted = Entity.GetProp( entity, "CBaseEntity", "m_bSpotted" ); 278 | 279 | // Calculate the distance from our local player to this entity. 280 | const dst = distance( Entity.GetRenderOrigin( me ), Entity.GetRenderOrigin( entity ) ); 281 | 282 | // Check if we're using 'On proximity' and if the distance is lower than our threshold. 283 | if ( active & ( 1 << 4 ) && dst < UI.GetValue( proximity ) ) { 284 | // Update flags, for further checks, and the time. 285 | data.last_flags = flags; 286 | data.time = UI.GetValue( duration ); 287 | return; 288 | } 289 | 290 | // Check if we're using 'On FOV' and player is within desired FOV. 291 | if ( active & ( 1 << 5 ) && calculateFOV( me, Entity.GetHitboxPosition( entity, 0 ) ) ) { 292 | // Update flags, for further checks, and the time. 293 | data.last_flags = flags; 294 | data.time = UI.GetValue( duration ); 295 | return; 296 | } 297 | 298 | // Check if we're using 'On spotted' and if the entity is spotted. 299 | if ( active & ( 1 << 0 ) && spotted ) { 300 | // Update flags, for further checks, and the time. 301 | data.last_flags = flags; 302 | data.time = UI.GetValue( duration ); 303 | return; 304 | } 305 | 306 | // Check if we're using 'On visible' and if the entity is/will be visible. 307 | if ( active & ( 1 << 2 ) && isEntityVisible( me, entity, active & ( 1 << 3 ) ) ) { 308 | // Update flags, for further checks, and the time. 309 | data.last_flags = flags; 310 | data.time = UI.GetValue( duration ); 311 | return; 312 | } 313 | 314 | // Check if the entity has landed on this tick, meaning that they probably made a landing sound. 315 | if ( active & ( 1 << 1 ) && !( data.last_flags & Flags.ON_GROUND ) && ( flags & Flags.ON_GROUND ) ) { 316 | // Update flags, for further checks, and the time. 317 | data.last_flags = flags; 318 | data.time = UI.GetValue( duration ); 319 | return; 320 | } 321 | 322 | // Update flags for further checks. 323 | data.last_flags = flags; 324 | } 325 | 326 | function updateEntityData( ) { 327 | // Get our entities. 328 | const me = Entity.GetLocalPlayer( ); 329 | const enemies = Entity.GetEnemies( ); 330 | 331 | // Get some static values. 332 | const tick_interval = Globals.TickInterval( ); 333 | const dur = UI.GetValue( duration ); 334 | 335 | UI.SetValue( [ "Visuals", "Extra", "Radar", "Radar reveal" ], 0 ); 336 | 337 | // Loop through every single enemy in-game. 338 | for ( var i = 0; i < enemies.length; i++ ) { 339 | // Get our current enemy. 340 | const entity = enemies[ i ]; 341 | 342 | // Check if this entity doesn't have any data. 343 | if ( !data[ entity ] ) { 344 | // Initialize this entity. 345 | resetData( entity ); 346 | } 347 | 348 | // Check if this entity is dead. 349 | if ( !Entity.IsAlive( entity ) ) { 350 | // Reset this entity. 351 | resetData( entity ); 352 | continue; 353 | } 354 | 355 | // Decrement the time from this entity. 356 | data[ entity ].time = clamp( data[ entity ].time - tick_interval, 0, dur ); 357 | 358 | // Check if this entity is dormant. 359 | if ( Entity.IsDormant( entity ) ) { 360 | // Disable ESP and skip checks. 361 | Entity.DisableESP( entity ); 362 | continue; 363 | } 364 | 365 | // Check if any conditions are met on this entity and update its time. 366 | doTriggers( me, entity, data[ entity ], enemies, dur ); 367 | 368 | // If this entity's time isn't greater than 0 then disable ESP. 369 | if ( !data[ entity ].time ) 370 | Entity.DisableESP( entity ); 371 | } 372 | } 373 | //endregion 374 | 375 | //region Sounds 376 | function updateSoundTime( ) { 377 | // Check if 'On sound' is enabled. 378 | if ( !( UI.GetValue( triggers ) & ( 1 << 1 ) ) ) 379 | return; 380 | 381 | // Get the event's entity. 382 | const userid = Entity.GetEntityFromUserID( Event.GetInt( "userid" ) ); 383 | 384 | // Check if the entity is valid and if it is an enemy. 385 | if ( !Entity.IsValid( userid ) || !Entity.IsEnemy( userid ) ) 386 | return; 387 | 388 | // Check if this entity doesn't have any data registered to it. 389 | // If so, initialize it. 390 | if ( !data[ userid ] ) 391 | resetData( userid ); 392 | 393 | //Cheat.Print( "[Sound] Registered sound for " + Entity.GetName( userid ) + '\n' ); 394 | 395 | // Update this entity's time. 396 | data[ userid ].time = UI.GetValue( duration ); 397 | } 398 | //endregion 399 | 400 | //region Callbacks 401 | function onCreateMove( ) { 402 | // Check if the feature is enabled and update data. 403 | if ( UI.GetValue( enable ) ) 404 | updateEntityData( ); 405 | } 406 | 407 | function onFrameRenderStart( ) { 408 | // Check if the menu is open and update menu visibility and values. 409 | if ( UI.IsMenuOpen( ) ) 410 | handleMenuEvents( ); 411 | } 412 | 413 | // Register the main callbacks. 414 | Cheat.RegisterCallback( "CreateMove", "onCreateMove" ); 415 | Cheat.RegisterCallback( "FRAME_RENDER_START", "onFrameRenderStart" ); 416 | 417 | // Register the sound callbacks. 418 | Cheat.RegisterCallback( "bomb_begindefuse", "updateSoundTime" ); 419 | Cheat.RegisterCallback( "bomb_beginplant", "updateSoundTime" ); 420 | Cheat.RegisterCallback( "weapon_fire", "updateSoundTime" ); 421 | Cheat.RegisterCallback( "weapon_fire_on_empty", "updateSoundTime" ); 422 | Cheat.RegisterCallback( "weapon_reload", "updateSoundTime" ); 423 | Cheat.RegisterCallback( "weapon_zoom", "updateSoundTime" ); 424 | Cheat.RegisterCallback( "grenade_thrown", "updateSoundTime" ); 425 | Cheat.RegisterCallback( "player_spawned", "updateSoundTime" ); 426 | Cheat.RegisterCallback( "item_pickup", "updateSoundTime" ); 427 | Cheat.RegisterCallback( "player_footstep", "updateSoundTime" ); 428 | Cheat.RegisterCallback( "player_falldamage", "updateSoundTime" ); 429 | //endregion 430 | //endregion 431 | -------------------------------------------------------------------------------- /onetap_v4/miss_log_framework.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Title: Miss logs 4 | * Author: april#0001 5 | * Description: Checks if a ragebot_fire event successfully hit or not. 6 | * 7 | */ 8 | 9 | // DISCLAIMER: 10 | // This is a framework to help other scripters to make their own ragebot logs 11 | // with support for misses. This script on its own, although usable, isn't 12 | // useful. 13 | 14 | // Array to store all bullet information. 15 | const bullets = [ ]; 16 | 17 | /** 18 | * Converts time in seconds into ticks. 19 | * @param time 20 | * @returns {number} 21 | */ 22 | function TIME_TO_TICKS( time ) { 23 | return Math.round( time / Globals.TickInterval( ) ); 24 | } 25 | 26 | function onRagebot( ) { 27 | // Push bullet information to global array. 28 | bullets.push({ 29 | tick: Entity.GetProp( Entity.GetLocalPlayer( ), "CBasePlayer", "m_nTickBase" ), 30 | time: 0, 31 | delay: TIME_TO_TICKS( Local.Latency( ) ), 32 | registered: false, 33 | hit: false 34 | }) 35 | 36 | // Log action 37 | Cheat.Print( "[ " + Globals.Tickcount( ) + " ] Pushed\n" ); 38 | } 39 | 40 | // Middle 41 | function onBulletImpact( ) { 42 | // Get the player who shot. 43 | const userid = Entity.GetEntityFromUserID( Event.GetInt( "userid" ) ); 44 | 45 | // Check if we aren't the ones who shot. 46 | if ( !Entity.IsLocalPlayer( userid ) ) 47 | return; 48 | 49 | // Get current tickbase. 50 | const tick_count = Entity.GetProp( Entity.GetLocalPlayer( ), "CBasePlayer", "m_nTickBase" ); 51 | 52 | // Loop through all bullets 53 | for ( var i = 0; i < bullets.length; i++ ) { 54 | // Get current bullet. 55 | const current = bullets[ i ]; 56 | 57 | // Check if this bullet hasn't been registered and if it is 58 | // still valid for registration. 59 | if ( !current.registered && current.tick + current.delay >= tick_count ) { 60 | // Update registered state. 61 | current.registered = true; 62 | 63 | // Log action. 64 | Cheat.Print( "[ " + current.tick + " ] Registered\n" ); 65 | } 66 | 67 | } 68 | } 69 | 70 | function onPlayerHurt( ) { 71 | // Get attacker 72 | const attacker = Entity.GetEntityFromUserID( Event.GetInt( "attacker" ) ); 73 | 74 | // Check if we aren't the one who attacked. 75 | if ( !Entity.IsLocalPlayer( attacker ) ) 76 | return; 77 | 78 | // Get current tickbase. 79 | const tick_count = Entity.GetProp( Entity.GetLocalPlayer( ), "CBasePlayer", "m_nTickBase" ); 80 | 81 | // Loop through all bullets. 82 | for ( var i = 0; i < bullets.length; i++ ) { 83 | // Get current bullet. 84 | const current = bullets[ i ]; 85 | 86 | // Check if this bullet has already been registered on bullet_impact, 87 | // if it hasn't hit a player yet and if it is still valid. 88 | if ( current.registered && !current.hit && current.tick + current.delay >= tick_count ) { 89 | // Update hit status. 90 | current.hit = true; 91 | 92 | // Log action. 93 | Cheat.Print( "[ " + current.tick + " ] Hit\n" ); 94 | } 95 | } 96 | } 97 | 98 | function onNetUpdateStart( ) { 99 | // Loop through all bullets. 100 | for ( var i = 0; i < bullets.length; i++ ) { 101 | // Get current bullet. 102 | const current = bullets[ i ]; 103 | 104 | // Check if bullet_impact hasn't registered this bullet yet. 105 | if ( !current.registered ) 106 | continue; 107 | 108 | // Increment bullet's time. 109 | current.time++; 110 | 111 | // Check if this bullet's registration time is over, meaning that the 112 | // script should already have an answer for whether or not it hit. 113 | if ( current.time >= current.delay ) { 114 | // Log whether or not it hit. 115 | Cheat.Print( "[ " + current.tick + " ] The shot has " + ( current.hit ? "HIT" : "MISSED" ) + ".\n" ); 116 | 117 | // Delete this bullet's information. 118 | bullets.splice( i, 1 ); 119 | } 120 | } 121 | } 122 | 123 | // Register callbacks 124 | Cheat.RegisterCallback( "FRAME_NET_UPDATE_START", "onNetUpdateStart" ); 125 | Cheat.RegisterCallback( "ragebot_fire", "onRagebot" ); 126 | Cheat.RegisterCallback( "player_hurt", "onPlayerHurt" ); 127 | Cheat.RegisterCallback( "bullet_impact", "onBulletImpact" ); 128 | --------------------------------------------------------------------------------