Maintainers
Pricing
Enterprise
More
More
Documentation
Try Live
Rankings
Install
Blog
Docs7
Ask
New
Add Docs
NL API
https://github.com/yungjoky/nl-api
Admin
Tokens:
53,087
Snippets:
334
Trust Score:
6.3
Update:
1 year ago
Context
Chat
Benchmark
Latest
Show doc for...
Code
Info
Show Results
Tokens:
Raw
Copy
Link
Tokens:
Raw
Copy
Link
### Neverlose UI API Functionality Source: https://github.com/yungjoky/nl-api/blob/main/useful-information_script-examples_ui.md This snippet demonstrates the core functionalities of the Neverlose UI API. It covers creating UI groups and items (switches, combos), setting and overriding their values, handling value changes with callbacks, updating item contents, attaching color pickers, and navigating the UI hierarchy. It serves as a practical guide for developers interacting with the Neverlose UI. ```lua -- Pseudocode that shows most of the ui functions and how to use them -- If you want to get a reference to an existing group or item, call .find local double_tap_ref = ui.find("aimbot", "ragebot", "main", "double tap") -- "ui.create" creates a group -- in which you can add items such as switches, sliders, combos, etc. local group_ref = ui.create("Group") -- Some arguments can be optional, like the 2nd one in this function, -- it will make its default value true local switch_ref = group_ref:switch("Switch", true) -- You can change its value switch_ref:set(false) -- Or you can "override" its value -- This will allow you to change the value of the item -- without changing its value in the menu or in the cheat's configuration switch_ref:override(true) -- Reset the previous override switch_ref:override() -- You can register a function that will be executed -- every time the value of the item changes -- The reference can be accessed from the arguments of the callback switch_ref:set_callback(function(ref) -- You can access the value of the item by calling :get -- To access the value it's overriden to with :override, call :get_override print(string.format("New value: %s", ref:get())) end) -- If you want to what type of object the item is, you can call :get_type -- print(switch_ref:type()) --> switch -- You can attach other items to some types of items by calling :create -- This will create and return a reference to the item group, -- to which you can add other items local switch_group_ref = switch_ref:create() -- Our API offers a lot of overloads, you can either just provide a bunch of strings -- or you can provide a table of strings local combo_ref = switch_group_ref:combo("Combo", "Option A", "Option B", "Option C") -- You can update the contents of combos, selectables, list, and listables with :update combo_ref:update({"Option A"}) -- You can attach color pickers to some types of items, -- but keep in mind that you won't be able to attach a group at the same time local combo_color_picker_ref = combo_ref:color_picker(color(255, 0, 0, 255)) -- If you want to see what group the item belongs to, call :parent -- print(group_ref == switch_ref:parent()) --> true -- print(switch_group_ref == combo_ref:parent()) --> true -- If you want to describe an item, you can call :tooltip, -- which will display a text when you move the cursor over the item switch_ref:tooltip("Some useful information.") -- Further reading: -- https://lua.neverlose.cc/documentation/variables/ui -- DM Serene#1337 for any documentation errors ``` -------------------------------- ### Lua UI Functions: Create, Modify, and Event Handling Source: https://github.com/yungjoky/nl-api/blob/main/useful-information_script-examples_ui.md This pseudocode demonstrates the usage of a Lua-based UI library for creating and managing user interface elements. It covers finding existing elements, creating new groups and items (switches, combos), manipulating their states, registering callbacks for value changes, and customizing appearance with tooltips and color pickers. The examples highlight common patterns for building interactive UIs. ```lua -- Pseudocode that shows most of the ui functions and how to use them -- If you want to get a reference to an existing group or item, call .find local double_tap_ref = ui.find("aimbot", "ragebot", "main", "double tap") -- "ui.create" creates a group -- in which you can add items such as switches, sliders, combos, etc. local group_ref = ui.create("Group") -- Some arguments can be optional, like the 2nd one in this function, -- it will make its default value true local switch_ref = group_ref:switch("Switch", true) -- You can change its value switch_ref:set(false) -- Or you can "override" its value -- This will allow you to change the value of the item -- without changing its value in the menu or in the cheat's configuration switch_ref:override(true) -- Reset the previous override switch_ref:override() -- You can register a function that will be executed -- every time the value of the item changes -- The reference can be accessed from the arguments of the callback switch_ref:set_callback(function(ref) -- You can access the value of the item by calling :get -- To access the value it's overriden to with :override, call :get_override print(string.format("New value: %s", ref:get())) end) -- If you want to what type of object the item is, you can call :get_type -- print(switch_ref:type()) --> switch -- You can attach other items to some types of items by calling :create -- This will create and return a reference to the item group, -- to which you can add other items local switch_group_ref = switch_ref:create() -- Our API offers a lot of overloads, you can either just provide a bunch of strings -- or you can provide a table of strings local combo_ref = switch_group_ref:combo("Combo", "Option A", "Option B", "Option C") -- You can update the contents of combos, selectables, list, and listables with :update combo_ref:update({"Option A"}) -- You can attach color pickers to some types of items, -- but keep in mind that you won't be able to attach a group at the same time local combo_color_picker_ref = combo_ref:color_picker(color(255, 0, 0, 255)) -- If you want to see what group the item belongs to, call :parent -- print(group_ref == switch_ref:parent()) --> true -- print(switch_group_ref == combo_ref:parent()) --> true -- If you want to describe an item, you can call :tooltip, -- which will display a text when you move the cursor over the item switch_ref:tooltip("Some useful information.") -- Further reading: -- https://lua.neverlose.cc/documentation/variables/ui -- DM Serene#1337 for any documentation errors ``` -------------------------------- ### Lua Class and Method Definition Example Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables__g.md Demonstrates defining a Lua class with a struct, including variables and methods. Shows how to instantiate and call a method on the struct. ```Lua local ctx = new_class() :struct 'struct_one' { variable1 = 'test', some_function = function(self, arg1) print(arg1) print(string.format('Hello World (%s)', self.variable1)) end } ctx.struct_one:some_function('test') ``` -------------------------------- ### Create Item ESP with Switch Source: https://github.com/yungjoky/nl-api/blob/main/useful-information_script-examples_esp.md Illustrates creating an item element for ESP with an associated switch. It logs the selected item and the switch's state during the render event, demonstrating interaction. ```lua local item_example = esp.enemy:new_item("Item Example") local item_example_group_ref = item_example:create() local switch_ref = item_example_group_ref:switch("Switch") events.render:set(function() print(string.format("Item Example Selected: %s", item_example:get())) print(string.format("Switch Enabled: %s", switch_ref:get())) end) ``` -------------------------------- ### Render Circle Outline Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_render.md Draws the outline of a circle at a specified position with a given color, radius, starting angle, and fill percentage. Optionally accepts outline thickness. The start angle defines 0 degrees as the right side. ```APIDOC render.circle_outline(position: vector, color: color, radius: number, start_deg: number, pct: number[, thickness: number]) position: vector - Screen position color: color - Color of the circle radius: number - Radius of the circle in pixels start_deg: number - 0 is the right side, 90 is the bottom, 180 is the left, 270 is the top pct: number - Percentage in the range [0.0-1.0] determining how full the circle is thickness: number - Optional. Thickness of the outline in pixels ``` -------------------------------- ### Create and Use Multi-Color Picker in NL-API Lua Source: https://github.com/yungjoky/nl-api/blob/main/useful-information_script-examples_ui.md Demonstrates how to create a multi-color picker UI element using the `ui.create` function in Lua. It covers defining different color modes (Simple, Double, Multiple), listing available modes, and retrieving selected colors within an event handler for rendering gradients. ```lua -- create a group local group_ref = ui.create("Example Group") -- create a color picker in the group local color_picker_ref = group_ref:color_picker("Example Color Picker", { ["Simple"] = { color(255, 255, 255) }, ["Double"] = { color(255, 255, 255), color(0, 0, 0) }, ["Multiple"] = { color(255, 0, 0), color(0, 255, 0), color(0, 0, 255), color(255, 0, 255) }, }) -- print the available modes for _, v in ipairs(color_picker_ref:list()) do print(v) -- [neverlose] Simple -- [neverlose] Multiple -- [neverlose] Double end events.render(function() -- get the currently selected mode and color(s) -- (the second returned value can be a table) local mode, colors = color_picker_ref:get() print(mode) -- get colors from a specific mode local top_left, top_right, bottom_left, bottom_right = unpack(color_picker_ref:get("Multiple")) render.gradient( vector(20, 20), vector(120, 120), top_left, top_right, bottom_left, bottom_right ) end) ``` -------------------------------- ### Create Bar ESP for Player Speed Source: https://github.com/yungjoky/nl-api/blob/main/useful-information_script-examples_esp.md Shows how to create a bar ESP element visualizing a player's current speed as a percentage of their weapon's maximum speed. It calculates speed from player velocity and weapon data. ```lua local bar_example = esp.enemy:new_bar("Bar Example", function(player) local velocity = player.m_vecVelocity local speed = velocity:length() if speed < 2 then return end local max_speed = 260 local weapon = player:get_player_weapon() if weapon then max_speed = weapon:get_max_speed() end return speed / max_speed * 100 end) ``` -------------------------------- ### Render Circle Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_render.md Draws a filled circle at a specified position with a given color, radius, starting angle, and fill percentage. The start angle defines 0 degrees as the right side. ```APIDOC render.circle(position: vector, color: color, radius: number, start_deg: number, pct: number) position: vector - Screen position color: color - Color of the circle radius: number - Radius of the circle in pixels start_deg: number - 0 is the right side, 90 is the bottom, 180 is the left, 270 is the top pct: number - Percentage in the range [0.0-1.0] determining how full the circle is ``` -------------------------------- ### Create Text ESP with Slider Source: https://github.com/yungjoky/nl-api/blob/main/useful-information_script-examples_esp.md Demonstrates creating a text ESP element that displays 'LOW HP' when a player's health is below a configurable threshold. Includes a slider to dynamically adjust this threshold. ```lua local low_health = 20 local text_example = esp.enemy:new_text("Text Example", "LOW HP", function(player) local health = player.m_iHealth if health > low_health then return end return "LOW HP" end) local group_ref = text_example:create() local slider_ref = group_ref:slider("Low Health", 0, 50, low_health) slider_ref:set_callback(function(slider_ref) low_health = slider_ref:get() end, true) ``` -------------------------------- ### Get Hotkey Bindings Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_ui.md Retrieves a table containing pointers to all defined hotkeys. Each hotkey entry includes its name, mode (Hold/Toggle), state, and a reference to its menu item. ```Lua ui.get_binds(): table ``` -------------------------------- ### Set ConVar Callback Source: https://github.com/yungjoky/nl-api/blob/main/useful-information_script-examples_convars.md Shows how to register callback functions for console variables. The first example triggers a server crash if `sv_cheats` is changed to 1. The second example refuses connections from a specific IP address ('127.0.0.1'). ```lua cvar.sv_cheats:set_callback(function(cvar_obj, old_value, new_value) if tonumber(old_value) == 0 and tonumber(new_value) == 1 then -- invoke ent_create convar callback with "weapon_ak47" argument -- cvar.ent_create:call 'weapon_ak47' cvar.clear:call() print '\aFF697Asv_cheats was updated. Crashing the server.' utils.console_exec 'ent_create weapon_ak47' end end) cvar.connect:set_callback(function(cvar_obj, args) if args[1] == '127.0.0.1' then return false end end) ``` -------------------------------- ### Get Menu Size Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_ui.md Returns the current dimensions of the menu as a vector. ```Lua ui.get_size(): vector ``` -------------------------------- ### Get Menu Opacity Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_ui.md Retrieves the menu's opacity level, returned as a floating-point number between 0 and 1. ```Lua ui.get_alpha(): number ``` -------------------------------- ### Get Menu Position Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_ui.md Returns the current position of the menu as a vector. ```Lua ui.get_position(): vector ``` -------------------------------- ### Lua item:tooltip() - Get/Set Item Tooltip Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_ui.md Gets or sets the tooltip text for the menu item. Tooltips provide additional information when the user hovers over the item. ```APIDOC item:tooltip([value: any]) Parameters: value: any (optional) - The new tooltip text for the menu item. ``` -------------------------------- ### Lua item:set_callback() - Set Item Callback Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_ui.md Sets a callback function to be executed when the menu item is interacted with. An optional flag can force the callback to be called immediately after setup. ```APIDOC item:set_callback(callback: function[, force_call: boolean]) Parameters: callback: function - The function to be called upon interaction. force_call: boolean (optional) - If true, calls the callback immediately after setup. ``` -------------------------------- ### Get Style Option Color Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_ui.md Returns the color of a specific style option by name. If no name is provided, it returns a table containing all style options. ```Lua ui.get_style([ name: string ]): color / table ``` -------------------------------- ### Get Multiple Materials by Partial Path Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_materials.md Retrieves a table of material objects from a partial path. Supports optional force loading and a callback function for processing each material. ```APIDOC materials.get_materials(partial_path: string[, force_load: boolean, callback: function]): table Parameters: - partial_path: string - Directory to the specified materials. - force_load: boolean (optional) - Loads each material if not loaded. - callback: function (optional) - A callback with a pointer to the material object as the argument. If nil, returns the table of material objects. Returns: table - A table of material objects or nil if callback is used. ``` -------------------------------- ### Get Material by Path Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_materials.md Retrieves a specific material object from the specified path. Optionally forces a reload if the material is not already loaded. ```APIDOC materials.get(path: string[, force_load: boolean]): Material Parameters: - path: string - Directory to the specified material. - force_load: boolean (optional) - Loads the material if not loaded. Returns: Material - The material object. ``` -------------------------------- ### Lua Vector Operations and Rendering Example Source: https://github.com/yungjoky/nl-api/blob/main/useful-information_script-examples_vector.md Demonstrates creating and manipulating 3D vectors in Lua. It shows how to access vector components (x, y, z), convert angles to direction vectors, and use vectors for raycasting and rendering text on screen. Requires the Neverlose scripting environment. ```lua -- You can create your own vector objects -- All vectors are 3D local vec = vector(1, 2, 3) -- There are 3 fields you can access: "x", "y", and "z" print(string.format("x: %.2f, y: %.2f, z: %.2f", vec.x, vec.y, vec.z)) -- You can also set them vec.x, vec.y, vec.z = 0, 0, 0 events.render:set(function() -- All vectors are 3D, even the ones you'd expect to be 2D local screen_center = render.screen_size() * 0.5 local local_player = entity.get_local_player() if not local_player or not local_player:is_alive() then return end local camera_position = render.camera_position() -- Even angles are 3D vectors -- x is pitch, y is yaw, z is roll local camera_angles = render.camera_angles() -- Let's convert it to a forward vector though local direction = vector():angles(camera_angles) local closest_distance, closest_enemy = math.huge for _, enemy in ipairs(entity.get_players(true)) do local head_position = enemy:get_hitbox_position(1) local ray_distance = head_position:dist_to_ray( camera_position, direction ) if ray_distance < closest_distance then closest_distance = ray_distance closest_enemy = enemy end end if not closest_enemy then return end render.text( 1, vector(screen_center.x, screen_center.y + 20), color(), "cd", string.format( "Closest enemy to crosshair: %s", closest_enemy:get_name() ) ) end) ``` -------------------------------- ### Lua item:name() - Get/Set Item Name Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_ui.md Gets or sets the name of the menu item. The name is a fundamental property used for identification and display. ```APIDOC item:name([value: any]) Parameters: value: any (optional) - The new name for the menu item. ``` -------------------------------- ### Trace Line Function Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_utils.md Performs a line trace from a start point to an end point. It supports optional skipping of entities, masks, and trace types for detailed collision detection. ```APIDOC utils.trace_line(from: vector, to: vector[, skip: entity/table/function, mask: number, type: number]): trace - Traces a line from 'from' to 'to' and returns a trace struct. - Parameters: - from: vector - Vector to start tracing from. - to: vector - Vector to trace to. - skip: entity/table/function (Optional) - Entity skipping options. Can be an entity object, a table of entities, or a callback function. - mask: number (Optional) - Trace mask to filter what is hit. - type: number (Optional) - Trace type [0-3]. 0: Trace everything [Default], 1: Trace world only, 2: Trace entities only, 3: Trace everything filter props. - Returns: - trace: A struct containing detailed information about the trace hit. - Notes: - If 'skip' is a callback, it receives the entity and contents_mask as arguments and should return true to skip the entity, false otherwise. ``` -------------------------------- ### Lua Createmove Event Handler Source: https://github.com/yungjoky/nl-api/blob/main/documentation_events.md Example Lua code demonstrating how to register a callback for the 'createmove' event. This callback receives a command object and can be used to modify player movement or actions. ```lua local on_createmove = function(cmd) cmd.in_attack -- +attack cmd.in_attack2 -- +attack2 cmd.in_use -- +use cmd.in_jump -- +jump cmd.in_duck -- +duck cmd.in_walk -- +walk cmd.in_speed -- +speed cmd.in_reload -- +reload cmd.in_moveleft cmd.in_moveright cmd.in_forward cmd.in_back cmd.in_left cmd.in_right cmd.in_bullrush end events.createmove:set(on_createmove) ``` -------------------------------- ### Get DPI Scale Value Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_render.md Retrieves the DPI scale value for either the menu or ESP. The type parameter specifies which scale to return. ```APIDOC render.get_scale(type: number): number Parameters: type (number): The type of DPI scale to return. 1 for Menu Scale, 2 for ESP Scale. Returns: number: The DPI scale value. ``` -------------------------------- ### Lua item:list() - Get Item List Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_ui.md Retrieves a list of items, specifically combo or selectable menu item objects. This method is used to fetch the available items within a menu structure. ```APIDOC item:list(): table Description: Returns the list of items. combo / selectable menu item objects only. ``` -------------------------------- ### Network GET and POST Requests Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_network.md Functions for making HTTP GET and POST requests. Supports custom headers, data payloads, and callbacks for handling responses. ```APIDOC network.get(url: string[, headers: table, callback: function]): string Sends a GET request to the URL. Parameters: url: string - The URL to send the GET request to. headers: table (optional) - Headers to include in the request. callback: function (optional) - A function to be called with the response. Returns: string - The response from the URL. network.post(url: string[, data: table, headers: table, callback: function]): string Sends a POST request to the URL. Parameters: url: string - The URL to send the POST request to. data: table (optional) - Data to send in the POST request body. headers: table (optional) - Headers to include in the request. callback: function (optional) - A function to be called with the response. Returns: string - The response from the URL. ``` -------------------------------- ### Execute Console Commands Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_utils.md Executes a console command in the game. Multiple commands can be chained using ';'. Caution is advised when passing user input, such as usernames, to prevent security vulnerabilities. ```APIDOC utils.console_exec(cmd: string[, ...]) Executes a console command. Parameters: cmd: string - The console command(s) to execute. Multiple commands can be combined with ';'. ...: string - Comma-separated arguments to concatenate with cmd. Description: This function allows direct execution of game console commands. It's crucial to sanitize any user-provided input before passing it to this function to avoid potential exploits. ``` -------------------------------- ### Create Hotkey Menu Item Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_ui.md Creates and returns a hotkey menu item. It requires a name and can optionally have a default key value. ```APIDOC group:hotkey(name: string[, default_key: number): MenuItem Parameters: name: string - Item name default_key: number - Optional. Default key. Returns: MenuItem object or throws an error on failure. ``` -------------------------------- ### Get Mouse Position Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_ui.md Returns the current position of the mouse cursor on the screen as a vector. ```Lua ui.get_mouse_position(): vector ``` -------------------------------- ### Create Color Picker Menu Item Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_ui.md Creates and returns a color picker menu item. It can be initialized with a single color or a table of colors. Requires a name. ```APIDOC group:color_picker(name: string[, color: color]): MenuItem Parameters: name: string - Item name color: color - Optional. Initial color value. Returns: MenuItem object or throws an error on failure. ``` ```APIDOC group:color_picker(name: string, colors: table): MenuItem Parameters: name: string - Item name colors: table - Table containing tables with a string index, and those tables should contain one or multiple color objects. Returns: MenuItem object or throws an error on failure. ``` -------------------------------- ### Get FontAwesome Icon Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_ui.md Converts a FontAwesome icon name into its corresponding Unicode string representation. ```Lua ui.get_icon(name: string): string ``` -------------------------------- ### Create Listable Menu Item Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_ui.md Creates and returns a listable menu item. It requires a name and a list of items. The items can be provided as comma-separated values or a table of strings. ```APIDOC group:listable(name: string, items: any[, ...]): MenuItem Parameters: name: string - Item name items: any - One or more comma separated values that will be added to the listable. Alternatively, a table of strings that will be added. Returns: MenuItem object or throws an error on failure. ``` -------------------------------- ### Get Bounding Box API - Entity Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_entity.md Retrieves the bounding box coordinates and alpha value for an entity. ```APIDOC ent:get_bbox(): table Description: Returns a table containing pos1, pos2, and alpha values representing the entity's bounding box. Return Values: A table with keys: pos1, pos2, alpha. ``` -------------------------------- ### Get Animation State API - Entity Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_entity.md Retrieves a comprehensive table detailing the animation state of a player entity. ```APIDOC ent:get_anim_state(): table Description: Returns a table containing detailed information about the animation state of the player. Return Values: A table containing numerous animation-related properties, including: - abs_yaw: number - abs_yaw_last: number - acceleration: vector - acceleration_weight: number - action_weight_bias_remainder: number - adjust_started: boolean - aim_matrix_transition: number - aim_matrix_transition_delay: number - aim_pitch_max: number - aim_pitch_min: number - aim_yaw_max: number - aim_yaw_min: number - anim_duck_amount: number - animstate_model_version: number - cached_model_index: number - camera_smooth_height: number - crouch_walk_aim: userdata - defuse_started: boolean - duck_additional: number - duration_in_air: number - duration_move_weight_is_too_high: number - duration_moving: number - duration_still: number - duration_strafing: number - eye_pitch: number - eye_position_smooth_lerp: number - eye_yaw: number - feet_crossed: boolean - first_foot_plant_since_init: boolean - first_run_since_init: boolean - flashed: boolean - foot_left: userdata - foot_lerp: number - foot_right: userdata - in_air_smooth_value: number - jump_to_fall: number - ladder_speed: number - ladder_weight: number - land_anim_multiplier: number - landed_on_ground_this_frame: boolean - landing: boolean - last_foot_plant_update: number - last_rendered_eye_z: number - last_time_velocity_over_ten: number - last_update_frame: number - last_update_increment: number - last_update_time: number - last_velocity_test_time: number - layer_order_preset: userdata - left_ground_height: number - left_the_ground_this_frame: boolean - move_weight: number - move_weight_smoothed: number - move_yaw: number - move_yaw_current_to_ideal: number - move_yaw_ideal: number - next_twitch_time: number - on_ground: boolean - on_ladder: boolean - plant_anim_started: boolean - player: entity - player_is_accelerating: boolean - pose_param_mappings: userdata - position_current: vector - position_last: vector - previous_move_state: number - primary_cycle: number - recrouch_weight: number - smooth_height_valid: boolean - speed_as_portion_of_crouch_top_speed: number - speed_as_portion_of_run_top_speed: number - speed_as_portion_of_walk_top_speed: number - stand_run_aim: userdata - stand_walk_aim: userdata - static_approach_speed: number - step_height_left: number - step_height_right: number - strafe_change_cycle: number - strafe_change_target_weight: number - strafe_change_weight: number - strafe_change_weight_smooth_fall_off: number - strafe_changing: boolean - strafe_sequence: number - stutter_step: number - target_acceleration: vector - time_of_last_known_injury: number - time_to_align_lower_body: number - twitch_anim_started: boolean - velocity: vector - velocity_last: vector - velocity_length_xy: number - velocity_length_z: number - velocity_normalized: vector - velocity_normalized_non_zero: vector - walk_run_transition: number - walk_to_run_transition_state: boolean - weapon: entity - weapon_last: entity - weapon_last_bone_setup: entity ``` -------------------------------- ### Create Label Menu Item Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_ui.md Creates and returns a label menu item, which displays static text. It requires the text content. ```APIDOC group:label(text: string): MenuItem Parameters: text: string - Label text. Returns: MenuItem object or throws an error on failure. ``` -------------------------------- ### teamplay_round_start Structure Source: https://github.com/yungjoky/nl-api/blob/main/wiki.alliedmods.net_Counter-Strike__Global_Offensive_Events.md Indicates the start of a round in teamplay mode, with an option for a full map reset. ```APIDOC teamplay_round_start: full_reset: bool Description: Flag indicating if this is a full reset of the map. ``` -------------------------------- ### Create Combo Box Menu Item Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_ui.md Creates and returns a combo box menu item. It requires a name and a list of items. The items can be provided as comma-separated values or a table of strings. ```APIDOC group:combo(name: string, items: any[, ...]): MenuItem Parameters: name: string - Item name items: any - One or more comma separated values that will be added to the combo. Alternatively, a table of strings that will be added. Returns: MenuItem object or throws an error on failure. ``` -------------------------------- ### Create List Menu Item Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_ui.md Creates and returns a list menu item. It requires a name and a list of items. The items can be provided as comma-separated values or a table of strings. ```APIDOC group:list(name: string, items: any[, ...]): MenuItem Parameters: name: string - Item name items: any - One or more comma separated values that will be added to the list. Alternatively, a table of strings that will be added. Returns: MenuItem object or throws an error on failure. ``` -------------------------------- ### Get NetChannel Struct Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_utils.md Retrieves the NetChannel structure. This utility function provides access to network channel information. ```APIDOC utils.net_channel(): NetChannel - Returns the NetChannel struct. ``` -------------------------------- ### freezecam_started Event Source: https://github.com/yungjoky/nl-api/blob/main/wiki.alliedmods.net_Counter-Strike__Global_Offensive_Events.md Represents the 'freezecam_started' event. No specific parameters are detailed in the provided structure. ```APIDOC freezecam_started: Parameters: (No parameters specified) ``` -------------------------------- ### Get Menu Item ID Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_ui.md Retrieves the unique identifier for a menu item. This method is called on a MenuItem object. ```APIDOC item:id(): number Returns: The unique id of the menu item. ``` -------------------------------- ### Create Button Menu Item Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_ui.md Creates and returns a button menu item. It requires a name and can optionally have a callback function and an alternative style. ```APIDOC group:button(name: string[, callback: function, alt_style: boolean]): MenuItem Parameters: name: string - Item name callback: function - Optional. Function that will be called when the button is clicked. alt_style: boolean - Optional. Pass true to enable the alternative style for the specified button. Returns: MenuItem object or throws an error on failure. ``` -------------------------------- ### Get Menu Item Value Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_ui.md Retrieves the current value of a menu item. This method is called on a MenuItem object. ```APIDOC item:get(): any Returns: The value of the menu item. ``` -------------------------------- ### Neverlose Common API Functions Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_common.md Provides access to various utility functions for interacting with the Neverlose client and game environment. This includes retrieving dates, times, system information, game state, and managing scripts. ```APIDOC common.get_date(format: string[, unix_time: number]): string - Returns the formatted date. - Parameters: - format (string): The desired date format (strftime). - unix_time (number, optional): The Unix timestamp to format. Defaults to current time. common.get_unixtime(): number - Returns the number of seconds that have elapsed since the Unix epoch (January 1, 1970). common.get_timestamp(): number - Returns a high-precision timestamp in milliseconds. common.get_system_time(): table - Returns the current Windows time as a table. - Table structure: - year (number) - month (number) - day (number) - hours (number) - minutes (number) - seconds (number) common.get_product_version(): number - Returns the product version of the game client. common.get_game_directory(): string - Returns the absolute path to the game client folder. common.get_map_data(): table - Returns a table containing data about the current map. - Table structure: - name (string): The full name of the map. - shortname (string): The short name or internal identifier of the map. - group (string): The map group the map belongs to. common.get_username(): string - Returns the username associated with the Neverlose account. common.get_config_name(): string - Returns the name of the currently loaded configuration file. common.get_active_scripts(): table - Returns a table of strings, where each string is the name of a currently loaded script. common.get_mouse_wheel_delta(): number - Returns a value indicating the amount the mouse wheel has changed since the last check. common.is_in_thirdperson(): boolean - Returns true if the game camera is currently in third-person mode, false otherwise. common.reload_script() - Reloads the currently executing script. common.unload_script() - Unloads the currently executing script. common.force_full_update() - Forces the game server to send a full update packet for the client's state. common.set_clan_tag(text: string) - Sets the player's in-game clan tag. - Parameters: - text (string): The new clan tag to set. common.set_name(text: string) - Sets the player's in-game name. - Parameters: - text (string): The new name to set. common.add_event(text: string[, icon_name: string]) - Prints text to the upper-left Neverlose event panel. - Parameters: - text (string): The text content to display. - icon_name (string, optional): The name of a Font Awesome icon to display alongside the text. common.add_notify(title: string, text: string) - Displays a custom notification to the user. - Parameters: - title (string): The title of the notification. - text (string): The main body text of the notification. common.is_button_down(key: number): boolean - Checks if a specific key is currently being held down. - Parameters: - key (number): The numerical identifier for the key to check. - Returns: true if the key is down, nil on failure. common.is_button_released(key: number): boolean - Checks if a specific key was released since the last check. - Parameters: - key (number): The numerical identifier for the key to check. - Returns: true if the key was released, nil on failure. ``` -------------------------------- ### Create Selectable List Menu Item Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_ui.md Creates and returns a selectable list menu item. It requires a name and a list of items. The items can be provided as comma-separated values or a table of strings. ```APIDOC group:selectable(name: string, items: any[, ...]): MenuItem Parameters: name: string - Item name items: any - One or more comma separated values that will be added to the combo. Alternatively, a table of strings that will be added. Returns: MenuItem object or throws an error on failure. ``` -------------------------------- ### Get Player Weapon API - Entity Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_entity.md Retrieves the player's currently held weapon entity or all weapons if specified. ```APIDOC ent:get_player_weapon([all_weapons: boolean]): entity / table Description: Returns a pointer to the player's weapon entity. If all_weapons is true, returns a table containing pointers to every weapon entity the player is currently carrying. Parameters: - all_weapons (boolean, optional): If true, all weapons will be included in the returned table. ``` -------------------------------- ### Get Player Info API - Entity Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_entity.md Retrieves detailed information about a player entity, including identification and status flags. ```APIDOC ent:get_player_info(): table Description: Returns a table containing information from the player_info_t structure of the entity. Return Values: A table with the following keys: - is_hltv: boolean - is_fake_player: boolean - steamid: string - steamid64: string - userid: number - files_downloaded: number ``` -------------------------------- ### Create Texture Menu Item Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_ui.md Creates and returns a texture menu item, which displays an image. It requires an ImgObject and can optionally specify size, color, mode (fill/repeat), and rounding. ```APIDOC group:texture(texture: ImgObject[, size: vector, color: color, mode: string, rounding: number]): MenuItem Parameters: texture: ImgObject - Image object. size: vector - Optional. Size of the image. color: color - Optional. Color of the texture. mode: string - Optional. 'f' for fill, 'r' for repeat. rounding: number - Optional. Image border rounding. Returns: MenuItem object or throws an error on failure. ``` -------------------------------- ### Get Player Weapon Information Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_entity.md Retrieves specific information about a player's currently equipped weapon, including its index and icon. ```APIDOC ent:get_weapon_index(): number -- Returns the index of the weapon. ent:get_weapon_icon(): ImgObject -- Returns the icon of the weapon. ``` -------------------------------- ### Create Slider Menu Item Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_ui.md Creates and returns a slider menu item. It requires a name, minimum, and maximum value. Optional parameters include an initial value, a scale multiplier for display, and a tooltip function or string. ```APIDOC group:slider(name: string, min: number, max: number[, init: number, scale: number, tooltip: function]): MenuItem Parameters: name: string - Item name min: number - Minimum allowed value max: number - Maximum allowed value init: number - Default value (optional) scale: number - Display value multiplier (optional). Can be used for decimal places. tooltip: string / function - A string appends itself to the display value. A function allows you to access the raw display value and displays anything it returns (optional). Returns: MenuItem object or throws an error on failure. ``` -------------------------------- ### Network API Methods Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_utils.md Comprehensive documentation for various network API methods, covering server information retrieval, packet validation, time, byte size, and response latency. ```APIDOC get_server_info(): table Description: Returns a table containing rate, name, address, frame_time, and deviation (or nil on failure). Parameters: None Returns: table: A table with server information including 'rate', 'name', 'address', 'frame_time', 'deviation'. is_valid_packet(flow: number, frame: number): number Description: Checks if a packet is valid. Parameters: flow (number): Channel (Flow) identifier. frame (number): Sequence number of the packet. Returns: number: Returns true (or a truthy value) if the packet is valid, otherwise false (or a falsy value). get_packet_time(flow: number, frame: number): number Description: Retrieves the timestamp when a packet was sent. Parameters: flow (number): Channel (Flow) identifier. frame (number): Sequence number of the packet. Returns: number: The time the packet was sent. get_packet_bytes(flow: number, frame: number, group: number): number Description: Returns the size in bytes of a specific packet group. Parameters: flow (number): Channel (Flow) identifier. frame (number): Sequence number of the packet. group (number): The group identifier for the packet. Returns: number: The size of the packet group in bytes. get_packet_response_latency(flow: number, frame: number): number, number Description: Returns the latency and choke information for a given packet. Parameters: flow (number): Channel (Flow) identifier. frame (number): Sequence number of the packet. Returns: number: The latency in milliseconds (latency_msecs). number: The choke value. ``` -------------------------------- ### Get Network State API - Entity Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_entity.md Retrieves the current network state of an entity. The state indicates dormancy and the source of its last update. ```APIDOC ent:get_network_state(): number Description: Returns the network state of the player. Return Values: - 0: The entity is not dormant. - 1: The entity is dormant but the cheat has 100% info where the player is. - 2: The entity is dormant (updated by Shared ESP). - 3: The entity is dormant (updated by Sounds). - 4: The entity is dormant (not updated). - 5: The entity is dormant (data is unavailable or too old). ``` -------------------------------- ### Create Input Menu Item Source: https://github.com/yungjoky/nl-api/blob/main/documentation_variables_ui.md Creates and returns an input field menu item. It requires a name and can optionally have default text. ```APIDOC group:input(name: string[, text: string]): MenuItem Parameters: name: string - Item name text: string - Optional. Default value. Returns: MenuItem object or throws an error on failure. ```