Lua API

Scripting for

Getting started

  1. Create a file in the scripts folder (or with "Create script" in the Scripts tab).
  2. Load it in the Scripts tab; "Autoload" starts it every time.
  3. print() and errors go to the game's console.

An example: a watermark with its settings in the menu.

watermark.lua
-- watermark.lua: the name, your nick, fps, ping and the time in the top right corner.
-- Put it into %USERPROFILE%\.oxide\scripts and load it in the Scripts tab.

local group = ui.create("Watermark", "Settings")
local enabled = group:switch("Show watermark", true)
local accent = enabled:color_picker(color(180, 167, 255, 255))   -- the colour sits in the switch's "..." menu
local rounding = group:slider("Rounding", 0, 12, 8, 1, "px")

local font = render.load_font("Verdana", 12, "a")
local fps = 60

events.render:set(function()
    if not enabled:get() then return end

    -- a smoothed FPS counter
    if globals.frametime > 0 then
        fps = fps + (1 / globals.frametime - fps) * 0.08
    end

    local me = entity.get_local_player()
    local ping = me and me.m_iPing or 0
    local text = string.format("oxide!  |  %s  |  %d fps  |  %d ms  |  %s",
        common.get_username(), fps, ping, common.get_date("%H:%M"))

    local size = render.measure_text(font, nil, text)
    local screen = render.screen_size()
    local pos = vector(screen.x - size.x - 34, 14)
    local box = pos + vector(size.x + 20, size.y + 12)

    render.shadow(pos, box, accent:get(), 24, 0, rounding:get())
    render.rect(pos, box, color(14, 15, 22, 220), rounding:get())
    render.text(font, pos + vector(10, 6), color(235, 235, 245), nil, text)
end)
createmove.lua
-- the command the game just made: change it and it is what gets sent
events.createmove:set(function(cmd)
    local me = entity.get_local_player()
    if not me or not me:is_alive() then return end

    local on_ground = bit.band(me.m_fFlags, 1) ~= 0
    if not on_ground then
        cmd.in_jump = false            -- bunny hop: let go of jump in the air
    end
end)
events.lua
-- the game's own events: events.<name>, the fields of that event on `e`
events.player_hurt:set(function(e)
    local attacker = entity.get(e.attacker, true)
    local victim = entity.get(e.userid, true)
    if attacker and victim then
        print(string.format("%s -> %s: %d (%s)", attacker:get_name(), victim:get_name(), e.dmg_health, e.weapon))
    end
end)
traces.lua
-- the game's own traces: they work in createmove (the game's thread), not in events.render
events.createmove:set(function(cmd)
    local me = entity.get_local_player()
    if not me or not cmd.in_use then return end

    local eye = me:get_eye_position()
    local ahead = eye + vector():angles(cmd.view_angles) * 4096
    local trace = utils.trace_line(eye, ahead)            -- skips you by default
    local damage = utils.trace_bullet(me, eye, ahead)    -- your gun's damage there, through walls

    if trace.entity then
        print(trace.entity:get_name(), math.floor(eye:dist(trace.end_pos)), damage)
    end
end)
ffi.lua
-- ffi and bit are globals, the way Neverlose has them
ffi.cdef[[
    typedef struct { float x, y, z; } vec3_t;
    unsigned long GetTickCount(void);
]]

print("uptime, minutes:", math.floor(ffi.C.GetTickCount() / 60000))

local me = entity.get_local_player()
if me then
    local pawn = ffi.cast("uintptr_t", me[0])                       -- ent[0]: the pawn's address
    local offset = utils.get_netvar_offset("C_BaseEntity", "m_iHealth")
    print("health:", ffi.cast("int*", pawn + offset)[0], me.m_iHealth)
    print("duck:", me.m_flDuckAmount, "flags:", bit.tohex(me.m_fFlags))
end

-- convars in place: the game's value, written without the console
print("sv_gravity =", cvar.sv_gravity:float())
cvar.sensitivity:set_callback(function(cv, old, new) print(cv.name, old, "->", new) end)

events

Callbacks. Subscribe with events.<name>:set(fn) or events.<name>(fn), remove with :unset(fn) or events.<name>(fn, false) (:add / :remove are the same); :call(...) fires it yourself. A handler that throws is removed and the error goes to the console. Any game event name works too (player_hurt, player_death, weapon_fire, round_start, bomb_planted...).

render

Every frame, also when the menu is closed. The render.* functions draw only here.

