Lich Proxy Connection
Connect Two-Face through Lich for full script support and the Lich ecosystem.
Overview
Lich is a middleware application that sits between your client and the game server. It provides:
- Script execution (Ruby-based automation)
- Plugin support
- Community scripts repository
- Character management
Two-Face connects to Lich’s local proxy port, receiving game data and sending commands through Lich.
Prerequisites
- Lich installed and configured
- Ruby (required by Lich)
- Game account and subscription
Installing Lich
Download Lich
Visit the Lich Project website or community resources to download Lich.
Install Ruby
Lich requires Ruby. Install the appropriate version for your platform:
Windows:
- Download RubyInstaller from https://rubyinstaller.org/
- Install with DevKit option
macOS:
brew install ruby
Linux:
sudo apt install ruby ruby-dev
Configure Lich
- Run Lich setup wizard
- Enter your Simutronics credentials
- Select your character
- Configure proxy port (default: 8000)
Connecting Two-Face
Basic Connection
Once Lich is running and logged in:
two-face --host 127.0.0.1 --port 8000
Configuration File
Add to ~/.two-face/config.toml:
[connection]
mode = "lich"
host = "127.0.0.1"
port = 8000
auto_reconnect = true
reconnect_delay = 5
Command Line Options
two-face --host HOST --port PORT [OPTIONS]
Options:
--host HOST Lich proxy host (default: 127.0.0.1)
--port PORT Lich proxy port (default: 8000)
--no-reconnect Disable auto-reconnect
Connection Workflow
Step-by-Step
-
Start Lich
ruby lich.rb -
Log into character via Lich
- Use Lich’s login interface
- Select character
- Wait for game connection
-
Verify Lich is listening
- Lich should show proxy port status
- Default: listening on port 8000
-
Connect Two-Face
two-face --host 127.0.0.1 --port 8000 -
Verify connection
- Two-Face should display game output
- Commands typed in Two-Face should work in game
Diagram
┌──────────────────────────────────────────────────────────────┐
│ Your Computer │
│ │
│ ┌───────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Two-Face │◄───────▶│ Lich │◄───────▶│ Scripts │ │
│ └───────────┘ └──────────┘ └──────────┘ │
│ │ │ │
│ │ │ Port 8000 │
│ └─────────────────────┘ │
│ │ │
└─────────────────────────────┼───────────────────────────────┘
│
▼ Internet
┌──────────────────┐
│ Game Server │
└──────────────────┘
Multi-Character Setup
Different Ports per Character
If running multiple characters:
Lich configuration:
- Character 1: Port 8000
- Character 2: Port 8001
- Character 3: Port 8002
Two-Face instances:
# Terminal 1
two-face --port 8000
# Terminal 2
two-face --port 8001
# Terminal 3
two-face --port 8002
Profile-Based Configuration
Create character profiles in ~/.two-face/profiles/:
# ~/.two-face/profiles/warrior.toml
[connection]
port = 8000
# ~/.two-face/profiles/wizard.toml
[connection]
port = 8001
Launch with profile:
two-face --profile warrior
two-face --profile wizard
Lich Script Integration
Running Scripts
Lich scripts are controlled through Lich, not Two-Face. Common commands:
;script_name # Run a script
;kill script_name # Stop a script
;pause script_name # Pause a script
;unpause script_name # Resume a script
;list # List running scripts
These commands are sent to Lich, which executes them.
Script Output
Script output appears in Two-Face’s main text window alongside game output. You can filter script messages using stream filtering if Lich tags them appropriately.
Script Commands vs Game Commands
| Prefix | Destination | Example |
|---|---|---|
; | Lich (scripts) | ;go2 bank |
. | Two-Face (client) | .reload config |
| (none) | Game server | north |
Lich Settings
Proxy Configuration
In Lich’s configuration:
# Listen on all interfaces (for remote access)
proxy_host = "0.0.0.0"
proxy_port = 8000
# Listen on localhost only (more secure)
proxy_host = "127.0.0.1"
proxy_port = 8000
XML Mode
Ensure Lich is configured to pass through game XML:
xml_passthrough = true
Two-Face requires XML tags to properly parse game state.
Performance Considerations
Latency
Lich adds minimal latency (typically <10ms) due to local proxy processing.
Memory
Running Lich + Ruby + scripts uses additional memory. Typical usage:
- Lich base: ~50-100MB
- Per character: +20-50MB
- Scripts: Varies by script
CPU
Script execution uses CPU. Complex scripts may impact performance during heavy automation.
Troubleshooting
Connection Refused
Error: Connection refused to 127.0.0.1:8000
Solutions:
- Verify Lich is running
- Check Lich has logged into a character
- Confirm proxy port matches (check Lich status)
- Try a different port if 8000 is in use
Lich Not Receiving Commands
Solutions:
- Check Two-Face is connected (look for game output)
- Verify commands aren’t being intercepted
- Check for Lich script conflicts
XML Not Parsing
If widgets aren’t updating:
Solutions:
- Enable XML passthrough in Lich
- Check Lich version supports XML
- Verify game has XML mode enabled
Disconnects
If connection drops frequently:
Solutions:
- Check network stability
- Enable auto-reconnect:
[connection] auto_reconnect = true reconnect_delay = 5 - Check Lich logs for errors
Port Already in Use
Error: Port 8000 already in use
Solutions:
- Close other applications using the port
- Change Lich’s proxy port
- Find the process using the port:
# Linux/macOS lsof -i :8000 # Windows netstat -ano | findstr :8000
Advanced Configuration
Remote Lich Access
To connect from a different machine (advanced):
-
Configure Lich to listen on network:
proxy_host = "0.0.0.0" -
Connect from Two-Face:
two-face --host 192.168.1.100 --port 8000 -
Security warning: Only do this on trusted networks!
SSH Tunneling
For secure remote access:
# On remote machine
ssh -L 8000:localhost:8000 user@lich-server
# Then connect Two-Face locally
two-face --host 127.0.0.1 --port 8000
See Also
- Direct eAccess - Alternative without Lich
- Troubleshooting - More connection issues
- Configuration - Full config reference