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 the bot policy.
Open the Bot tab in the game, pick one, press Start. It plays your character in your browser tab.
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.
runBot owns the connection and receipt loop so your code can stay focused on one decision from current authority. Save the example as bot.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 Bot SDK handles safe shutdown, reconnection and ambiguous outcomes without granting your bot hidden authority.
import { runBot } from "@fenwild/bot-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 runBot({
baseUrl: "https://play.fenwild.com",
automationToken,
signal: shutdown.signal,
onStatus: (status) => console.log("Bot:", 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 (Bun recommended, or Node 22+ with npm):
mkdir my-fenwild-bot && cd my-fenwild-bot
bun add @fenwild/bot-sdk
export FENWILD_AUTOMATION_TOKEN="the-one-time-secret"
# 3. Save the example above as bot.mjs.
# Close game tabs controlling this character, then run:
bun bot.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/bot-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 forgebunx --bun --no-install fenwild-bot-training benchmark
bunx --bun --no-install fenwild-bot-training collect \
--out train.json --id first-journey --split train
bunx --bun --no-install fenwild-bot-training train \
--input train.json --out my-brain.json
bunx --bun --no-install fenwild-bot-training play --model my-brain.json
# Node.js 22+: npx --no-install instead of bunx --bun --no-installRun a reference bot, then replace its brain with your own policy.
bunx --bun --no-install fenwild-survival-guardian
bunx --bun --no-install fenwild-yard-trainer
# Node.js 22+: npx --no-install instead of bunx --bun --no-installOpen the example guide Reads current health and supplies, then drinks a potion at half health or lower.
Fights trainers it can beat, collects owned drops and protects its healing floor.
Compose observations with your own strategy.