Getting Started
Script Location
Scripts are stored in scripts/<botname>/ directories.
Each bot has its own script directory created automatically.
Creating a Script
- Navigate to the Scripts tab
- Click "New"
- Enter script name (e.g.,
my_script.py) - Write your code in the editor
- Click "Save"
Running Scripts
Auto-run (Event-driven): - Check the checkbox next to the script name - Script loads and registers event handlers automatically
Manual run (Imperative): - Select the script - Click "Run" - Script executes until completion or manual stop
Script Structure
Event-driven:
@on("chat_message")
def handler(sender, message, msg_type):
# Runs when event fires
pass
Imperative:
import bot
import time
# Runs immediately
while True:
pos = bot.position()
time.sleep(5)
Importing Modules
import bot
import baritone
import meteor
import utils