createmove(cmd)

Every tick, right after the game made the command. What you change in cmd is sent.

createmove_run(run)

After createmove: what the command ended up as (command_number, tick_count, move_yaw, forwardmove, sidemove, upmove).

pre_render / post_render

The start and the end of the game's frame.

net_update_start / net_update_end

Before and after the entities are updated from a server packet.

level_init

You are in a match on a new map.

shutdown

The script is about to be unloaded.

level_shutdown

You left the match.

frame_stage(stage, before)

Every stage of the game's frame, both sides of it (stage: 1 net update start ... 5 render start, 6 render end, 7 net update end).

render_overlay

Like render, but drawn over the menu: your own pop-ups.

menu_toggled(open)

The menu was opened or closed.

key_input(message, key, lparam)

A key message on its way to the game (WM_KEYDOWN 0x100, WM_KEYUP 0x101...). Return false and the game does not get it.

player_esp(ctx)

Every alive player with a box on the screen: your own ESP items around it. ctx.entity, ctx.box, ctx.is_enemy; ctx:add_text(side, text[, color, font]), ctx:add_icon(side, image[, color, height]), ctx:add_bar(side, 0..1, color[, second_color]), ctx:offset(side), ctx:bump(side, pixels). side: "top", "bottom", "left", "right".

config_state(state, name)

The header's config picker: state is "pre_save", "post_save", "pre_load" or "post_load", name the config.

mouse_input(message, wparam, lparam)

A mouse message on its way to the game (WM_MOUSEMOVE 0x200, WM_LBUTTONDOWN 0x201...). Return false and the game doesn't get it.

aim_fire(e)

The Ragebot shot: e.id, e.target (entity), e.damage, e.hitchance, e.hitgroup, e.backtrack (ticks), e.aim, e.angle.

aim_ack(e)

How that shot ended: e.id, e.target, e.damage (dealt), e.hitgroup (hit), e.wanted_damage, e.wanted_hitgroup, e.state = nil on a hit, else "spread", "correction", "occlusion", "prediction error", "backtrack failure".

override_view(ctx)

The camera of every frame: ctx.fov, ctx.camera (position), ctx.view (angles) - change them and that is what is drawn.

localplayer_transparency(ctx)

ctx.current_alpha (0..255); return a number and your model gets that alpha (seen in third person).

grenade_prediction(e) / grenade_warning(e)

The grenade in your hand / each one in the air: e.type ("Frag", "Molly", "Smoke", "Flash", "Decoy"), e.path, e.collisions, e.closest_point, e.expire_time, e.danger. They work with the menu's grenade switches off too.

bullet_fire(e)

