1.8 KiB
1.8 KiB
Bot Operations
This document describes current control flow and operational expectations.
Startup Sequence
- Load
.envand allow-list. - Create mineflayer bot instance.
- On
spawn, setjoinPosition. - Start security monitor interval.
- Arm security after delay (
SECURITY_ARM_DELAY_MS).
Spawner Loop
Loop starts via POST /api/spawner.
Per cycle:
- Locate/face nearby spawner block.
- Open spawner GUI.
- Move all bones from GUI to inventory.
- Close GUI.
- Run
/order ZareMate. - Open order GUI and click bone order item.
- Move inventory bones into delivery GUI.
- Confirm with lime/green glass pane.
- Wait
LOOP_DELAY_MS(default 60s).
Security Logic
Security checks run when securityArmed === true.
Triggers:
- Unauthorized player within
SECURITY_RADIUS. - Nearby block broken event within
SECURITY_RADIUS.
On trigger:
- Stop spawner loop.
- Try to break spawner until gone.
- Wait briefly for drops.
- Attempt to open nearby ender chest.
- Shift-move spawner items from inventory into chest.
- Send Discord alert with status.
- Quit bot.
Ender Chest Stash Notes
- Looks for
ender_chestblock within 6 blocks. - If no chest is found, routine logs and continues to quit.
- If no spawner items are present in inventory, stash routine is skipped.
Web API Contract
GET /api/logsreturns:{ logs: [{ time, message }, ...] }
POST /api/spawnerreturns:{ ok: true, running: true }on success
POST /api/stopreturns:{ ok: true, running: false }when stopped
Operational Tips
- Keep an accessible ender chest near the bot for emergency stash reliability.
- Keep
allowed_players.txtcurrent. - Enable
DEBUG_LOGS=1while diagnosing GUI slot behavior. - Confirm webhook mentions are configured as expected in your Discord channel.