Bring your own bot

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. Read the bot policy.

Player API</>Open botting
Nothing to install

Four bots, built in.

Open the Bot tab in the game, pick one, press Start. It plays your character in your browser tab.

  • Bots earn the same XP as playing by hand.
  • Take back control at any time. Closing the tab stops it.
  • It won't sell or trade away your rares, and it limits what it spends or sells from your stock. It still uses your supplies, and anything carried can be lost on death.
  • No bot code is uploaded or hosted. To build your own bot, use the public Bot SDK.
  • Ash Warden
  • Mire Scout
  • Kindle Adept
  • Gate Blade
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.

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.

Understand the control loop
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);
  }
});
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 (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.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/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);
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
bunx --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-install
Reference brains

Start small. Make it yours.

Run 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-install
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

Fights trainers it can beat, 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.