Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions bots/java/TestEchoTwo/TestEchoTwo.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@echo off
setlocal
set BOT_API_VERSION=1.3.1
if "%RUMBLE_JAVA_CACHE%"=="" set "RUMBLE_JAVA_CACHE=%TEMP%\rumble-bots-java"
if not exist "%RUMBLE_JAVA_CACHE%" mkdir "%RUMBLE_JAVA_CACHE%"
set "JAR=%RUMBLE_JAVA_CACHE%\robocode-tankroyale-bot-api-%BOT_API_VERSION%.jar"
if not exist "%JAR%" (
curl -fsSL -o "%JAR%.tmp" "https://repo.maven.apache.org/maven2/dev/robocode/tankroyale/robocode-tankroyale-bot-api/%BOT_API_VERSION%/robocode-tankroyale-bot-api-%BOT_API_VERSION%.jar"
if errorlevel 1 exit /b 1
move /y "%JAR%.tmp" "%JAR%" >nul
)
java -cp "%JAR%" "%~dp0src\TestEchoTwo.java" %*
exit /b %errorlevel%
10 changes: 10 additions & 0 deletions bots/java/TestEchoTwo/TestEchoTwo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "TestEchoTwo",
"version": "1.0.0",
"authors": ["Flemming N. Larsen"],
"description": "Test submission that turns its gun and fires at scanned opponents. Used to check the test Rumble end to end.",
"platform": "JVM",
"programmingLang": "Java 25",
"gameTypes": ["1v1", "melee", "twinduel"],
"license": "Apache-2.0"
}
12 changes: 12 additions & 0 deletions bots/java/TestEchoTwo/TestEchoTwo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env sh
set -eu
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
BOT_API_VERSION=1.3.1
CACHE_DIR="${RUMBLE_JAVA_CACHE:-${TMPDIR:-/tmp}/rumble-bots-java}"
JAR="$CACHE_DIR/robocode-tankroyale-bot-api-$BOT_API_VERSION.jar"
if [ ! -f "$JAR" ]; then
mkdir -p "$CACHE_DIR"
curl -fsSL -o "$JAR.$$.tmp" "https://repo.maven.apache.org/maven2/dev/robocode/tankroyale/robocode-tankroyale-bot-api/$BOT_API_VERSION/robocode-tankroyale-bot-api-$BOT_API_VERSION.jar"
mv "$JAR.$$.tmp" "$JAR"
fi
exec java -cp "$JAR" "$SCRIPT_DIR/src/TestEchoTwo.java" "$@"
24 changes: 24 additions & 0 deletions bots/java/TestEchoTwo/src/TestEchoTwo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import dev.robocode.tankroyale.botapi.Bot;
import dev.robocode.tankroyale.botapi.events.ScannedBotEvent;

public class TestEchoTwo extends Bot {
public static void main(final String[] args) {
if ("1".equals(System.getenv("RUMBLE_SMOKE"))) {
System.out.println("RUMBLE_SMOKE_READY TestEchoTwo");
return;
}
new TestEchoTwo().start();
}

@Override
public void run() {
while (isRunning()) {
turnGunRight(10);
}
}

@Override
public void onScannedBot(final ScannedBotEvent event) {
fire(1);
}
}
Loading