homunculus

Quick Start

Getting started with Homunculus

This library is a work in progress!

It is not intended for use yet, large changes are due to happen. This library is primarily intended for chat functionality in Second Life. Other features may not work as intended or may be incomplete. Use at your own risk.

Introduction

Homunculus is a minimal set of Node.js packages that allows basic interactions with the virtual world Second Life, utilizing the official Second Life UDP protocol.

Homunculus is not affiliated with or sponsored by Linden Research, Linden Lab or Second Life.

Installation

From a new empty project folder
npm init -y
npm install @gwigz/homunculus-core
npm install --save-dev @types/node
bun init -y
bun add @gwigz/homunculus-core
bun add --dev @types/node

Authentication

It's recommended that you create an .env file in the root of your project, see the example file.

Basic Usage

This is a simple example of how to connect to Second Life and listen for nearby chat messages.

If you're planning on primarily adding chat commands or LSL/SLua bindings, consider using the @gwigz/homunculus-bot package for a more "abstracted" experience.

index.ts
import { ,  } from "@gwigz/homunculus-core"

const  = new ()

..("chat", () => {
  if (
    . === .. &&
    . === ..
  ) {
    if (..("ping")) {
      ..("pong")
    }

    .()
  }
})

// by default, we connect using the SL_USERNAME, SL_PASSWORD, and SL_START
// environment variables -- alternatively, you can just pass those values in
.()

To run the script, you can use the following command:

npx dotenv-cli npx tsx index.ts
bun run index.ts

That's it!

Resources