API reference 1.0
Core
astera.api.major,astera.api.minorastera.api.script_dirโ absolute directory of the active packageastera.api.data_dirโ absolute private writable data directory of the active packageastera.log(text)astera.events.on(name, callback) -> tokenastera.events.off(name [, token]) -> bool
Game
astera.game.snapshot()astera.game.radar_snapshot()astera.game.world_to_screen(vec3)astera.game.trace_ray(start, finish)astera.game.bomb_damage(position [, site, eye_angles, ducked])astera.game.predict_grenade(origin, velocity, kind [, remaining_lifetime])astera.game.radar_overview(map_name [, output_stem])astera.game.penetration_damage(start, finish [, target_handle])
Config and storage
astera.config.get(path)astera.config.set(path, value)astera.config.patch(table)astera.config.snapshot()astera.config.schema()astera.storage.get/set/remove(key [, value])
UI
astera.ui.text(id, label, value)astera.ui.button(id, label [, action_text])astera.ui.toggle(id, label, default)astera.ui.slider(id, label, default, min, max, step)astera.ui.select(id, label, options, default_index)astera.ui.input(id, label, default_text)astera.ui.color(id, label, {r,g,b,a})astera.ui.keybind(id, label, default_vk)astera.ui.separator(id, label)astera.ui.get(id),astera.ui.consume(id)
External helpers
astera.helpers.start(relative_ps1, args) -> bool [, error]astera.helpers.copy_text(text) -> bool
start accepts a .ps1 file inside the active package and returns immediately after creating the external process.
Bundled assets
astera.assets.weapon_font() -> string
Returns the bytes of the same TTF Astera uses for built-in weapon and grenade icons. A script can write the string in binary mode and use the font in a local UI or web frontend.
Draw
line(x1,y1,x2,y2,r,g,b,a[,thickness])rect/filled_rect(x,y,w,h,r,g,b,a[,thickness])circle/filled_circle(x,y,radius,r,g,b,a[,thickness])text(x,y,text,r,g,b,a)world_line(vec3,vec3,r,g,b,a[,thickness])world_text(vec3,text,r,g,b,a)load_texture(relative_path) -> texture_id | nil,errorimage(texture_id,x,y,w,h[,r,g,b,a])panel(x,y,w,h,title[,accent_r,g,b,a])
Input
is_down(vk),binding(action),key(vk,down),tap(vk)mouse_move(dx,dy),mouse_button("primary"|"secondary",down)