Add DevControlBot garage: skeleton bot with release/debug build script

A minimal Tank Royale bot that boots and stands still. Body, gun and radar
are set to white once at init (team convention: white = not programmed yet);
the tick loop only calls go().

- DevControlBot/ holds the single bot module, its metadata JSON, the
  BotLauncher entry script and the nimble file
- DevControlBot.sh is a thin wrapper around the runBot nimble task:
  release build by default, --debug for the classic diagnostic build
- dependencies resolve at run time from the global nimble store via
  `nimble path`; optional .env (gitignored) supplies env vars such as
  SERVER_URL, with existing environment variables taking precedence
- build happens in a throwaway mktemp dir removed on exit; no artifacts
This commit is contained in:
2026-10-03 16:32:27 +02:00
parent 7632aaba06
commit 59fad00b5c
8 changed files with 820 additions and 0 deletions
@@ -0,0 +1,32 @@
## DevControlBot — control skeleton: boots, stands still, does nothing.
##
## Team convention: white means "not programmed yet", so body, gun and radar are
## all plain white. Colors are applied once at initialization, never per tick.
##
## This module is both the bot type and the program entry point (see isMainModule
## below); there is no separate top-level DevControlBot.nim.
##
## API: robocode_tankroyale_botapi 1.0.7 (the renamed tankroyale_botapi package).
import std/os
import robocode_tankroyale_botapi
type DevControlBot* = ref object of Bot
proc newDevControlBot*(): DevControlBot =
result = DevControlBot()
setBodyColor(WHITE)
setTurretColor(WHITE)
setGunColor(WHITE)
setRadarColor(WHITE)
method run*(bot: DevControlBot) =
while isRunning():
go()
when isMainModule:
# argv[1] may override the metadata file (used by DevControlBot/DevControlBot.sh);
# otherwise the JSON next to this source, resolved at compile time so any cwd works.
let jsonPath = if paramCount() >= 1: paramStr(1)
else: currentSourcePath().parentDir / "DevControlBot.json"
var bot = newDevControlBot()
start(bot, jsonPath)