BattleScript API Reference
Complete reference documentation for all BattleScript functions, methods, and APIs. Use the table of contents below to navigate to specific sections.
USEFUL INFO: BattleScript refers to the programming language used to write scripts for BattleCore devices. BattleCore is the hardware and firmware inside the laser tag devices.
WARNING: This documentation is a work in progress and is incomplete, inaccurate and under constant change. While much of the BattleScript Core Language (BCL) is finalised, many parts of the BattleCore Standard Library (BSL) that BattleScript code interacts with are still undergoing heavy development.
In particular, Device APIs and Utility Functions are still undergoing heavy change and improvement. This documentation will be updated as the APIs are finalized. For updates on development or to follow discussions, please join our Facebook group.
Table of Contents
Core Language (BCL)
The BattleScript language syntax and keywords
BattleCore Standard Library (BSL)
Control interface to BattleCore hardware and game state
Utility Functions
Helper functionality exposed as standard in BattleScript
BattleScript.io HTTP REST API
Programmatically create, read and update files on the BattleScript.io code sharing platform
Getting Started with the API
The BattleScript API is divided into several categories:
- Core Language (BCL) - Fundamental language features like variables, functions, and events. The core language is the same across all BattleScript platforms and encompasses the syntax, semantics, and keywords of the language.
- BattleCore Standard Library (BSL) - Functions for controlling hardware and game mechanics on BattleCore devices. These interfaces are not part of the core language and are exposed as part of the BattleCore firmware running on your device.
- Utility Functions - Helper functions for common tasks
- BattleScript.io API - HTTP endpoints for interacting with the BattleScript.io code sharing platform
Each API function is documented with its syntax, parameters, return values, and usage examples. Click on any section in the table of contents to explore the specific APIs.
API Conventions
BattleScript APIs follow these conventions:
- Function names use camelCase (e.g.,
std::console.log()) - Constants use UPPER_SNAKE_CASE (e.g.,
MAX_PLAYERS) - Events are referenced as strings (e.g.,
"irReceiver.decodedData") - States are defined using the
statekeyword followed by a string name - Interfaces are defined using the
interfacekeyword