Skip to content

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.generic

Ability Slots

slot.ability1       slot.ability2       slot.ability3       slot.ability4

Bones

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_R

Player 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_ult

Virtual 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.Z

Player Object

Obtained from local_player() or get_players().

MethodReturnsDescription
p:get_health()floatCurrent HP
p:get_max_health()floatMax HP
p:get_health_percentage()floatCurrent HP as percentage (0-100)
p:is_alive()boolIs alive
p:is_valid()boolValid pointer
p:is_visible()boolCurrently visible
p:is_on_screen()boolOn screen
p:get_distance()floatDistance to local player (meters)
p:get_distance(other)floatDistance to another player (meters)
p:get_position()vec3World position
p:get_bone_position(bone)vec3Bone world position
p:get_hero_id()intHero ID enum value
p:get_team()intTeam number
p:get_flags()intRaw flags bitmask
p:has_flag(flag)boolCheck player flag

Targeting

FunctionReturnsDescription
targeting.find_closest(fov, max_dist)player or nilClosest enemy within FOV cone
targeting.compute_aim_delta(player, bone, speed)vec2Mouse delta to aim at bone. speed = projectile velocity, 0 for hitscan
targeting.get_fov(player, bone)floatAngle in degrees from crosshair to bone

Ability

FunctionReturnsDescription
ability.is_ready(slot)boolCan be cast now
ability.is_in_cast_delay(slot)boolIn cast animation
ability.is_cooling_down(slot)boolOn cooldown
ability.get_points(slot)intUpgrade points spent

Input

FunctionReturnsDescription
input.is_key_held(vk)boolCheck 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)boolCheck if a VK code is a mouse button

Aim

FunctionReturnsDescription
aim.move_mouse(vec2)boolMove mouse by a vec2 delta (from targeting.compute_aim_delta)
aim.move_mouse_smooth(vec2, speed)boolMove mouse with smoothing (speed 0.01-1.0, higher = faster)
aim.move_mouse_by(x, y)boolMove 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

FunctionReturnsDescription
local_player()playerThe local player object
get_players()tableAll enemy players
clock()doubleHigh-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)intConvert slot enum to configured VK
is_shutting_down()boolCheck if application is closing
print(msg)-Log message to script console
aim_at_target(target, opts)boolAim 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/MethodTypeDescription
x, yfloatComponents
empty()boolCheck if zero
length()floatMagnitude
length_sqr()floatSquared magnitude
distance(other)floatDistance to another vec2
normalized()vec2Unit vector

Supports +, -, *, / operators with both vec2 and float operands.

vec3

Field/MethodTypeDescription
x, y, zfloatComponents
empty()boolCheck if zero
length()floatMagnitude
length_sqr()floatSquared magnitude
length_2d()floatXY magnitude
distance(other)floatDistance to another vec3
normalized()vec3Unit vector

Supports +, -, *, / operators with both vec3 and float operands.