@caspertech/node-metaverse
v0.7.39
Published
A node.js interface for Second Life.
Downloads
168
Readme
node-metaverse
A node.js interface for Second Life.
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);
});