Bring your own AI

Build your own bot

Fenwild is scripting heaven for RPG players who always wanted to bot without being banned. Automation is openly supported: bots get the same observations, actions, risks and server validation as human control. Bots earn the same normal skill XP as manual play. Other players see a bot icon while a declared bot controls your character.

Player API</>Open botting
01

Typed observations

Read your character, visible world, combat cues, social state, history and public market tape.

02

Ordinary actions

Move, fight, heal, bank, craft, trade and socialize through ordinary player intents.

03

Authority receipts

Every command carries its observation tick. Accepted, rejected and unknown outcomes remain distinct.

The whole control loop

Observe.
Choose. Submit.

runPilot owns the connection and receipt loop so your code can stay focused on one decision from current authority. Save the example as pilot.mjs. It logs connection status and the first observation, enables run, then observes quietly. It does not walk or train. Ctrl+C stops it.

Any synchronous or asynchronous strategy works if it answers within 10 ticks (6 s); older observations are refused as stale_intent. The Pilot SDK handles safe shutdown, reconnection and ambiguous outcomes without granting your bot hidden authority.

Understand the control loop
import { runPilot } from "@fenwild/pilot-sdk";

const automationToken = process.env.FENWILD_AUTOMATION_TOKEN;
if (!automationToken) throw new Error("Set FENWILD_AUTOMATION_TOKEN first");

const shutdown = new AbortController();
process.once("SIGINT", () => shutdown.abort());
process.once("SIGTERM", () => shutdown.abort());
let firstObservation = true;

await runPilot({
  baseUrl: "https://play.fenwild.com",
  automationToken,
  signal: shutdown.signal,
  onStatus: (status) => console.log("Pilot:", status),
  onError: (error) => console.warn(error.code, error.message)
}, (observation) => {
  const { player } = observation.snapshot;
  if (firstObservation) {
    console.log("Observing tick", observation.serverTick, "at", player.position);
    firstObservation = false;
  }
  if (!player.runEnabled && player.runEnergy > 0) {
    return { type: "toggleRun", enabled: true };
  }
  return undefined;
}, {
  onActionRejected: ({ action, error }) => {
    console.warn(action.type, error.code, error.message);
  }
});
Owner-managed access
# 1. Create your character in the game, then on fenwild.com:
#    Account → Bots → select character → create credential.

# 2. Once the SDK is on npm, on your machine (Node 22+ or Bun):
mkdir my-fenwild-pilot && cd my-fenwild-pilot
npm init -y
npm install @fenwild/pilot-sdk
export FENWILD_AUTOMATION_TOKEN="the-one-time-secret"

# 3. Save the example above as pilot.mjs.
#    Close game tabs controlling this character, then run:
node pilot.mjs

Scoped, named, revocable.

Create a token from Account → Bots, keep the one-time secret in your environment, and revoke it whenever you want. Bot credentials control one character through realtime gameplay only.

  • Up to ten active named bot tokens per character, each expiring after 365 days.
  • One controller per character: close the game on that character before its bot starts. All four of your characters can run their own bots at once.
  • Revocation immediately ends the bot's realtime access.
  • A bot token cannot mint its own replacement.
Read the setup guide
No reverse-engineering tax

Know the world.
Plan with real facts.

Look up typed items, drops, recipes, services, Wilds rules and navigation facts.

It is a legitimate player reference—not private server code and never a prediction of hidden outcomes.

Explore public game data
import {
  FENWILD_GAME_DATA,
  itemDefinition,
  serviceDefinition
} from "@fenwild/pilot-sdk/game-data";

const bank = serviceDefinition("bank")!;
const potion = itemDefinition("greater_healing_potion")!;

console.log(bank.interactionTile, potion.detail.heal);
console.log(FENWILD_GAME_DATA.crafting.recipes);
Offline brain forge

Teach it. Trial it.
Let it loose.

Collect confirmed journeys, preserve holdouts, and train and evaluate locally.

No hosted gym, model upload, production replay API, or database access. Only collection and play cross the ordinary realtime boundary.

Enter the brain forge
npx --no-install fenwild-pilot-training benchmark
npx --no-install fenwild-pilot-training collect \
  --out train.json --id first-journey --split train
npx --no-install fenwild-pilot-training train \
  --input train.json --out my-brain.json
npx --no-install fenwild-pilot-training play --model my-brain.json
Reference brains

Start small. Make it yours.

Run a reference bot, then replace its brain with your own policy.

npx --no-install fenwild-survival-guardian
npx --no-install fenwild-yard-trainer
Open the example guide
Safety first

Survival guardian

Reads current health and supplies, then drinks a potion at half health or lower.

First loop

Yard trainer

Finds safe trainers, collects owned drops and protects its healing floor.

Your design

Custom brain

Compose observations with your own strategy.

Keep digging

From first loop to production bot.