From 2a47c91dbfdbe2eb2993a8225134fc93f1685865 Mon Sep 17 00:00:00 2001 From: Boris Date: Mon, 15 Jan 2024 09:30:27 +0000 Subject: [PATCH] clone from github --- BorisBotDiscordEdition/config.jsonexample | 20 + .../credentials.jsonexample | 5 + BorisBotDiscordEdition/data/chunkhistory.db | 0 BorisBotDiscordEdition/data/playerkills.db | 0 BorisBotDiscordEdition/data/players.db | 8 + BorisBotDiscordEdition/data/spawnables.db | 1 + BorisBotDiscordEdition/index.js | 180 ++ BorisBotDiscordEdition/indexcj.js | 248 +++ BorisBotDiscordEdition/package-lock.json | 839 ++++++++++ BorisBotDiscordEdition/src/discordcmds.js | 366 ++++ BorisBotDiscordEdition/src/managers.js | 148 ++ BorisBotDiscordEdition/src/player.js | 21 + BorisBotDiscordEdition/src/subscriptions.js | 124 ++ BorisBotV1/.gitignore | 67 + BorisBotV1/LICENSE | 674 ++++++++ BorisBotV1/README.md | 6 + BorisBotV1/config.jsonexample | 20 + BorisBotV1/credentials.jsonexample | 5 + BorisBotV1/data/chunkhistory.db | 0 BorisBotV1/data/playerkills.db | 0 BorisBotV1/data/players.db | 5 + BorisBotV1/data/spawnables.db | 1 + BorisBotV1/index.js | 546 ++++++ BorisBotV1/indexpoige.js | 1476 +++++++++++++++++ BorisBotV1/items.json | 1 + BorisBotV1/package-lock.json | 861 ++++++++++ BorisBotV1/package.json | 49 + BorisBotV1/src/discordcmds.js | 369 +++++ BorisBotV1/src/managers.js | 148 ++ BorisBotV1/src/player.js | 21 + BorisBotV1/src/subscriptions.js | 124 ++ Gulag/.gitignore | 67 + Gulag/index.js | 114 ++ Gulag/package-lock.json | 907 ++++++++++ Gulag/package.json | 22 + Gulag/src/player.js | 21 + Gulag/src/subscriptions.js | 117 ++ 37 files changed, 7581 insertions(+) create mode 100644 BorisBotDiscordEdition/config.jsonexample create mode 100644 BorisBotDiscordEdition/credentials.jsonexample create mode 100644 BorisBotDiscordEdition/data/chunkhistory.db create mode 100644 BorisBotDiscordEdition/data/playerkills.db create mode 100644 BorisBotDiscordEdition/data/players.db create mode 100644 BorisBotDiscordEdition/data/spawnables.db create mode 100644 BorisBotDiscordEdition/index.js create mode 100644 BorisBotDiscordEdition/indexcj.js create mode 100644 BorisBotDiscordEdition/package-lock.json create mode 100644 BorisBotDiscordEdition/src/discordcmds.js create mode 100644 BorisBotDiscordEdition/src/managers.js create mode 100644 BorisBotDiscordEdition/src/player.js create mode 100644 BorisBotDiscordEdition/src/subscriptions.js create mode 100644 BorisBotV1/.gitignore create mode 100644 BorisBotV1/LICENSE create mode 100644 BorisBotV1/README.md create mode 100644 BorisBotV1/config.jsonexample create mode 100644 BorisBotV1/credentials.jsonexample create mode 100644 BorisBotV1/data/chunkhistory.db create mode 100644 BorisBotV1/data/playerkills.db create mode 100644 BorisBotV1/data/players.db create mode 100644 BorisBotV1/data/spawnables.db create mode 100644 BorisBotV1/index.js create mode 100644 BorisBotV1/indexpoige.js create mode 100644 BorisBotV1/items.json create mode 100644 BorisBotV1/package-lock.json create mode 100644 BorisBotV1/package.json create mode 100644 BorisBotV1/src/discordcmds.js create mode 100644 BorisBotV1/src/managers.js create mode 100644 BorisBotV1/src/player.js create mode 100644 BorisBotV1/src/subscriptions.js create mode 100644 Gulag/.gitignore create mode 100644 Gulag/index.js create mode 100644 Gulag/package-lock.json create mode 100644 Gulag/package.json create mode 100644 Gulag/src/player.js create mode 100644 Gulag/src/subscriptions.js diff --git a/BorisBotDiscordEdition/config.jsonexample b/BorisBotDiscordEdition/config.jsonexample new file mode 100644 index 0000000..8979591 --- /dev/null +++ b/BorisBotDiscordEdition/config.jsonexample @@ -0,0 +1,20 @@ +{ + "discordPrefix" : "", + + "discordChannels" : + { + "PlayerJoined" : "", + "PlayerLeft" : "", + "PlayerKilled" : "", + "PublicPlayerKilled" : "", + "PlayerMovedChunk" : "", + "TradeDeckUsed" : "", + "CreatureKilled" : "" + }, + + "discordRoles" : + { + "admin" : [], + "spawn" : [] + } +} diff --git a/BorisBotDiscordEdition/credentials.jsonexample b/BorisBotDiscordEdition/credentials.jsonexample new file mode 100644 index 0000000..ee7cd53 --- /dev/null +++ b/BorisBotDiscordEdition/credentials.jsonexample @@ -0,0 +1,5 @@ +{ + "username": "", + "password": ""//, + //"botToken": "" +} \ No newline at end of file diff --git a/BorisBotDiscordEdition/data/chunkhistory.db b/BorisBotDiscordEdition/data/chunkhistory.db new file mode 100644 index 0000000..e69de29 diff --git a/BorisBotDiscordEdition/data/playerkills.db b/BorisBotDiscordEdition/data/playerkills.db new file mode 100644 index 0000000..e69de29 diff --git a/BorisBotDiscordEdition/data/players.db b/BorisBotDiscordEdition/data/players.db new file mode 100644 index 0000000..25e6713 --- /dev/null +++ b/BorisBotDiscordEdition/data/players.db @@ -0,0 +1,8 @@ +{"id":430480604,"username":"Guts","lastLogin":1585069824986,"_id":"DB5tkNBe6DhWPNRL"} +{"id":1833104236,"username":"Boris","lastLogin":1584647644426,"_id":"NB0BoE8nnIh7ToX5"} +{"id":971306613,"username":"poiuytrewq4645","lastLogin":1584282273535,"_id":"PI05jVvpOfvR5urh"} +{"id":833789224,"username":"mot40344","lastLogin":1585065470922,"_id":"TJoevTLA3FuCDErw"} +{"id":446362829,"username":"mr_blobbsen","lastLogin":1585066894604,"_id":"URneUJ5zw3P5k0Nk"} +{"id":670400968,"username":"Kinny","lastLogin":1584309293642,"_id":"h9SNzZCCqUm6L6j6"} +{"id":1179574189,"username":"Agidon","lastLogin":1584294727359,"_id":"vSM2TstpKQLyisNG"} +{"$$indexCreated":{"fieldName":"id","unique":"true","sparse":false}} diff --git a/BorisBotDiscordEdition/data/spawnables.db b/BorisBotDiscordEdition/data/spawnables.db new file mode 100644 index 0000000..5f23990 --- /dev/null +++ b/BorisBotDiscordEdition/data/spawnables.db @@ -0,0 +1 @@ +{"$$indexCreated":{"fieldName":"hash","unique":"true","sparse":false}} diff --git a/BorisBotDiscordEdition/index.js b/BorisBotDiscordEdition/index.js new file mode 100644 index 0000000..ed0870b --- /dev/null +++ b/BorisBotDiscordEdition/index.js @@ -0,0 +1,180 @@ +//Load required classes. +const { Servers } = require('alta-jsapi'); +const { WebsocketBot } = require('att-bot-core'); +const { BasicWrapper } = require('att-websockets'); +const Discord = require('discord.js'); +const moment = require('moment'); +const sha512 = require('crypto-js/sha512'); +const fs = require('fs'); +const alta_jsapi = require('alta-jsapi'); + +//Local classes +const Player = require('./src/player.js'); +const Subscriptions = require('./src/subscriptions.js'); +const commands = require('./src/discordcmds.js') +const managers = require('./src/managers.js'); + +//Load information from credentials and config +const { username, password, botToken } = require("./credentials"); +const { targetServers, showAllServers, blacklistServers, discordPrefix, discordChannels, discordRoles } = require("./config"); + +//readline stuffs +const readline = require('readline'); +const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout +}); + +//NeDB +var Datastore = require('nedb'); +var players = new Datastore({ filename : 'data/players.db', autoload: true }); +var kills = new Datastore({ filename : 'data/playerkills.db', autoload: true }); +var chunkHistory = new Datastore({ filename : 'data/chunkhistory.db', autoload: true }); +var spawnables = new Datastore({ filename : 'data/spawnables.db', autoload: true }); +players.ensureIndex({ fieldName: 'id', unique: 'true' }); +players.persistence.setAutocompactionInterval( 129600 ); +spawnables.ensureIndex({ fieldName: 'hash', unique: 'true' }); + +//Vars +var playername = username; +var botConnection; +var pendingCommandList = []; + +//Some utility helper functions and prototypes +function ts() +{ + return "["+ moment().format("h:mm:ss A") +"] " +} + +function strrep( str, n ) +{ + if ( n < 1 ) return ''; + var result = str; + while( n-- > 0 ) + { + result += str; + } + return result; +} + +// Database helpers +function insertHandler( err, doc ) +{ + if ( err ) { console.log( err ); } +} + +function updateHandler( err, rows ) +{ + if ( err ) { console.log( err ); } +} + +function convertPassToHash( username, password, botToken ) +{ + // The SHA512 hash generated by crypto-js/sha512 will be 128 characters + if ( password.length !== 128 ) + { + console.log( "Plaintext password encountered, converting to SHA512 hash for permanent storage" ); + newPass = alta_jsapi.Sessions.hashPassword(password) + newFile = { "username" : username, "password" : newPass, "botToken": botToken }; + fs.writeFile('./credentials.json', JSON.stringify( newFile, null, 4 ), function( err ) { + if ( err ) + { + console.log( err ); + } else { + console.log( "New credentials.json saved" ); + } + }); + password = newPass; + } + return password; +} +//Run the program +main(); + +async function main() +{ + console.log( ts() + "[BorisBot: Discord Edition] is Starting" ); + + // Convert the password to a hash if necessary + var mpassword = convertPassToHash( username, password, botToken ); + // Players in database + //players.find({}).exec( function( err, docs ) { console.log( docs ); }); + + //Connect to discord + const discord = new Discord.Client(); + await new Promise( resolve => + { + discord.on('ready', resolve); + discord.login(botToken); + }); + + //Discord command and message management (todo: move to own lib) + discord.on('message', message => + { + if ( message.content.length > 0 && message.content.startsWith( discordPrefix ) ) + { + var tmessage = message.content.substring(discordPrefix.length).trim(); + + var args = splitArgs( tmessage ); + + if ( args && args.length >= 1 ) + { + var command = args.shift(); + var commandFunction = commands[command]; + if (!!commandFunction) + { + commandFunction(message, args, tmessage); + } + } + } + }); + + //Alta Login + const bot = new WebsocketBot(); + //Use a hashed password, SHA512 + await bot.loginWithHash(username, mpassword); + //Run the bot. + //When any of the 'targetServers' are available, a connection is automatically created. + var subs = new Subscriptions( discordChannels, players, kills, chunkHistory ); + alta_jsapi.Sessions.loginWithUsername(username, mpassword); + await bot.run(test => targetServers.includes(test.id), async (server, connection) => + { + var wrapper = new BasicWrapper(connection); + + botConnection = + { + "connection" : connection, + "wrapper" : wrapper + } + + console.log( ts() +"loading inital players" ); + for ( var i in server.online_players ) + { + let oplayer = server.online_players[i]; + subs.PlayerJoined( discord, { "user": { "id": oplayer.id, "username": oplayer.username } }); + } + + // Subscriptions + await wrapper.subscribe("PlayerJoined", data => { subs.PlayerJoined( discord, data ) }); + await wrapper.subscribe("PlayerLeft", data => { subs.PlayerLeft( discord, data ); }); + await wrapper.subscribe("PlayerKilled", data => { subs.PlayerKilled( discord, data ); }); + await wrapper.subscribe("TradeDeckUsed", data => { subs.TradeDeckUsed( discord, data ); }); + await wrapper.subscribe("CreatureKilled", data => { subs.CreatureKilled( discord, data ); }); + await wrapper.subscribe("PlayerMovedChunk", data => { subs.PlayerMovedChunk( discord, data ); }); + await wrapper.subscribe("TraceLog", data => { + if ( pendingCommandList.length && data.logger === pendingCommandList[0].module ) + { + console.log( "the command is a module match" ) + // TODO: add a 'type' to pending commands to better match response items + let command = pendingCommandList.shift(); + if ( command ) + { + console.log( "executing handler" ) + command.handler( data.message ); + } + } + } + ); + } + ) + } \ No newline at end of file diff --git a/BorisBotDiscordEdition/indexcj.js b/BorisBotDiscordEdition/indexcj.js new file mode 100644 index 0000000..4fc29d0 --- /dev/null +++ b/BorisBotDiscordEdition/indexcj.js @@ -0,0 +1,248 @@ +//Load required classes. +const { Servers } = require('alta-jsapi'); +const { WebsocketBot } = require('att-bot-core'); +const { BasicWrapper } = require('att-websockets'); +const Discord = require('discord.js'); +const moment = require('moment'); +const sha512 = require('crypto-js/sha512'); +const fs = require('fs'); +const alta_jsapi = require('alta-jsapi'); + +//Local classes +const Player = require('./src/player.js'); +const Subscriptions = require('./src/subscriptions.js'); +const commands = require('./src/discordcmds.js') +const managers = require('./src/managers.js'); + +//Load information from credentials and config +const { username, password, botToken } = require("./credentials"); +const { targetServers, showAllServers, blacklistServers, discordPrefix, discordChannels, discordRoles } = require("./config"); + +//readline stuffs +const readline = require('readline'); +const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout +}); + +//NeDB +var Datastore = require('nedb'); +var players = new Datastore({ filename : 'data/players.db', autoload: true }); +var kills = new Datastore({ filename : 'data/playerkills.db', autoload: true }); +var chunkHistory = new Datastore({ filename : 'data/chunkhistory.db', autoload: true }); +var spawnables = new Datastore({ filename : 'data/spawnables.db', autoload: true }); +players.ensureIndex({ fieldName: 'id', unique: 'true' }); +players.persistence.setAutocompactionInterval( 129600 ); +spawnables.ensureIndex({ fieldName: 'hash', unique: 'true' }); + +//Vars +var playername = username; +var botConnection; +var pendingCommandList = []; + +//Some utility helper functions and prototypes +function ts() +{ + return "["+ moment().format("h:mm:ss A") +"] " +} + +function strrep( str, n ) +{ + if ( n < 1 ) return ''; + var result = str; + while( n-- > 0 ) + { + result += str; + } + return result; +} + +// Database helpers +function insertHandler( err, doc ) +{ + if ( err ) { console.log( err ); } +} + +function updateHandler( err, rows ) +{ + if ( err ) { console.log( err ); } +} + +function convertPassToHash( username, password, botToken ) +{ + // The SHA512 hash generated by crypto-js/sha512 will be 128 characters + if ( password.length !== 128 ) + { + console.log( "Plaintext password encountered, converting to SHA512 hash for permanent storage" ); + newPass = alta_jsapi.Sessions.hashPassword(password) + newFile = { "username" : username, "password" : newPass, "botToken": botToken }; + fs.writeFile('./credentials.json', JSON.stringify( newFile, null, 4 ), function( err ) { + if ( err ) + { + console.log( err ); + } else { + console.log( "New credentials.json saved" ); + } + }); + password = newPass; + } + return password; +} + +//Run the program +main(); + +async function main() +{ + console.log( ts() + "[BorisBot: Discord Edition] is Starting" ); + + // Convert the password to a hash if necessary + var mpassword = convertPassToHash( username, password, botToken ); + // Players in database + //players.find({}).exec( function( err, docs ) { console.log( docs ); }); + + //Connect to discord + const discord = new Discord.Client(); + await new Promise( resolve => + { + discord.on('ready', resolve); + discord.login(botToken); + }); + + //Discord command and message management (todo: move to own lib) + discord.on('message', message => + { + if ( message.content.length > 0 && message.content.startsWith( discordPrefix ) ) + { + var tmessage = message.content.substring(discordPrefix.length).trim(); + + var args = splitArgs( tmessage ); + + if ( args && args.length >= 1 ) + { + var command = args.shift(); + var commandFunction = commands[command]; + if (!!commandFunction) + { + commandFunction(message, args, tmessage); + } + } + } + }); + + //Alta Login + const bot = new WebsocketBot(); + //Use a hashed password, SHA512 + await bot.loginWithHash(username, mpassword); + //Run the bot. + //When any of the 'targetServers' are available, a connection is automatically created. + var subs = new Subscriptions( discordChannels, players, kills, chunkHistory ); + alta_jsapi.Sessions.loginWithUsername(username, mpassword); + var targetServers = [] + serverquery() + function serverquery() { + rl.question('Server? > ', (serverans) => //Outputs 'Server? > ' to allow the user to input one of the below results + { + (async () => { + servers = await alta_jsapi.Servers.getConsoleServers() + for(i=0; i targetServers.includes(test.id), async (server, connection) => + { + var wrapper = new BasicWrapper(connection); + + botConnection = + { + "connection" : connection, + "wrapper" : wrapper + } + + console.log( ts() +"loading inital players" ); + for ( var i in server.online_players ) + { + let oplayer = server.online_players[i]; + subs.PlayerJoined( discord, { "user": { "id": oplayer.id, "username": oplayer.username } }); + } + + //Subscriptions + await wrapper.subscribe("PlayerJoined", data => { subs.PlayerJoined( discord, data ) }); + await wrapper.subscribe("PlayerLeft", data => { subs.PlayerLeft( discord, data ); }); + await wrapper.subscribe("PlayerKilled", data => { subs.PlayerKilled( discord, data ); }); + await wrapper.subscribe("TradeDeckUsed", data => { subs.TradeDeckUsed( discord, data ); }); + await wrapper.subscribe("CreatureKilled", data => { subs.CreatureKilled( discord, data ); }); + await wrapper.subscribe("PlayerMovedChunk", data => { subs.PlayerMovedChunk( discord, data ); }); + await wrapper.subscribe("TraceLog", data => { + + if (message.content.startsWith("!")) + { + say("Working on pleb commands shut it") + } + // Admin Only /////////////////////////////////////////////////////////////////// + // Admin commands are preceeded by an exclamation mark to avoid accidentally doing stuff. + else if (message.content.startsWith("!!")) + { + var TEMPmessage = message.content.replace(/[,\/#!$%\^&\*;:{}=\-_`'~?()]/g,"") + originalMessageAsAnArray = TEMPmessage.split(' '); + + // Make sure the user is CJ or Poi. + if (message.author.discriminator.match("8147")) + { + + // List possible commands. Will explan on this later. + if (hazWerds("command", "list") == "Y") + { + say('**Current commands:** \n!teleport [PLAYER] to [PLAYER]\n!broadcast [TIME IN SECONDS] [MESSAGE WITH NO QUOTES] (Still working on this)') + } + + // Broadcast a message to all players. + else if (hazWerds("broadcast") == "Y") + { + originalMessageAsAnArray.shift() + TEMPduration = originalMessageAsAnArray[0] + originalMessageAsAnArray.shift() + TEMPmessage = originalMessageAsAnArray.join(" ") + try + { + wrapper.send('player message * "' + TEMPmessage + '" ' + TEMPduration) + say('SENT: player message * "' + TEMPmessage + '" ' + TEMPduration) + } + catch(err) {main()} + } + // Teleport one player to another. + else if (hazWerds("teleport", "to") == "Y") + { + try + {wrapper.send("player teleport " + originalMessageAsAnArray[1] + " " + originalMessageAsAnArray[3]) + say(originalMessageAsAnArray[1] + " should have been teleported to " + originalMessageAsAnArray[3] + ".")} + catch(err) {main()} + } + + // Just send it to the server directly as a command. + else + { + wrapper.send(TEMPmessage) + } + } + } + } + ); + } + ) + } + )() + } + ) + } + } \ No newline at end of file diff --git a/BorisBotDiscordEdition/package-lock.json b/BorisBotDiscordEdition/package-lock.json new file mode 100644 index 0000000..9b5efd0 --- /dev/null +++ b/BorisBotDiscordEdition/package-lock.json @@ -0,0 +1,839 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "@discordjs/collection": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.5.tgz", + "integrity": "sha512-CU1q0UXQUpFNzNB7gufgoisDHP7n+T3tkqTsp3MNUkVJ5+hS3BCvME8uCXAUFlz+6T2FbTCu75A+yQ7HMKqRKw==" + }, + "abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "requires": { + "event-target-shim": "^5.0.0" + } + }, + "ajv": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz", + "integrity": "sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "alta-jsapi": { + "version": "git+https://github.com/alta-vr/alta-jsapi.git#b49de4d687d3f70daa1a16f409dfb741a75b9453", + "from": "git+https://github.com/alta-vr/alta-jsapi.git", + "requires": { + "crypto-js": "^3.1.9-1", + "jsonwebtoken": "^8.5.1", + "memoizee": "^0.4.14", + "request": "^2.88.0", + "request-promise-native": "^1.0.7" + } + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "async": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "att-bot-core": { + "version": "git+https://github.com/alta-vr/ATT-Bot-JS.git#9a4ba212c1a69749fb7fc40160d24f3d4c99bcef", + "from": "git+https://github.com/alta-vr/ATT-Bot-JS.git", + "requires": { + "alta-jsapi": "git+https://github.com/alta-vr/alta-jsapi.git", + "att-websockets": "git+https://github.com/alta-vr/att-websockets.git", + "chalk": "^2.4.2", + "crypto-js": "^3.1.9-1", + "node": "^12.10.0" + } + }, + "att-websockets": { + "version": "git+https://github.com/alta-vr/att-websockets.git#8bf9c52f2e23050655e40d38e5d8faef074c4576", + "from": "git+https://github.com/alta-vr/att-websockets.git", + "requires": { + "alta-jsapi": "git+https://github.com/alta-vr/alta-jsapi.git", + "isomorphic-ws": "^4.0.1", + "ws": "^7.1.2" + } + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz", + "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==" + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "requires": { + "tweetnacl": "^0.14.3" + }, + "dependencies": { + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + } + } + }, + "binary-search-tree": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/binary-search-tree/-/binary-search-tree-0.2.5.tgz", + "integrity": "sha1-fbs7IQ/coIJFDa0jNMMErzm9x4Q=", + "requires": { + "underscore": "~1.4.4" + } + }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "crypto-js": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz", + "integrity": "sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q==" + }, + "d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "requires": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "discord.js": { + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.0.2.tgz", + "integrity": "sha512-iZiEA4Y61gqq/EjFfLXnkRK9pLapnax/vTVDUhs/mAhyqozAy0GOlk/MZI9rSa1iIoKTWRq6P9CRKhLNT2wUnA==", + "requires": { + "@discordjs/collection": "^0.1.5", + "abort-controller": "^3.0.0", + "form-data": "^3.0.0", + "node-fetch": "^2.6.0", + "prism-media": "^1.2.0", + "setimmediate": "^1.0.5", + "tweetnacl": "^1.0.3", + "ws": "^7.2.1" + }, + "dependencies": { + "form-data": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", + "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + } + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "es5-ext": { + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "requires": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" + }, + "dependencies": { + "next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" + } + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "requires": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, + "es6-weak-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", + "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", + "requires": { + "d": "1", + "es5-ext": "^0.10.46", + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "requires": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, + "event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" + }, + "ext": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "requires": { + "type": "^2.0.0" + }, + "dependencies": { + "type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.0.0.tgz", + "integrity": "sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow==" + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", + "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==" + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "requires": { + "ajv": "^6.5.5", + "har-schema": "^2.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=" + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "isomorphic-ws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", + "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "jsonwebtoken": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", + "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", + "requires": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^5.6.0" + } + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "requires": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "lie": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz", + "integrity": "sha1-mkNrLMd0bKWd56QfpGmz77dr2H4=", + "requires": { + "immediate": "~3.0.5" + } + }, + "localforage": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/localforage/-/localforage-1.7.3.tgz", + "integrity": "sha512-1TulyYfc4udS7ECSBT2vwJksWbkwwTX8BzeUIiq8Y07Riy7bDAAnxDaPU/tWyOVmQAcWJIEIFP9lPfBGqVoPgQ==", + "requires": { + "lie": "3.1.1" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + }, + "lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=" + }, + "lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=" + }, + "lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=" + }, + "lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=" + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" + }, + "lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" + }, + "lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" + }, + "lru-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", + "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=", + "requires": { + "es5-ext": "~0.10.2" + } + }, + "memoizee": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.14.tgz", + "integrity": "sha512-/SWFvWegAIYAO4NQMpcX+gcra0yEZu4OntmUdrBaWrJncxOqAziGFlHxc7yjKVK2uu3lpPW27P27wkR82wA8mg==", + "requires": { + "d": "1", + "es5-ext": "^0.10.45", + "es6-weak-map": "^2.0.2", + "event-emitter": "^0.3.5", + "is-promise": "^2.1", + "lru-queue": "0.1", + "next-tick": "1", + "timers-ext": "^0.1.5" + } + }, + "mime-db": { + "version": "1.43.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", + "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==" + }, + "mime-types": { + "version": "2.1.26", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", + "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", + "requires": { + "mime-db": "1.43.0" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + }, + "mkdirp": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz", + "integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==", + "requires": { + "minimist": "^1.2.5" + } + }, + "moment": { + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", + "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==" + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "nedb": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/nedb/-/nedb-1.8.0.tgz", + "integrity": "sha1-DjUCzYLABNU1WkPJ5VV3vXvZHYg=", + "requires": { + "async": "0.2.10", + "binary-search-tree": "0.2.5", + "localforage": "^1.3.0", + "mkdirp": "~0.5.1", + "underscore": "~1.4.4" + } + }, + "next-tick": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" + }, + "node": { + "version": "12.16.1", + "resolved": "https://registry.npmjs.org/node/-/node-12.16.1.tgz", + "integrity": "sha512-YFayjFMXG6thgqKHsiihuGXgjD/0227b3lO3S+BmRcN/DxBlSANOUndewuo2SD7sjleo/JKiL89aDDxP2VOV3w==", + "requires": { + "node-bin-setup": "^1.0.0" + } + }, + "node-bin-setup": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/node-bin-setup/-/node-bin-setup-1.0.6.tgz", + "integrity": "sha512-uPIxXNis1CRbv1DwqAxkgBk5NFV3s7cMN/Gf556jSw6jBvV7ca4F9lRL/8cALcZecRibeqU+5dFYqFFmzv5a0Q==" + }, + "node-fetch": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", + "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "prism-media": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.1.tgz", + "integrity": "sha512-R3EbKwJiYlTvGwcG1DpUt+06DsxOGS5W4AMEHT7oVOjG93MjpdhGX1whHyjnqknylLMupKAsKMEXcTNRbPe6Vw==" + }, + "psl": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.7.0.tgz", + "integrity": "sha512-5NsSEDv8zY70ScRnOTn7bK7eanl2MvFrOrS/R6x+dBt5g1ghnj9Zv90kO8GwT8gxcu2ANyFprnFYB85IogIJOQ==" + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, + "request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + } + } + }, + "request-promise-core": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.3.tgz", + "integrity": "sha512-QIs2+ArIGQVp5ZYbWD5ZLCY29D5CfWizP8eWnm8FoGD1TX61veauETVQbrV60662V0oFBkrDOuaBI8XgtuyYAQ==", + "requires": { + "lodash": "^4.17.15" + } + }, + "request-promise-native": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.8.tgz", + "integrity": "sha512-dapwLGqkHtwL5AEbfenuzjTYg35Jd6KPytsC2/TLkVMz8rm+tNt72MGUWT1RP/aYawMpN6HqbNGBQaRcBtjQMQ==", + "requires": { + "request-promise-core": "1.1.3", + "stealthy-require": "^1.1.1", + "tough-cookie": "^2.3.3" + } + }, + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "dependencies": { + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + } + } + }, + "stealthy-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", + "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + }, + "timers-ext": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz", + "integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==", + "requires": { + "es5-ext": "~0.10.46", + "next-tick": "1" + } + }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" + }, + "underscore": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz", + "integrity": "sha1-YaajIBBiKvoHljvzJSA88SI51gQ=" + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "requires": { + "punycode": "^2.1.0" + } + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "ws": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.2.3.tgz", + "integrity": "sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ==" + } + } +} diff --git a/BorisBotDiscordEdition/src/discordcmds.js b/BorisBotDiscordEdition/src/discordcmds.js new file mode 100644 index 0000000..ba34710 --- /dev/null +++ b/BorisBotDiscordEdition/src/discordcmds.js @@ -0,0 +1,366 @@ +//Command list +const commands = { + 'ping': (message, args) => + { + message.channel.send("pong"); + }, + 'tp': async function (message, args) + { + while ( args.length && args[0].toLowerCase() === namemanager(args[0]) ) + { + argv = args.shift(); + } + }, + 'where': (message, args) => + { + while ( args.length && args[0].toLowerCase() === "is" ) + { + argv = args.shift(); + } + + var username = args.join(' '); + players.findOne({ username: username }, function( err, player ) { + if ( err ) + { + console.log( err ); + } else if ( !!player && player.lastChunk !== undefined ) { + message.channel.send( '```'+ username +" was last seen at "+ player.lastChunk +'```'); + } else { + message.channel.send( '```'+ "No location known for "+ username +'```' ); + } + }); + }, + + 'who': (message, args) => + { + while( args.length && args[0].toLowerCase() === "is" ) + { + argv = args.shift(); + } + + var username = args.join(' '); + players.findOne({ username: username }, function( err, player ) { + if ( err ) + { + console.log( err ); + } else { + if ( !player ) + { + message.guild.channel.send('```'+ "Unknown user: "+ username +'```'); + } else if ( !player.bio ) { + message.channel.send('```'+ username +" does not have a bio"+ '```'); + } else { + message.channel.send('```'+ username +" is "+ player.bio +'```'); + } + } + }); + }, + + 'bio': (message, args) => + { + console.log( args ); + function updatePlayerBio( playerid, bio ) + { + players.update({ id: playerid }, { $set: { bio: bio } }, {}, function( err, numReplaced ) { + if ( err ) + { + console.log( err ); + } else { + message.channel.send('```'+ username +" is "+ bio +'```'); + } + }); + } + + var username = message.author.username; + players.findOne({ username: username }, function( err, player ) { + if ( err ) { + console.log( err ); + } + console.log( player ); + if ( player ) + { + while ( args[0] === username || args[0] === "is" ) + { + args.shift(); + } + var bio = args.join(' '); + updatePlayerBio( player.id, bio ); + } else { + username = args.shift(); + while( args[0] === "is" ) { args.shift(); } + var bio = args.join(' '); + players.findOne({ username, username }, function( err, player ) { + if ( player ) + { + updatePlayerBio( player.id, bio ) + } else { + message.channel.send('```'+ "Unknown user: "+ username +'```'); + } + }); + } + }); + }, + + 'servers': async function (message, args) + { + var servers = await Servers.getOnline(); + + if ( !!servers ) + { + var longest = 0; + for( var i in servers ) + { + if ( servers[i].name.length > longest ) + { + longest = servers[i].name.length; + } + } + + var serverNameLen = longest + 1; + var listTable = "| Servers"+ strrep(' ', (serverNameLen - 7)) +"| Players\n"; + listTable += "|"+ strrep('-', (serverNameLen + 1) ) +"|---------\n"; + for ( var i in servers ) + { + if ( blacklistServers.includes( servers[i].id ) ) + { + continue + } + if ( !showAllServers && !targetServers.includes( servers[i].id ) ) + { + continue + } + listTable += "| "+ servers[i].name + strrep(' ', ( serverNameLen - servers[i].name.length )) +"| "+ servers[i].online_players.length +"\n"; + } + + message.channel.send( '```'+ listTable +'```' ); + + } else { + message.channel.send("No servers appear to be online, perhaps it's patch day?"); + } + }, + + 'players': async function (message, args) + { + var servers = await Servers.getOnline(); + var listTable = ''; + + while ( args.length && ( args[0].toLowerCase() === "online" || args[0].toLowerCase() === "in" || args[0].toLowerCase() === "on" ) ) + { + args.shift(); + } + + var mustMatch = args.join(' '); + + for( var i in servers ) + { + var pOnline = servers[i].online_players; + if ( pOnline.length <= 0 && !mustMatch ) + { + continue + } + + if ( blacklistServers.includes( servers[i].id ) ) + { + continue; + } + + if ( !showAllServers && !targetServers.includes( servers[i].id ) ) + { + continue; + } + + if ( mustMatch ) + { + var re = new RegExp( mustMatch, 'ig' ); + if ( !servers[i].name.match( re ) ) + { + continue; + } + } + + listTable += "| "+ servers[i].name +"\n"; + listTable += "|"+ strrep('-', (servers[i].name.length + 1)) +"\n"; + + if ( pOnline.length <= 0 ) + { + listTable += "| No players online\n" + } else { + for( var n in pOnline ) + { + listTable += "| "+ pOnline[n].username +"\n"; + } + } + + listTable += "\n"; + } + + if ( listTable === '' ) + { + if ( mustMatch ) + { + message.channel.send('```No server found matching "'+ mustMatch +'"```'); + } else { + message.channel.send('```No servers were found online, is it patch day?```'); + } + } else { + message.channel.send('```'+ listTable +'```'); + } + }, + + 'zone': async function (message, args) + { + switch( args.shift() ) + { + case 'history': + var chunkName = args.join(' '); + players.find({}, function( err, playerList ) { + chunkHistory.find({ chunk: chunkName }).sort({ ts: -1 }).exec( function( err, chunklist ) { + if ( err ) + { + console.log( err ); + } else if ( !chunklist ) { + message.channel.send('```'+ "No history for zone '"+ chunkName +"'"+ '```'); + } else { + var response = "| Players who have recently visited zone '"+ chunkName +"'\n"; + response += "|--------------------------------"+ strrep( '-', chunkName.length ) +"-\n"; + let limit = 15; + if ( chunklist.length < limit ) { limit = chunklist.length; } + for ( var i = 0; i < limit; i++ ) { + ichunk = chunklist[i]; + if ( ++i > 10 ) { } + player = playerList.find( x => x.id === ichunk.player ); + response += "|["+ moment( ichunk.ts ).format("YYYY/MM/DD HH:mm:ss") +"] "+ player.username +"\n"; + }; + message.channel.send('```'+ response +'```'); + } + }); + }); + break; + } + }, + + 'player' : async function ( message, args ) + { + switch( args.shift() ) + { + case 'path': + // Return known history of player movements + var username = args.join(' '); + players.findOne({ username: username }, function( err, player ) { + if ( err ) + { + message.channel.send('```'+ "No player data found for "+ username +'```'); + } else { + if ( !!player ) + { + chunkHistory.find({ player: player.id }).sort({ ts: -1 }).exec( function ( err, chunklist ) { + if ( err ) + { + console.log( err ); + } else if ( !!chunklist ) { + let limit = 20; + var response = '| Path History for '+ username +"\n"; + response += '|------------------'+ strrep('-', username.length+1) +"\n"; + if ( chunklist.length < limit ) { limit = chunklist.length; } + for ( var i = 0; i < limit ; i++ ) { + var elem = chunklist[i]; + response += "|["+ moment( elem.ts ).format( "YYYY/MM/DD HH:mm:ss" ) +"] "+ elem.chunk +"\n"; + } + message.channel.send('```'+ response +'```'); + } else { + message.channel.send('```'+ "No path data found for "+ username +'```'); + } + }); + } else { + message.channel.send('```'+ "No player found for "+ username +'```'); + } + } + }); + break; + + } + }, + + 'load' : async function( message, args ) + { + switch( args.shift() ) + { + case 'assets': + // First verify the message author has correct permission + if ( message.member.roles.some( x => discordRoles.admin.includes( x.id ) )) + { + console.log( ts()+ "loading assets"); + message.channel.send('```'+ "Loading ATT assets, please wait" +'```'); + + // Add the handler to pendingCommandList + pendingCommandList.push({ + "command" : "spawn list", + "module" : "Alta.Console.Commands.SpawnCommandModule", + "handler": function ( response ) { + let countPrefabs = 0; + let responselines = response.split(/\n/) + responselines.forEach( function( line ) { + let found = line.match( /\|([^|]+)\|([^|]+)\|/ ); + if ( found ) + { + found.shift(); // fulltext of match + let num = new String( found.shift() ).trim() // ID of the prefab + let val = new String( found.shift() ).trim() // The prefab name + if ( num.match( /[0-9]+/ ) ) + { + // It's a prefab! Store it + console.log( "found asset: "+ num +" | "+ val ) + spawnables.update({ hash: num }, { $set : { hash: num, name: val } }, { upsert: true }, updateHandler ); + countPrefabs++; + } + } + }); + message.channel.send( '```'+ "Found and stored "+ countPrefabs + " spawnable assets" +'```') + } + }); + + // Finally, execute the command + try { + botConnection.wrapper.send( "spwan list" ); + } catch ( e ) { + console.log( e ) + message.channel.send( '```'+ "Cannot send command, is server offline?" +'```') + return; + } + + } else { + console.log( "invalid permission to load assets" ); + message.channel.send('```'+ "You do not have the required permissions" +'```'); + } + break; + } + }, + 'find' : async function( message, args ) + { + switch( args.shift() ) + { + case 'asset': + case 'spawnable': + case 'item': + let mustMatch = args.join(' '); + spawnables.find({ name : { $regex: new RegExp( mustMatch, 'gi' ) }}).sort({ name : 1 }).exec( function( err, results ) { + let response = "| Spawnable items matching "+ mustMatch +" ("+ results.length +")\n"; + response += "|--------------------------"+ strrep('-', mustMatch.length) + "-----\n"; + let itemc = 0; + results.forEach( function( item ) { + let shortsp = ''; + if ( item.hash.length < 5 ) { shortsp = ' '; } + response += "| "+ item.hash + shortsp + " | "+ item.name +"\n"; + if ( itemc++ > 20 ) + { + message.channel.send('```'+ response +'```') + itemc = 0; + response = ''; + } + }); + message.channel.send( '```'+ response +'```') + }) + break; + } + } +} diff --git a/BorisBotDiscordEdition/src/managers.js b/BorisBotDiscordEdition/src/managers.js new file mode 100644 index 0000000..f3b3743 --- /dev/null +++ b/BorisBotDiscordEdition/src/managers.js @@ -0,0 +1,148 @@ +"use strict"; +exports.namemanager = (name) => { + if(name == undefined) { + name = playername + } + if(name == "") { + name = playername + } + if(name == "poi") { + name = "poiuytrewq4645" + } + if(name == "mansnac") { + name = "mantax" + } + if(name == "ursa") { + name = "Ursidious" + } + /*if(name == "") { + name = "" + }*/ + return name +} +exports.splitArgs = (args) => { + let spaceChars = '#s#'; + // If an exact match of the space character exists in the string, make it more unique + while( args.indexOf( spaceChars ) > -1 ) { spaceChars += '|'; } + + // replace spaces which are inside quotes with the spaceChar placeholder + let mangleargs = args.replace( /[“"]([^“^"]*)[“"]?/g, ( match, cap ) => { + return cap.replace(/\s/g, spaceChars ); + }); + + // split the padded string on actual spaces + let newargs = mangleargs.split( /\ +/ ); + + // replace the spaceChar in any matching elements with actual spaces + let reg = new RegExp( spaceChars, 'g' ); + let argarr = newargs.map( ( x ) => { return x.replace( reg, ' ' ); }); + + return argarr; +} +exports.teleportmanager = (location) => { + console.log(location) + switch (location) { + //Pope Mountain + case "Mountain": + return [-1259,1000.69,942] + break + //Mystery Roof Place + case "000": + return [0,1000.69,0] + break + //Evinon Empire + case "EE": + return [-174.5,1000.69,-644.5] + break + case "Storage": + return [ -351.975, 209.94, -661.433 ] + break + //Grey Wardens + case "GW": + return [-639.453,1000.69,-82.208] + break + //Sin City + case "SC": + return [-329.748,1000.69,-343.807] + break + //Schmmechee Sentinels + case "SS": + return [-969.479,1000.69,129.304] + break + //Viridium Valour + case "VV": + return [-608.406,1000.69,94.553] + break + //Bounding Foxes + case "BF": + return [-519.507,1000.69,62.1519966] + break + //Town Blacksmith + case "Smithy": + return [-717.2,1000.69,12.7] + break + //Town Hall :V + case "TH": + return [-895.2,1000.69,93.9] + break + //Path between Dust Bowl and Cliffs + case "DB": + return [-581,1000.69,325.3] + break + //Inside Mines + case "Mines": + return [-897.749,1000.69,-160.403] + break + //Mountain outback of camps + case "OM": + return [988.816,1000.69,-736.122] + break + //Mountain outback of the outback mountain of the camps + case "OOM": + return [1019.675,1000.69,-1371.084] + break + //Outside the MP Bridge + case "MP": + return [-1051.641,1000.69,39.53] + break + //Televator Surface TP + case "Televator": + return [-869.021,1000.69,-123.773] + break + //Town Crafting Building + case "Crafting_Building": + return [-799.941,1000.69,103.74] + break + //Skydiving, may die + case "Skydive": + return [-295.713,990,435.593] + break + // + //SHRINES START + // + case "Archery": + return [-835,1000.69,385] + break + case "Blacksmith": + return [-642.704,1000.69,19.363] + break + case "Combat": + return [-1403.3,1000.69,161] + break + case "Woodcutting": + return [-404.3,1000.69,19.6] + break + case "Mining": + return [-825.419,1000.69,-59.953] + break + case "General_Shrine": + return [-1145.647,1000.69,113.898] + break + // + ///SHRINES END + // + default: + return null + break + } +} \ No newline at end of file diff --git a/BorisBotDiscordEdition/src/player.js b/BorisBotDiscordEdition/src/player.js new file mode 100644 index 0000000..155f2d3 --- /dev/null +++ b/BorisBotDiscordEdition/src/player.js @@ -0,0 +1,21 @@ +module.exports = class Player { + + constructor( id, username ) + { + this.id = id; + this.username = username; + } + + set id( id ) { this._id = id; } + get id() { return _id; } + + set username(username) { this._username = username; } + get username() { return this._username; } + + set bio(bio) { this._bio = bio; } + get bio() { return _bio; } + + set lastLogin(lastLogin) { this._lastLogin = lastLogin; } + get lastLogin() { return _lastLogin; } + +} diff --git a/BorisBotDiscordEdition/src/subscriptions.js b/BorisBotDiscordEdition/src/subscriptions.js new file mode 100644 index 0000000..a59a61d --- /dev/null +++ b/BorisBotDiscordEdition/src/subscriptions.js @@ -0,0 +1,124 @@ +const moment = require('moment'); + +function now() +{ + return moment().valueOf(); +} + +function ts_f() +{ + return "["+ moment().format("h:mm:ss A") +"] " +} + +// Database helpers +function insertHandler( err, doc ) +{ + if ( err ) { console.log( err ); } +} + +function updateHandler( err, rows ) +{ + if ( err ) { console.log( err ); } +} + +module.exports = class Subscriptions { + constructor( discordChannels, playersDb, killsDb, chunksDb ) { + this.discordChannels = discordChannels; + this.playersDb = playersDb; + this.killsDb = killsDb; + this.chunksDb = chunksDb; + } + + + PlayerJoined( discord, data ) + { + //console.log( data ); + this.playersDb.update( + { id: data.user.id }, + { $set: { username: data.user.username, lastLogin: now() } }, + { upsert: true }, + updateHandler + ); + discord.channels.get( this.discordChannels["PlayerJoined"] ).send( ts_f() + data.user.username +" joined the server" ); + console.log( ts_f() + data.user.username +" joined the server" ); + } + + PlayerLeft( discord, data ) + { + //console.log( data ); + discord.channels.get( this.discordChannels["PlayerLeft"] ).send( ts_f() + data.user.username +" left the server" ); + console.log( ts_f() + data.user.username +" left the server" ); + } + + PlayerMovedChunk( discord, data ) + { + //console.log( data ); + this.playersDb.update({ id: data.player.id }, { $set: { lastChunk: data.newChunk } }, {}, updateHandler ); + this.chunksDb.insert({ ts: now(), player: data.player.id, chunk: data.newChunk }, insertHandler ); + // also update the zone history for the new chunk + // TODO + console.log( ts_f() + data.player.username +" has moved to chunk "+ data.newChunk ); + } + + PlayerKilled( discord, data ) + { + //console.log( data ); + console.log( ts_f() + "player kill" ); + if ( data.killerPlayer != undefined ) + { + this.killsDb.insert({ + ts: now(), + killed : data.killedPlayer.id, + killer: data.killerPlayer.id, + usedTool: data.usedTool, + toolWielder: data.toolWielder + }, insertHandler ); + discord.channels.get( this.discordChannels["PlayerKilled"] ).send( ts_f() + data.killerPlayer.username +" has killed "+ data.killedPlayer.username ); + discord.channels.get( this.discordChannels["PublicPlayerKilled"] ).send( '```'+ data.killerPlayer.username +" has murdered "+ data.killedPlayer.username +'```' ); + } else { + if ( data.toolWielder ) + { + this.killsDb.insert({ + ts: now(), + killed : data.killedPlayer.id, + usedTool: data.usedTool, + toolWielder: data.toolWielder + }, insertHandler ); + let matches = data.toolWielder.match( /[0-9]+\s-\s([^\()]+)/ ); + let toolWielder = data.toolWielder; + if ( matches !== null ) + { + toolWielder = matches[1]; + } + discord.channels.get( this.discordChannels["PlayerKilled"] ).send( ts_f() + data.killedPlayer.username +" was killed by: "+ toolWielder ); + discord.channels.get( this.discordChannels["PublicPlayerKilled"] ).send( '```'+ data.killedPlayer.username +" was killed by: "+ toolWielder +'```' ); + } else { + this.killsDb.insert({ + ts: now(), + killed : data.killedPlayer.id, + }, insertHandler ); + discord.channels.get( this.discordChannels["PlayerKilled"] ).send( ts_f() + data.killedPlayer.username +" has suddenly offed themselves" ); + discord.channels.get( this.discordChannels["PublicPlayerKilled"] ).send( '```'+ data.killedPlayer.username +" has suddenly offed themselves" +'```'); + } + } + } + + TradeDeckUsed( discord, data ) + { + console.log( ts_f() + "trade deck used" ); + console.log( data ); + } + + CreatureKilled( discord, data ) + { + console.log( ts_f() + "creature murdered" ); + console.log( data ); + } + + CreatureSpawned( discord, data ) + { + console.log( ts_f() + "creature has spawned" ); + console.log( data ); + } + +} diff --git a/BorisBotV1/.gitignore b/BorisBotV1/.gitignore new file mode 100644 index 0000000..98ad8f5 --- /dev/null +++ b/BorisBotV1/.gitignore @@ -0,0 +1,67 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# next.js build output +.next + + + +# Custom things +credentials.json +config.json diff --git a/BorisBotV1/LICENSE b/BorisBotV1/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/BorisBotV1/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/BorisBotV1/README.md b/BorisBotV1/README.md new file mode 100644 index 0000000..23b623e --- /dev/null +++ b/BorisBotV1/README.md @@ -0,0 +1,6 @@ +#henlo welcoom to bot + +To get this repo working, simply : +- Run 'npm i' +- Put your credentials "credentials.json". +- Run 'node .' diff --git a/BorisBotV1/config.jsonexample b/BorisBotV1/config.jsonexample new file mode 100644 index 0000000..8979591 --- /dev/null +++ b/BorisBotV1/config.jsonexample @@ -0,0 +1,20 @@ +{ + "discordPrefix" : "", + + "discordChannels" : + { + "PlayerJoined" : "", + "PlayerLeft" : "", + "PlayerKilled" : "", + "PublicPlayerKilled" : "", + "PlayerMovedChunk" : "", + "TradeDeckUsed" : "", + "CreatureKilled" : "" + }, + + "discordRoles" : + { + "admin" : [], + "spawn" : [] + } +} diff --git a/BorisBotV1/credentials.jsonexample b/BorisBotV1/credentials.jsonexample new file mode 100644 index 0000000..ee7cd53 --- /dev/null +++ b/BorisBotV1/credentials.jsonexample @@ -0,0 +1,5 @@ +{ + "username": "", + "password": ""//, + //"botToken": "" +} \ No newline at end of file diff --git a/BorisBotV1/data/chunkhistory.db b/BorisBotV1/data/chunkhistory.db new file mode 100644 index 0000000..e69de29 diff --git a/BorisBotV1/data/playerkills.db b/BorisBotV1/data/playerkills.db new file mode 100644 index 0000000..e69de29 diff --git a/BorisBotV1/data/players.db b/BorisBotV1/data/players.db new file mode 100644 index 0000000..4dfc322 --- /dev/null +++ b/BorisBotV1/data/players.db @@ -0,0 +1,5 @@ +{"id":971306613,"username":"poiuytrewq4645","lastLogin":1584282273535,"_id":"PI05jVvpOfvR5urh"} +{"id":670400968,"username":"Kinny","lastLogin":1584309293642,"_id":"h9SNzZCCqUm6L6j6"} +{"id":1979661870,"username":"Jackie","lastLogin":1584380637860,"_id":"rgLEAZSfPNNDD7S1"} +{"id":1179574189,"username":"Agidon","lastLogin":1584294727359,"_id":"vSM2TstpKQLyisNG"} +{"$$indexCreated":{"fieldName":"id","unique":"true","sparse":false}} diff --git a/BorisBotV1/data/spawnables.db b/BorisBotV1/data/spawnables.db new file mode 100644 index 0000000..5f23990 --- /dev/null +++ b/BorisBotV1/data/spawnables.db @@ -0,0 +1 @@ +{"$$indexCreated":{"fieldName":"hash","unique":"true","sparse":false}} diff --git a/BorisBotV1/index.js b/BorisBotV1/index.js new file mode 100644 index 0000000..9b4743a --- /dev/null +++ b/BorisBotV1/index.js @@ -0,0 +1,546 @@ +//Load required classes. +const { WebsocketBot } = require('att-bot-core'); +const { BasicWrapper } = require('att-websockets'); +const alta_jsapi = require("alta-jsapi"); +const moment = require('moment'); +const fs = require('fs'); +const sha512 = require('crypto-js/sha512'); + +//Local classes +const Player = require('./src/player.js'); +const Subscriptions = require('./src/subscriptions.js'); +const commands = require('./src/discordcmds.js'); +const managers = require('./src/managers.js'); + +//Load information from credentials and config +const { username, password, botToken } = require("./credentials"); + +//readline stuffs +const readline = require('readline'); +const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout +}); + +//functions +//NeDB +var Datastore = require('nedb'); +var players = new Datastore({ filename : 'data/players.db', autoload: true }); +var kills = new Datastore({ filename : 'data/playerkills.db', autoload: true }); +var chunkHistory = new Datastore({ filename : 'data/chunkhistory.db', autoload: true }); +var spawnables = new Datastore({ filename : 'data/spawnables.db', autoload: true }); +players.ensureIndex({ fieldName: 'id', unique: 'true' }); +players.persistence.setAutocompactionInterval( 129600 ); +spawnables.ensureIndex({ fieldName: 'hash', unique: 'true' }); + + +//Some utility helper functions and prototypes +function ts() +{ + return "["+ moment().format("h:mm:ss A") +"] " +} + +function strrep( str, n ) +{ + if ( n < 1 ) return ''; + var result = str; + while( n-- > 0 ) + { + result += str; + } + return result; +} + +// Database helpers +function insertHandler( err, doc ) +{ + if ( err ) { console.log( err ); } +} + +function updateHandler( err, rows ) +{ + if ( err ) { console.log( err ); } +} + +//general functions +//ring of (item) +async function ro(rad, amnt, item, up) { + while (i ', (serverans) => //Outputs 'Server? > ' to allow the user to input one of the below results + { + (async () => { + servers = await alta_jsapi.Servers.getConsoleServers() + for(i=0; i targetServers.includes(test.id), async (server, connection) => + { + + var wrapper = new BasicWrapper(connection); + + command() + function command() + { + rl.question('> ', (answer) => + { + /*// + //help + // + if (answer.startsWith("help ")) { + answer = answer.split(" ");; + if(answerARR[1] == undefined) { + //const placeholder = ["{Command}: ``", "{Syntax}: ``", "{Description}: ``"] + const cmd = ["{Command}: `cmd`","{Syntax}: `cmd [command]`","{Description}: `Runs a command from the existing modules built into the ATT Dashboard.`"] + const blendcmd = ["{Command}: `blend`","{Syntax}: `blend`","{Description}: `Spins the currently selected object as fast as the dash will let me.`"] + const stringcmd = ["{Command}: `string`","{Syntax}: `string`","{Description}: `Outputs the currently selected object to `Items.json`.`"] + const tp = ["{Command}: `teleport`","{Syntax}: `teleport [player] [location]`","{Description}: `Teleports specified player to predefined location.`"] + const clone = ["{Command}: `clone`","{Syntax}: `clone`","{Description}: `Clones currently selected item from a string.`"] + const roft = ["{Command}: `rot`","{Syntax}: `rot [radius(m)] [count] [itemname] [up ammount]`","{Description}: `Spawns a ring of things.`"] + const rofd = ["{Command}: `rod`","{Syntax}: `rod`","{Description}: `Spawns a ring of Explosive Spikes to decimate everyone in the surrounding area.`"] + const quitcmd = ["{Command}: `quit`","{Syntax}: `quit`","{Description}: `Just crashes the bot lmao.`"] + const speed = ["{Command}: `speed`","{Syntax}: `speed [(optional)playerTarget] [(optional)multiplier]`","{Description}: `Sets the target player's speed. (Default Value: 5)`"] + const heal = ["{Command}: `heal`","{Syntax}: `heal [(optional)playerTarget] [(optional)amount]`","{Description}: `Sets the target player's health. (Default Value: 100000)`"] + const strong = ["{Command}: `strong`","{Syntax}: `strong [(optional)playerTarget] [(optional)amount]`","{Description}: `Sets the target players strength. (Default Value: 15)`"] + const godon = ["{Command}: `godon`","{Syntax}: `godon [(optional)playerTarget]`","{Description}: `Turns on godmode for target player.`"] + const godoff = ["{Command}: `godoff`","{Syntax}: `godoff [(optional)playerTarget]`","{Description}: `Turns off godmode for target player.`"] + const op = ["{Command}: `op`","{Syntax}: `op [(optional)playerTarget]`","{Description}: `Boosts resistance(100000), damage(100000) and speed(2) for the target player. Lasts for 300 seconds.`"] + const spawn = ["{Command}: `spawn`","{Syntax}: `spawn [playerTarget] [ItemID] [args]`","{Description}: `Simple spawn command that integrates with managers.namemanager.`"] + const selectget = ["{Command}: `select get`","{Syntax}: `select get`","{Description}: `More detailed version of `select get` from the dashboard.`"] + const message = ["{Command}: `message`","{Syntax}: `message`; `playerTarget`; `message`","{Description}: `If both rl.questions are undefined, it will go back to original rl.question and ask for a new command. Sends a command so targetPlayer and doesnt lose focus until rl.questions are undefined.`"] + const tsd = ["{Command}: `day`", "{Syntax}: `day`", "{Description}: `Sets time to 7am`"] + const tsn = ["{Command}: `night`", "{Syntax}: `night`", "{Description}: `Sets time to 8pm`"] + const scale = ["{Command}: `scale`", "{Syntax}: `scale`", "{Description}: `WIP`"] + const SkillsAll = ["{Command}: `skillsall`", "{Syntax}: `skillsall [(optional)playerTarget]`", "{Description}: `Sets target players skills to all skills.`"] + console.log(cmd[0],cmd[1],cmd[2]), + console.log(blendcmd[0],blendcmd[1],blendcmd[2]), + console.log(stringcmd[0],stringcmd[1],stringcmd[2]), + console.log(tp[0],tp[1],tp[2]), + console.log(clone[0],clone[1],clone[2]), + console.log(rofd[0],rofd[1],rofd[2]), + console.log(roft[0],roft[1],roft[2]), + console.log(quitcmd[0],quitcmd[1],quitcmd[2]), + console.log(speed[0],speed[1],speed[2]), + console.log(heal[0],heal[1],heal[2]), + console.log(strong[0],strong[1],strong[2]), + console.log(godon[0],godon[1],godon[2]), + console.log(godoff[0],godoff[1],godoff[2]), + console.log(op[0],op[1],op[2]), + console.log(spawn[0],spawn[1],spawn[2]), + console.log(selectget[0],selectget[1],selectget[2]), + console.log(message[0],message[1],message[2]), + console.log(tsd[0],tsd[1],tsd[2]), + console.log(tsn[0],tsn[1],tsn[2]), + console.log(scale[0],scale[1],scale[2]), + console.log(SkillsAll[0],SkillsAll[1],SkillsAll[2]) + } + };*/ + // + //COMMAND COMMAND + // + if (answer.startsWith("cmd ")) { + answer = answer.slice(4);; //y dis work lol + (async () => { + var result = await wrapper.send(answer) + console.log(result.Result) + command() + }) () + }; + // + //SPEEN + // + if (answer.startsWith("blend")) { + (async () => { + answer = answer.slice(6); + let {xe, ye, ze} = 0 + switch(answer) { + case "x": + xe = 15 + break + case "y": + ye = 15 + break + case "z": + ze = 15 + break + default: + ze = 15 + break + } + let locat = await wrapper.send("select get") + let x = locat.Result.Position[0] + let z = locat.Result.Position[1] + let y = locat.Result.Position[2] + let xr = locat.Result.Rotation[0] + let zr = locat.Result.Rotation[1] + let yr = locat.Result.Rotation[2] + while(i < 1800) { + await new Promise(r => setTimeout(r, 5)); + wrapper.send(`select rotate exact ${xr+xe},${zr+ze},${yr+ye}`) + wrapper.send(`select move exact ${x},${z},${y}`) + i++ + } + i=0 + })() + command() + }; + // + //TOSTRING WRITETO COMMAND + // + if (answer.startsWith("string")) { + (async () => { + let streeng = await wrapper.send(`select tostring`) + console.log(streeng) + let out = streeng.ResultString.split(`|`); + fs.writeFile("items.json", out[0],'utf8', function (err) { + if (err) { + console.log("An error occured while writing JSON Object to File."); + return console.log(err); + } + console.log("JSON file has been saved."); + }) + })() + command() + }; + // + //TELEPORT EXACT COMMAND + // + if (answer.startsWith("teleport ")) { + //probs not possible but worth poking + (async () => { + answerARR = answer.split(" "); + wrapper.send(`select 4`); + var location = await wrapper.send(`select get`); + let [x, z, y] = location.Result.Position; + let [bla, name, x2, z2, y2] = answerARR + playername = managers.namemanager(name) + let dest = managers.teleportmanager(x2) + + if (dest != null) { + [x2, z2, y2] = dest + } + wrapper.send(`select move exact ${x2},${z2},${y2}`) + if(z2 == 1000.69) { + wrapper.send(`select snap-ground`) + wrapper.send(`select move up 2`) + } + wrapper.send(`player teleport ${playername} testingarea`) + wrapper.send(`select move exact ${x},${z},${y}`) + command() + })(); + } + // + //CLONE COMMAND + // + if (answer.startsWith("clone")) { + (async () => { + const string = await wrapper.send("select tostring") + wrapper.send(`spawn string ${playername} ${string.ResultString}`) + })() + command() + }; + // + //RING OF THING + // + //rot syntax: rot (radius(m)) (count) (itemname) (up ammount) + if (answer.startsWith("rot ")) { + answerARR = answer.split(" "); + if(answerARR[4] == undefined) { + answerARR[4] = 0 + } + ro(answerARR[1], answerARR[2], answerARR[3], answerARR[4]) + command() + }; + // + //RING OF DEATH + // + if (answer.startsWith("rod")) { + ro(5, 40, "explosivespike", 10) + command() + }; + // + //quit command (literally just crashes the bot lmao) + // + if (answer.startsWith("quit")) { + quit + command() + }; + // + //set player's speed + // + if (answer.startsWith("speed ")) { + answerARR = answer.split(" "); + answerARR[1] = managers.namemanager(answerARR[1]) + if ((answerARR[1].contains() && isnumeric(answerARR[2]))) { + wrapper.send(`player setstat ${answerARR[1]} speed ${answerARR[2]}`) + } + else if ((answerARR[1] == undefined) && (answerARR[2] == undefined)) { + wrapper.send(`player setstat ${playername} speed 5`) + } + else if ((answerARR[1].contains(name)) && (answerARR[2] == undefined)){ + wrapper.send(`player setstat ${answerARR[1]} speed 5`) + } + else { + console.log("Blame Boris lmao") + } + command() + }; + // + //set a player's health + // + if (answer.startsWith("heal ")) { + answerARR = answer.split(" "); + answerARR[1] = managers.namemanager(answerARR[1]) + if ((answerARR[1].contains(name) && isnumeric(answerARR[2]))) { + wrapper.send(`player setstat ${answerARR[1]} health ${answerARR[2]}`) + } + else if ((answerARR[1] == undefined) && (answerARR[2] == undefined)) { + wrapper.send(`player setstat ${playername} health 100000`) + } + else if ((answerARR[1].contains(name)) && (answerARR[2] == undefined)){ + wrapper.send(`player setstat ${answerARR[1]} health 100000`) + } + else { + console.log("Blame Boris lmao") + } + command() + }; + // + //set a player's damage + // + if (answer.startsWith("strong ")) { + answerARR = answer.split(" "); + answerARR[1] = managers.namemanager(answerARR[1]) + if ((answerARR[1].contains(name) && isnumeric(answerARR[2]))) { + wrapper.send(`player setstat ${answerARR[1]} damage ${answerARR[2]}`) + } + else if ((answerARR[1] == undefined) && (answerARR[2] == undefined)) { + wrapper.send(`player setstat ${playername} damage 15`) + } + else if ((answerARR[1].contains(name)) && (answerARR[2] == undefined)){ + wrapper.send(`player setstat ${answerARR[1]} damage 15`) + } + else { + console.log("Blame Boris lmao") + } + command() + }; + if (answer.startsWith("godon ")) { + answerARR = answer.split(" "); + answerARR[1] = managers.namemanager(answerARR[1]) + if (answerARR[1].contains(name)) { + wrapper.send(`player godmodeon ${answerARR[1]}`) + } + else { + wrapper.send(`player godmodeon ${playername}`) + } + command() + }; + if (answer.startsWith("godoff ")) { + answerARR = answer.split(" "); + answerARR[1] = managers.namemanager(answerARR[1]) + if (answerARR[1].contains(name)) { + wrapper.send(`player godmodeoff ${answerARR[1]}`) + } + else { + wrapper.send(`player godmodeoff ${playername}`) + } + command() + }; + if (answer.startsWith("op ")) { + answerARR = answer.split(" "); + answerARR[1] = managers.namemanager(answerARR[1]) + if (answerARR[1].contains(name)) { + wrapper.send(`player modifystat ${answerARR[1]} damage 100000 300`) + wrapper.send(`player modifystat ${answerARR[1]} damageprotection 100000 300`) + wrapper.send(`player modifystat ${answerARR[1]} speed 2 300`) + } + else if (answerARR[1] == undefined) { + wrapper.send(`player modifystat ${playername} damage 100000 300`) + wrapper.send(`player modifystat ${playername} damageprotection 100000 300`) + wrapper.send(`player modifystat ${playername} speed 2 300`) + } + else { + console.log("Blame Boris lmao") + } + }; + //spawn command + //super lazy code + if (answer.startsWith("spawn ")) { + (async () => { + answerARR = answer.split(" "); + answerARR[1] = managers.namemanager(answerARR[1]) + //this V is SUPER lazy please dont ever code like me + let item + if(answerARR[5] != undefined) { + item = answerARR[2] + answerARR[3] + answerARR[4] + answerARR[5] + } else if(answerARR[4] != undefined) { + item = answerARR[2] + answerARR[3] + answerARR[4] + } else if(answerARR[3] != undefined) { + item = answerARR[2] + answerARR[3] + } else { + item = answerARR[2] + } + await wrapper.send(`spawn ${answerARR[1]} ${item}`) + //catch(error) {console.log("poi cant code for shit lmao")} + //console.log(result.Result) + command() + }) () + }; + //select get that outputs to console commands + if (answer.startsWith("select get")) { + (async () => { + let locat = await wrapper.send("select get"); + let { x, z, y } = locat.Result.Position + let { xr, zr, yr } = locat.Result.Rotation + console.log(`select move exact ${x},${z},${y}`) + console.log(`select rotate exact ${xr},${zr},${yr}`) + console.log(`name: ${locat.Result.Name}`) + command() + }) () + }; + // + //daytime + // + if (answer.startsWith("day")) { + wrapper.send("time set 7") + command() + }; + // + //nighttime + // + if (answer.startsWith("night")) { + wrapper.send("time set 20") + command() + }; + // + //Buys all skills + // + if (answer.startsWith("SkillsAll ")) { + (async () => { + answerARR = answer.split(" "); + answerARR[1] = namemanager(answerARR[1]) + while(i{ + let selection = await wrapper.send(`select get`) + if(selection.Result) { + let response = await wrapper.send(`select tostring`) + var location = await wrapper.send(`select get`) + let string = response.ResultString.split(",") + await wrapper.send(`select destroy`) + //11 but js from 0 + string[10] = 1036831949 + string = string.toString() + //console.log(response, location, string, location.Result.Position.toString()) + wrapper.send(`spawn string ${playername} ${string}`) + wrapper.send(`select move exact ${location.Result.Position.toString()}`) + wrapper.send(`select rotate exact ${location.Result.Rotation.toString()}`) + } + })() + command() + } + if (answer.startsWith("")) { + command() + }; + })} + }) + })() + }) + } + //Hash Password + function convertPassToHash( username, password, botToken ) + { + // The SHA512 hash generated by crypto-js/sha512 will be 128 characters + if ( password.length !== 128 ) + { + console.log( "Plaintext password encountered, converting to SHA512 hash for permanent storage" ); + newPass = alta_jsapi.Sessions.hashPassword(password) + newFile = { "username" : username, "password" : newPass, "botToken": botToken }; + fs.writeFile('./credentials.json', JSON.stringify( newFile, null, 4 ), function( err ) { + if ( err ) + { + console.log( err ); + } else { + console.log( "New credentials.json saved" ); + } + }); + password = newPass; + } + return password; + } + } \ No newline at end of file diff --git a/BorisBotV1/indexpoige.js b/BorisBotV1/indexpoige.js new file mode 100644 index 0000000..53d6fb3 --- /dev/null +++ b/BorisBotV1/indexpoige.js @@ -0,0 +1,1476 @@ +//Load required classes. +const { WebsocketBot } = require('att-bot-core'); +const { BasicWrapper } = require('att-websockets'); +const jsapi = require('alta-jsapi') + +const createapi = require('./output') +//Load information from credentials and config +const { username, password } = require("./credentials"); +const { targetServers } = require("./config"); +const fs = require('fs'); +//readline stuffs +const readline = require('readline'); +const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout +}); +//variables +{ + var loop = 0; + var i = 0; + var i2 = 0; + var x = 0; + var y = 0; + var z = 0; + var r = 5; + var a = 0; + var b = 0; + var x2 = 0; + var y2 = 0; + var z2 = 0; + var x3 = 0; + var y3 = 0; + var z3 = 0; + var smf = "select move forward "; + var sml = "select move left "; + var pi = Math.PI; + var smfx = "select move forward "; + var smly = "select move left "; + var dat = []; + var playername = username; + var playername2 = username; + var playerid = null; + var playerid2 = null; + var deletes; + var powspir = .5; + var mulspir = 55; + var turnFraction = -0.6005000; + var numpoints = 400; + var upheight = 20; + var dist; + var angle; + var parse = false; + var midarray; + //var fak = createapi.default(wrapper) +} +//Run the program +main(); + + +async function main() +{ + + //Create a new bot + const bot = new WebsocketBot(); + + //Login. Use "loginWithHash" if you're storing a hashed version of the password + await bot.login(username, password); + + //Run the bot. + //When any of the 'targetServers' are available, a connection is automatically created. + await bot.run(test => targetServers.includes(test.id), async (server, connection) => + { + + + var wrapper = new BasicWrapper(connection); + wrapper.subscribe("TraceLog", data => {}); + //subscriptions + wrapper.subscribe("PlayerKilled", data => + { + (async ()=>{ + await new Promise(r => setTimeout(r, 10000)) + wrapper.send(`spawn string ${data.killedPlayer.username} 40748,238,40748,1153596956,1131759753,1152314055,3166093433,3207611429,1017707607,1060732130,1065353237,2290978823,418,1153596956,1131759753,1152314055,3166093433,3207611429,1017707607,1060732130,784502081,1314217728,248297180,0,0,0,363610349,2147483656,1058831617,4171539668,2147483664,0,0,703843710,2147483648,1073741824,1901,3221225536,3181911225,2415919106,619548216,54023745,2013265920,2147483648,64208762,1,2214592512,17891632,4227858479,3935379412,872415232,2181038080,37861376,0,228,33554432,2180306929,763363328,272629760,8388608,0,0,|93,3801256786,2,272188517,1,237360636,1,391977879,1,22446553,1,2617495528,1,2272630171,1,1217391130,1,276353327,1,1823429789,1,3445325106,1,2126500253,1,2624099526,1,1871432223,1,3373651539,1,2907231276,1,654225716,1,1454441398,1,3704379512,1,3257374625,1,2262399392,2,3146178080,1,661497638,1,2293737711,1,2190886200,1,3920618075,1,3665939353,1,3901697682,1,1211178616,1,2951515968,1,1588536425,1,70871065,1,3101665521,1,2815374842,1,4081488368,1,3820454400,2,1624211074,1,7704646,1,1651678475,1,2400796504,1,910018632,2,4144776006,3,2975913730,1,2169673426,1,3450348902,1,1233775263,1,43510150,2,1645673210,2,4095875831,1,2314081177,1,2590537994,2,2443660852,1,4248664925,1,634164392,5,3642863935,2,1931537627,1,259381630,1,3932346318,1,2978388169,1,1431397437,2,3070493599,2,3588929783,1,3640332570,1,1787084913,3,1454955908,1,788405183,1,2563567105,2,766675725,1,2882590463,1,1499506132,1,205333986,1,4179293747,1,3236280681,2,902024186,1,2450553269,1,2629079826,1,963907309,1,1753993206,1,1923918202,1,1776498660,1,3638500874,2,1098050191,3,3084373371,1,4163873252,1,1587058252,1,2592242915,2,1962842866,1,4282337604,1,3561515449,1,2290978823,1,3674519521,1,4109360768,2,3457519710,2,`) + })() + } + ) + wrapper.subscribe("PlayerJoined", data => + { + (async ()=>{ + await new Promise(r => setTimeout(r, 10000)) + wrapper.send(`spawn string ${data.user.username} 40748,238,40748,1153596956,1131759753,1152314055,3166093433,3207611429,1017707607,1060732130,1065353237,2290978823,418,1153596956,1131759753,1152314055,3166093433,3207611429,1017707607,1060732130,784502081,1314217728,248297180,0,0,0,363610349,2147483656,1058831617,4171539668,2147483664,0,0,703843710,2147483648,1073741824,1901,3221225536,3181911225,2415919106,619548216,54023745,2013265920,2147483648,64208762,1,2214592512,17891632,4227858479,3935379412,872415232,2181038080,37861376,0,228,33554432,2180306929,763363328,272629760,8388608,0,0,|93,3801256786,2,272188517,1,237360636,1,391977879,1,22446553,1,2617495528,1,2272630171,1,1217391130,1,276353327,1,1823429789,1,3445325106,1,2126500253,1,2624099526,1,1871432223,1,3373651539,1,2907231276,1,654225716,1,1454441398,1,3704379512,1,3257374625,1,2262399392,2,3146178080,1,661497638,1,2293737711,1,2190886200,1,3920618075,1,3665939353,1,3901697682,1,1211178616,1,2951515968,1,1588536425,1,70871065,1,3101665521,1,2815374842,1,4081488368,1,3820454400,2,1624211074,1,7704646,1,1651678475,1,2400796504,1,910018632,2,4144776006,3,2975913730,1,2169673426,1,3450348902,1,1233775263,1,43510150,2,1645673210,2,4095875831,1,2314081177,1,2590537994,2,2443660852,1,4248664925,1,634164392,5,3642863935,2,1931537627,1,259381630,1,3932346318,1,2978388169,1,1431397437,2,3070493599,2,3588929783,1,3640332570,1,1787084913,3,1454955908,1,788405183,1,2563567105,2,766675725,1,2882590463,1,1499506132,1,205333986,1,4179293747,1,3236280681,2,902024186,1,2450553269,1,2629079826,1,963907309,1,1753993206,1,1923918202,1,1776498660,1,3638500874,2,1098050191,3,3084373371,1,4163873252,1,1587058252,1,2592242915,2,1962842866,1,4282337604,1,3561515449,1,2290978823,1,3674519521,1,4109360768,2,3457519710,2,`) + })() + } + ) + + var result = await wrapper.send("player list-detailed") + console.log(result.Result); + if(playername !== "poiuytrewq4645") { + console.log('\x1b[31m%s\x1b[0m', 'PLAYER NAME ISNT POI') + } + setid() + setid2(playername) + + + + + + //functions + + async function ro(rad, amnt, item, up) { + while (i setTimeout(r, 100)); + i++ + } + i=0 + } + async function newke2(amnt, item) { + while(i setTimeout(r, 100)); + i++ + } + i=0 + } + function namemanager(name) { + if(name == undefined) { + name = playername + } + if(name == "") { + name = playername + } + if(name == "poi") { + name = "poiuytrewq4645" + } + if(name == "league") { + console.log('\x1b[31m%s\x1b[0m', 'DONT YOU GO NUKING PPL NOW') + name = "league" + } + console.log(name); + return name + } + async function getid() { + var result = await wrapper.send(`player detailed ${playername}`) + + console.log(result.Result.Body.Identifier) + command() + } + + async function setid() { + + var result = await wrapper.send(`player detailed ${playername}`) + + playerid = result.Result.Body.Identifier + console.log(playerid) + command() + } + + async function setid2(playerinternal) { + playerinternal = namemanager(playerinternal) + var result = await wrapper.send(`player detailed ${playerinternal}`) + + playerid2 = result.Result.Body.Identifier + console.log(playerid) + command() + } + + async function spiral(item) { + setid() + wrapper.send(`select ${playerid}`) + var location = await wrapper.send("select get") + x2 = location.Result.Position[0] + z2 = location.Result.Position[1] + y2 = location.Result.Position[2] + while(i < numpoints) { + dst = Math.pow(i / (numpoints - 1), powspir) + angle = 2 * Math.PI * turnFraction * i + x = dst * Math.cos(angle) * mulspir + y = dst * Math.sin(angle) * mulspir + z = upheight + (i/30) + console.log("z",z) + x = x+x2 + y = y+y2 + z = z+z2 + + console.log(x,y,z) + //await new Promise(r => setTimeout(r, 20)) + wrapper.send(`spawn exact ${x},${z},${y} 0,0,0 ${item} fakujoel`) + console.log(i) + i++ + } + i=0 + command() + } + // these dont work- just copy them into async code + /*async function plyr1crds() { + wrapper.send(`select ${playerid}`) + var location = await wrapper.send("select get") + x2 = location.Result.Position[0] + z2 = location.Result.Position[1] + y2 = location.Result.Position[2] + //console.log(location) + }*/ + + /*async function plyr2crds() { + wrapper.send(`select ${playerid2}`) + var location = await wrapper.send("select get") + x3 = location.Result.Position[0] + z3 = location.Result.Position[1] + y3 = location.Result.Position[2] + //console.log(location) + }*/ + + function teleportmanager(location) { + console.log(location) + switch (location) { + + case "Mountain": + return [-1259,1000.69,942] + break + case "000": + return [0,1000.69,0] + break + case "EE": + return [-174.5,1000.69,-644.5] + break + case "GW": + return [-639.453,1000.69,-82.208] + break + case "SC": + return [-329.748,1000.69,-343.807] + break + case "Blacksmith Building": + return [-717.2,1000.69,12.7] + break + case "Town Hall": + return [-895.2,1000.69,93.9] + break + case "Archery": + return [-835,1000.69,385] + break + case "Blacksmith": + return [-642.704,1000.69,19.363] + break + case "Combat": + return [-1403.3,1000.69,161] + break + case "Woodcutting": + return [-404.3,1000.69,19.6] + break + case "Mining": + return [-825.419,1000.69,-59.953] + break + case "Dust Bowl": + return [-581,1000.69,325.3] + break + case "Mines": + return [-897.749,1000.69,-160.403] + break + case "Outback Mountain": + return [988.816,1000.69,-736.122] + break + case "Oo Mountain": + return [1019.675,1000.69,-1371.084] + break + + default: + return null + break + } + + } + + async function spiralstring(string1,string2,string3,string4) { + setid() + wrapper.send(`select ${playerid}`) + var location = await wrapper.send("select get") + x2 = location.Result.Position[0] + z2 = location.Result.Position[1] + y2 = location.Result.Position[2] + + while(i < numpoints) { + dst = Math.pow(i / (numpoints - 1), powspir) + angle = 2 * Math.PI * turnFraction * i + x = dst * Math.cos(angle) * mulspir //* 5 + y = dst * Math.sin(angle) * mulspir //* 5 + z = -1 + x = x+x2 + y = y+y2 + z = z+z2 + + console.log(x,y,z) + + //try selecting around player and searching for higest id + + /*var id = await */ + if(i%4 == 0) { + wrapper.send(`spawn string ${playername} ${string4}`) + } + else if(i%3 == 0) { + wrapper.send(`spawn string ${playername} ${string3}`) + } + else if(i%2 == 0) { + wrapper.send(`spawn string ${playername} ${string2}`) + } + else if(i%1 == 0) { + wrapper.send(`spawn string ${playername} ${string1}`) + } + + /*wrapper.send(`select ${id.Result[0].Identifier}`) + dat.push(id.Result[0].Identifier)*/ + wrapper.send(`select move exact ${x},${z + 2},${y}`) + console.log(i) + i++ + } + console.log(dat) + /*while(i > -1) { + wrapper.send(`select ${dat[i]}`) + wrapper.send(`select destroy`) + i-- + }*/ + i=0 + command() + } + + command() + async function command() { + + rl.question('command?: ', (answer) => { + //player list detailed + if (answer.startsWith("playerlist")) { + playerlist() + async function playerlist() { + var result = await wrapper.send("player list-detailed") + result.Result.forEach(result => { + console.log(result.username) + console.log(result.Body.Identifier) + console.log(result.id) + } + ) + } + /*if (answer.startsWith("playerlist")) { + playerlist() + async function playerlist() { + var result = await wrapper.send("player list-detailed") + console.log(result.Result); + }*/ + command() + }; + //flinthell + if (answer.startsWith("flinthell")) { + while (i<500) { + wrapper.send(`spawn ${playername} flint`) + i++ + }; + i=0 + command() + }; + //ringofdeath + if (answer.startsWith("rod")) { + ro(5, 180, "explosivespike", 10) + command() + }; + //ZONE OF DEATH + if (answer.startsWith("zod")) { + ro(1, 3, "explosivespike", 10) + ro(2, 5, "explosivespike", 10) + ro(3, 7, "explosivespike", 10) + ro(4, 10, "explosivespike", 10) + ro(5, 15, "explosivespike", 10) + ro(6, 20, "explosivespike", 10) + ro(7, 30, "explosivespike", 10) + ro(8, 30, "explosivespike", 10) + ro(9, 30, "explosivespike", 10) + ro(10, 30, "explosivespike", 10) + ro(11, 30, "explosivespike", 10) + ro(12, 50, "explosivespike", 10) + command() + }; + //ringofpotions + if (answer.startsWith("rop")) { + //ro(rad, amnt, item, up) + setTimeout(ro, 0, 5, 25, "potionmedium", 5) + setTimeout(ro, 800, 6, 30, "potionmedium", 5) + setTimeout(ro, 1500, 7, 35, "potionmedium", 5) + command() + }; + //ringofslow + if (answer.startsWith("rosl")) { + ro(3, 90, "goteraseedlingorb", 10) + command() + }; + //daytime + if (answer.startsWith("tss")) { + wrapper.send("time set 7") + command() + }; + //nighttime + if (answer.startsWith("tsn")) { + wrapper.send("time set 20") + command() + }; + //ringofmoney + if (answer.startsWith("rom")) { + ro(3, 20, "goldcoin", 2) + command() + }; + //ringofvines + if (answer.startsWith("rov")) { + ro(4, 360, "BreakableRootHangingStraight", -1) + command() + }; + //change the selected player for playername + if (answer.startsWith("changename ")) { + answerARR = answer.split(" "); + playername = namemanager(answerARR[1]) + setid() + console.log(`changed the selected name and id to "${playername}", "${playerid}"`); + command() + }; + //change the selected player for playername2 + if (answer.startsWith("changename2 ")) { + answerARR = answer.split(" "); + + playername2 = namemanager(answerARR[1]) + setid2(playername2) + console.log(`changed the second selected name and id to "${playername2}", ${playerid2}`); + command() + }; + //teleport either the selected player or the player thats inputted to testing area + if (answer.startsWith("testingarea")) { + answerARR = answer.split(" "); + answerARR[1] = namemanager(answerARR[1]) + wrapper.send(`player teleport ${answerARR[1]} testingarea`) + command() + }; + //teleport either the selected player or the player thats inputted to spawn + if (answer.startsWith("rspwn")) { + answerARR = answer.split(" "); + answerARR[1] = namemanager(answerARR[1]) + wrapper.send(`player teleport ${answerARR[1]} respawnpoint`) + command() + }; + //just a fucking nuke lol + if (answer.startsWith("newke")) { + newke(200) + command() + }; + //like newke but a circle + if (answer.startsWith("ron")) { + ro(3, 90, "explosivespike", 10) + ro(3, 90, "dynamite", 0) + command(); + i=0 + command() + }; + //like above but with fireworks + if (answer.startsWith("rof")) { + ro(3, 90, "explosivespike", 10) + ro(3, 90, "firework", 0) + command(); + i=0 + command() + }; + //ring of gold + if (answer.startsWith("rog")) { + ro(5, 30, "goldingot", 0) + command(); + i=0 + command() + }; + // ing of whatever item youm want + if (answer.startsWith("ro")) { + answerARR = answer.split(" "); + ro(5, 10, answerARR[1], -1) + command() + }; + //like ro but fully customizable + if (answer.startsWith("rot")) { + answerARR = answer.split(" "); + ro(answerARR[1], answerARR[2], answerARR[3], answerARR[4]) + command() + }; + //a help command + //need to expand + if (answer.startsWith("help")) { + answerARR = answer.split(" "); + if (answerARR[1] = "rot") { + console.log("syntax: rot (radius) (amount) (item) (up dist)") + } + command() + }; + //send commands to console bypassing bot and not collecting $200 + if (answer.startsWith("cmmd")) { + answer = answer.slice(5) + (async () => { var result = await wrapper.send(answer) + console.log(result.Result) + command() + }) () + }; + //send the id of selected/entered player to console + if (answer.startsWith("id")) { + answerARR = answer.split(" "); + answerARR[1] = namemanager(answerARR[1]) + getid() + async function sendcommand() {var result = await wrapper.send(`player id ${answerARR[1]}`) + console.log(result.Result.id) + command() + } + sendcommand() + }; + //quit + if (answer.startsWith("quit")) { + quit + command() + }; + //set player's speed + if (answer.startsWith("speed ")) { + answerARR = answer.split(" "); + answerARR[1] = namemanager(answerARR[1]) + wrapper.send(`player setstat ${answerARR[1]} speed ${answerARR[2]}`) + command() + }; + //set a player's health + if (answer.startsWith("heal ")) { + answerARR = answer.split(" "); + answerARR[1] = namemanager(answerARR[1]) + wrapper.send(`player setstat ${answerARR[1]} health ${answerARR[2]}`) + command() + }; + //set a player's damage + if (answer.startsWith("damage")) { + answerARR = answer.split(" "); + answerARR[1] = namemanager(answerARR[1]) + wrapper.send(`player setstat ${answerARR[1]} damage ${answerARR[2]}`) + command() + }; + //hue + if (answer.startsWith("fireworktest ")) { + while(i<25) { + //yellow + wrapper.send("spawn string poiuytrewq4645 40748,238,40748,3293268740,1124524024,1097099520,3167335126,1064044012,3178461380,3200485162,1065353224,2290978823,418,3293268740,1124524024,1097099520,3167335126,1064044012,3178461380,3200485162,3221225472,0,0,0,0,0,363610349,2147483656,779697565,2024056020,2147483664,280860479,2684362763,703843710,2147483648,1610612736,1901,3221225536,3181911225,2415919106,553517056,54023745,2013265920,2147483648,64208762,1,2214592512,11035970,3305111808,647045076,872415232,2181038080,37861376,0,228,33554432,2180306929,763363328,272629760,25165824,0,0,|92,3801256786,2,272188517,1,237360636,1,391977879,1,22446553,1,2617495528,1,2272630171,1,1217391130,1,276353327,1,1823429789,1,3445325106,1,2126500253,1,2624099526,1,1871432223,1,3373651539,1,2907231276,1,654225716,1,1454441398,1,3227511059,1,3704379512,1,3257374625,1,2262399392,2,3146178080,1,661497638,1,2293737711,1,2190886200,1,3920618075,1,3665939353,1,3901697682,1,1211178616,1,2951515968,1,1588536425,1,70871065,1,3101665521,1,2815374842,1,4081488368,1,3820454400,2,1651678475,1,2400796504,1,910018632,2,4144776006,3,2975913730,1,2169673426,1,3450348902,1,1233775263,1,43510150,2,1645673210,2,2629079826,1,963907309,1,1753993206,1,1923918202,1,1776498660,1,4095875831,1,2314081177,1,2590537994,1,2443660852,1,4248664925,1,634164392,2,3642863935,2,259381630,1,3932346318,1,2978388169,1,1431397437,2,3070493599,2,3588929783,1,3640332570,1,1787084913,3,1650910821,1,1454955908,1,788405183,1,2563567105,2,766675725,1,2882590463,1,1499506132,1,205333986,1,4179293747,1,3236280681,1,902024186,1,2450553269,1,3638500874,2,1098050191,2,3084373371,1,4163873252,1,1587058252,1,2592242915,2,1962842866,1,4282337604,1,3561515449,1,2290978823,1,3674519521,1,4109360768,2,3457519710,2,") + //green + wrapper.send("spawn string poiuytrewq4645 40748,238,40748,3291252396,1124083377,1120039616,0,0,0,1065353216,1065353231,2290978823,418,3291252396,1124083377,1120039616,0,0,0,1065353216,3221225472,0,0,0,0,0,363610349,2147483656,779697565,2024056020,2147483664,601618698,536879115,1777585534,2147483648,1610612736,1901,3221225536,3181911225,2415919106,553517056,54023745,2013265920,2147483648,64208762,1,2214592512,13231031,3305111808,881926100,872415232,2181038080,37861376,0,228,33554432,2180306929,763363328,272629760,16777216,0,0,|92,3801256786,2,272188517,1,237360636,1,391977879,1,22446553,1,2617495528,1,2272630171,1,1217391130,1,276353327,1,1823429789,1,3445325106,1,2126500253,1,2624099526,1,1871432223,1,3373651539,1,2907231276,1,654225716,1,1454441398,1,3227511059,1,3704379512,1,3257374625,1,2262399392,2,3146178080,1,661497638,1,2293737711,1,2190886200,1,3920618075,1,3665939353,1,3901697682,1,1211178616,1,2951515968,1,1588536425,1,70871065,1,3101665521,1,2815374842,1,4081488368,1,3820454400,2,1651678475,1,2400796504,1,910018632,2,4144776006,3,2975913730,1,2169673426,1,3450348902,1,1233775263,1,43510150,2,1645673210,2,2629079826,1,963907309,1,1753993206,1,1923918202,1,1776498660,1,4095875831,1,2314081177,1,2590537994,1,2443660852,1,4248664925,1,634164392,2,3642863935,2,259381630,1,3932346318,1,2978388169,1,1431397437,2,3070493599,2,3588929783,1,3640332570,1,1787084913,3,1650910821,1,1454955908,1,788405183,1,2563567105,2,766675725,1,2882590463,1,1499506132,1,205333986,1,4179293747,1,3236280681,1,902024186,1,2450553269,1,3638500874,2,1098050191,2,3084373371,1,4163873252,1,1587058252,1,2592242915,2,1962842866,1,4282337604,1,3561515449,1,2290978823,1,3674519521,1,4109360768,2,3457519710,2,") + //blue + wrapper.send("spawn string poiuytrewq4645 40748,238,40748,3291224682,1124083377,1120154272,0,0,0,1065353216,1065353234,2290978823,418,3291224682,1124083377,1120154272,0,0,0,1065353216,3221225472,0,0,0,0,0,363610349,2147483656,779697565,2024056020,2147483664,973981719,2684362763,703843710,2147483648,1610612736,1901,3221225536,3181911225,2415919106,553517056,54023745,2013265920,2147483648,64208762,1,2214592512,21475918,4110418176,881926100,872415232,2181038080,37861376,0,228,33554432,2180306929,763363328,272629760,8388608,0,0,|92,3801256786,2,272188517,1,237360636,1,391977879,1,22446553,1,2617495528,1,2272630171,1,1217391130,1,276353327,1,1823429789,1,3445325106,1,2126500253,1,2624099526,1,1871432223,1,3373651539,1,2907231276,1,654225716,1,1454441398,1,3227511059,1,3704379512,1,3257374625,1,2262399392,2,3146178080,1,661497638,1,2293737711,1,2190886200,1,3920618075,1,3665939353,1,3901697682,1,1211178616,1,2951515968,1,1588536425,1,70871065,1,3101665521,1,2815374842,1,4081488368,1,3820454400,2,1651678475,1,2400796504,1,910018632,2,4144776006,3,2975913730,1,2169673426,1,3450348902,1,1233775263,1,43510150,2,1645673210,2,2629079826,1,963907309,1,1753993206,1,1923918202,1,1776498660,1,4095875831,1,2314081177,1,2590537994,1,2443660852,1,4248664925,1,634164392,2,3642863935,2,259381630,1,3932346318,1,2978388169,1,1431397437,2,3070493599,2,3588929783,1,3640332570,1,1787084913,3,1650910821,1,1454955908,1,788405183,1,2563567105,2,766675725,1,2882590463,1,1499506132,1,205333986,1,4179293747,1,3236280681,1,902024186,1,2450553269,1,3638500874,2,1098050191,2,3084373371,1,4163873252,1,1587058252,1,2592242915,2,1962842866,1,4282337604,1,3561515449,1,2290978823,1,3674519521,1,4109360768,2,3457519710,2,") + //red + wrapper.send("spawn string poiuytrewq4645 40748,238,40748,3291255956,1124083377,1120086944,0,0,0,1065353216,1065353218,2290978823,418,3291255956,1124083377,1120086944,0,0,0,1065353216,3221225472,0,0,0,0,0,363610349,2147483656,779697565,2024056020,2147483664,325791935,2684362764,2851327358,2147483648,1610612736,1901,3221225536,3181911225,2415919106,553517056,54023745,2013265920,2147483648,64208762,1,2214592512,26382226,2298478848,881926100,872415232,2181038080,37861376,0,228,33554432,2180306929,763363328,272629760,0,0,0,|92,3801256786,2,272188517,1,237360636,1,391977879,1,22446553,1,2617495528,1,2272630171,1,1217391130,1,276353327,1,1823429789,1,3445325106,1,2126500253,1,2624099526,1,1871432223,1,3373651539,1,2907231276,1,654225716,1,1454441398,1,3227511059,1,3704379512,1,3257374625,1,2262399392,2,3146178080,1,661497638,1,2293737711,1,2190886200,1,3920618075,1,3665939353,1,3901697682,1,1211178616,1,2951515968,1,1588536425,1,70871065,1,3101665521,1,2815374842,1,4081488368,1,3820454400,2,1651678475,1,2400796504,1,910018632,2,4144776006,3,2975913730,1,2169673426,1,3450348902,1,1233775263,1,43510150,2,1645673210,2,2629079826,1,963907309,1,1753993206,1,1923918202,1,1776498660,1,4095875831,1,2314081177,1,2590537994,1,2443660852,1,4248664925,1,634164392,2,3642863935,2,259381630,1,3932346318,1,2978388169,1,1431397437,2,3070493599,2,3588929783,1,3640332570,1,1787084913,3,1650910821,1,1454955908,1,788405183,1,2563567105,2,766675725,1,2882590463,1,1499506132,1,205333986,1,4179293747,1,3236280681,1,902024186,1,2450553269,1,3638500874,2,1098050191,2,3084373371,1,4163873252,1,1587058252,1,2592242915,2,1962842866,1,4282337604,1,3561515449,1,2290978823,1,3674519521,1,4109360768,2,3457519710,2,") + i++ + } + i=0 + command() + }; + //explosivespike spiral + if (answer.startsWith("exspir")) { + spiral("explosivespike") + command() + }; + //customisable spiral + if (answer.startsWith("cspir ")) { + answerARR = answer.split(" "); + spiral(answerARR[1]) + command() + }; + //tomato spiral + if (answer.startsWith("tomat")) { + spiral("tomatofullripe") + command() + } + //handtest + if (answer.startsWith("ht")) { + setid() + wrapper.send(`select snap-to ${playerid + 3}`) + + command() + }; + //spiral of fireworks (broken) + if (answer.startsWith("firspir")) { + //blue + spiralstring("40748,238,40748,1102324111,1087096292,1101905327,0,0,2969567230,1065353216,1065353234,2290978823,418,1102324111,1087096292,1101905327,0,0,2969567230,1065353216,216037828,272971723,0,0,0,0,363610349,2147483656,779697565,2024056020,2147483664,1017128448,2147483653,3925069182,2147483648,1610612736,1901,3221225536,3181911225,2415919106,620504393,2000180801,2013265920,2147483648,64208762,1,2214592512,15651320,3825205248,76619732,872415232,2181038080,37861376,0,228,33554432,2180306929,763363328,272629760,8388608,0,0," + ,"40748,238,40748,1095729689,1067394135,3236749396,0,0,2969567230,1065353216,1065353231,2290978823,418,1095729689,1067394135,3236749396,0,0,2969567230,1065353216,210428035,267251337,0,0,0,0,363610349,2147483656,779697565,2024056020,2147483664,906752342,1073741831,703843710,2147483648,1610612736,1901,3221225536,3181911225,2415919106,620551526,389568065,2013265920,2147483648,64208762,1,2214592512,26316849,2080374784,143728596,872415232,2181038080,37861376,0,228,33554432,2180306929,763363328,272629760,16777216,0,0," + ,"40748,238,40748,1098275414,1081449556,3235809248,0,0,0,1065353216,1065353224,2290978823,418,1098275414,1081449556,3235809248,0,0,0,1065353216,0,271914786,3221225472,0,0,0,363610349,2147483656,779697565,2024056020,2147483664,494606384,6,1777585534,2147483648,1610612736,1901,3221225536,3181911225,2415919106,620520345,1127765569,2013265920,2147483648,64208762,1,2214592512,1509020,771751936,177283028,872415232,2181038080,37861376,0,228,33554432,2180306929,763363328,272629760,25165824,0,0," + ,"40748,238,40748,1098955205,1081794856,3234133429,0,0,2969567230,1065353216,1065353218,2290978823,418,1098955205,1081794856,3234133429,0,0,2969567230,1065353216,214691300,1345418594,0,0,0,0,363610349,2147483656,779697565,2024056020,2147483664,1011978036,2147483655,703843710,2147483648,1610612736,1901,3221225536,3181911225,2415919106,620521477,859330113,2013265920,2147483648,64208762,1,2214592512,3783909,4160749568,177283028,872415232,2181038080,37861376,0,228,33554432,2180306929,763363328,272629760,0,0,0,") + command() + }; + + + + //get line of points between two players + if (answer.startsWith("lnt ")) { + lnt() + async function lnt() { + answerARR = answer.split(" "); + //get the target player's id + setid2(answerARR[1]) + //set player to crds + wrapper.send(`select ${playerid}`) + var location = await wrapper.send("select get") + var [x2, z2, y2] = location.Result.Position; + //target player to crds + wrapper.send(`select ${playerid2}`) + var location = await wrapper.send("select get") + var [x3, z3, y3] = location.Result.Position; + + /*x3 = 1585 + y3 = 1431 + z3 = z2*/ + // example numbers + // x2 100 x3 120 x = 20 + // y2 14 y3 50 y = 36 + // h = 41.1825205639 + // angle = ‭29.0546040991 + x = x3 - x2 + y = y3 - y2 + //while i is less then 3x hyp + while(i < (Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2))) ) { + wrapper.send(`select ${playerid2}`) + var location = await wrapper.send("select get") + var [x3, z3, y3] = location.Result.Position; + x = x3 - x2 + y = y3 - y2 + console.log(i) + var angle = Math.atan(x/y) + if (x < 0 && y > 0 || x > 0 && y > 0) { + //console.log('\x1b[31m%s\x1b[0m', `A + //x ${x} y ${y}`) + x3 = Math.sin(angle) * i + x2 + y3 = Math.cos(angle) * i + y2 + } + else { + //console.log('\x1b[31m%s\x1b[0m', `B + //x ${x} y ${y}`) + x3 = Math.sin(angle) * -i + x2 + y3 = Math.cos(angle) * -i + y2 + } + console.log(`x3 ${x3}, y3 ${y3}, z2 ${z2}, angle ${angle}, `) + await new Promise(r => setTimeout(r, 50)); + wrapper.send(`spawn exact ${x3},${z2 + 10},${y3} 0,0,0 explosivespike fakujoel`) + i++ + } + //roe(3, 90, "explosivespike", 10, x3, y3, z3) + //spiral("explosivespike") + i=0 + } + command() + }; + + if (answer.startsWith("chase")) { + chase() + async function chase() { + answerARR = answer.split(" "); + setid2(answerARR[1]) + //set player to crds + wrapper.send(`select ${playerid}`) + var location = await wrapper.send("select get") + var [x2, z2, y2] = location.Result.Position; + //target player to crds + wrapper.send(`select ${playerid2}`) + var location = await wrapper.send("select get") + var [x3, z3, y3] = location.Result.Position; + x = x3 - x2 + y = y3 - y2 + //while i is less then 3x hyp + var spikeid = await wrapper.send(`spawn ${playername} potionmedium`) + console.log(spikeid.Result[0].Identifier) + while(i < (Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2))) ) { + wrapper.send(`select ${playerid2}`) + var location = await wrapper.send("select get") + x3 = location.Result.Position[0] + z3 = location.Result.Position[1] + y3 = location.Result.Position[2] + x = x3 - x2 + y = y3 - y2 + console.log(i) + var angle = Math.atan(x/y) + if (x < 0 && y > 0 || x > 0 && y > 0) { + //console.log('\x1b[31m%s\x1b[0m', `A + //x ${x} y ${y}`) + x3 = Math.sin(angle) * i + x2 + y3 = Math.cos(angle) * i + y2 + } + else { + //console.log('\x1b[31m%s\x1b[0m', `B + //x ${x} y ${y}`) + x3 = Math.sin(angle) * -i + x2 + y3 = Math.cos(angle) * -i + y2 + } + console.log(`x3 ${x3}, y3 ${y3}, z2 ${z2}, angle ${angle}, `) + wrapper.send(`select ${spikeid.Result[0].Identifier}`) + await wrapper.send(`select move exact ${x3},${z3 + 10},${y3}`) + i++ + } + i=0 + while(i < 30) { + wrapper.send(`select ${playerid2}`) + var location = await wrapper.send("select get") + x3 = location.Result.Position[0] + z3 = location.Result.Position[1] + y3 = location.Result.Position[2] + wrapper.send(`select ${spikeid.Result[0].Identifier}`) + await wrapper.send(`select move exact ${x3},${z3 + 10-(i/5)},${y3}`) + i++ + } + i=0 + } + command() + }; + + if (answer.startsWith("lst ")) { + lst() + async function lst() { + answerARR = answer.split(" "); + //get the target player's id + setid2(answerARR[1]) + //set player to crds + wrapper.send(`select ${playerid}`) + var location = await wrapper.send("select get") + var [x2, z2, y2] = location.Result.Position; + //target player to crds + wrapper.send(`select ${playerid2}`) + var location = await wrapper.send("select get") + var [x3, z3, y3] = location.Result.Position; + + /*x3 = 1585 + y3 = 1431 + z3 = z2*/ + // example numbers + // x2 100 x3 120 x = 20 + // y2 14 y3 50 y = 36 + // h = 41.1825205639 + // angle = ‭29.0546040991 + x = x3 - x2 + y = y3 - y2 + //while i is less then 3x hyp + while(i < (Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2))) ) { + wrapper.send(`select ${playerid2}`) + var location = await wrapper.send("select get") + var [x3, z3, y3] = location.Result.Position; + x = x3 - x2 + y = y3 - y2 + console.log(i) + var angle = Math.atan(x/y) + if (x < 0 && y > 0 || x > 0 && y > 0) { + //console.log('\x1b[31m%s\x1b[0m', `A + //x ${x} y ${y}`) + x3 = Math.sin(angle) * i + x2 + y3 = Math.cos(angle) * i + y2 + } + else { + //console.log('\x1b[31m%s\x1b[0m', `B + //x ${x} y ${y}`) + x3 = Math.sin(angle) * -i + x2 + y3 = Math.cos(angle) * -i + y2 + } + console.log(`x3 ${x3}, y3 ${y3}, z2 ${z2}, angle ${angle}, `) + await new Promise(r => setTimeout(r, 50)); + wrapper.send(`spawn exact ${x3},${z2 + 10},${y3} 0,0,0 ${answerARR[2]} fakujoel`) + i++ + } + //roe(3, 90, "explosivespike", 10, x3, y3, z3) + //spiral("explosivespike") + i=0 + } + command() + }; + + + if (answer.startsWith("spin")) { + spin() + async function spin() { + while(i < 1800) { + await new Promise(r => setTimeout(r, 5)); + wrapper.send(`select rotate yaw 15`) + i++ + } + i=0 + } + command() + }; + + if (answer.startsWith("hammer")) { + spin() + async function spin() { + while(i < 1800) { + await new Promise(r => setTimeout(r, 5)); + wrapper.send(`select move up 0.2`) + await new Promise(r => setTimeout(r, 5)); + wrapper.send(`select move down 0.2`) + i++ + } + i=0 + } + command() + }; + + + //line spike + /*if (answer.startsWith("lst ")) { + lst() + async function lst() { + answerARR = answer.split(" "); + //get the target player's id + setid2(answerARR[1]) + //set player to crds + wrapper.send(`select ${playerid}`) + var location = await wrapper.send("select get") + x2 = location.Result.Position[0] + z2 = location.Result.Position[1] + y2 = location.Result.Position[2] + //target player to crds + wrapper.send(`select ${playerid2}`) + var location = await wrapper.send("select get") + x3 = location.Result.Position[0] + z3 = location.Result.Position[1] + y3 = location.Result.Position[2] + + /*x3 = 1585 + y3 = 1431 + z3 = z2 + // example numbers + // x2 100 x3 120 x = 20 + // y2 14 y3 50 y = 36 + // h = 41.1825205639 + // angle = ‭29.0546040991 + x = x3 - x2 + y = y3 - y2 + //while i is less then 3x hyp + while(i < (Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2))) ) { + wrapper.send(`select ${playerid2}`) + var location = await wrapper.send("select get") + x3 = location.Result.Position[0] + z3 = location.Result.Position[1] + y3 = location.Result.Position[2] + x = x3 - x2 + y = y3 - y2 + console.log(i) + var angle = Math.atan(x/y) + if (x < 0 && y > 0 || x > 0 && y > 0) { + //console.log('\x1b[31m%s\x1b[0m', `A + //x ${x} y ${y}`) + x3 = Math.sin(angle) * i + x2 + y3 = Math.cos(angle) * i + y2 + } + else { + //console.log('\x1b[31m%s\x1b[0m', `B + //x ${x} y ${y}`) + x3 = Math.sin(angle) * -i + x2 + y3 = Math.cos(angle) * -i + y2 + } + console.log(`x3 ${x3}, y3 ${y3}, z2 ${z2}, angle ${angle}, `) + //await new Promise(r => setTimeout(r, 50)); + var id = await wrapper.send(`spawn exact ${x3},${z2 + 10},${y3} 0,0,0 BreakableRootHangingStraight fakujoel`) + dat.push(id.Result[0].Identifier) + i++ + } + //roe(3, 90, "explosivespike", 10, x3, y3, z3) + i2= i2 + i + i=0 + } + command() + };*/ + + if (answer.startsWith("delet")) { + while(i2 >= 0) { + wrapper.send(`select ${dat[i2]}`) + wrapper.send("select destroy") + i2-- + } + command() + }; + + if (answer.startsWith("timetest ")) { + console.log(`${new Date().toUTCString()}`) + command() + }; + + if (answer.startsWith("potnuke")) { + newke2(300, "potionmedium") + command() + }; + + if (answer.startsWith("test ")) { + + test() + async function test() { + const load = [".","..","..."] + while(i <= 50) { + + wrapper.send(`player message ${playername} "loading${load[i%3]}"`) + await new Promise(r => setTimeout(r, 1000)); + i++ + i2++ + } + i=0 + } + command() + }; + + if (answer.startsWith("rosh")) { + ror(5, 30, "rustyspade", 5, 90, 0, 0) + command() + }; + + if (answer.startsWith("clone")) { + (async () => { + const string = await wrapper.send("select tostring") + wrapper.send(`spawn string ${playername} ${string.ResultString}`) + })() + command() + }; + + + if (answer.startsWith("eyeon")) { + + command() + }; + + if (answer.startsWith("eyeoff")) { + + command() + }; + + if (answer.startsWith("teleport ")) { + //probs not possible but worth poking + (async ()=>{ + answerARR = answer.split(" "); + wrapper.send(`select 4`) + var location = await wrapper.send(`select get`) + let [x, z, y] = location.Result.Position; + let [bla, name, x2, z2, y2] = answerARR + playername = namemanager(name) + let dest = teleportmanager(x2) + + if (dest != null) { + [x2, z2, y2] = dest + } + wrapper.send(`select move exact ${x2},${z2},${y2}`) + if(z2 == 1000.69) { + wrapper.send(`select snap-ground`) + wrapper.send(`select move up 3`) + } + wrapper.send(`player teleport ${playername} testingarea`) + wrapper.send(`select move exact ${x},${z},${y}`) + })() + command() + }; + + if (answer.startsWith("getstring")) { + (async ()=>{ + let response = await wrapper.send(`select tostring`) + console.log(response.ResultString) + })() + command() + }; + + if (answer.startsWith("bigen")) { + //tostring select get, string to array, edit string, spawn and move to selectgetted location + (async ()=>{ + let selection = await wrapper.send(`select get`) + if(selection.Result) { + let response = await wrapper.send(`select tostring`) + var location = await wrapper.send(`select get`) + let string = response.ResultString.split(",") + await wrapper.send(`select destroy`) + //11 but js from 0 + string[10] = 1092616192 + string = string.toString() + //console.log(response, location, string, location.Result.Position.toString()) + + wrapper.send(`spawn string ${playername} ${string}`) + wrapper.send(`select move exact ${location.Result.Position.toString()}`) + wrapper.send(`select rotate exact ${location.Result.Rotation.toString()}`) + + + + } + })() + command() + }; + + if (answer.startsWith("normalen")) { + //tostring select get, string to array, edit string, spawn and move to selectgetted location + (async ()=>{ + let selection = await wrapper.send(`select get`) + if(selection.Result) { + let response = await wrapper.send(`select tostring`) + var location = await wrapper.send(`select get`) + let string = response.ResultString.split(",") + await wrapper.send(`select destroy`) + //11 but js from 0 + string[10] = 1065353216 + string = string.toString() + //console.log(response, location, string, location.Result.Position.toString()) + + wrapper.send(`spawn string ${playername} ${string}`) + wrapper.send(`select move exact ${location.Result.Position.toString()}`) + wrapper.send(`select rotate exact ${location.Result.Rotation.toString()}`) + + + + } + })() + command() + }; + + if (answer.startsWith("smol")) { + //tostring select get, string to array, edit string, spawn and move to selectgetted location + (async ()=>{ + let selection = await wrapper.send(`select get`) + if(selection.Result) { + let response = await wrapper.send(`select tostring`) + var location = await wrapper.send(`select get`) + let string = response.ResultString.split(",") + await wrapper.send(`select destroy`) + //11 but js from 0 + string[10] = 1036831949 + string = string.toString() + //console.log(response, location, string, location.Result.Position.toString()) + + wrapper.send(`spawn string ${playername} ${string}`) + wrapper.send(`select move exact ${location.Result.Position.toString()}`) + wrapper.send(`select rotate exact ${location.Result.Rotation.toString()}`) + + + + } + })() + command() + }; + + + + if (answer.startsWith("baggies")) { + const mats = ["Straw","Dais Leather","Dais Red Leather","Unknown Leather","Wyrm Face Leather","Aluminium","Brass","Carsi Alloy","Copper","Evinon Steel Alloy","Gold","Iron","Mythril","Orchi Alloy","Red Iron Alloy","Silver","Tin","White Gold Alloy","Ash","Birch","Oak","Redwood","Walnut"] + mats.forEach(thing => { + (async ()=>{ + thing = thing.toLowerCase(); + thing = thing.replace(/\s/g, "") + console.log(thing) + wrapper.send(`spawn ${playername} bag ${thing}`) + wrapper.send(`spawn ${playername} woodenbag ${thing}`) + wrapper.send(`spawn ${playername} standardsidepouchattachment ${thing}`) + wrapper.send(`spawn ${playername} standardsidetoolattachment ${thing}`) + await new Promise(r => setTimeout(r, 500)) + })() + } + ) + command() + }; + + if (answer.startsWith("hoocc")) { + const mats = ["Straw","Dais Leather","Dais Red Leather","Unknown Leather","Wyrm Face Leather","Aluminium","Brass","Carsi Alloy","Copper","Evinon Steel Alloy","Gold","Iron","Mythril","Orchi Alloy","Red Iron Alloy","Silver","Tin","White Gold Alloy","Ash","Birch","Oak","Redwood","Walnut"] + mats.forEach(thing => { + (async ()=>{ + thing = thing.toLowerCase(); + thing = thing.replace(/\s/g, "") + console.log(thing) + + wrapper.send(`spawn ${playername} metalwallhook ${thing}`) + await new Promise(r => setTimeout(r, 500)) + })() + } + ) + command() + }; + + if (answer.startsWith("parts")) { + const mats = ["Straw","Dais Leather","Dais Red Leather","Unknown Leather","Wyrm Face Leather","Aluminium","Brass","Carsi Alloy","Copper","Evinon Steel Alloy","Gold","Iron","Mythril","Orchi Alloy","Red Iron Alloy","Silver","Tin","White Gold Alloy","Ash","Birch","Oak","Redwood","Walnut"] + mats.forEach(thing => { + (async ()=>{ + thing = thing.toLowerCase(); + thing = thing.replace(/\s/g, "") + console.log(thing) + wrapper.send(`spawn ${playername} softfabricmediumroll ${thing} 50`) + wrapper.send(`spawn ${playername} softfabricmediumstrips ${thing} 50`) + wrapper.send(`spawn ${playername} hardmetalsmallbits ${thing} 50`) + wrapper.send(`spawn ${playername} hardplatemetalmediumsquare ${thing} forged 50`) + await new Promise(r => setTimeout(r, 500)) + })() + } + ) + command() + }; + + if (answer.startsWith("singleparts")) { + const mats = ["Straw","Dais Leather","Dais Red Leather","Unknown Leather","Wyrm Face Leather","Aluminium","Brass","Carsi Alloy","Copper","Evinon Steel Alloy","Gold","Iron","Mythril","Orchi Alloy","Red Iron Alloy","Silver","Tin","White Gold Alloy","Ash","Birch","Oak","Redwood","Walnut"] + mats.forEach(thing => { + (async ()=>{ + thing = thing.toLowerCase(); + thing = thing.replace(/\s/g, "") + console.log(thing) + wrapper.send(`spawn ${playername} softfabricmediumroll ${thing}`) + wrapper.send(`spawn ${playername} softfabricmediumstrips ${thing}`) + wrapper.send(`spawn ${playername} hardmetalsmallbits ${thing}`) + wrapper.send(`spawn ${playername} hardplatemetalmediumsquare ${thing} forged`) + await new Promise(r => setTimeout(r, 500)) + })() + } + ) + command() + }; + + if (answer.startsWith("justafukkinmess")) { + const mats = ["Straw","Dais Leather","Dais Red Leather","Unknown Leather","Wyrm Face Leather","Aluminium","Brass","Carsi Alloy","Copper","Evinon Steel Alloy","Gold","Iron","Mythril","Orchi Alloy","Red Iron Alloy","Silver","Tin","White Gold Alloy","Ash","Birch","Oak","Redwood","Walnut"] + mats.forEach(thing => { + (async ()=>{ + thing = thing.toLowerCase(); + thing = thing.replace(/\s/g, "") + console.log(thing) + wrapper.send(`repeat 10 0`) + wrapper.send(`repeat 10 0`) + wrapper.send(`repeat 10 0`) + wrapper.send(`repeat 10 0`) + wrapper.send(`spawn ${playername} softfabricmediumroll ${thing}`) + wrapper.send(`spawn ${playername} softfabricmediumstrips ${thing}`) + wrapper.send(`spawn ${playername} hardmetalsmallbits ${thing}`) + wrapper.send(`spawn ${playername} hardplatemetalmediumsquare ${thing} forged`) + await new Promise(r => setTimeout(r, 500)) + })() + } + ) + command() + }; + + if (answer.startsWith("backflip")) { + answerARR = answer.split(" "); + setid2(answerARR[1]) + wrapper.send(`select ${playerid2}`) + while(i<360) { + wrapper.send(`select rotate pitch 1`) + if(i<180){ + wrapper.send(`select move up 0.1`) + } + else { + + } + } + wrapper.send(`select look-at ${answerARR[1]}`) + + command() + }; + + if (answer.startsWith("spiralstaircase ")) { + answerARR = answer.split(" "); + (async ()=>{ + setid() + wrapper.send(`select ${playerid}`) + let locat = await wrapper.send("select get") + let x2 = locat.Result.Position[0] + let z2 = locat.Result.Position[1] + let y2 = locat.Result.Position[2] + let rotx = locat.Result.Rotation[0] + let rotz = locat.Result.Rotation[1] + let roty = locat.Result.Rotation[2] + i++ + while(i<=answerARR[1]) { + i2++ + + if(i2==5) { + i2=1 + } + //foward + if(i2==4) { + let x = x2 - 1 + let z = z2 + i - 1 + let y = y2 + let ida = await wrapper.send(`spawn exact ${x+1},${z},${y-1} 0,270,0 woodenPlatform_Stairs_02 dammitjoel`) + dat.push(ida.Result.Identifier) + let idb = await wrapper.send(`spawn exact ${x-1},${z+0.2},${y+1} 0,0,0 woodenPlatform_1x1 dammitjoel`) + dat.push(idb.Result.Identifier) + } + //right + else if(i2==3) { + let x = x2 + let z = z2 + i - 1 + let y = y2 - 1 + let ida = await wrapper.send(`spawn exact ${x+2},${z},${y} 0,180,0 woodenPlatform_Stairs_02 dammitjoel`) + dat.push(ida.Result.Identifier) + let idb = await wrapper.send(`spawn exact ${x-2},${z+0.2},${y-2} 0,0,0 woodenPlatform_1x1 dammitjoel`) + dat.push(idb.Result.Identifier) + } + //backward + else if(i2==2) { + let x = x2 + 1 + let z = z2 + i - 1 + let y = y2 + let ida = await wrapper.send(`spawn exact ${x+1},${z},${y+1} 0,90,0 woodenPlatform_Stairs_02 dammitjoel`) + dat.push(ida.Result.Identifier) + let idb = await wrapper.send(`spawn exact ${x+1},${z+0.2},${y-3} 0,0,0 woodenPlatform_1x1 dammitjoel`) + dat.push(idb.Result.Identifier) + } + //left + else if(i2==1) { + let x = x2 + let z = z2 + i - 1 + let y = y2 + 1 + let ida = await wrapper.send(`spawn exact ${x},${z},${y} 0,0,0 woodenPlatform_Stairs_02 dammitjoel`) + dat.push(ida.Result.Identifier) + let idb = await wrapper.send(`spawn exact ${x+2},${z+0.2},${y} 0,0,0 woodenPlatform_1x1 dammitjoel`) + dat.push(idb.Result.Identifier) + } + i++ + console.log(i) + } + })() + i=0 + command() + }; + + if (answer.startsWith("destroystairs")) { + //console.log(dat) + dat.forEach(num => { + console.log(num) + wrapper.send(`select ${num}`) + wrapper.send(`select destroy`) + }) + dat = [] + command() + }; + + if (answer.startsWith("EVERYTHING ")) { + answerARR = answer.split(" "); + answerARR[1] = namemanager(answerARR[1]) + console.log(answerARR[2]) + while(i{ + wrapper.send(`select ${playerid}`) + let locat = await wrapper.send("select get") + let x = locat.Result.Position[0] + let z = locat.Result.Position[1] + let y = locat.Result.Position[2] + let size = [30, 30, 10, 20,] + let div = 3 + let up = 10 + for(i2=0; i2=size[2] && i2=size[2] && i{ + + wrapper.send(`select ${playerid}`) + let locat = await wrapper.send("select get") + let x = locat.Result.Position[0] + let z = locat.Result.Position[1] + let y = locat.Result.Position[2] + let size = [30, 30, 10, 20,] + let div = 3 + let up = 10 + for(i2=0; i2=size[2] && i2=size[2] && i{ + let streeng = await wrapper.send(`select tostring`) + console.log(streeng) + let out = streeng.ResultString.split(`|`) + fs.writeFile("items.json", out[0],'utf8', function (err) { + if (err) { + console.log("An error occured while writing JSON Object to File."); + return console.log(err); + } + console.log("JSON file has been saved."); + }) + })() + command() + }; + + if (answer.startsWith("blend")) { + (async () => { + let locat = await wrapper.send("select get") + let x = locat.Result.Position[0] + let z = locat.Result.Position[1] + let y = locat.Result.Position[2] + let xr = locat.Result.Rotation[0] + let zr = locat.Result.Rotation[1] + let yr = locat.Result.Rotation[2] + + while(i < 1800) { + await new Promise(r => setTimeout(r, 5)); + wrapper.send(`select rotate exact ${xr},${zr+15},${yr}`) + wrapper.send(`select move exact ${x},${z},${y}`) + i++ + } + i=0 + })() + command() + }; + + if (answer.startsWith("")) { + + command() + }; + + if (answer.startsWith("")) { + + command() + }; + + if (answer.startsWith("")) { + + command() + }; + + + if (answer.startsWith("")) { + + command() + }; + + if (answer.startsWith("")) { + + command() + }; + + if (answer.startsWith("")) { + + command() + }; + + if (answer.startsWith("")) { + + command() + }; + + if (answer.startsWith("")) { + + command() + }; + + if (answer.startsWith("")) { + + command() + }; + + if (answer.startsWith("")) { + + command() + }; + + if (answer.startsWith("")) { + + command() + }; + + + if (answer.startsWith("")) { + + command() + }; + + if (answer.startsWith("")) { + + command() + }; + + + + })}})} + \ No newline at end of file diff --git a/BorisBotV1/items.json b/BorisBotV1/items.json new file mode 100644 index 0000000..e8e6ffb --- /dev/null +++ b/BorisBotV1/items.json @@ -0,0 +1 @@ +30092,161,30092,3280830664,1129413781,3291120764,3179605801,1063073485,1034984552,3204165742,1057523849,2290978823,418,3280830664,1129413781,3291120764,3179605801,1063073485,1034984552,3204165742,3221225472,0,0,0,0,0,363610349,2147483656,737068568,950314196,2147483664,0,0,0,3262,40,2836528451,1073741832,536870912,605782016,0,0,0, \ No newline at end of file diff --git a/BorisBotV1/package-lock.json b/BorisBotV1/package-lock.json new file mode 100644 index 0000000..178e5ec --- /dev/null +++ b/BorisBotV1/package-lock.json @@ -0,0 +1,861 @@ +{ + "name": "att-bot-example", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@discordjs/collection": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.5.tgz", + "integrity": "sha512-CU1q0UXQUpFNzNB7gufgoisDHP7n+T3tkqTsp3MNUkVJ5+hS3BCvME8uCXAUFlz+6T2FbTCu75A+yQ7HMKqRKw==" + }, + "abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "requires": { + "event-target-shim": "^5.0.0" + } + }, + "ajv": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz", + "integrity": "sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "alta-jsapi": { + "version": "github:alta-vr/alta-jsapi#b49de4d687d3f70daa1a16f409dfb741a75b9453", + "from": "github:alta-vr/alta-jsapi", + "requires": { + "crypto-js": "^3.1.9-1", + "jsonwebtoken": "^8.5.1", + "memoizee": "^0.4.14", + "request": "^2.88.0", + "request-promise-native": "^1.0.7" + } + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "async": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "att-bot-core": { + "version": "git+https://github.com/alta-vr/ATT-Bot-JS.git#9a4ba212c1a69749fb7fc40160d24f3d4c99bcef", + "from": "git+https://github.com/alta-vr/ATT-Bot-JS.git", + "requires": { + "alta-jsapi": "git+https://github.com/alta-vr/alta-jsapi.git", + "att-websockets": "git+https://github.com/alta-vr/att-websockets.git", + "chalk": "^2.4.2", + "crypto-js": "^3.1.9-1", + "node": "^12.10.0" + }, + "dependencies": { + "alta-jsapi": { + "version": "git+https://github.com/alta-vr/alta-jsapi.git#b49de4d687d3f70daa1a16f409dfb741a75b9453", + "from": "git+https://github.com/alta-vr/alta-jsapi.git", + "requires": { + "crypto-js": "^3.1.9-1", + "jsonwebtoken": "^8.5.1", + "memoizee": "^0.4.14", + "request": "^2.88.0", + "request-promise-native": "^1.0.7" + } + } + } + }, + "att-websockets": { + "version": "git+https://github.com/alta-vr/att-websockets.git#8bf9c52f2e23050655e40d38e5d8faef074c4576", + "from": "git+https://github.com/alta-vr/att-websockets.git", + "requires": { + "alta-jsapi": "git+https://github.com/alta-vr/alta-jsapi.git", + "isomorphic-ws": "^4.0.1", + "ws": "^7.1.2" + }, + "dependencies": { + "alta-jsapi": { + "version": "git+https://github.com/alta-vr/alta-jsapi.git#b49de4d687d3f70daa1a16f409dfb741a75b9453", + "from": "git+https://github.com/alta-vr/alta-jsapi.git", + "requires": { + "crypto-js": "^3.1.9-1", + "jsonwebtoken": "^8.5.1", + "memoizee": "^0.4.14", + "request": "^2.88.0", + "request-promise-native": "^1.0.7" + } + } + } + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz", + "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==" + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "binary-search-tree": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/binary-search-tree/-/binary-search-tree-0.2.5.tgz", + "integrity": "sha1-fbs7IQ/coIJFDa0jNMMErzm9x4Q=", + "requires": { + "underscore": "~1.4.4" + } + }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "crypto-js": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz", + "integrity": "sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q==" + }, + "d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "requires": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "discord.js": { + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.0.2.tgz", + "integrity": "sha512-iZiEA4Y61gqq/EjFfLXnkRK9pLapnax/vTVDUhs/mAhyqozAy0GOlk/MZI9rSa1iIoKTWRq6P9CRKhLNT2wUnA==", + "requires": { + "@discordjs/collection": "^0.1.5", + "abort-controller": "^3.0.0", + "form-data": "^3.0.0", + "node-fetch": "^2.6.0", + "prism-media": "^1.2.0", + "setimmediate": "^1.0.5", + "tweetnacl": "^1.0.3", + "ws": "^7.2.1" + }, + "dependencies": { + "form-data": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", + "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + } + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "es5-ext": { + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "requires": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" + }, + "dependencies": { + "next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" + } + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "requires": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, + "es6-weak-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", + "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", + "requires": { + "d": "1", + "es5-ext": "^0.10.46", + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "requires": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, + "event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" + }, + "ext": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "requires": { + "type": "^2.0.0" + }, + "dependencies": { + "type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.0.0.tgz", + "integrity": "sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow==" + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", + "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==" + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "requires": { + "ajv": "^6.5.5", + "har-schema": "^2.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=" + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "isomorphic-ws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", + "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "jsonwebtoken": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", + "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", + "requires": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^5.6.0" + } + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "requires": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "lie": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz", + "integrity": "sha1-mkNrLMd0bKWd56QfpGmz77dr2H4=", + "requires": { + "immediate": "~3.0.5" + } + }, + "localforage": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/localforage/-/localforage-1.7.3.tgz", + "integrity": "sha512-1TulyYfc4udS7ECSBT2vwJksWbkwwTX8BzeUIiq8Y07Riy7bDAAnxDaPU/tWyOVmQAcWJIEIFP9lPfBGqVoPgQ==", + "requires": { + "lie": "3.1.1" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + }, + "lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=" + }, + "lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=" + }, + "lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=" + }, + "lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=" + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" + }, + "lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" + }, + "lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" + }, + "lru-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", + "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=", + "requires": { + "es5-ext": "~0.10.2" + } + }, + "memoizee": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.14.tgz", + "integrity": "sha512-/SWFvWegAIYAO4NQMpcX+gcra0yEZu4OntmUdrBaWrJncxOqAziGFlHxc7yjKVK2uu3lpPW27P27wkR82wA8mg==", + "requires": { + "d": "1", + "es5-ext": "^0.10.45", + "es6-weak-map": "^2.0.2", + "event-emitter": "^0.3.5", + "is-promise": "^2.1", + "lru-queue": "0.1", + "next-tick": "1", + "timers-ext": "^0.1.5" + } + }, + "mime-db": { + "version": "1.43.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", + "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==" + }, + "mime-types": { + "version": "2.1.26", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", + "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", + "requires": { + "mime-db": "1.43.0" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + } + }, + "moment": { + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", + "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==" + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "nedb": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/nedb/-/nedb-1.8.0.tgz", + "integrity": "sha1-DjUCzYLABNU1WkPJ5VV3vXvZHYg=", + "requires": { + "async": "0.2.10", + "binary-search-tree": "0.2.5", + "localforage": "^1.3.0", + "mkdirp": "~0.5.1", + "underscore": "~1.4.4" + } + }, + "next-tick": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" + }, + "nodb": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/nodb/-/nodb-0.0.1.tgz", + "integrity": "sha1-0phYw8+t/kTspxTytBL/UdBU5Xg=" + }, + "node": { + "version": "12.16.1", + "resolved": "https://registry.npmjs.org/node/-/node-12.16.1.tgz", + "integrity": "sha512-YFayjFMXG6thgqKHsiihuGXgjD/0227b3lO3S+BmRcN/DxBlSANOUndewuo2SD7sjleo/JKiL89aDDxP2VOV3w==", + "requires": { + "node-bin-setup": "^1.0.0" + } + }, + "node-bin-setup": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/node-bin-setup/-/node-bin-setup-1.0.6.tgz", + "integrity": "sha512-uPIxXNis1CRbv1DwqAxkgBk5NFV3s7cMN/Gf556jSw6jBvV7ca4F9lRL/8cALcZecRibeqU+5dFYqFFmzv5a0Q==" + }, + "node-fetch": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", + "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "prism-media": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.1.tgz", + "integrity": "sha512-R3EbKwJiYlTvGwcG1DpUt+06DsxOGS5W4AMEHT7oVOjG93MjpdhGX1whHyjnqknylLMupKAsKMEXcTNRbPe6Vw==" + }, + "psl": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.7.0.tgz", + "integrity": "sha512-5NsSEDv8zY70ScRnOTn7bK7eanl2MvFrOrS/R6x+dBt5g1ghnj9Zv90kO8GwT8gxcu2ANyFprnFYB85IogIJOQ==" + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, + "request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "request-promise-core": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.3.tgz", + "integrity": "sha512-QIs2+ArIGQVp5ZYbWD5ZLCY29D5CfWizP8eWnm8FoGD1TX61veauETVQbrV60662V0oFBkrDOuaBI8XgtuyYAQ==", + "requires": { + "lodash": "^4.17.15" + } + }, + "request-promise-native": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.8.tgz", + "integrity": "sha512-dapwLGqkHtwL5AEbfenuzjTYg35Jd6KPytsC2/TLkVMz8rm+tNt72MGUWT1RP/aYawMpN6HqbNGBQaRcBtjQMQ==", + "requires": { + "request-promise-core": "1.1.3", + "stealthy-require": "^1.1.1", + "tough-cookie": "^2.3.3" + } + }, + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "stealthy-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", + "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + }, + "timers-ext": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz", + "integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==", + "requires": { + "es5-ext": "~0.10.46", + "next-tick": "1" + } + }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + }, + "type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" + }, + "underscore": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz", + "integrity": "sha1-YaajIBBiKvoHljvzJSA88SI51gQ=" + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "requires": { + "punycode": "^2.1.0" + } + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "ws": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.2.3.tgz", + "integrity": "sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ==" + } + } +} diff --git a/BorisBotV1/package.json b/BorisBotV1/package.json new file mode 100644 index 0000000..bd6e798 --- /dev/null +++ b/BorisBotV1/package.json @@ -0,0 +1,49 @@ +{ + "_from": "git+https://github.com/alta-vr/att-bot-example.git", + "_id": "att-bot-example@1.0.0", + "_inBundle": false, + "_integrity": "", + "_location": "/att-bot-example", + "_phantomChildren": {}, + "_requested": { + "type": "git", + "raw": "https://github.com/alta-vr/att-bot-example", + "rawSpec": "https://github.com/alta-vr/att-bot-example", + "saveSpec": "git+https://github.com/alta-vr/att-bot-example.git", + "fetchSpec": "https://github.com/alta-vr/att-bot-example.git", + "gitCommittish": null + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "git+https://github.com/alta-vr/att-bot-example.git#a646aa2f0209f12154118b29e6253f1a01e8085a", + "_spec": "https://github.com/alta-vr/att-bot-example", + "_where": "C:\\Games\\ATT\\ATT Bot", + "author": { + "name": "Joel VDV" + }, + "bundleDependencies": false, + "dependencies": { + "alta-jsapi": "github:alta-vr/alta-jsapi", + "att-bot-core": "git+https://github.com/alta-vr/ATT-Bot-JS.git", + "discord.js": "^12.0.2", + "moment": "^2.24.0", + "nedb": "^1.8.0", + "nodb": "0.0.1" + }, + "deprecated": false, + "description": "An example ATT bot", + "keywords": [ + "att", + "bot" + ], + "license": "GPL-3.0", + "main": "index.js", + "name": "att-bot-example", + "scripts": { + "start": "node .", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "version": "1.0.0" +} diff --git a/BorisBotV1/src/discordcmds.js b/BorisBotV1/src/discordcmds.js new file mode 100644 index 0000000..e173a66 --- /dev/null +++ b/BorisBotV1/src/discordcmds.js @@ -0,0 +1,369 @@ +teleportmanager = require("./managers.js"); +namemanager = require("./managers.js"); + +//Command list +const commands = { + 'ping': (message, args) => + { + message.channel.send("pong"); + }, + 'tp': async function (message, args) + { + while ( args.length && args[0].toLowerCase() === namemanager(args[0]) ) + { + argv = args.shift(); + } + }, + 'where': (message, args) => + { + while ( args.length && args[0].toLowerCase() === "is" ) + { + argv = args.shift(); + } + + var username = args.join(' '); + players.findOne({ username: username }, function( err, player ) { + if ( err ) + { + console.log( err ); + } else if ( !!player && player.lastChunk !== undefined ) { + message.channel.send( '```'+ username +" was last seen at "+ player.lastChunk +'```'); + } else { + message.channel.send( '```'+ "No location known for "+ username +'```' ); + } + }); + }, + + 'who': (message, args) => + { + while( args.length && args[0].toLowerCase() === "is" ) + { + argv = args.shift(); + } + + var username = args.join(' '); + players.findOne({ username: username }, function( err, player ) { + if ( err ) + { + console.log( err ); + } else { + if ( !player ) + { + message.guild.channel.send('```'+ "Unknown user: "+ username +'```'); + } else if ( !player.bio ) { + message.channel.send('```'+ username +" does not have a bio"+ '```'); + } else { + message.channel.send('```'+ username +" is "+ player.bio +'```'); + } + } + }); + }, + + 'bio': (message, args) => + { + console.log( args ); + function updatePlayerBio( playerid, bio ) + { + players.update({ id: playerid }, { $set: { bio: bio } }, {}, function( err, numReplaced ) { + if ( err ) + { + console.log( err ); + } else { + message.channel.send('```'+ username +" is "+ bio +'```'); + } + }); + } + + var username = message.author.username; + players.findOne({ username: username }, function( err, player ) { + if ( err ) { + console.log( err ); + } + console.log( player ); + if ( player ) + { + while ( args[0] === username || args[0] === "is" ) + { + args.shift(); + } + var bio = args.join(' '); + updatePlayerBio( player.id, bio ); + } else { + username = args.shift(); + while( args[0] === "is" ) { args.shift(); } + var bio = args.join(' '); + players.findOne({ username, username }, function( err, player ) { + if ( player ) + { + updatePlayerBio( player.id, bio ) + } else { + message.channel.send('```'+ "Unknown user: "+ username +'```'); + } + }); + } + }); + }, + + 'servers': async function (message, args) + { + var servers = await Servers.getOnline(); + + if ( !!servers ) + { + var longest = 0; + for( var i in servers ) + { + if ( servers[i].name.length > longest ) + { + longest = servers[i].name.length; + } + } + + var serverNameLen = longest + 1; + var listTable = "| Servers"+ strrep(' ', (serverNameLen - 7)) +"| Players\n"; + listTable += "|"+ strrep('-', (serverNameLen + 1) ) +"|---------\n"; + for ( var i in servers ) + { + if ( blacklistServers.includes( servers[i].id ) ) + { + continue + } + if ( !showAllServers && !targetServers.includes( servers[i].id ) ) + { + continue + } + listTable += "| "+ servers[i].name + strrep(' ', ( serverNameLen - servers[i].name.length )) +"| "+ servers[i].online_players.length +"\n"; + } + + message.channel.send( '```'+ listTable +'```' ); + + } else { + message.channel.send("No servers appear to be online, perhaps it's patch day?"); + } + }, + + 'players': async function (message, args) + { + var servers = await Servers.getOnline(); + var listTable = ''; + + while ( args.length && ( args[0].toLowerCase() === "online" || args[0].toLowerCase() === "in" || args[0].toLowerCase() === "on" ) ) + { + args.shift(); + } + + var mustMatch = args.join(' '); + + for( var i in servers ) + { + var pOnline = servers[i].online_players; + if ( pOnline.length <= 0 && !mustMatch ) + { + continue + } + + if ( blacklistServers.includes( servers[i].id ) ) + { + continue; + } + + if ( !showAllServers && !targetServers.includes( servers[i].id ) ) + { + continue; + } + + if ( mustMatch ) + { + var re = new RegExp( mustMatch, 'ig' ); + if ( !servers[i].name.match( re ) ) + { + continue; + } + } + + listTable += "| "+ servers[i].name +"\n"; + listTable += "|"+ strrep('-', (servers[i].name.length + 1)) +"\n"; + + if ( pOnline.length <= 0 ) + { + listTable += "| No players online\n" + } else { + for( var n in pOnline ) + { + listTable += "| "+ pOnline[n].username +"\n"; + } + } + + listTable += "\n"; + } + + if ( listTable === '' ) + { + if ( mustMatch ) + { + message.channel.send('```No server found matching "'+ mustMatch +'"```'); + } else { + message.channel.send('```No servers were found online, is it patch day?```'); + } + } else { + message.channel.send('```'+ listTable +'```'); + } + }, + + 'zone': async function (message, args) + { + switch( args.shift() ) + { + case 'history': + var chunkName = args.join(' '); + players.find({}, function( err, playerList ) { + chunkHistory.find({ chunk: chunkName }).sort({ ts: -1 }).exec( function( err, chunklist ) { + if ( err ) + { + console.log( err ); + } else if ( !chunklist ) { + message.channel.send('```'+ "No history for zone '"+ chunkName +"'"+ '```'); + } else { + var response = "| Players who have recently visited zone '"+ chunkName +"'\n"; + response += "|--------------------------------"+ strrep( '-', chunkName.length ) +"-\n"; + let limit = 15; + if ( chunklist.length < limit ) { limit = chunklist.length; } + for ( var i = 0; i < limit; i++ ) { + ichunk = chunklist[i]; + if ( ++i > 10 ) { } + player = playerList.find( x => x.id === ichunk.player ); + response += "|["+ moment( ichunk.ts ).format("YYYY/MM/DD HH:mm:ss") +"] "+ player.username +"\n"; + }; + message.channel.send('```'+ response +'```'); + } + }); + }); + break; + } + }, + + 'player' : async function ( message, args ) + { + switch( args.shift() ) + { + case 'path': + // Return known history of player movements + var username = args.join(' '); + players.findOne({ username: username }, function( err, player ) { + if ( err ) + { + message.channel.send('```'+ "No player data found for "+ username +'```'); + } else { + if ( !!player ) + { + chunkHistory.find({ player: player.id }).sort({ ts: -1 }).exec( function ( err, chunklist ) { + if ( err ) + { + console.log( err ); + } else if ( !!chunklist ) { + let limit = 20; + var response = '| Path History for '+ username +"\n"; + response += '|------------------'+ strrep('-', username.length+1) +"\n"; + if ( chunklist.length < limit ) { limit = chunklist.length; } + for ( var i = 0; i < limit ; i++ ) { + var elem = chunklist[i]; + response += "|["+ moment( elem.ts ).format( "YYYY/MM/DD HH:mm:ss" ) +"] "+ elem.chunk +"\n"; + } + message.channel.send('```'+ response +'```'); + } else { + message.channel.send('```'+ "No path data found for "+ username +'```'); + } + }); + } else { + message.channel.send('```'+ "No player found for "+ username +'```'); + } + } + }); + break; + + } + }, + + 'load' : async function( message, args ) + { + switch( args.shift() ) + { + case 'assets': + // First verify the message author has correct permission + if ( message.member.roles.some( x => discordRoles.admin.includes( x.id ) )) + { + console.log( ts()+ "loading assets"); + message.channel.send('```'+ "Loading ATT assets, please wait" +'```'); + + // Add the handler to pendingCommandList + pendingCommandList.push({ + "command" : "spawn list", + "module" : "Alta.Console.Commands.SpawnCommandModule", + "handler": function ( response ) { + let countPrefabs = 0; + let responselines = response.split(/\n/) + responselines.forEach( function( line ) { + let found = line.match( /\|([^|]+)\|([^|]+)\|/ ); + if ( found ) + { + found.shift(); // fulltext of match + let num = new String( found.shift() ).trim() // ID of the prefab + let val = new String( found.shift() ).trim() // The prefab name + if ( num.match( /[0-9]+/ ) ) + { + // It's a prefab! Store it + console.log( "found asset: "+ num +" | "+ val ) + spawnables.update({ hash: num }, { $set : { hash: num, name: val } }, { upsert: true }, updateHandler ); + countPrefabs++; + } + } + }); + message.channel.send( '```'+ "Found and stored "+ countPrefabs + " spawnable assets" +'```') + } + }); + + // Finally, execute the command + try { + botConnection.wrapper.send( "spwan list" ); + } catch ( e ) { + console.log( e ) + message.channel.send( '```'+ "Cannot send command, is server offline?" +'```') + return; + } + + } else { + console.log( "invalid permission to load assets" ); + message.channel.send('```'+ "You do not have the required permissions" +'```'); + } + break; + } + }, + 'find' : async function( message, args ) + { + switch( args.shift() ) + { + case 'asset': + case 'spawnable': + case 'item': + let mustMatch = args.join(' '); + spawnables.find({ name : { $regex: new RegExp( mustMatch, 'gi' ) }}).sort({ name : 1 }).exec( function( err, results ) { + let response = "| Spawnable items matching "+ mustMatch +" ("+ results.length +")\n"; + response += "|--------------------------"+ strrep('-', mustMatch.length) + "-----\n"; + let itemc = 0; + results.forEach( function( item ) { + let shortsp = ''; + if ( item.hash.length < 5 ) { shortsp = ' '; } + response += "| "+ item.hash + shortsp + " | "+ item.name +"\n"; + if ( itemc++ > 20 ) + { + message.channel.send('```'+ response +'```') + itemc = 0; + response = ''; + } + }); + message.channel.send( '```'+ response +'```') + }) + break; + } + } +} diff --git a/BorisBotV1/src/managers.js b/BorisBotV1/src/managers.js new file mode 100644 index 0000000..4f38205 --- /dev/null +++ b/BorisBotV1/src/managers.js @@ -0,0 +1,148 @@ +"use strict"; +/*exports.namemanager = (name) => { + if(name == undefined) { + name = playername + } + if(name == "") { + name = playername + } + if(name == "poi") { + name = "poiuytrewq4645" + } + if(name == "mansnac") { + name = "mantax" + } + if(name == "ursa") { + name = "Ursidious" + } + /*if(name == "") { + name = "" + } + return name*/ +//} +exports.splitArgs = (args) => { + let spaceChars = '#s#'; + // If an exact match of the space character exists in the string, make it more unique + while( args.indexOf( spaceChars ) > -1 ) { spaceChars += '|'; } + + // replace spaces which are inside quotes with the spaceChar placeholder + let mangleargs = args.replace( /[“"]([^“^"]*)[“"]?/g, ( match, cap ) => { + return cap.replace(/\s/g, spaceChars ); + }); + + // split the padded string on actual spaces + let newargs = mangleargs.split( /\ +/ ); + + // replace the spaceChar in any matching elements with actual spaces + let reg = new RegExp( spaceChars, 'g' ); + let argarr = newargs.map( ( x ) => { return x.replace( reg, ' ' ); }); + + return argarr; +} +exports.teleportmanager = (location) => { + console.log(location) + switch (location) { + //Pope Mountain + case "Mountain": + return [-1259,1000.69,942] + break + //Mystery Roof Place + case "000": + return [0,1000.69,0] + break + //Evinon Empire + case "EE": + return [-174.5,1000.69,-644.5] + break + case "Storage": + return [ -351.975, 209.94, -661.433 ] + break + //Grey Wardens + case "GW": + return [-639.453,1000.69,-82.208] + break + //Sin City + case "SC": + return [-329.748,1000.69,-343.807] + break + //Schmmechee Sentinels + case "SS": + return [-969.479,1000.69,129.304] + break + //Viridium Valour + case "VV": + return [-608.406,1000.69,94.553] + break + //Bounding Foxes + case "BF": + return [-519.507,1000.69,62.1519966] + break + //Town Blacksmith + case "Smithy": + return [-717.2,1000.69,12.7] + break + //Town Hall :V + case "TH": + return [-895.2,1000.69,93.9] + break + //Path between Dust Bowl and Cliffs + case "DB": + return [-581,1000.69,325.3] + break + //Inside Mines + case "Mines": + return [-897.749,1000.69,-160.403] + break + //Mountain outback of camps + case "OM": + return [988.816,1000.69,-736.122] + break + //Mountain outback of the outback mountain of the camps + case "OOM": + return [1019.675,1000.69,-1371.084] + break + //Outside the MP Bridge + case "MP": + return [-1051.641,1000.69,39.53] + break + //Televator Surface TP + case "Televator": + return [-869.021,1000.69,-123.773] + break + //Town Crafting Building + case "Crafting_Building": + return [-799.941,1000.69,103.74] + break + //Skydiving, may die + case "Skydive": + return [-295.713,990,435.593] + break + // + //SHRINES START + // + case "Archery": + return [-835,1000.69,385] + break + case "Blacksmith": + return [-642.704,1000.69,19.363] + break + case "Combat": + return [-1403.3,1000.69,161] + break + case "Woodcutting": + return [-404.3,1000.69,19.6] + break + case "Mining": + return [-825.419,1000.69,-59.953] + break + case "General_Shrine": + return [-1145.647,1000.69,113.898] + break + // + ///SHRINES END + // + default: + return null + break + } +} \ No newline at end of file diff --git a/BorisBotV1/src/player.js b/BorisBotV1/src/player.js new file mode 100644 index 0000000..155f2d3 --- /dev/null +++ b/BorisBotV1/src/player.js @@ -0,0 +1,21 @@ +module.exports = class Player { + + constructor( id, username ) + { + this.id = id; + this.username = username; + } + + set id( id ) { this._id = id; } + get id() { return _id; } + + set username(username) { this._username = username; } + get username() { return this._username; } + + set bio(bio) { this._bio = bio; } + get bio() { return _bio; } + + set lastLogin(lastLogin) { this._lastLogin = lastLogin; } + get lastLogin() { return _lastLogin; } + +} diff --git a/BorisBotV1/src/subscriptions.js b/BorisBotV1/src/subscriptions.js new file mode 100644 index 0000000..a59a61d --- /dev/null +++ b/BorisBotV1/src/subscriptions.js @@ -0,0 +1,124 @@ +const moment = require('moment'); + +function now() +{ + return moment().valueOf(); +} + +function ts_f() +{ + return "["+ moment().format("h:mm:ss A") +"] " +} + +// Database helpers +function insertHandler( err, doc ) +{ + if ( err ) { console.log( err ); } +} + +function updateHandler( err, rows ) +{ + if ( err ) { console.log( err ); } +} + +module.exports = class Subscriptions { + constructor( discordChannels, playersDb, killsDb, chunksDb ) { + this.discordChannels = discordChannels; + this.playersDb = playersDb; + this.killsDb = killsDb; + this.chunksDb = chunksDb; + } + + + PlayerJoined( discord, data ) + { + //console.log( data ); + this.playersDb.update( + { id: data.user.id }, + { $set: { username: data.user.username, lastLogin: now() } }, + { upsert: true }, + updateHandler + ); + discord.channels.get( this.discordChannels["PlayerJoined"] ).send( ts_f() + data.user.username +" joined the server" ); + console.log( ts_f() + data.user.username +" joined the server" ); + } + + PlayerLeft( discord, data ) + { + //console.log( data ); + discord.channels.get( this.discordChannels["PlayerLeft"] ).send( ts_f() + data.user.username +" left the server" ); + console.log( ts_f() + data.user.username +" left the server" ); + } + + PlayerMovedChunk( discord, data ) + { + //console.log( data ); + this.playersDb.update({ id: data.player.id }, { $set: { lastChunk: data.newChunk } }, {}, updateHandler ); + this.chunksDb.insert({ ts: now(), player: data.player.id, chunk: data.newChunk }, insertHandler ); + // also update the zone history for the new chunk + // TODO + console.log( ts_f() + data.player.username +" has moved to chunk "+ data.newChunk ); + } + + PlayerKilled( discord, data ) + { + //console.log( data ); + console.log( ts_f() + "player kill" ); + if ( data.killerPlayer != undefined ) + { + this.killsDb.insert({ + ts: now(), + killed : data.killedPlayer.id, + killer: data.killerPlayer.id, + usedTool: data.usedTool, + toolWielder: data.toolWielder + }, insertHandler ); + discord.channels.get( this.discordChannels["PlayerKilled"] ).send( ts_f() + data.killerPlayer.username +" has killed "+ data.killedPlayer.username ); + discord.channels.get( this.discordChannels["PublicPlayerKilled"] ).send( '```'+ data.killerPlayer.username +" has murdered "+ data.killedPlayer.username +'```' ); + } else { + if ( data.toolWielder ) + { + this.killsDb.insert({ + ts: now(), + killed : data.killedPlayer.id, + usedTool: data.usedTool, + toolWielder: data.toolWielder + }, insertHandler ); + let matches = data.toolWielder.match( /[0-9]+\s-\s([^\()]+)/ ); + let toolWielder = data.toolWielder; + if ( matches !== null ) + { + toolWielder = matches[1]; + } + discord.channels.get( this.discordChannels["PlayerKilled"] ).send( ts_f() + data.killedPlayer.username +" was killed by: "+ toolWielder ); + discord.channels.get( this.discordChannels["PublicPlayerKilled"] ).send( '```'+ data.killedPlayer.username +" was killed by: "+ toolWielder +'```' ); + } else { + this.killsDb.insert({ + ts: now(), + killed : data.killedPlayer.id, + }, insertHandler ); + discord.channels.get( this.discordChannels["PlayerKilled"] ).send( ts_f() + data.killedPlayer.username +" has suddenly offed themselves" ); + discord.channels.get( this.discordChannels["PublicPlayerKilled"] ).send( '```'+ data.killedPlayer.username +" has suddenly offed themselves" +'```'); + } + } + } + + TradeDeckUsed( discord, data ) + { + console.log( ts_f() + "trade deck used" ); + console.log( data ); + } + + CreatureKilled( discord, data ) + { + console.log( ts_f() + "creature murdered" ); + console.log( data ); + } + + CreatureSpawned( discord, data ) + { + console.log( ts_f() + "creature has spawned" ); + console.log( data ); + } + +} diff --git a/Gulag/.gitignore b/Gulag/.gitignore new file mode 100644 index 0000000..98ad8f5 --- /dev/null +++ b/Gulag/.gitignore @@ -0,0 +1,67 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# next.js build output +.next + + + +# Custom things +credentials.json +config.json diff --git a/Gulag/index.js b/Gulag/index.js new file mode 100644 index 0000000..e598780 --- /dev/null +++ b/Gulag/index.js @@ -0,0 +1,114 @@ +const Discord = require('discord.js'); + +const client = new Discord.Client(); + +const PREFIX = 'CM'; + +var version = '1.0.1'; +const moment = require('moment'); +const util = require('util'); +const fs = require('fs'); +const sha512 = require('crypto-js/sha512'); +const Player = require('./src/player.js'); +const Subscriptions = require('./src/subscriptions.js'); +const { Servers } = require('alta-jsapi'); +const { WebsocketBot } = require('att-bot-core'); +const { BasicWrapper } = require('att-websockets'); +const { username, password, botToken } = require("./credentials"); + +var targetServers = [179294432]; + + + +client.on('ready', () =>{ + console.log('\x1b[36m%s\x1b[0m', 'Discord ON'); +}) + + +main(); + +async function main() +{ + + console.log(ts() + "bot is starting"); + + + //Discord part + var mpassword = convertPassToHash( username, password, botToken ); + + + //Discord command and message management (todo: move to own lib) + client.on('message', message => + { + + }); + + + //ATT Part + const bot = new WebsocketBot(); + await bot.loginWithHash(username, mpassword); + await bot.run(test => targetServers.includes(test.id), async (server, connection) => + { + + }); +} + + +function convertPassToHash( username, password, botToken ) +{ + // The SHA512 hash generated by crypto-js/sha512 will be 128 characters + if ( password.length !== 128 ) + { + console.log( "Plaintext password encountered, converting to SHA512 hash for permanent storage" ); + newPass = sha512( password ).toString(); + newFile = { "username" : username, "password" : newPass, "botToken": botToken }; + fs.writeFile('./credentials.json', JSON.stringify( newFile, null, 4 ), function( err ) { + if ( err ) + { + console.log( err ); + } else { + console.log( "New credentials.json saved" ); + } + }); + password = newPass; + } + return password; +} + +function ts() +{ + return "["+ moment().format("h:mm:ss A") +"] " +} + +function insertHandler( err, doc ) +{ + if ( err ) { console.log( err ); } +} + +function updateHandler( err, rows ) +{ + if ( err ) { console.log( err ); } +} + +function strrep( str, n ) +{ + if ( n < 1 ) return ''; + var result = str; + while( n-- > 0 ) + { + result += str; + } + return result; +} + + + + + + + + + + + +client.login(botToken); \ No newline at end of file diff --git a/Gulag/package-lock.json b/Gulag/package-lock.json new file mode 100644 index 0000000..6573b0d --- /dev/null +++ b/Gulag/package-lock.json @@ -0,0 +1,907 @@ +{ + "name": "gulag", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "ajv": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz", + "integrity": "sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "alta-jsapi": { + "version": "git+https://github.com/alta-vr/alta-jsapi.git#b49de4d687d3f70daa1a16f409dfb741a75b9453", + "from": "git+https://github.com/alta-vr/alta-jsapi.git", + "requires": { + "crypto-js": "^3.1.9-1", + "jsonwebtoken": "^8.5.1", + "memoizee": "^0.4.14", + "request": "^2.88.0", + "request-promise-native": "^1.0.7" + } + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "async-limiter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "att-bot-core": { + "version": "git+https://github.com/alta-vr/ATT-Bot-JS.git#9a4ba212c1a69749fb7fc40160d24f3d4c99bcef", + "from": "git+https://github.com/alta-vr/ATT-Bot-JS.git", + "requires": { + "alta-jsapi": "git+https://github.com/alta-vr/alta-jsapi.git", + "att-websockets": "git+https://github.com/alta-vr/att-websockets.git", + "chalk": "^2.4.2", + "crypto-js": "^3.1.9-1", + "node": "^12.10.0" + } + }, + "att-websockets": { + "version": "git+https://github.com/alta-vr/att-websockets.git#8bf9c52f2e23050655e40d38e5d8faef074c4576", + "from": "git+https://github.com/alta-vr/att-websockets.git", + "requires": { + "alta-jsapi": "git+https://github.com/alta-vr/alta-jsapi.git", + "isomorphic-ws": "^4.0.1", + "ws": "^7.1.2" + }, + "dependencies": { + "ws": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.2.1.tgz", + "integrity": "sha512-sucePNSafamSKoOqoNfBd8V0StlkzJKL2ZAhGQinCfNQ+oacw+Pk7lcdAElecBF2VkLNZRiIb5Oi1Q5lVUVt2A==" + } + } + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz", + "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==" + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "requires": { + "tweetnacl": "^0.14.3" + }, + "dependencies": { + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + } + } + }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "crypto-js": { + "version": "3.1.9-1", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.9-1.tgz", + "integrity": "sha1-/aGedh/Ad+Af+/3G6f38WeiAbNg=" + }, + "d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "requires": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "requires": { + "object-keys": "^1.0.12" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "discord.js": { + "version": "11.5.1", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-11.5.1.tgz", + "integrity": "sha512-tGhV5xaZXE3Z+4uXJb3hYM6gQ1NmnSxp9PClcsSAYFVRzH6AJH74040mO3afPDMWEAlj8XsoPXXTJHTxesqcGw==", + "requires": { + "long": "^4.0.0", + "prism-media": "^0.0.3", + "snekfetch": "^3.6.4", + "tweetnacl": "^1.0.0", + "ws": "^6.0.0" + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "es-abstract": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.16.0.tgz", + "integrity": "sha512-xdQnfykZ9JMEiasTAJZJdMWCQ1Vm00NBw79/AWi7ELfZuuPCSOMDZbT9mkOfSctVtfhb+sAAzrm+j//GjjLHLg==", + "requires": { + "es-to-primitive": "^1.2.0", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.0", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-inspect": "^1.6.0", + "object-keys": "^1.1.1", + "string.prototype.trimleft": "^2.1.0", + "string.prototype.trimright": "^2.1.0" + } + }, + "es-to-primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", + "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "es5-ext": { + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "requires": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" + }, + "dependencies": { + "next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" + } + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "requires": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, + "es6-weak-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", + "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", + "requires": { + "d": "1", + "es5-ext": "^0.10.46", + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "requires": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, + "ext": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "requires": { + "type": "^2.0.0" + }, + "dependencies": { + "type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.0.0.tgz", + "integrity": "sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow==" + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", + "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==" + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fs": { + "version": "0.0.1-security", + "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", + "integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ=" + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "requires": { + "ajv": "^6.5.5", + "har-schema": "^2.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=" + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==" + }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==" + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" + }, + "is-generator-function": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.7.tgz", + "integrity": "sha512-YZc5EwyO4f2kWCax7oegfuSr9mFz1ZvieNYBEjmukLxgXfBUbxAWGVF7GZf0zidYtoBl3WvC07YK0wT76a+Rtw==" + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "requires": { + "has": "^1.0.1" + } + }, + "is-symbol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", + "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "requires": { + "has-symbols": "^1.0.0" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "isomorphic-ws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", + "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "jsonwebtoken": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", + "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", + "requires": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^5.6.0" + } + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "requires": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + }, + "lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=" + }, + "lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=" + }, + "lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=" + }, + "lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=" + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" + }, + "lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" + }, + "lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" + }, + "long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, + "lru-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", + "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=", + "requires": { + "es5-ext": "~0.10.2" + } + }, + "memoizee": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.14.tgz", + "integrity": "sha512-/SWFvWegAIYAO4NQMpcX+gcra0yEZu4OntmUdrBaWrJncxOqAziGFlHxc7yjKVK2uu3lpPW27P27wkR82wA8mg==", + "requires": { + "d": "1", + "es5-ext": "^0.10.45", + "es6-weak-map": "^2.0.2", + "event-emitter": "^0.3.5", + "is-promise": "^2.1", + "lru-queue": "0.1", + "next-tick": "1", + "timers-ext": "^0.1.5" + } + }, + "mime-db": { + "version": "1.43.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", + "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==" + }, + "mime-types": { + "version": "2.1.26", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", + "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", + "requires": { + "mime-db": "1.43.0" + } + }, + "moment": { + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", + "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==" + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "next-tick": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" + }, + "node": { + "version": "12.16.1", + "resolved": "https://registry.npmjs.org/node/-/node-12.16.1.tgz", + "integrity": "sha512-YFayjFMXG6thgqKHsiihuGXgjD/0227b3lO3S+BmRcN/DxBlSANOUndewuo2SD7sjleo/JKiL89aDDxP2VOV3w==", + "requires": { + "node-bin-setup": "^1.0.0" + } + }, + "node-bin-setup": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/node-bin-setup/-/node-bin-setup-1.0.6.tgz", + "integrity": "sha512-uPIxXNis1CRbv1DwqAxkgBk5NFV3s7cMN/Gf556jSw6jBvV7ca4F9lRL/8cALcZecRibeqU+5dFYqFFmzv5a0Q==" + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + }, + "object-inspect": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", + "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==" + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + }, + "object.entries": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.0.tgz", + "integrity": "sha512-l+H6EQ8qzGRxbkHOd5I/aHRhHDKoQXQ8g0BYt4uSweQU1/J6dZUOyWh9a2Vky35YCKjzmgxOzta2hH6kf9HuXA==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.12.0", + "function-bind": "^1.1.1", + "has": "^1.0.3" + } + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "prism-media": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-0.0.3.tgz", + "integrity": "sha512-c9KkNifSMU/iXT8FFTaBwBMr+rdVcN+H/uNv1o+CuFeTThNZNTOrQ+RgXA1yL/DeLk098duAeRPP3QNPNbhxYQ==" + }, + "psl": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.7.0.tgz", + "integrity": "sha512-5NsSEDv8zY70ScRnOTn7bK7eanl2MvFrOrS/R6x+dBt5g1ghnj9Zv90kO8GwT8gxcu2ANyFprnFYB85IogIJOQ==" + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, + "request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "request-promise-core": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.3.tgz", + "integrity": "sha512-QIs2+ArIGQVp5ZYbWD5ZLCY29D5CfWizP8eWnm8FoGD1TX61veauETVQbrV60662V0oFBkrDOuaBI8XgtuyYAQ==", + "requires": { + "lodash": "^4.17.15" + } + }, + "request-promise-native": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.8.tgz", + "integrity": "sha512-dapwLGqkHtwL5AEbfenuzjTYg35Jd6KPytsC2/TLkVMz8rm+tNt72MGUWT1RP/aYawMpN6HqbNGBQaRcBtjQMQ==", + "requires": { + "request-promise-core": "1.1.3", + "stealthy-require": "^1.1.1", + "tough-cookie": "^2.3.3" + } + }, + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "snekfetch": { + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/snekfetch/-/snekfetch-3.6.4.tgz", + "integrity": "sha512-NjxjITIj04Ffqid5lqr7XdgwM7X61c/Dns073Ly170bPQHLm6jkmelye/eglS++1nfTWktpP6Y2bFXjdPlQqdw==" + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "dependencies": { + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + } + } + }, + "stealthy-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", + "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=" + }, + "string.prototype.trimleft": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz", + "integrity": "sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw==", + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, + "string.prototype.trimright": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz", + "integrity": "sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg==", + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + }, + "timers-ext": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz", + "integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==", + "requires": { + "es5-ext": "~0.10.46", + "next-tick": "1" + } + }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.1.tgz", + "integrity": "sha512-kcoMoKTPYnoeS50tzoqjPY3Uv9axeuuFAZY9M/9zFnhoVvRfxz9K29IMPD7jGmt2c8SW7i3gT9WqDl2+nV7p4A==" + }, + "type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "requires": { + "punycode": "^2.1.0" + } + }, + "util": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.1.tgz", + "integrity": "sha512-MREAtYOp+GTt9/+kwf00IYoHZyjM8VU4aVrkzUlejyqaIjd2GztVl5V9hGXKlvBKE3gENn/FMfHE5v6hElXGcQ==", + "requires": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "object.entries": "^1.1.0", + "safe-buffer": "^5.1.2" + } + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "ws": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", + "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", + "requires": { + "async-limiter": "~1.0.0" + } + } + } +} diff --git a/Gulag/package.json b/Gulag/package.json new file mode 100644 index 0000000..f749c50 --- /dev/null +++ b/Gulag/package.json @@ -0,0 +1,22 @@ +{ + "name": "gulag", + "version": "1.0.0", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "Zea", + "license": "ISC", + "dependencies": { + "alta-jsapi": "git+https://github.com/alta-vr/alta-jsapi.git", + "att-bot-core": "git+https://github.com/alta-vr/ATT-Bot-JS.git", + "att-websockets": "git+https://github.com/alta-vr/att-websockets.git", + "crypto-js": "^3.1.9-1", + "discord.js": "^11.5.1", + "fs": "0.0.1-security", + "moment": "^2.24.0", + "util": "^0.12.1" + }, + "devDependencies": {}, + "description": "" +} diff --git a/Gulag/src/player.js b/Gulag/src/player.js new file mode 100644 index 0000000..155f2d3 --- /dev/null +++ b/Gulag/src/player.js @@ -0,0 +1,21 @@ +module.exports = class Player { + + constructor( id, username ) + { + this.id = id; + this.username = username; + } + + set id( id ) { this._id = id; } + get id() { return _id; } + + set username(username) { this._username = username; } + get username() { return this._username; } + + set bio(bio) { this._bio = bio; } + get bio() { return _bio; } + + set lastLogin(lastLogin) { this._lastLogin = lastLogin; } + get lastLogin() { return _lastLogin; } + +} diff --git a/Gulag/src/subscriptions.js b/Gulag/src/subscriptions.js new file mode 100644 index 0000000..d63a120 --- /dev/null +++ b/Gulag/src/subscriptions.js @@ -0,0 +1,117 @@ +const moment = require('moment'); + +function now() +{ + return moment().valueOf(); +} + +function ts_f() +{ + return "["+ moment().format("h:mm:ss A") +"] " +} + +function insertHandler( err, doc ) +{ + if ( err ) { console.log( err ); } +} + +function updateHandler( err, rows ) +{ + if ( err ) { console.log( err ); } +} + +module.exports = class Subscriptions { + constructor( discordChannels, playersDb, killsDb, chunksDb ) { + this.discordChannels = discordChannels; + this.playersDb = playersDb; + this.killsDb = killsDb; + this.chunksDb = chunksDb; + } + + + PlayerJoined( discord, data ) + { + //console.log( data ); + this.playersDb.update( + { id: data.user.id }, + { $set: { username: data.user.username, lastLogin: now() } }, + { upsert: true }, + updateHandler + ); + discord.channels.get( this.discordChannels["PlayerJoined"] ).send( ts_f() + data.user.username +" joined the server" ); + console.log( ts_f() + data.user.username +" joined the server" ); + } + + PlayerLeft( discord, data ) + { + //console.log( data ); + discord.channels.get( this.discordChannels["PlayerLeft"] ).send( ts_f() + data.user.username +" left the server" ); + console.log( ts_f() + data.user.username +" left the server" ); + } + + PlayerMovedChunk( discord, data ) + { + //console.log( data ); + this.playersDb.update({ id: data.player.id }, { $set: { lastChunk: data.newChunk } }, {}, updateHandler ); + this.chunksDb.insert({ ts: now(), player: data.player.id, chunk: data.newChunk }, insertHandler ); + // also update the zone history for the new chunk + // TODO + console.log( ts_f() + data.player.username +" has moved to chunk "+ data.newChunk ); + } + + PlayerKilled( discord, data ) + { + //console.log( data ); + console.log( ts_f() + "player kill" ); + if ( data.killerPlayer != undefined ) + { + this.killsDb.insert({ + ts: now(), + killed : data.killedPlayer.id, + killer: data.killerPlayer.id, + usedTool: data.usedTool, + toolWielder: data.toolWielder + }, insertHandler ); + discord.channels.get( this.discordChannels["PlayerKilled"] ).send( ts_f() + data.killerPlayer.username +" has killed "+ data.killedPlayer.username ); + discord.channels.get( this.discordChannels["PublicPlayerKilled"] ).send( '```'+ data.killerPlayer.username +" has murdered "+ data.killedPlayer.username +'```' ); + } else { + if ( data.toolWielder ) + { + this.killsDb.insert({ + ts: now(), + killed : data.killedPlayer.id, + usedTool: data.usedTool, + toolWielder: data.toolWielder + }, insertHandler ); + discord.channels.get( this.discordChannels["PlayerKilled"] ).send( ts_f() + data.killedPlayer.username +" was killed by: "+ data.toolWielder ); + discord.channels.get( this.discordChannels["PublicPlayerKilled"] ).send( '```'+ data.killedPlayer.username +" was killed by: "+ data.toolWielder ); + } else { + this.killsDb.insert({ + ts: now(), + killed : data.killedPlayer.id, + }, insertHandler ); + discord.channels.get( this.discordChannels["PlayerKilled"] ).send( ts_f() + data.killedPlayer.username +" has suddenly offed themselves" ); + discord.channels.get( this.discordChannels["PublicPlayerKilled"] ).send( '```'+ data.killedPlayer.username +" has suddenly offed themselves" +'```'); + } + } + } + + TradeDeckUsed( discord, data ) + { + console.log( ts_f() + "trade deck used" ); + console.log( data ); + } + + CreatureKilled( discord, data ) + { + console.log( ts_f() + "creature murdered" ); + console.log( data ); + } + + CreatureSpawned( discord, data ) + { + console.log( ts_f() + "creature has spawned" ); + console.log( data ); + } + +}