APIs

=Built-In= - Every script must contain a top-level update function. This function will be called each time your bot gets a turn.

- An optional function that can be defined at the top-level and will run once at the beginning of each phase.

General
- Returns if the bot can sense the passed entity.

- Checks that the passed variable exists and is defined.

- Filters an array of entities by either distance or life.

- Returns the enemy bot with the lowest distance.

- Returns all entities fitting the specified criteria.

- Returns all entities fitting the specified criteria.

- Returns the entity fitting the specified criteria.

- Returns the manhattan to a tile or an entity that the bot can sense.

- Returns the entity at the specified tile if the bot can sense it.

- Returns the life of the entity at the specified tile if the bot can sense it.

- Returns the x coordinate of the entity at the specified tile if the bot can sense it.

- Returns the y coordinate of the entity at the specified tile if the bot can sense it.

- Returns the total missing health of a group of entities.

Movement
- Returns whether the bot can move in the specified or any direction.

- Returns whether the bot can sense a path to the specified location or entity.

- Attempts to move the bot in a specified or random direction.

- Attempts to move the bot to a specified tile or entity.

- alias of.

Sensors
- Attempts to activate the bot's sensors.

- Checks if the bot currently has its sensors activated.

- Checks if the bot can activate its sensors.

Utility / Math
- Returns the absolute value of number.

- Returns true number% of the time.

- Returns a number between inclusiveMin and exclusiveMax

- Returns the value closest to the number that is restricted between the lower and upper bounds

- Returns the number of entries of an array or the number of characters in a string.

- Returns the largest integer less than or equal to the number.

- Returns the smallest integer greater than ot equal to the number.

- Returns the value of the number rounded to the nearest integer.

- Returns the smallest of multiple values.

- Returns the largest of multiple values.

=Weapon Hardware=

Melee
- Returns true if the bot's Melee charge cooldown is ready.

- Attempts to melee an enemy or the passed entity.

- Returns true if there is an enemy within melee range or if the passed entity is within melee range.

Missiles
- Attempts to fire missiles at a target within range or at the specified entity.

- Returns true if the specified entity is within range of the equipped missiles.

Lasers
- Returns true if the specified target is within range of the equipped lasers.

- Attempts to fire the equipped lasers at the specified entity or fires in the specified direction.

Artillery
- Returns true if the specified entity is within range of the equipped artillery.

- Attempts to fire the equipped artillery at the specified entity.

Zapper
- Returns true if the equipped Zapper's cooldown is ready

- Returns true if the bot currently has Zapper activated.

- Attempts to activate the equipped Zapper.

Landmines
- Returns true if there is not a Mine already placed in the occupied tile.

- Attempts to place a Mine in the occupied tile.

=Support Hardware=

Shield
- Returns true if the equipped Shield hardware's cooldown is ready and the specified entity is within range.

- Attempts to use the equipped Shield hardware on the specified entity.

- Returns true if the specified entity is currently shielded.

Reflect
- Returns true if the equipped Reflect hardware's cooldown is ready.

- Returns true if the bot currently has Reflect active.

- Attempts to activate the equipped Reflect hardware.

Repair
- Returns true if the bot is within range of the specified entity and the specified entity is damaged.

- Attempts to use the equipped Repair hardware on the specified entity.

EMP
- Returns true if the equipped EMP hardware's cooldown is ready.

- Attempts to use the equipped EMP hardware to disable the specified equipment type.

Teleport
- Returns true if the equipped Teleport's cooldown is ready and the bot can both sense the specified entity or tile and the destination is within range.

- Attempts to teleport to the specified tile or adjacent to the specified entity within range.