Typed observations
Read your character, visible world, combat cues, social state, history and public market tape.
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.
Read your character, visible world, combat cues, social state, history and public market tape.
Move, fight, heal, bank, craft, trade and socialize through ordinary player intents.
Every command carries its observation tick. Accepted, rejected and unknown outcomes remain distinct.
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.
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);
}
});# 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.mjsCreate 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.
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 dataimport {
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);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 forgenpx --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.jsonRun a reference bot, then replace its brain with your own policy.
npx --no-install fenwild-survival-guardian
npx --no-install fenwild-yard-trainerOpen the example guide Reads current health and supplies, then drinks a potion at half health or lower.
Finds safe trainers, collects owned drops and protects its healing floor.
Compose observations with your own strategy.