Skip to main content

Overview

Lich acts as a proxy between your front-end client and the game server. It sits in the middle of the connection, intercepting and modifying game data streams in both directions. This architecture allows scripts to interact with game data, modify output, and inject commands.

Supported Front-ends

Lich supports multiple front-end clients, each with different capabilities:

Modern Front-ends (XML-based)

Capabilities: XML, Streams, Mono, Room WindowWrayth is the default front-end identity for Lich. It supports full XML parsing, multiple data streams, and monospace formatting.
# Wrayth is the default, no flag needed
lich
Capabilities: XML, Streams, Mono, Room WindowSimutronics’ official XML-based client for Windows.
lich --stormfront
lich -s
Capabilities: XML, StreamsTerminal-based front-end for Linux/macOS. Works via detachable client mode.
lich --without-frontend --detachable-client=8000
# Then connect Profanity to localhost:8000
Capabilities: XML, MonoXML-based client primarily for DragonRealms.
lich --dragonrealms --genie
Capabilities: XMLModern XML-based client.
lich --frostbite

Legacy Front-ends (GSL-based)

Capabilities: GSL (Game Scripting Language)Simutronics’ original front-end using GSL formatting.
lich --wizard
lich -w
Capabilities: GSLAlternative GSL-based front-end.
lich --avalon

Front-end Capabilities

Capability Matrix

Front-endXMLStreamsMonoRoom WindowGSL
Wrayth
StormFront
Profanity
Genie
Frostbite
Wizard
Avalon

Capability Definitions

XML

Supports XML tags for structured game data parsing

Streams

Multiple data streams (experience, thoughts, conversations, etc.)

Mono

Monospace text formatting support

Room Window

Separate room description window

GSL

Game Scripting Language support

Front-end Detection

Lich automatically detects and configures front-end capabilities:
lib/common/front-end.rb
module Lich
  module Common
    module Frontend
      # Check if front-end supports XML
      Frontend.supports_xml?        # => true/false
      
      # Check if front-end supports streams
      Frontend.supports_streams?    # => true/false
      
      # Check if front-end supports mono
      Frontend.supports_mono?       # => true/false
      
      # Check if front-end supports room window
      Frontend.supports_room_window? # => true/false
      
      # Get current front-end name
      Frontend.client               # => "stormfront", "wizard", etc.
    end
  end
end

How the Proxy Works

Connection Flow

  1. Front-end connects to Lich (typically on localhost)
  2. Lich authenticates with the game server using your credentials
  3. Lich establishes the game connection
  4. Data flows bidirectionally through Lich:
    • Downstream: Game → Lich → Scripts → Front-end
    • Upstream: Front-end → Lich → Scripts → Game

Client String Negotiation

When connecting, Lich identifies itself to the game server:
lib/common/front-end.rb
# Default client string (Wrayth identity)
CLIENT_STRING = "/FE:WRAYTH /VERSION:1.0.1.28 /P:WIN_UNKNOWN /XML"
This tells the game server:
  • Front-end type: WRAYTH
  • Version: 1.0.1.28
  • Platform: WIN_UNKNOWN
  • Protocol: XML

Session Files

Lich creates session files for detachable clients:
lib/common/front-end.rb
# Creates session descriptor at /tmp/simutronics/sessions/
Frontend.create_session_file(
  name: "CharacterName",
  host: "127.0.0.1", 
  port: 8000
)
This allows clients like Profanity to discover and connect to Lich.

Front-end PID Tracking

Lich tracks the front-end process for features like window refocusing:
lib/common/front-end.rb
# Initialize from parent process (for Warlock)
Frontend.init_from_parent(parent_pid)

# Set from detachable client (for Profanity)
Frontend.set_from_client(pid)

# Get current front-end PID
Frontend.pid  # => 12345

# Refocus front-end window
Frontend.refocus
This works across platforms:
  • Windows: Uses Win32 API via FFI
  • macOS: Uses AppleScript via osascript
  • Linux: Uses xdotool for window management

Detachable Client Mode

Run Lich as a server that clients can connect to:
# Start Lich on port 8000
lich --without-frontend --detachable-client=8000 --login=MyCharacter

# Or specify host and port
lich --without-frontend --detachable-client=127.0.0.1:8000
Then connect your client (e.g., Profanity) to localhost:8000.
Detachable client mode is ideal for:
  • Running Lich on a server
  • Using terminal-based clients
  • Connecting multiple clients to one Lich instance

Headless Mode

Run Lich without any front-end or GUI:
lich --no-gui --without-frontend --start-scripts=autohunt,upkeep
This is useful for:
  • Automated botting on servers
  • Background script execution
  • CI/CD testing environments

Registering Custom Front-ends

Advanced users can register custom front-ends:
module Lich
  module Common
    module Frontend
      # Register a custom front-end
      register(
        :myclient,
        capabilities: [:xml, :streams, :mono],
        metadata: { client_string: "/FE:MYCLIENT /VERSION:1.0.0 /XML" }
      )
    end
  end
end
Custom front-end registration requires modifying Lich source code or loading it via a startup script.

Front-end Handshake

For Wizard/Avalon/Frostbite, Lich sends a handshake sequence:
lib/common/front-end.rb
Frontend.send_handshake(version_string)
# Sends:
# 1. Version string
# 2. Command prefix (2x)
# 3. Setup commands:
#    - _injury 2
#    - _flag Display Inventory Boxes 1
#    - _flag Display Dialog Boxes 0

Troubleshooting

Front-end Won’t Connect

1

Check Lich is running

Verify Lich started successfully and shows waiting for connection
2

Verify ports

Ensure your front-end is connecting to the correct port (usually 8000)
3

Check firewall

Make sure localhost connections aren’t blocked
4

Try different front-end

Test with a different front-end to isolate the issue

Stream Data Not Working

# Check if current front-end supports streams
if Frontend.supports_streams?
  # Stream features available
else
  # Fall back to non-stream behavior
end

XML Parsing Issues

# Verify XML support
if Frontend.supports_xml?
  # Can parse XML tags
else
  # Use GSL parsing instead
end

Configuration

Command-line options for front-ends

GTK Interface

Lich’s built-in GUI launcher

Scripts

Writing scripts that work with all front-ends

API Reference

Complete Frontend API documentation

Build docs developers (and LLMs) love