Skip to content

CasperTech/node-metaverse

Repository files navigation

node-metaverse

A node.js interface for Second Life.

npm version Build Status Known Vulnerabilities

Install

npm install --save @caspertech/node-metaverse

Usage

Javascript

const nmv = require('@caspertech/node-metaverse');

const loginParameters     = new nmv.LoginParameters();
loginParameters.firstName = 'firstName';
loginParameters.lastName  = 'lastName';
loginParameters.password  = 'password';
loginParameters.start     = "last";

const options = nmv.BotOptionFlags.LiteObjectStore | nmv.BotOptionFlags.StoreMyAttachmentsOnly;
const bot     = new nmv.Bot(loginParameters, options);

bot.login().then((response) =>
{
    console.log("Login complete");

    //Establish circuit with region
    return bot.connectToSim();
}).then(() =>
{
    console.log("Connected");
}).catch((error) =>
{
    console.error(error);
});

Typescript

import { Bot, BotOptionFlags, LoginParameters } from '@caspertech/node-metaverse';

const loginParameters = new LoginParameters();
loginParameters.firstName = 'firstName';
loginParameters.lastName = 'lastName';
loginParameters.password = 'password';
loginParameters.start = 'last';

const options = BotOptionFlags.LiteObjectStore | BotOptionFlags.StoreMyAttachmentsOnly;
const bot = new Bot(loginParameters, options);

bot.login().then((response) =>
{
    console.log("Login complete");

    //Establish circuit with region
    return bot.connectToSim();
}).then(() =>
{
    console.log("Connected");
}).catch((error) =>
{
    console.error(error);
});

License

MIT