API Reference
Enums & Constants
Hero IDs
hero_id.abrams hero_id.bebop hero_id.calico
hero_id.dynamo hero_id.greytalon hero_id.haze
hero_id.holliday hero_id.ivy hero_id.kelvin
hero_id.ladygeist hero_id.lash hero_id.mcginnis
hero_id.mirage hero_id.moandkrill hero_id.paradox
hero_id.pocket hero_id.seven hero_id.shiv
hero_id.sinclair hero_id.viscous hero_id.vindicta
hero_id.vyper hero_id.warden hero_id.wraith
hero_id.wrecker hero_id.yamato hero_id.infernus
hero_id.none hero_id.genericAbility Slots
slot.ability1 slot.ability2 slot.ability3 slot.ability4Bones
bone.head bone.neck bone.spine_1
bone.spine_2 bone.pelvis
bone.arm_upper_L bone.arm_lower_L bone.hand_L
bone.arm_upper_R bone.arm_lower_R bone.hand_R
bone.leg_upper_L bone.leg_lower_L bone.ankle_L
bone.leg_upper_R bone.leg_lower_R bone.ankle_RPlayer Flags
player_flag.immune player_flag.invisible player_flag.urn
player_flag.respawn_credit player_flag.ult player_flag.burning
player_flag.stunned player_flag.kidnapped player_flag.slow
player_flag.shop player_flag.disarmed player_flag.silenced
player_flag.teleporting player_flag.zipline player_flag.burrow
player_flag.attached player_flag.bunny player_flag.cat
player_flag.frog player_flag.lycan player_flag.copy_ultVirtual Keys (VK)
VK.LBUTTON VK.RBUTTON VK.MBUTTON
VK.XBUTTON1 VK.XBUTTON2
VK.SHIFT VK.SPACE VK.RETURN VK.ESCAPE
VK.F1 .. VK.F12
VK.KEY_0 .. VK.KEY_9
VK.A .. VK.ZPlayer Object
Obtained from local_player() or get_players().
| Method | Returns | Description |
|---|---|---|
p:get_health() | float | Current HP |
p:get_max_health() | float | Max HP |
p:get_health_percentage() | float | Current HP as percentage (0-100) |
p:is_alive() | bool | Is alive |
p:is_valid() | bool | Valid pointer |
p:is_visible() | bool | Currently visible |
p:is_on_screen() | bool | On screen |
p:get_distance() | float | Distance to local player (meters) |
p:get_distance(other) | float | Distance to another player (meters) |
p:get_position() | vec3 | World position |
p:get_bone_position(bone) | vec3 | Bone world position |
p:get_hero_id() | int | Hero ID enum value |
p:get_team() | int | Team number |
p:get_flags() | int | Raw flags bitmask |
p:has_flag(flag) | bool | Check player flag |
Targeting
| Function | Returns | Description |
|---|---|---|
targeting.find_closest(fov, max_dist) | player or nil | Closest enemy within FOV cone |
targeting.compute_aim_delta(player, bone, speed) | vec2 | Mouse delta to aim at bone. speed = projectile velocity, 0 for hitscan |
targeting.get_fov(player, bone) | float | Angle in degrees from crosshair to bone |
Ability
| Function | Returns | Description |
|---|---|---|
ability.is_ready(slot) | bool | Can be cast now |
ability.is_in_cast_delay(slot) | bool | In cast animation |
ability.is_cooling_down(slot) | bool | On cooldown |
ability.get_points(slot) | int | Upgrade points spent |
Input
| Function | Returns | Description |
|---|---|---|
input.is_key_held(vk) | bool | Check if key is currently held |
input.press_key(vk) | - | Tap key (down + short delay + up) |
input.key_down(vk) | - | Hold key down |
input.key_up(vk) | - | Release key |
input.is_mouse_key(vk) | bool | Check if a VK code is a mouse button |
Aim
| Function | Returns | Description |
|---|---|---|
aim.move_mouse(vec2) | bool | Move mouse by a vec2 delta (from targeting.compute_aim_delta) |
aim.move_mouse_smooth(vec2, speed) | bool | Move mouse with smoothing (speed 0.01-1.0, higher = faster) |
aim.move_mouse_by(x, y) | bool | Move mouse by raw x/y floats (convenience wrapper) |
Keybinds
Read the user's configured keybinds:
lua
keybinds.reload_key() keybinds.parry_key() keybinds.dash_key()
keybinds.jump_key()
keybinds.ability1_key() keybinds.ability2_key() keybinds.ability3_key()
keybinds.ability4_key()
keybinds.item1_key() keybinds.item2_key() keybinds.item3_key()
keybinds.item4_key()Global Functions
| Function | Returns | Description |
|---|---|---|
local_player() | player | The local player object |
get_players() | table | All enemy players |
clock() | double | High-precision time in seconds |
click_mouse() | - | Left mouse click |
right_click() | - | Right mouse click |
precise_sleep(ms) | - | Blocking sleep, does NOT yield (use sparingly) |
slot_to_key(slot) | int | Convert slot enum to configured VK |
is_shutting_down() | bool | Check if application is closing |
print(msg) | - | Log message to script console |
aim_at_target(target, opts) | bool | Aim at a target; instant flick or smooth aim loop |
lock_aim(target, opts) | - | Lock aim onto a target for the duration of a combo |
unlock_aim() | - | Release the aim lock |
Vector Types
vec2
| Field/Method | Type | Description |
|---|---|---|
x, y | float | Components |
empty() | bool | Check if zero |
length() | float | Magnitude |
length_sqr() | float | Squared magnitude |
distance(other) | float | Distance to another vec2 |
normalized() | vec2 | Unit vector |
Supports +, -, *, / operators with both vec2 and float operands.
vec3
| Field/Method | Type | Description |
|---|---|---|
x, y, z | float | Components |
empty() | bool | Check if zero |
length() | float | Magnitude |
length_sqr() | float | Squared magnitude |
length_2d() | float | XY magnitude |
distance(other) | float | Distance to another vec3 |
normalized() | vec3 | Unit vector |
Supports +, -, *, / operators with both vec3 and float operands.
