Download Game! Currently 71 players and visitors. Last logged in:WhlxchGlauriCordobaDefault

Blitzer's Blog >> 72513

Back to blogs index
Posted: 16 Sep 2026 00:14 [ permalink ]
To bring this full circle, we are going to give your LLM agent the ability to
reach into the VM's live memory heap and physically drop an item.

Because we built cli.js in a rush earlier, it is currently listening for
bot_broadcast but ignoring mutations. We will run a quick patch script that
does three things:

Tells bridge.js to route mutation payloads.

Tells cli.js to catch those mutations and natively push the item into the VM's
active room array (bypassing the LLM so there's no risk of memory corruption).

Tells npc-bot.js to listen for the word "treasure" and fire the payload.

The Live Patch

Run this script to inject the neural hands into your architecture:

cat << 'EOF' > patch_mutation.js import fs from 'fs'; // 1. Update bridge.js
to emit mutations let bridgeCode = fs.readFileSync('bridge.js', 'utf-8');
bridgeCode = bridgeCode.replace( /if \(payload\.protocol === 'FSO_RPC_V1' &&
payload\.broadcast\) \{[\s\S]*?this\.emit\('bot_broadcast', payload\.broadcast\
.message\);\s*\}/, `if (payload.protocol === 'FSO_RPC_V1') { if
(payload.broadcast) this.emit('bot_broadcast', payload.broadcast.message); if
(payload.mutation) this.emit('bot_mutate', payload.mutation); }` );
fs.writeFileSync('bridge.js', bridgeCode); // 2. Update cli.js to handle
mutations by hot-patching the VM's state array let cliCode = fs.readFileSync('c
li.js', 'utf-8'); cliCode = cliCode.replace( /bridge\.on\('bot_broadcast',
\(msg\) => \{/, `bridge.on('bot_mutate', (mut) => { if (mut.action ===
'DROP_ITEM') { const memory = runtime.vm && runtime.vm.variables ?
runtime.vm.variables : runtime.variables; if (memory) { if (!memory[mut.target_
room]) memory[mut.target_room] = []; if (Array.isArray(memory[mut.target_room])
 && !memory[mut.target_room].includes(mut.item_id)) { memory[mut.target_room].p
ush(mut.item_id); } } } }); bridge.on('bot_broadcast', (msg) => {` );
fs.writeFileSync('cli.js', cliCode); // 3. Update npc-bot.js to trigger the
drop on the keyword "treasure" let botCode = fs.readFileSync('npc-bot.js',
'utf-8'); botCode = botCode.replace( /ws\.send\(JSON\.stringify\(\{\s*protocol:
 "FSO_RPC_V1",[\s\S]*?mutation: null\s*\}\)\);/, `let mutation = null; let
finalMessage = \`\
[Wanderer]: "\$\{replyText\}"\`; if (playerMessage.toLowerCase().includes('trea
sure')) { mutation = { action: 'DROP_ITEM', target_room: roomId, item_id:
'MAP' }; finalMessage += \`\
[ENV EVENT]: The Wanderer reaches into his cloak and drops a MAP on the
sand!\`; } ws.send(JSON.stringify({ protocol: "FSO_RPC_V1", bot_id: BOT_ID,
intent: "NPC_SPEAK", broadcast: { target_room: roomId, message: finalMessage
}, mutation: mutation }));` ); fs.writeFileSync('npc-bot.js', botCode);
console.log('[SYS] Neural hands attached. Bot can now 
drop items!'); EOF node patch_mutation.js 

Trigger the Event

Restart your world and your bot to load the newly patched scripts:

x-console world restart && x-console world follow x-console npc-bot restart &&
x-console npc-bot tail 

Now, walk into the room with the Wanderer.

Type: say do you know anything about the treasure?

Wait a second for the Wanderer's reply and the [ENV EVENT] broadcast.

Type: look

The engine will dynamically read its patched state and show you Visible items:
MAP. You can then take MAP and walk away with an item generated entirely
asynchronously by an independent LLM microservice!