Someone fired (made from the game's weapon_fire): e.entity, e.origin, e.angles, e.weapon_id, e.spread, e.inaccuracy, e.weapon_mode.

<game_event>(e)

e.<key> reads the event: e.userid / e.attacker / e.assister are players (use entity.get(e.userid, true)), e.dmg_health, e.weapon, e.headshot...

cmd fields

view_anglesvector

pitch, yaw, roll

forwardmove, sidemove, upmovenumber

-450..450, sidemove is positive to the right

move_yawnumber

the yaw the movement is meant for (turning the view keeps your walking direction)

in_attack, in_attack2, in_jump, in_duck, in_use, in_reload, in_walk, in_speedboolean

buttons

in_forward, in_back, in_moveleft, in_moveright, in_left, in_rightboolean

movement keys

in_zoom, in_score, in_lookatweaponboolean

more buttons

cmd:get_button(name) / set_button(name) / remove_button(name)

the same by name ("jump" or "in_jump")

cmd:rotate_movement(yaw) / cmd:lock_angles()

the walking is meant for that yaw; the camera takes the command's angles

tickcount, command_number, random_seednumber

the command's tick and number

mouse_dx, mouse_dy, weaponselect, impulsenumber

raw input

block_movementnumber

1 slow walk, 2 stand still

ui

Menu items. A group shows up as a panel; ui.create(tab, name) puts it on that page (Visuals, Misc...) or in the Scripts tab. Values are saved with the config.

ui.create(name) / ui.create(tab, name)MenuGroup

A group of items.

ui.sidebar(name, icon, color)SidebarTab

Your own tab in the menu's sidebar. icon: a name or SVG path data, color: color(), hex or a name. tab:create(name) gives a group on it.

ui.find(group[, item]) / ui.find(tab, group, item)MenuItem | MenuGroup

A group or item any loaded script made (oxide!'s own menu isn't made of script items: nil).

ui.localize(lang, text[, localized])string | nil

With localized: this script's text shows translated while the menu is in that language ("en", "ru"). Without: what was set.

ui.get_alpha() / is_open() / get_size() / get_position() / get_mouse_position() / get_mouse_delta()number / vector

The menu window.

ui.get_style([name]) / ui.get_icon(name)

The menu's accent colour; an icon's name (oxide!'s icons are named, ui.sidebar takes them).

ui.get_binds()table

The binds that work now (the menu's and the scripts' hotkeys): { name, value, mode, active, reference }.

group:switch(name[, init])MenuItem

A switch. Its "..." menu takes a colour picker or a group (item:color_picker(), item:create()).

group:slider(name, min, max[, init, scale, suffix|tooltip])MenuItem

A slider; tooltip can be a function(value) -> text.

group:combo(name, items...) / group:list(...)MenuItem

One of a list.

group:selectable(name, items...) / group:listable(...)MenuItem

Several of a list.

group:color_picker(name[, color])MenuItem

A colour.

group:button(name[, callback, alt_style])MenuItem

A button.

group:hotkey(name[, key])MenuItem

A key bind; :get() is true while it is held.

group:input(name[, text]) / group:label(text[, color, bold])MenuItem

A text field, a line of text.

group:texture(image[, size, color, mode, rounding])MenuItem

A picture (render.load_image...) in the group.

group:canvas(height, function(ctx))MenuItem

A row you draw yourself with render.*, your own control. ctx: position, size, mouse (from the canvas's top left), hovered, held, clicked, released, right_clicked, wheel.

group:spacer([height]) / group:separator()MenuItem

An empty row, a thin line.

ui.widget(name, position, size, function(widget))Widget

A box on the screen, dragged with the mouse while the menu is open; where it was left is remembered. The function draws it every frame at widget:position(); also widget:size(), set_size(v), set_position(v), rect(), visibility([v]), remove().

item:get() / item:set(value) / item:reset()

The value.

item:override([value]) / item:get_override()

item:get() says value until item:override() takes it off (the saved value stays).

item:set_callback(fn[, call_now]) / item:unset_callback(fn)

Runs when the user changes it.

item:name([v]) / tooltip([v]) / visibility([v]) / disabled([v, why])

Look and state; why is the hint of a disabled item.

item:update(items...) / item:list() / item:id() / item:type() / item:parent()

A combo's items, the item's id, type and parent.

render

Drawing for events.render, on the game's screen under the menu. Positions are vectors (x, y), colours are color().

render.screen_size()vector
render.world_to_screen(position)vector | nil

A world point on the screen (nil behind you or off the screen).

render.camera_position() / render.camera_angles()vector
render.get_offscreen(position, radius)vector, number, boolean

A point on a circle around the middle pointing at the target, the arrow's rotation, whether it is off the screen.

render.load_font(name, size[, flags])Font

A font of the PC ("Verdana", a .ttf). Flags: a anti-alias, b bold, o outline, d shadow.

render.measure_text(font, flags, text)vector
render.text(font, position, color, flags, text...)

Flags: c centred, r right, h centred across, v centred up and down, b bottom, s DPI-scaled. Built-in fonts: 1 default, 2 small, 3 console, 4 bold.

render.line(a, b, color[, thickness])
render.rect(a, b, color[, rounding]) / render.rect_outline(a, b, color[, thickness, rounding])
render.gradient(a, b, top_left, top_right, bottom_left, bottom_right[, rounding])

rounding: a number or { tl, tr, br, bl }.

render.rect_rounded(a, b, color, rounding[, thickness])

rounding: a number or { tl, tr, br, bl }. With a thickness: an outline.

render.pill(a, b, left[, right])

A bar with round ends.

render.glow(a, b, color, radius[, rounding, sides])

The light around a box. sides: which of "tblr" it reaches (all by default). The colour's alpha is its strength.

render.shadow_line(a, b, direction, alpha)

A shadow fading across the box; direction: "up", "down", "left", "right".

render.line_gradient(from, to, color_from, color_to[, thickness])
render.triangle(a, b, c, color[, thickness]) / render.quad(a, b, c, d, color[, thickness])

Filled; with a thickness an outline.

render.triangle_gradient(a, b, c, color_a, color_b, color_c) / render.quad_gradient(a, b, c, d, color_a, color_b, color_c, color_d)

A colour per corner.

render.polyline(points, color[, thickness, closed])

A table of points.

render.push_alpha(0..1) / render.pop_alpha()

What is drawn in between is that transparent, as one layer.

render.svg(paths, position, size, color[, thickness])boolean

An outline drawing: SVG path data, or a whole <svg> whose paths are in a 24 x 24 box. Stroked, not filled.

render.create_shader(hlsl)Shader | nil, string

Your own pixel shader: float4 main(PS_INPUT input) : SV_Target. Given: input.pos, input.col, input.uv, resolution, time, delta_time, params, texture0, sampler0, backdrop (the blurred game). On an error: nil and the compiler's text.

render.push_shader(shader[, a, b, c, d]) / render.pop_shader()

What is drawn in between goes through the shader; a, b, c, d arrive as params.

render.with_blur(a, b, fn[, rounding, alpha]) / render.with_frost(a, b, fn[, rounding, alpha])

The blurred game behind a box (with_frost: with a pale tint), then what fn draws.

render.wrap_text(font, text, width[, flags]) / render.text_box(font, position, width, color, flags, text)

Text broken into lines of at most width pixels.

font:measure(text) / font:wrap(text, width)
render.circle / circle_outline / circle_gradient(position, color, radius, start_deg, pct)
render.circle_3d / circle_3d_outline / circle_3d_gradient(position, color, radius, start_deg, pct)

A circle lying on the ground.

render.poly(color, points...) / render.poly_line(color, points...)
render.shadow(a, b, color[, thickness, offset, rounding])

A glow around a rectangle (the menu's own).

render.blur_rect(a, b[, rounding, alpha])

The game behind the rectangle, blurred like the menu's glass (the picture of the previous frame). alpha: how strong the picture is. While the menu's blur is off, or not ready yet, a darkening stands in. It makes a blurred copy of the screen every frame it is used.

render.blur(a, b, strength, alpha[, rounding])

The game behind the rectangle, blurred like the menu's glass.

render.poly_blur(opacity, strength, points...)

The same inside a convex polygon.

render.get_pixel(position)color | nil

A pixel of the game's picture (without oxide!'s drawing). The answer comes a frame later: nil the first time.

render.highlight_hitbox(entity, hitbox, color)

The hitbox's capsule filled on the screen (call it every frame in events.render).

render.load_image(png_jpeg_or_gif, size) / load_image_rgba(pixels, size) / load_image_from_file(path, size)Image

A picture; image.width, image.height.

render.texture(image, position[, size, color, mode, rounding])

Mode "f" fills the box (crops instead of squeezing).

render.texture_uv(image, position, size, uv_from, uv_to[, color, rounding])

A part of the picture (uv 0..1).

image:frame_count() / image:set_frame([n]) / image:set_loop(on) / image:restart()

A GIF plays by itself; set_frame stops on that frame, set_frame() plays again.

render.push_rotation(degrees[, pivot]) / render.pop_rotation()

What is drawn in between turns around its middle.

render.push_clip_rect(a, b[, intersect]) / render.pop_clip_rect()
render.get_scale()number

The menu's DPI scale.

entity

The players and every other entity (weapons on the ground, grenades, the bomb, the game rules). An entity reads any field of the game's schema by name, on the pawn and then on the controller: ent.m_iHealth, ent.m_fFlags, ent.m_vecVelocity, ent.m_flDuckAmount, ent.m_hObserverTarget (a player's handle comes back as that player), ent["C_CSPlayerPawn->m_flVelocityModifier"]. The type comes from Valve's prefix (m_fl float, m_i / m_n int, m_b boolean, m_vec / m_ang vector, m_h handle, m_sz text). ent.m_x = v writes it (numbers, booleans, vectors); ent[0] is the pawn's address (for ffi).

entity.get_local_player()Entity | nil
entity.get(index[, by_userid])Entity | nil

By the index an event gives (e.userid).

entity.get_players([enemies_only, include_dormant, filter])table
entity.get_entities([class, include_dormant, filter])table

Players and every other entity; class: "C_WeaponAK47", "C_PlantedC4", "C_SmokeGrenadeProjectile" (the C_ may be left out).

entity.get_game_rules()Entity

C_CSGameRules: rules.m_bWarmupPeriod, m_bFreezePeriod, m_fRoundStartTime, m_iRoundTime, m_bBombPlanted...

entity.get_threat()Entity | nil

The enemy nearest to your crosshair.

entity.get_projectiles() / entity.get_dropped_weapons()table

The grenades in the air, the guns lying around.

ent:is_alive() / is_enemy() / is_bot() / is_dormant() / is_player() / is_weapon()boolean
ent:is_visible() / is_occluded() / is_enemy_to(other)boolean

is_visible: the game says your player sees this one.

ent:get_classname() / get_model_name() / get_simulation_time()

The pawn's class, the model it wears, { current, old } simulation time.

ent:get_spectators()table

Who watches this player (known for you only).

ent:get_steam_avatar()Image | nil

The Steam picture for render.texture (nil for bots).

ent:get_index() / get_name() / get_xuid() / get_player_info()

Who it is (get_player_info: name, steamid64, is_bot, ping).

ent:get_origin() / get_eye_position() / get_angles() / get_view_offset() / get_velocity()vector
ent:get_bone_position(bone) / ent:get_hitbox_position(hitbox)vector

get_hitbox_position: the middle of the game's own hitbox (0 head ... 18).

ent:get_bbox(){ pos1, pos2, alpha }

The box the ESP draws.

ent:get_player_weapon([all])Weapon

weapon:get_weapon_index(), get_classname(), get_weapon_info(), get_weapon_owner(); for your own weapon also get_spread(), get_inaccuracy(), get_max_speed(), weapon.m_iClip1; weapon[0] is its address.

common

common.get_username()string

Your oxide! account's name.

common.add_notify(title, text[, color]) / common.add_event(text)

A pop-up in the corner.

common.get_date(format[, unix_time])string

strftime: "%H:%M:%S".

common.get_unixtime() / get_timestamp() / get_system_time()
common.is_button_down(key) / is_button_pressed(key) / is_button_released(key)boolean

Virtual key codes (0x01 mouse 1, 0x20 space...).

common.get_mouse_wheel_delta()number
common.get_active_scripts() / get_config_name() / get_game_directory()

get_config_name: the config last loaded or saved in the header.

common.get_script_name() / common.get_resource_dir()string

This script's name; the full path of the folder files works in.

common.play_sound(path[, volume])

A sound of the game ("sounds/ui/beep"), volume 0..1.

common.set_view_angles(angles)

Where the camera looks.

common.set_name(text)

Your name in the game.

common.set_clan_tag(text)

CS2 has no settable clan tag: the text goes in front of your name ("" removes it; it comes off when the script unloads).

common.get_map_data()table | nil

{ name, shortname, group } of the map ("de_mirage", "de").

common.force_full_update()

The game's cl_fullupdate (the server decides whether it runs).

common.reload_script() / common.unload_script()

globals

globals.realtime / curtime / frametime / absoluteframetime / framecountnumber
globals.tickcount / tickinterval / server_tick / client_ticknumber
globals.max_players / commandack / last_outgoing_commandnumber
globals.is_connected / is_in_gameboolean

utils

utils.execute_after(seconds, fn, ...) / delay(seconds, fn, ...)

Runs fn later.

utils.console_exec(command...)

A console command.

utils.random_int(min, max) / random_float(min, max) / random_seed(seed)
utils.opcode_scan(module, signature[, offset])cdata (void*)

A pattern in a game module ("48 8B ? ?").

utils.create_interface(module, name)cdata (void*)
utils.get_vfunc(index, type) / utils.get_vfunc(module, interface, index, type)function

A virtual function, with the FFI type you give.

utils.get_netvar_offset(class, field)number

A schema offset ("C_BaseEntity", "m_iHealth").

utils.net_channel()table

latency[0/1] from your ping; loss, choke... are 0.

utils.trace_line(from, to[, skip, mask]) / utils.trace_hull(from, to, mins, maxs[, skip, mask])trace

The game's own traces. Only on the game's thread: createmove, createmove_run, pre_render, post_render, net_update_*, game events (in events.render nothing is hit). skip: an entity (you by default). trace.fraction, end_pos, entity, plane.normal, start_solid, :did_hit(), :did_hit_world(), :is_visible().

utils.trace_bullet(from_entity, from, to[, skip])number, trace

The damage your weapon does at `to`, through walls (the game's penetration), and the trace.

utils.trace_sphere(from, to, radius[, skip, mask]) / utils.trace_movement(from, to[, mins, maxs]) / utils.trace_grenade(from, to[, skip])trace

More of the game's traces, on the game's thread too: a sphere, your player's movement box, a grenade's way. A bullet's trace also has trace.impacts: every point it touched something.

utils.scale_damage(damage, hitgroup[, armor_ratio, armor, helmet])number

The damage a body part takes through armor.

utils.base64_encode(text) / utils.base64_decode(text) / utils.murmur2(text[, seed]) / utils.fnv1a(text)string / number
utils.clipboard_get() / utils.clipboard_set(text)
utils.array_to_string(bytes) / utils.string_to_array(text)
utils.find_pattern(module, signature[, offset]) / utils.find_export(module, name)cdata (void*)

An address in a module (find_pattern is utils.opcode_scan).

particles.create(path[, seconds, position])Particle

An effect of the game's own particle system; without seconds it stays until :destroy(). particle:set_control(point, vector), set_entity(point, entity), is_valid(), destroy().

files · db · json · network · cvar

files.read(path) / files.write(path, text) / files.create_folder(path) / files.get_crc32(path)

Inside scripts\files only.

files.exists(path) / size(path) / remove(path) / rename(from, to) / append(path, text) / list([folder])

Inside scripts\files only. list: the names, a folder ends in "/".

db.<key> / db.<key> = value

What a script keeps between sessions (saved to its own file).

json.parse(text) / json.stringify(value[, pretty])
network.get(url[, headers, callback]) / network.post(url[, data, headers, callback])

Without a callback the answer is returned (body, status); with one it comes as callback(body, status, error).

network.download(url, path[, callback(ok, status)])

A file into scripts\files, in the background.

cvar.<name>:int([v, raw]) / :float([v, raw]) / :bool([v]) / :string([v]) / :call(...)

Without v: the game's value now. With v: set through the console; raw = true writes it in place (hidden / cheat / clamped ones too). :string() reads back only what the script set.

cvar.<name>:set_callback(fn(cvar, old, new)) / :unset_callback(fn)

Called when the value changes.

vector · color · math · bit · ffi

vector(x, y, z)

+ - * /, :length(), :length2d(), :dist(v), :normalized(), :dot(v), :cross(v), :lerp(v, t), :angles(), :to_screen()...

color(r, g, b, a) / color("#RRGGBBAA")

:lerp(c, t), :mod_alpha(a), :darken(v), :lighten(v), :with_r/g/b/a(v), color.percent(p), color.gray(v), color.interpolate(a, b, t), :alpha_modulate(a), :to_hex(), :to_hsv(), :as_hsv(...), :grayscale()...

vector: :is_zero([tolerance]), :is_valid(), :forward(), :angle_vectors()

angle_vectors: these angles as forward, right, up.

rect(mins, maxs) / rect(x0, y0, x1, y1)

:width(), :height(), :size(), :center(), :contains(point), :translate(v), :explode(v), :margin_left/right/top/bottom(n), :intersect(r), :unpack() for render.rect(r:unpack(), color).

math.clamp(v, min, max) / math.map(v, a, b, c, d[, clamp]) / math.normalize_yaw(yaw) / math.lerp(a, b, t)
math.calc_angle(from, to) / vector_angles(forward) / approach_angles(from, to, speed) / edge_point(mins, maxs, direction, radius) / angle_normalize(a) / remap_val(v, a, b, c, d) / remap_val_clamped(...) / world_to_screen(v)
bit.band / bor / bxor / bnot / lshift / rshift / arshift / rol / ror / bswap / tobit / tohex

LuaJIT's bit library (32-bit).

ffi.cdef / ffi.C / ffi.load / ffi.new / ffi.cast / ffi.typeof / ffi.string / ffi.copy / ffi.fill / ffi.sizeof / ffi.metatype / ffi.gc

LuaJIT's FFI as a global: C declarations, calls into any DLL, raw memory. It has the game process's full rights - only run scripts you trust.

jit.version / jit.on() / jit.off() / jit.status()
function __shutdown() ... end / print(...) / print_error(...) / print_chat(...) / to_ticks(seconds) / to_time(ticks) / new_class()

esp · panorama

esp.enemy:new_text(name, preview, fn(ent) -> text[, color])

A line beside the enemies' box (esp.team / esp.local too).

esp.enemy:new_bar(name, fn(ent) -> 0..1[, color])

A bar beside the box.

panorama.loadstring(js)

JavaScript in the game's main menu.

Scripts run only inside oxide!. A script that comes from the cloud never starts by itself: load it yourself. Functions that need the game's physics or materials (utils.trace_*, materials) return an empty result.

Lua API · oxide!