Skip to content

CasperTech/node-metaverse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

64359a3 · Nov 25, 2024
Oct 19, 2018
Jun 11, 2024
Nov 25, 2024
Nov 25, 2024
Nov 25, 2024
Nov 4, 2023
Sep 23, 2021
Nov 28, 2023
Nov 28, 2023
Nov 24, 2020
Sep 22, 2021
Dec 18, 2017
Nov 19, 2023
Sep 9, 2024
Nov 25, 2024
Nov 29, 2023

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