A Mudlet combat automation script for Achaea, featuring auto-attack, butterfly catching, and rat farming capabilities.
Lua is required to build the project. On macOS, install it via Homebrew:
brew install luafalkor/
├── src/ # Source Lua files (edit these)
│ ├── log.lua # Logging utilities
│ ├── main.lua # Core utilities and startup
│ ├── player.lua # Combat and prompt handling
│ ├── runewarden.lua # Battlerage abilities
│ ├── butterflies.lua # Butterfly catching
│ └── rats.lua # Rat farming
├── build/ # Build output (generated, don't edit)
├── .vscode/ # VSCode configuration
│ └── tasks.json # Build task configuration
├── build.lua # Build script
└── README.md # This file
To build the project, you can use either method:
lua build.luaPress Cmd+Shift+B (or Ctrl+Shift+B on Windows/Linux) to run the "🐉 Build Falkor" task.
Building creates a new Mudlet XML package file.
- Build the project.
- Open Mudlet
- Open the Module Manager () (Toolbox > Module Manager)
- Press the Install button, navigating to the XML file to complete the installation.
att <target>- Begin auto-attacking a targetstop- Stop auto-attacking
autocollide- Toggle auto-Collide (14 rage, 16s cooldown)autobulwark- Toggle auto-Bulwark (28 rage, 45s cooldown)collide [target]- Manually use Collidebulwark- Manually use Bulwarkrage- Show current rage and ability status
butterflies- Toggle butterfly catchingbutterflies-start- Walk to Vellis and set up butterfly catchingsellbutterflies- Walk to Vellis and sell butterfliessellrats- Walk to Hakhim and sell rats
fquery <question>- Query the local knowledge base (requires Ollama)- Example:
fquery What are the tenets of Targossas? - Example:
fquery Explain devotion
- Example:
fpray <prompt>- Compose a prayer in the style of the Breviary of Targossas- Example:
fpray Compose a prayer for victory in battle - Example:
fpray Write a prayer of thanks for the Bloodsworn
- Example:
falkor- Reinstall Falkor module (automatically cleans up and shows what was removed)fregistry- Show registry statistics (triggers, aliases, timers)ftriggers- List all registered triggersfaliases- List all registered aliasesftimers- List all active timersfconfig- Show or set configuration values
Falkor includes a self-contained balance tracking and command queue system:
- Automatic balance/equilibrium detection from prompts
- Intelligent command queuing with priority support
- Balanceful function system for repeating combat actions
- No external dependencies required
- No command stacking or timing issues
The Runewarden module provides intelligent battlerage ability management:
- Auto-Collide: Automatically uses Collide when you have 14+ rage
- Auto-Bulwark: Automatically uses Bulwark when you have 28+ rage
- Tracks cooldowns (16s for Collide, 45s for Bulwark)
- Manual override commands available
- Real-time rage tracking from prompt
- Intelligent target tracking from game prompt
- Automatic attack queueing via built-in queue system
- Auto-disables on target death or error conditions
- Integrates with battlerage abilities
The code follows Lua best practices:
- Uses a namespace pattern (
Falkor = Falkor or {}) to avoid global pollution - Object-oriented style with
selffor method calls - Proper initialization and cleanup for reloading
- Modular structure ready for expansion
- Self-contained with no external dependencies
- Edit files in
src/directory - Build the project
- Issue the
falkorcommand in Mudlet to re-load the module.
Falkor includes a comprehensive cleanup system to prevent duplicate triggers, aliases, and event handlers when reloading:
Automatic Cleanup: The falkor command automatically cleans up all resources before reinstalling and shows you what was removed:
- All registered triggers and aliases
- All event handlers (GMCP listeners, etc.)
- All tracked timers
- Persistent actions and callbacks
- Combat state and hunting targets
Registry System: All triggers, aliases, and timers are tracked in a central registry:
- Use
fregistryto see counts of registered resources - Use
ftriggers,faliases, orftimersto list specific resources - The registry automatically prevents duplicates by cleaning up old instances before creating new ones
Best Practices:
- Always use
Falkor:registerTrigger()andFalkor:registerAlias()instead oftempTrigger()andtempAlias() - Use
Falkor:registerTimer()for timers that should be tracked and cleaned up - The
falkorcommand is now safe to use repeatedly without needing to reset the client
This project includes TypeScript tooling for document ingestion and querying with Pinecone.
- Install dependencies:
pnpm install - Copy
.env.exampleto.envand configure your Pinecone credentials - Install Ollama and pull the required models:
ollama pull nomic-embed-text(for embeddings)ollama pull llama3.2:3b(for responses)
- Place text files (
.txt,.md,.markdown) in thedocs/directory - Run ingestion:
pnpm ingest:docs
# Ingest all documents from the docs directory
pnpm ingest:docs
# Ingest a specific file
pnpm ingest path/to/file.txt# Query the knowledge base
pnpm query "What are the tenets of Targossas?"
# Query with a different model (default: qwen2.5:7b)
pnpm query "Explain the Bloodsworn" --model qwen2.5:7bThe query script will:
- Use the local Ollama model to determine which documents to fetch
- Retrieve relevant document content
- Generate a response based on the documents
# Compose a prayer in Breviary style
pnpm pray "Compose a prayer for courage in battle"
# Compose with a different model (default: qwen2.5:7b)
pnpm pray "Write a prayer of thanks" --model qwen2.5:7bThe prayer script will:
- Load the full text of the Breviary of Targossas
- Use it as a style reference for the LLM
- Generate a new prayer based on your prompt in the Breviary's style