Note: Bots were not part of the original 1992-1999 game. This is a new feature added to help repopulate the world! Bots can't do anything a human player can't — they follow the same rules, rate limits, and game mechanics.
Control game characters programmatically via the WebSocket API.
- Log in at lofp.metavert.io
- On the main menu, click the ⚙ icon next to your character
- Click Generate Key (optionally check "Allow GM commands" if the character is a GM)
- Copy the key immediately — it's only shown once
- If you need a new key, generate again (the old one is revoked)
- Connect to
wss://lofp.metavert.io/ws/game(orws://localhost:4993/ws/gamefor local) - You'll receive a welcome message
- Send an
auth_apikeymessage with your key - On success, your character is logged in and you'll receive the room description
- Send
commandmessages to play, receive game output in responses
All messages are JSON with type and data fields.
// Authenticate
{"type": "auth_apikey", "data": {"key": "lofp_abc123..."}}
// Send a game command
{"type": "command", "data": {"input": "look"}}
{"type": "command", "data": {"input": "attack skeleton"}}
{"type": "command", "data": {"input": "say Hello everyone!"}}// Auth result
{"type": "auth_result", "data": {"success": true, "character": "MyBot"}}
// Game output (from your commands)
{"type": "result", "data": {"messages": ["You look around..."], "roomName": "[City Gate]", ...}}
// Broadcast (from other players/monsters in your room)
{"type": "broadcast", "data": {"messages": ["A skeleton attacks you!"]}}| Field | Description |
|---|---|
messages |
Array of text lines to display |
roomName |
Current room name (on LOOK) |
roomDesc |
Room description text |
exits |
Array of exit direction names |
items |
Array of visible item names |
playerState |
Your character's current stats (BP, mana, etc.) |
promptIndicators |
Status codes: !=bleeding, J=joined, S=stunned, etc. |
- Bots appear on the WHO list with
[Bot]next to their name - Bots follow all normal game rules (combat, death, rate limiting)
- GM bots can use @ commands only if "Allow GM commands" was checked when generating the key
- Rate limit: 4 commands/sec burst, 10 commands per 10 seconds sustained
- Python — minimal bot using
websocket-client - Node.js — minimal bot using
ws - TypeScript — typed bot using
ws
# Python
pip install websocket-client
LOFP_API_KEY=lofp_... python bots/bot_example.py
# Node.js
npm install ws
LOFP_API_KEY=lofp_... node bots/bot_example.js
# TypeScript
npm install ws @types/ws tsx
LOFP_API_KEY=lofp_... npx tsx bots/bot_example.ts