This is documentation for the StellarHook Lua API, which allows you to interact with game entities, weapons, input commands, global variables, configuration variables, and rendering functions.
- Script Management
- Key Bindings
- Configuration Variables
- Player Information
- Weapons
- Drawing
- ImGui Interface
- AutoWall Functions
- Aimbot Functions
- Extended Player Functions
- LagComp Functions
- Ray Tracing
- Vector Functions
- Time and Ticks
- Other Functions
BIND_MODE_NONE -- No binding mode
BIND_MODE_HOLD -- Hold key mode
BIND_MODE_TOGGLE -- Toggle modeCreates a new key binding with the specified name.
Returns the current state of the binding (active or not).
Sets the key for the binding.
Sets the binding mode (BIND_MODE_NONE, BIND_MODE_HOLD, BIND_MODE_TOGGLE).
Returns the key code for the binding.
Returns the binding mode.
Sets a boolean value for a configuration variable.
Sets an integer value for a configuration variable.
Sets a floating-point value for a configuration variable.
Sets a color value for a configuration variable.
Returns the boolean value of a configuration variable.
Returns the integer value of a configuration variable.
Returns the floating-point value of a configuration variable.
Returns the color components of a configuration variable.
Returns a table of all available configuration variables.
Returns the local player object.
Returns a player object by index.
Returns the player's name.
Returns the player's team number.
Returns the player's health amount.
Returns the player's position coordinates.
Returns the player's eye position coordinates.
Returns the player's velocity vector.
Returns the player's current weapon.
Returns the player's flags.
Returns the player's armor amount.
Checks if the player has a helmet.
Returns the player's movement type.
Returns the player's simulation time.
Returns the number of bullets in the primary magazine.
Returns the number of bullets in the secondary magazine.
Returns the number of spare bullets for the primary weapon.
Returns the number of spare bullets for the secondary weapon.
Returns the time until the next possible primary fire attack.
Returns the time until the next possible secondary fire attack.
Converts 3D world coordinates to 2D screen coordinates.
Draws a line on the screen.
Draws a rectangle on the screen.
Draws a filled rectangle on the screen.
Draws a circle on the screen.
Draws a filled circle on the screen.
Draws text on the screen.
Draws a horizontal gradient on the screen.
Draws a vertical gradient on the screen.
Draws a 3D box in world coordinates.
Draws a hitbox of the specified entity.
Draws a skeleton of the specified entity.
Begins a new ImGui window.
Ends the current ImGui window.
Begins a child ImGui window.
Ends the child ImGui window.
Sets the position for the next ImGui window.
Sets the size for the next ImGui window.
Displays text in ImGui.
Displays a checkbox in ImGui.
Displays a button in ImGui.
Displays a slider for integers in ImGui.
Displays a slider for floating-point numbers in ImGui.
Places the next element on the same line.
Begins a new ImGui window (alternative method).
Ends the current ImGui window (alternative method).
Sets the position of the current ImGui window.
Sets the size of the current ImGui window.
Adds a separator line in ImGui.
Begins the main menu bar in ImGui.
Ends the main menu bar in ImGui.
Begins a submenu in ImGui.
Ends a submenu in ImGui.
Adds a menu item in ImGui.
Adds a color picker in ImGui.
Adds a dropdown list in ImGui.
Adds a text input field in ImGui.
Checks the state of a key.
Checks if it's possible to hit through walls and returns potential damage.
Calculates damage when hitting through walls.
Finds the best hitbox for shooting at the specified target.
Checks visibility between two points considering the specified target.
Returns the position of the specified entity's hitbox.
Returns the position of the specified player's hitbox.
Returns the position of the specified player's bone.
Checks if the specified player is visible from the local player's position.
Returns the number of lag compensation records for the specified player.
Returns the position of the specified lag compensation record.
Returns the index of the best lag compensation record for the specified player.
Performs ray tracing in the game world and returns the result.
Calculates the distance between two points in 3D space.
Converts a direction vector to angles (pitch and yaw).
Converts angles to a direction vector.
Calculates angles between two points in 3D space.
Returns the current tick count.
Returns the number of game ticks.
Returns the number of bullets fired.
Returns the number of bullets fired by the specified player.
Returns the current simulation time.
Returns the current animation time.
Returns the current time in seconds.
Pauses script execution for the specified number of seconds.
Outputs text to the console.
Returns the screen dimensions.
Returns the current mouse cursor position.
Checks if the mouse cursor is in the specified area.
Converts color from HSV to RGB.
Converts color from RGB to HSV.
Checks if the player is in game.
Checks if tick shifting is being performed.
Returns the double tap charge.
Returns the number of ticks until shift.
-- Check if it's possible to hit through a wall
local local_player = get_local_player()
local eye_pos = {local_player:get_eye_position()}
local target = get_player(1) -- Get the first player
local target_pos = {target:get_eye_position()}
local can_hit, damage = autowall_can_hit(
eye_pos[1], eye_pos[2], eye_pos[3],
target_pos[1], target_pos[2], target_pos[3],
1
)
if can_hit then
print("Can hit through wall! Damage: " .. damage)
else
print("Cannot hit through wall")
end-- Get the best hitbox for shooting
local target_index = 1
local hitbox_id, pos_x, pos_y, pos_z = aimbot_get_best_hitbox(target_index)
if hitbox_id ~= -1 then
print("Best hitbox: " .. hitbox_id)
print("Position: " .. pos_x .. ", " .. pos_y .. ", " .. pos_z)
-- Check hitbox visibility
local local_player = get_local_player()
local eye_pos = {local_player:get_eye_position()}
local visible = aimbot_check_visible(
eye_pos[1], eye_pos[2], eye_pos[3],
pos_x, pos_y, pos_z,
target_index
)
if visible then
print("Hitbox is visible")
else
print("Hitbox is not visible")
end
end-- Draw player skeleton
function on_paint()
for i = 1, 64 do
local player = get_player(i)
if player and player:get_health() > 0 and player:get_team() ~= get_local_player():get_team() then
draw_skeleton(i, 255, 0, 0, 255) -- Red skeleton for enemies
end
end
end
-- Draw 3D box around player
function on_paint()
for i = 1, 64 do
local player = get_player(i)
if player and player:get_health() > 0 then
local origin = {player:get_origin()}
draw_3d_box(origin[1], origin[2], origin[3], 30, 72, 30, 0, 255, 0, 255)
end
end
end-- Get positions from lag compensation records
function on_paint()
local target_index = 1
local records_count = lagcomp_get_records_count(target_index)
if records_count > 0 then
local best_record = lagcomp_get_best_record(target_index)
local pos_x, pos_y, pos_z = lagcomp_get_record_position(target_index, best_record)
-- Draw a point at the best record position
local screen_x, screen_y, visible = world_to_screen(pos_x, pos_y, pos_z)
if visible then
draw_filled_circle(screen_x, screen_y, 5, 20, 255, 255, 0, 255)
end
end
end-- Ray tracing to check for obstacles
local local_player = get_local_player()
local eye_pos = {local_player:get_eye_position()}
local forward = {angle_vectors(get_view_offset())}
local end_pos = {
eye_pos[1] + forward[1] * 1000,
eye_pos[2] + forward[2] * 1000,
eye_pos[3] + forward[3] * 1000
}
local hit, fraction, entity_index = trace_ray(
eye_pos[1], eye_pos[2], eye_pos[3],
end_pos[1], end_pos[2], end_pos[3],
0x46004003 -- MASK_SHOT
)
if hit then
print("Ray hit an obstacle at distance: " .. (fraction * 1000))
if entity_index ~= -1 then
print("Ray hit an entity with index: " .. entity_index)
end
end-- Calculate distance between players
local local_player = get_local_player()
local local_pos = {local_player:get_origin()}
local target = get_player(1)
local target_pos = {target:get_origin()}
local distance = vector_distance(
local_pos[1], local_pos[2], local_pos[3],
target_pos[1], target_pos[2], target_pos[3]
)
print("Distance to target: " .. distance)
-- Calculate angle for aiming
local pitch, yaw = calc_angle(
local_pos[1], local_pos[2], local_pos[3],
target_pos[1], target_pos[2], target_pos[3]
)
print("Aiming angle: " .. pitch .. ", " .. yaw)