If your language can generate a standalone binary for Linux, probably you can use it for Lux. This little guide details what I learned writing a Golang bot for the competition.
The first thing Lux will do when running your bot is run (or possibly import) main.py
, a Python script which will call your bot as a subprocess. This script will pass your stdout to Lux, and will pass the game state each turn to your bot.
Various main.py
scripts exist now in the official Lux kits. I recommend using the JavaScript kit's main.py
(yes, it's a Python script in the JavaScript kit). This version of main.py
has the useful property that it adjusts what Lux sends it slightly, producing a consistently-formatted input to your bot. All you have to do is edit it so that instead of running node
as its subprocess, it runs your bot instead.