forked from afspiegeling/NitoriBot
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2fa68da5ab |
@@ -0,0 +1,6 @@
|
||||
.env
|
||||
node_modules
|
||||
.upm
|
||||
.replit
|
||||
replit.nix
|
||||
new file
|
||||
@@ -0,0 +1,11 @@
|
||||
# chomens-bot-js
|
||||
***(originally named chomens-bot-mc)***\
|
||||
\
|
||||
Archive of ChomeNS Bot Javascript source code.\
|
||||
\
|
||||
Some of the code are messy and hardcoded so you might wanna change some of it.\
|
||||
\
|
||||
Explore the code and see how it works!\
|
||||
Also note that the core is broken sometimes.
|
||||
|
||||
R.I.P ChomeNS Bot Javascript
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
const mc = require('minecraft-protocol')
|
||||
const { EventEmitter } = require('node:events')
|
||||
const { EventEmitter } = require('events')
|
||||
const { loadPlugins } = require('./util/loadPlugins')
|
||||
const util = require('node:util')
|
||||
const randomstring = require('randomstring')
|
||||
|
||||
@@ -8,7 +8,6 @@ module.exports = {
|
||||
execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) {
|
||||
bot.tellraw(selector, [{ text: 'The bot\'s username is: ', color: 'white' }, { text: bot.username, color: 'gold', clickEvent: { action: 'copy_to_clipboard', value: bot.username }, hoverEvent: { action: 'show_text', contents: [{ text: 'Click here to copy the username to your clipboard', color: 'green' }] } }, { text: ' and the UUID is: ' }, { text: bot.uuid, color: 'aqua', clickEvent: { action: 'copy_to_clipboard', value: bot.uuid }, hoverEvent: { action: 'show_text', contents: [{ text: 'Click here to copy the UUID to your clipboard', color: 'green' }] } }])
|
||||
},
|
||||
|
||||
discordExecute (bot, username, sender, prefix, args, channeldc, message, config) {
|
||||
const Embed = new EmbedBuilder()
|
||||
.setColor(config.discord.embedsColors.normal)
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
const randomstring = require('randomstring')
|
||||
module.exports = {
|
||||
version: '1.19.2',
|
||||
prefixes: [
|
||||
'3*',
|
||||
'cbot3 ',
|
||||
'/cbot3 '
|
||||
],
|
||||
commandsDir: '../commands', // this will be used by the commands.js in the plugins folder so it needs ../
|
||||
proxy: {
|
||||
enabled: false,
|
||||
version: '1.19.2'
|
||||
},
|
||||
console: true,
|
||||
chat: {
|
||||
messageLength: 100
|
||||
},
|
||||
core: {
|
||||
layers: 3,
|
||||
refillInterval: 1000 * 60,
|
||||
|
||||
customName: [
|
||||
{
|
||||
text: 'https://doin-your.mom',
|
||||
color: 'dark_red'
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
self_care: {
|
||||
prefix: true,
|
||||
op: true,
|
||||
cspy: true,
|
||||
vanish: true,
|
||||
nickname: true,
|
||||
socialspy: true,
|
||||
gamemode: true,
|
||||
mute: true,
|
||||
endCredits: true
|
||||
},
|
||||
eval: {
|
||||
serverUrl: 'http://localhost:4445/'
|
||||
},
|
||||
reconnectTimeout: 15000, // idk mabe
|
||||
timeoutInterval: 1000 * 40,
|
||||
self_care_check_interval: 2000,
|
||||
discord: {
|
||||
prefix: '!',
|
||||
servers: {
|
||||
'chipmunk.land:25565': '1152778909901934602',
|
||||
'thefreedomz.one:25565': '1152807307256811561',
|
||||
'24.69.170.247:25565': '1155838188586283109',
|
||||
'ipv4.fusselig.xyz:25565': '1152807355000565871',
|
||||
'kaboom.pw:25565': '1152807462836109402',
|
||||
'172.126.70.0:25565': '1160601659098017925',
|
||||
'24.69.170.247:25564': '1160600923467415602'
|
||||
},
|
||||
embedsColors: {
|
||||
normal: '#FFFF00',
|
||||
error: '#FF0000'
|
||||
}
|
||||
},
|
||||
servers: [
|
||||
// logging means log to console
|
||||
{
|
||||
host: 'chipmunk.land',
|
||||
port: 25565,
|
||||
username: randomstring.generate(8),
|
||||
kaboom: true,
|
||||
logging: true,
|
||||
useChat: false
|
||||
},
|
||||
{
|
||||
host: '172.126.70.0',
|
||||
port: 25565,
|
||||
username: randomstring.generate(8),
|
||||
kaboom: true,
|
||||
logging: true,
|
||||
useChat: false
|
||||
},
|
||||
{
|
||||
host: '24.69.170.247',
|
||||
port: 25564,
|
||||
username: randomstring.generate(8),
|
||||
kaboom: true,
|
||||
logging: true,
|
||||
useChat: false
|
||||
},
|
||||
{
|
||||
host: 'ipv4.fusselig.xyz',
|
||||
port: 25565,
|
||||
username: randomstring.generate(8),
|
||||
kaboom: true,
|
||||
logging: true,
|
||||
useChat: false
|
||||
},
|
||||
{
|
||||
host: 'kaboom.pw',
|
||||
port: 25565,
|
||||
username: randomstring.generate(8),
|
||||
kaboom: true,
|
||||
logging: true,
|
||||
useChat: false
|
||||
},
|
||||
|
||||
{
|
||||
host: 'thefreedomz.one',
|
||||
port: 25565,
|
||||
username: randomstring.generate(8),
|
||||
kaboom: true,
|
||||
logging: true,
|
||||
useChat: false
|
||||
},
|
||||
|
||||
{
|
||||
host: '24.69.170.247',
|
||||
port: 25565,
|
||||
username: randomstring.generate(8),
|
||||
kaboom: true,
|
||||
logging: true,
|
||||
useChat: false
|
||||
}
|
||||
]
|
||||
}
|
||||
+1
-1
@@ -28,7 +28,7 @@ const { MessageContent, GuildMessages, Guilds } = GatewayIntentBits
|
||||
}
|
||||
})
|
||||
require('dotenv').config()
|
||||
dcclient.login(process.env.discordtoken)
|
||||
dcclient.login(process.env.discordtoken1)
|
||||
}
|
||||
|
||||
// TODO: improve this thing
|
||||
|
||||
@@ -12,7 +12,7 @@ function inject (bot, dcclient, config) {
|
||||
bot.chatQueue.shift()
|
||||
return
|
||||
};
|
||||
|
||||
// totallynotskidded™️ from mineflayer/lib/plugins/chat.js
|
||||
for (const subMessage of bot.chatQueue[0].split('\n')) {
|
||||
if (!subMessage) return
|
||||
let smallMsg
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
function inject (bot) {
|
||||
bot.cloop = {
|
||||
list: [],
|
||||
add (command, interval, list = true) {
|
||||
add (command, interval, list = true /* list is used in the cloop command listing and eaglercrash */) {
|
||||
const id = setInterval(() => bot.core.run(command), interval)
|
||||
|
||||
const thingsToPush /* ig not the best variable name */ = { id, interval, command, list }
|
||||
|
||||
@@ -31,7 +31,7 @@ function inject (bot, dcclient, config) {
|
||||
if (!command) throw new Error(`Unknown command: "${commandName}"`)
|
||||
|
||||
if (command.trusted > 0) {
|
||||
const discordRoles = message.member?.roles?.cache // do i need the "?"s ?
|
||||
const discordRoles = message.member?.roles?.cache // do i need the "?"s ?
|
||||
|
||||
// TODO: Don't hardcode the roles
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const nbt = require('prismarine-nbt');
|
||||
const Vec3 = require('vec3');
|
||||
|
||||
const relativePosition = new Vec3(0, 0, 0);
|
||||
const relativePosition = new Vec3(0, 0, 0);
|
||||
|
||||
function inject(bot, dcclient, config) {
|
||||
const mcData = require('minecraft-data')(bot.version);
|
||||
|
||||
@@ -7,7 +7,7 @@ class CommandError extends Error {
|
||||
super(stringify(message), filename, lineError)
|
||||
this.name = 'CommandError'
|
||||
this._message = message
|
||||
|
||||
|
||||
}
|
||||
|
||||
get message () {
|
||||
|
||||
@@ -1,25 +1,16 @@
|
||||
class CommandSource {
|
||||
constructor (player, sources, hash, owner, discordMessageEvent = null, consoleOnly, name, profile, bot) {//this worked just fine in v4.3.4
|
||||
//does it get defined in discord thingy wherever dat is
|
||||
// sus
|
||||
|
||||
constructor (player, sources, hash, owner = false, discordMessageEvent = null) {
|
||||
this.player = player
|
||||
|
||||
this.sources = sources
|
||||
this.profile = bot
|
||||
this.hash = hash
|
||||
|
||||
this.owner = owner
|
||||
this.consoleOnly = consoleOnly
|
||||
this.discordMessageEvent = discordMessageEvent
|
||||
|
||||
|
||||
this.owner = owner
|
||||
this.discordMessageEvent = discordMessageEvent
|
||||
}
|
||||
|
||||
sendFeedback () {}
|
||||
|
||||
sendError (message) {
|
||||
this.sendFeedback([{ text: '', color: 'red' }, message], false)
|
||||
this.sendFeedback([{ text: '', color: 'dark_red' }, message], false)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,111 +1,73 @@
|
||||
const mc = require("minecraft-protocol");
|
||||
const { EventEmitter } = require("node:events");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const util = require("node:util");
|
||||
console.log(`Starting ${process.env["buildstring"]} .......`);
|
||||
console.log(`Foundation: ${process.env["FoundationBuildString"]}`);
|
||||
console.log("this may take a few moments....");
|
||||
require("events").EventEmitter.defaultMaxListeners = 30;
|
||||
const mc = require('minecraft-protocol')
|
||||
const { EventEmitter } = require('events')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const forge = require('minecraft-protocol-forge')
|
||||
// "buildstring":"FNFBoyfriendBotX V4.0.8a Build:97",
|
||||
//"FoundationBuildString":"Ultimate Foundation V1.0.1 Build:31",
|
||||
function createBot(options = {}) {
|
||||
const bot = new EventEmitter();
|
||||
const rs = require("randomstring");
|
||||
const bot = new EventEmitter()
|
||||
const rs = require('randomstring')
|
||||
// Set some default values in options
|
||||
let r = Math.floor(Math.random() * 255) + 1;
|
||||
options.host ??= "localhost";
|
||||
options.username ??= "FNFBoyfriendBot";
|
||||
options.hideErrors ??= false; // HACK: Hide errors by default as a lazy fix to console being spammed with them
|
||||
options.console ??= true;
|
||||
options.input ??= true;
|
||||
|
||||
options.commands.MainPrefix ??= "~";
|
||||
options.commands.SecondaryPrefix ??= "%";
|
||||
options.commands.TertiaryPrefix ??= "&";
|
||||
options.selfcare.unmuted ??= true;
|
||||
|
||||
options.selfcare.vanished ??= true;
|
||||
|
||||
options.selfcare.prefix ??= true;
|
||||
|
||||
options.selfcare.skin ??= true;
|
||||
|
||||
options.selfcare.cspy ??= true;
|
||||
|
||||
options.selfcare.op ??= true;
|
||||
|
||||
options.selfcare.gmc ??= true;
|
||||
|
||||
options.selfcare.interval ??= 500;
|
||||
|
||||
options.selfcare.username ??= true;
|
||||
|
||||
options.selfcare.nickname ??= true;
|
||||
|
||||
options.selfcare.god ??= true;
|
||||
|
||||
options.selfcare.tptoggle ??= true;
|
||||
|
||||
options.discord.commandPrefix ??= "~";
|
||||
|
||||
options.reconnectDelay ??= 1000;
|
||||
|
||||
bot.options = options;
|
||||
let r = Math.floor(Math.random() * 255) + 1;
|
||||
options.host ??= 'localhost'
|
||||
options.username ??= username()
|
||||
options.hideErrors ??= false // HACK: Hide errors by default as a lazy fix to console being spammed with them
|
||||
options.forge ??= true
|
||||
bot.options = options
|
||||
|
||||
// Create our client object, put it on the bot, and register some events
|
||||
bot.on("init_client", (client) => {
|
||||
client.on("packet", (data, meta) => {
|
||||
bot.emit("packet", data, meta);
|
||||
bot.emit("packet." + meta.name, data);
|
||||
});
|
||||
bot.on('init_client', client => {
|
||||
client.on('packet', (data, meta) => {
|
||||
bot.emit('packet', data, meta)
|
||||
bot.emit('packet.' + meta.name, data)
|
||||
})
|
||||
|
||||
client.on("login", async function (data) {
|
||||
bot.uuid = client.uuid;
|
||||
bot.username = client.username;
|
||||
bot.port = bot.options.port;
|
||||
bot.version = bot.options.version;
|
||||
console.log(`Username: ${bot.options.username}`);
|
||||
console.log(`Host: ${bot.options.host}:${bot.options.port}`);
|
||||
console.log(`Minecraft java version: ${bot.options.version}`);
|
||||
|
||||
});
|
||||
|
||||
client.on("end", (reason) => {
|
||||
bot.emit("end", reason);
|
||||
console.log(reason);
|
||||
bot.cloop.clear()
|
||||
bot.memusage.off()
|
||||
});
|
||||
client.on("disconnect", (reason) => {
|
||||
bot.emit("disconnect", reason);
|
||||
console.log(reason);
|
||||
});
|
||||
|
||||
client.on("kick_disconnect", (reason) => {
|
||||
bot.emit("kick_disconnect", reason);
|
||||
console.log(reason);
|
||||
});
|
||||
client.on("keep_alive", ({ keepAliveId }) => {
|
||||
bot.emit("keep_alive", { keepAliveId });
|
||||
});
|
||||
|
||||
client.on("error", (error) => bot.emit("error", error));
|
||||
});
|
||||
client.on('login', () => {
|
||||
bot.uuid = client.uuid
|
||||
bot.username = client.username
|
||||
})
|
||||
|
||||
client.on('end', reason => bot.emit('end', reason))
|
||||
|
||||
client.on('error', error => bot.emit('error', error))
|
||||
|
||||
})
|
||||
|
||||
const client = options.client ?? mc.createClient(options);
|
||||
bot._client = client;
|
||||
bot.emit("init_client", client);
|
||||
const buildstring = process.env['buildstring']
|
||||
|
||||
bot.bots = options.bots ?? [bot];
|
||||
const client = options.client ?? mc.createClient(options)
|
||||
bot._client = client
|
||||
bot.emit('init_client', client)
|
||||
|
||||
bot.bots = options.bots ?? [bot]
|
||||
|
||||
// Modules
|
||||
bot.loadModule = module => module(bot, options)
|
||||
|
||||
|
||||
return bot;
|
||||
}
|
||||
const amonger = "../";
|
||||
if (fs.existsSync("../FridayNightFunkinBoyfriendBot") == false) {
|
||||
process.exit(1);
|
||||
for (const filename of fs.readdirSync(path.join(__dirname, 'modules'))) {
|
||||
try {
|
||||
const module = require(path.join(__dirname, 'modules', filename))
|
||||
bot.loadModule(module)
|
||||
} catch (error) {
|
||||
console.error('Failed to load module', filename, ':', error)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return bot
|
||||
}
|
||||
|
||||
module.exports = createBot;
|
||||
// ABot username function mabe mabe
|
||||
function username() {
|
||||
const characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; // remove sus characters like ` or like ( or whatever because it breaks whatever
|
||||
let username = '';
|
||||
for (let i = 0; i < 8; i++) {
|
||||
const randomIndex = Math.floor(Math.random() * characters.length);
|
||||
username += characters[randomIndex];
|
||||
}
|
||||
return username;
|
||||
}
|
||||
|
||||
|
||||
module.exports = createBot
|
||||
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'botsrun',
|
||||
description:[''],
|
||||
aliases:[],
|
||||
trustLevel: 2,
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
// const client = context.client
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
const message = context.arguments.join(' ')
|
||||
//const source = context.source
|
||||
// if (args.length === 0){
|
||||
//source.sendFeedback({translate:"Too few Arguments!", color:"red"})
|
||||
const amogus = args.slice(1).join(' ');
|
||||
if (!args && !args[0] && !args[1] && !args[2]) return
|
||||
try{
|
||||
switch (args[1]) {
|
||||
case 'source':
|
||||
|
||||
for (const eachBot of bot.bots) {
|
||||
eachBot.commandManager.executeString(source, `${args.slice(2).join(' ')} `)
|
||||
}
|
||||
break
|
||||
case 'consolesource':
|
||||
|
||||
for (const eachBot of bot.bots) {
|
||||
eachBot.commandManager.executeString(bot.console.source, `${args.slice(2).join(' ')} `)
|
||||
}
|
||||
break
|
||||
default:
|
||||
context.source.sendError([ { text: 'Invalid action', color: 'dark_red', bold:false }])
|
||||
source.sendFeedback({text:'Args are source and consolesource', color:'green'})
|
||||
}
|
||||
|
||||
}catch(error){
|
||||
source.sendFeedback(error.stack)
|
||||
}
|
||||
// context.source.sendFeedback({ text: util.inspect(eval(script), { stylize }).substring(0, 32700) })
|
||||
|
||||
|
||||
}//
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
const convert = require('color-convert')
|
||||
|
||||
function inject (bot) {
|
||||
bot.bruhifyTextTellraw = ''
|
||||
let startHue = 0
|
||||
const timer = setInterval(() => {
|
||||
if (bot.bruhifyTextTellraw === '') return
|
||||
|
||||
let hue = startHue
|
||||
const displayName = bot.bruhifyTextTellraw
|
||||
const increment = (360 / Math.max(displayName.length, 20))
|
||||
const component = []
|
||||
for (const character of displayName) {
|
||||
const color = convert.hsv.hex(hue, 100, 100)
|
||||
component.push({
|
||||
text: character,
|
||||
color: `#${color}`,
|
||||
|
||||
})
|
||||
|
||||
// hoverEvent: { action:"show_text", value: '§aMan i like frogs - _ChipMC_'},
|
||||
hue = (hue + increment) % 360
|
||||
}
|
||||
bot.core.run(`tellraw @a ${JSON.stringify(component)}`) // instead of doing just "tellraw" do "minecraft:tellraw"
|
||||
|
||||
startHue = (startHue + increment) % 360
|
||||
}, 50)
|
||||
|
||||
bot.on('end', () => {
|
||||
clearInterval(timer)
|
||||
})
|
||||
}
|
||||
module.exports = inject
|
||||
@@ -1,33 +0,0 @@
|
||||
const convert = require('color-convert')
|
||||
|
||||
function inject (bot) {
|
||||
bot.bruhifyTextTitle = ''
|
||||
let startHue = 0
|
||||
const timer = setInterval(() => {
|
||||
if (bot.bruhifyTextTitle === '') return
|
||||
|
||||
let hue = startHue
|
||||
const displayName = bot.bruhifyTextTitle
|
||||
const increment = (360 / Math.max(displayName.length, 20))
|
||||
const component = []
|
||||
for (const character of displayName) {
|
||||
const color = convert.hsv.hex(hue, 100, 100)
|
||||
component.push({
|
||||
text: character,
|
||||
color: `#${color}`,
|
||||
|
||||
})
|
||||
|
||||
// hoverEvent: { action:"show_text", value: '§aMan i like frogs - _ChipMC_'},
|
||||
hue = (hue + increment) % 360
|
||||
}
|
||||
bot.core.run(`title @a title ${JSON.stringify(component)}`) // instead of doing just "tellraw" do "minecraft:tellraw"
|
||||
|
||||
startHue = (startHue + increment) % 360
|
||||
}, 100)
|
||||
|
||||
bot.on('end', () => {
|
||||
clearInterval(timer)
|
||||
})
|
||||
}
|
||||
module.exports = inject
|
||||
@@ -1,34 +0,0 @@
|
||||
function parseMessage (message, data, context) {
|
||||
try{
|
||||
if (message === null || typeof message !== 'object') return
|
||||
|
||||
if (message.with?.length < 2 || (message.translate !== 'chat.type.emote' && message.translate !== '%s %s')) return
|
||||
|
||||
const senderComponent = message.with[0]
|
||||
// wtf spam again - console.log(senderComponent)//wtf...
|
||||
//console.log(senderComponent)
|
||||
|
||||
const contents = message.with[1]
|
||||
// spam lol - console.log(contents)
|
||||
//console.log(contents)
|
||||
let sender
|
||||
|
||||
const hoverEvent = senderComponent.hoverEvent
|
||||
if (hoverEvent?.action === 'show_entity') {
|
||||
const id = hoverEvent.contents.id
|
||||
//
|
||||
sender = data.players.find(player => player.uuid === id)
|
||||
} else {
|
||||
const stringUsername = data.getMessageAsPrismarine(senderComponent).toString() // TypeError: data.getMessageAsPrismarine is not a function
|
||||
|
||||
sender = data.players.find(player => player.profile.name) //=== stringusername)
|
||||
}
|
||||
|
||||
if (!sender) return undefined
|
||||
|
||||
return { sender, contents, type: 'minecraft:chat', senderComponent }
|
||||
}catch(e){
|
||||
console.log(e.stack)
|
||||
}
|
||||
}
|
||||
module.exports = parseMessage
|
||||
@@ -1,34 +0,0 @@
|
||||
function parseMessage (message, data, context) {
|
||||
try {
|
||||
if (message === null || typeof message !== 'object') return
|
||||
|
||||
if (message.with?.length < 2 || (message.translate !== 'chat.type.text' && message.translate !== '%s %s')) return
|
||||
|
||||
const senderComponent = message.with[0]
|
||||
// wtf spam again - console.log(senderComponent)//wtf...
|
||||
//console.log(senderComponent)
|
||||
|
||||
const contents = message.with[1]
|
||||
// spam lol - console.log(contents)
|
||||
//console.log(contents)
|
||||
let sender
|
||||
|
||||
const hoverEvent = senderComponent.hoverEvent
|
||||
if (hoverEvent?.action === 'show_entity') {
|
||||
const id = hoverEvent.contents.id
|
||||
//
|
||||
sender = data.players.find(player => player.uuid === id)
|
||||
} else {
|
||||
const stringUsername = data.getMessageAsPrismarine(senderComponent).toString() // TypeError: data.getMessageAsPrismarine is not a function
|
||||
|
||||
sender = data.players.find(player => player.profile.name) //=== stringusername)
|
||||
}
|
||||
|
||||
if (!sender) return undefined
|
||||
|
||||
return { sender, contents, type: 'minecraft:chat', senderComponent }
|
||||
}catch(e){
|
||||
console.log(e.stack)
|
||||
}
|
||||
}
|
||||
module.exports = parseMessage
|
||||
+5
-12
@@ -1,20 +1,15 @@
|
||||
function parseMessage (message, data, context, bot) {
|
||||
try{
|
||||
if (message === null || typeof message !== 'object') return
|
||||
function parseMessage (message, data) {
|
||||
if (message === null || typeof message !== 'object') return
|
||||
|
||||
if (message.with?.length < 3 || (message.translate !== '[%s] %s › %s' && message.translate !== '%s %s › %s')) return
|
||||
|
||||
const senderComponent = message.with[1]
|
||||
// wtf spam again -
|
||||
//console.log(senderComponent)//wtf...
|
||||
|
||||
|
||||
// wtf spam again - console.log(senderComponent)//wtf...
|
||||
const contents = message.with[2]
|
||||
// spam lol - console.log(contents)
|
||||
let sender
|
||||
|
||||
const hoverEvent = senderComponent.hoverEvent
|
||||
//console.log(JSON.stringify(hoverEvent))
|
||||
if (hoverEvent?.action === 'show_entity') {
|
||||
const id = hoverEvent.contents.id
|
||||
//
|
||||
@@ -25,11 +20,9 @@ function parseMessage (message, data, context, bot) {
|
||||
sender = data.players.find(player => player.profile.name) //=== stringusername)
|
||||
}
|
||||
|
||||
if (!sender) return null
|
||||
if (!sender) return undefined
|
||||
|
||||
return { sender, contents, type: 'minecraft:chat', senderComponent }
|
||||
}catch(e){
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = parseMessage
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'botdevhistory',
|
||||
description:['bots dev history'],
|
||||
execute (context) {
|
||||
|
||||
const message = context.arguments.join(' ')
|
||||
const bot = context.bot
|
||||
var prefix = '&8&l&m[&4&mParker2991&8]&8&m[&b&mBOYFRIEND&8]&8&m[&b&mCONSOLE&8]&r '
|
||||
bot.core.run('bcraw ' + prefix + 'Thank you for all that helped and contributed with the bot, it has been one hell of a ride with the bot hasnt it? From November 22, 2022 to now, 0.1 beta to 4.0 alpha, Mineflayer to Node-Minecraft-Protocol. I have enjoyed all the new people i have met throughout the development of the bot back to the days when the bot used mineflayer for most of its lifespan to the present as it now uses node-minecraft-protocol. Its about time for me to tell how development went in the bot well here it is, back in 0.1 beta of the bot it was skidded off of menbot 1.0 reason why? Well because LoginTimedout gave me the bot when ayunboom was still a thing and he helped throughout that time period bot and when 1.0 beta came around he he just stopped helping me on it why? because he had servers to run so yeah but anyway back then i didnt know what skidded like i do now so i thought i could get away with but i was wrong 💀. Early names considered for the bot were &6&lParkerBot &4&lDEMONBot &b&lWoomyBot &b&lBoyfriendBot,&r i kept the name &b&lBoyfriendBot&r throughout most of the early development but i got sick and tired of being harassed about the name being told it was gay but people really didnt know what it meant did they? It was referenced to Boyfriend from Friday Night Funkin’ so right around 1.0 released i renamed it to &b&lFNFBoyfriend&4&lBot &rand around 2.0 changed it to &5&lFNF&b&lBoyfriend&4&lBot &rand luckily avoided the harassment when i changed it i love coding and i want to learn how to code more thank you all!')
|
||||
}
|
||||
}
|
||||
+161
-262
@@ -1,306 +1,205 @@
|
||||
// TODO: Maybe add more authors
|
||||
// TODO: Maybe add more authors
|
||||
const bots = [
|
||||
{
|
||||
name: { text: "HBot", color: "aqua", bold: false },
|
||||
authors: ["hhhzzzsss"],
|
||||
exclaimer: "HBOT HARRYBUTT LMAOOOOOOOOOOOOOOOOO",
|
||||
foundation: "java/mcprotocollib",
|
||||
prefixes: ["#"],
|
||||
name: { text: 'HBot', color: 'aqua', bold:false },
|
||||
authors: ['hhhzzzsss'],
|
||||
exclaimer:'HBOT HARRYBUTT LMAOOOOOOOOOOOOOOOOO',
|
||||
foundation: 'java/mcprotocollib',
|
||||
prefixes: ['#']
|
||||
},
|
||||
{
|
||||
name: { text: "64Bot", color: "gold", bold: false },
|
||||
authors: ["64Will64"],
|
||||
exclaimer: "NINTENDO 64?!?!??!?! 69Bot when??????",
|
||||
foundation: "NodeJS/Mineflayer",
|
||||
prefixes: ["w="],
|
||||
name: { text: '64Bot', color: 'gold', bold:false },
|
||||
authors: ['64Will64'],
|
||||
exclaimer:'NINTENDO 64?!?!??!?! 69Bot when??????',
|
||||
foundation: 'NodeJS/Mineflayer',
|
||||
prefixes: ['w=']
|
||||
},
|
||||
{
|
||||
name: { text: "Nebulabot", color: "dark_purple", bold: false },
|
||||
authors: ["IuCC"],
|
||||
exclaimer: "the void",
|
||||
foundation: "NodeJS/Node-minecraft-protocol",
|
||||
prefixes: ["["],
|
||||
name: [{ text: 'Evil', color: 'dark_red', bold:false }, {text:'Bot', color:'dark_purple'}],
|
||||
authors: ['FusseligerDev'],
|
||||
exclaimer:'',
|
||||
foundation: 'Java/Custom',
|
||||
prefixes: ['!']
|
||||
},
|
||||
{
|
||||
name: [
|
||||
{ text: "Prism", color: "#00FF9C", bold: true },
|
||||
{ text: "Bot", color: "white",bold:true },
|
||||
],
|
||||
authors: ["IuCC"],
|
||||
exclaimer: "prismarine :3",
|
||||
foundation: "NodeJS/Node-minecraft-protocol",
|
||||
prefixes: ["["],
|
||||
name: { text: 'SBot Java', color: 'white', bold:false }, // TODO: Gradient
|
||||
authors: ['evkc'],
|
||||
foundation: 'Java/MCProtocolLib',
|
||||
prefixes: [':']
|
||||
},
|
||||
{
|
||||
name: { text: 'SBot Rust', color: 'white', bold:false}, // TODO: Gradient
|
||||
authors: ['evkc'],
|
||||
foundation: 'Rust',
|
||||
prefixes: ['re:']
|
||||
},
|
||||
{
|
||||
name: { text: 'Z-Boy-Bot', color: 'dark_purple', bold:false }, // TODO: Gradient
|
||||
exclaimer: 'Most likely skidded along with kbot that the dev used',
|
||||
authors: ['Romnci'],
|
||||
foundation: 'NodeJS/mineflayer or Java/mcprotocollib idfk',
|
||||
prefixes: ['Z]']
|
||||
},
|
||||
{
|
||||
name: { text: 'ABot', color: 'gold', bold:true }, // TODO: Gradient
|
||||
exclaimer: 'not used anymore (replaced by V2)',
|
||||
authors: [{text: '_yfd', color: 'light_purple'}],
|
||||
foundation: 'NodeJS/Node-Minecraft-Protocol',
|
||||
prefixes: ['<']
|
||||
},
|
||||
{
|
||||
name: { text: "SharpBot", color: "aqua", bold: false },
|
||||
authors: ["64Will64"],
|
||||
exclaimer:
|
||||
"sharp as in the tv? idfk im out of jokes also the first c# bot on the list??",
|
||||
foundation: "C#/MineSharp",
|
||||
prefixes: ["s="],
|
||||
name: { text: 'ABot-V2', color: 'gold', bold:true }, // TODO: Gradient
|
||||
exclaimer: '',
|
||||
authors: [{text: '_yfd', color: 'light_purple'}],
|
||||
foundation: 'NodeJS/Node-Minecraft-Protocol',
|
||||
prefixes: ['<']
|
||||
},
|
||||
{
|
||||
name: { text: 'FardBot', color: 'light_purple', bold:false },
|
||||
authors: ['_yfd'],
|
||||
exclaimer: 'bot is dead lol',
|
||||
foundation: 'NodeJS/Mineflayer',
|
||||
prefixes: ['<']
|
||||
},
|
||||
|
||||
{
|
||||
name: { text: 'ChipmunkBot', color: 'green', bold:false },
|
||||
authors: ['_ChipMC_'],
|
||||
exclaimer: 'chips? also shoutout to chip and chayapak for helping in the rewrite',
|
||||
|
||||
foundation: 'Java/MCProtocolLib',
|
||||
prefixes: ["'", "/'"]
|
||||
},
|
||||
{
|
||||
name: { text: 'ChipmunkBot Old', color: 'green', bold:false },
|
||||
authors: ['_ChipMC_'],
|
||||
foundation: 'NodeJS/Node-Minecraft-Protocol',
|
||||
|
||||
},
|
||||
{
|
||||
name: { text: 'TestBot', color: 'aqua', bold:false },
|
||||
authors: ['Blackilykat'],
|
||||
foundation: 'Java/MCProtocolLib',
|
||||
prefixes: ["-"]
|
||||
},
|
||||
{
|
||||
name: { text: 'UBot', color: 'grey', bold:false },
|
||||
authors: ['HexWoman'],
|
||||
exclaimer: 'UwU OwO',
|
||||
|
||||
foundation: 'NodeJS/node-minecraft-protocol',
|
||||
prefixes: ['"']
|
||||
},
|
||||
{
|
||||
name: { text: 'ChomeNS Bot Java', color: 'yellow', bold:false},
|
||||
authors: ['chayapak'],
|
||||
exclaimer: 'wow its my bot !! ! 4374621q43567%^&#%67868-- chayapak',
|
||||
foundation: 'Java/MCProtocolLib',
|
||||
prefixes: ['*', 'cbot ', '/cbot ']
|
||||
},
|
||||
{
|
||||
name: { text: 'ChomeNS Bot NodeJS', color: 'yellow', bold:false},
|
||||
authors: ['chayapak'],
|
||||
|
||||
{
|
||||
name: { text: "MoonBot", color: "red", bold: false },
|
||||
authors: ["64Will64"],
|
||||
exclaimer: "stop mooning/mooing me ",
|
||||
foundation: "NodeJS/Mineflayer",
|
||||
prefixes: ["m="],
|
||||
foundation: 'NodeJS/Node-Minecraft-Protocol',
|
||||
prefixes: ['*', 'cbot', '/cbot']
|
||||
},
|
||||
{
|
||||
name: { text: "TableBot", color: "yellow", bold: false },
|
||||
authors: ["12alex12"],
|
||||
exclaimer: "TABLE CLOTH BOT?!?! ",
|
||||
foundation: "NodeJS/Node-minecraft-protocol",
|
||||
prefixes: ["t!"],
|
||||
name: { text: 'RecycleBot', color: 'dark_green', bold:false},
|
||||
foundation: ['MorganAnkan'],
|
||||
exclaimer: 'nice bot',
|
||||
language: 'NodeJS/node-minecraft-protocol',
|
||||
prefixes: ['=']
|
||||
},
|
||||
{
|
||||
name: [
|
||||
{ text: "Evil", color: "dark_red", bold: false },
|
||||
{ text: "Bot", color: "dark_purple" },
|
||||
],
|
||||
authors: ["FusseligerDev"],
|
||||
exclaimer: "",
|
||||
foundation: "Java/Custom",
|
||||
prefixes: ["!"],
|
||||
name: { text: 'ManBot', color: 'dark_green' , bold:false },
|
||||
exclaimer: '(more like men bot :skull:) OH HAAAAAAAAAAAAAAIIILL LOGINTIMEDOUT',
|
||||
authors: ['Man/LogintimedOut'],
|
||||
foundation: 'NodeJS/mineflayer',
|
||||
prefixes: ['(Note:I dont remember!!)']
|
||||
},
|
||||
{
|
||||
name: { text: "SBot Java", color: "white", bold: false }, // TODO: Gradient
|
||||
authors: ["evkc"],
|
||||
foundation: "Java/MCProtocolLib",
|
||||
prefixes: [":"],
|
||||
name: [{ text: 'Useless', color: 'red', bold:false}, { text: 'Bot', color: 'gray', bold:false}],
|
||||
exclaimer: 'it isnt useless its a good bot................',
|
||||
authors: ['IuCC'],
|
||||
foundation: 'NodeJS/node-minecraft-protocol',
|
||||
prefixes: ['[']
|
||||
},
|
||||
{
|
||||
name: { text: "SBot Rust", color: "white", bold: false }, // TODO: Gradient
|
||||
authors: ["evkc"],
|
||||
foundation: "Rust",
|
||||
prefixes: ["re:"],
|
||||
name: [{ text: 'Blurry', color: 'dark_purple' , bold:false}, { text: 'Bot', color: 'red' }],
|
||||
exclaimer: '',
|
||||
authors: ['SirLennox'],
|
||||
foundation: 'Java/custom',
|
||||
prefixes: [',']
|
||||
},
|
||||
{
|
||||
name: [{ text: 'KittyCorp', color: 'yellow', bold:false }, { text: 'Bot', color: 'yellow' }],
|
||||
exclaimer: '3 words ginlang is gay',
|
||||
authors: ['ginlang , G6_, ArrayBuffer, and i guess more??'],
|
||||
foundation: 'NodeJS/node-minecraft-protocol',
|
||||
prefixes: ['^']
|
||||
},
|
||||
|
||||
{
|
||||
name: [{ text:'FNF', color: 'dark_purple', bold: false}, {text:'Boyfriend', color: 'aqua', bold:false}, {text:'Bot', color:'dark_red', bold:false}, {text:' Node-Minecraft-Protocol', color:'black', bold:false}],
|
||||
authors: [{ text:'Parker2991', color: 'dark_red'}, {text:' _ChipMC_', color: 'dark_green', bold:false}, {text:' chayapak', color:'yellow', bold:false}],
|
||||
exclaimer: 'FNFBoyfriendBot NMP Rewrite',
|
||||
foundation: 'NodeJS/node-minecraft-protocol',
|
||||
prefixes: ['~']
|
||||
},
|
||||
{
|
||||
name: { text: "Z-Boy-Bot", color: "dark_purple", bold: false }, // TODO: Gradient
|
||||
exclaimer: "Most likely skidded along with kbot that the dev used",
|
||||
authors: ["Romnci"],
|
||||
foundation: "NodeJS/mineflayer or Java/mcprotocollib idfk",
|
||||
prefixes: ["Z]"],
|
||||
},
|
||||
{
|
||||
name: { text: "ABot", color: "gold", bold: true }, // TODO: Gradient
|
||||
exclaimer: "not used anymore (replaced by V2)",
|
||||
authors: [{ text: "_yfd", color: "light_purple" }],
|
||||
foundation: "NodeJS/Node-Minecraft-Protocol",
|
||||
prefixes: ["<"],
|
||||
},
|
||||
{
|
||||
name: { text: "ABot-V2", color: "gold", bold: true }, // TODO: Gradient
|
||||
exclaimer: "",
|
||||
authors: [{ text: "_yfd", color: "light_purple" }],
|
||||
foundation: "NodeJS/Node-Minecraft-Protocol",
|
||||
prefixes: ["<"],
|
||||
},
|
||||
{
|
||||
name: { text: "FardBot", color: "light_purple", bold: false },
|
||||
authors: ["_yfd"],
|
||||
exclaimer: "bot is dead lol",
|
||||
foundation: "NodeJS/Mineflayer",
|
||||
prefixes: ["<"],
|
||||
},
|
||||
|
||||
{
|
||||
name: { text: "ChipmunkBot Java", color: "green", bold: false },
|
||||
authors: ["_ChipMC_"],
|
||||
exclaimer:
|
||||
"chips? also shoutout to chip and chayapak for helping in the rewrite",
|
||||
|
||||
foundation: "Java/MCProtocolLib",
|
||||
prefixes: ["'", "/'"],
|
||||
},
|
||||
{
|
||||
name: { text: "ChipmunkBot NodeJS", color: "green", bold: false },
|
||||
authors: ["_ChipMC_"],
|
||||
foundation: "NodeJS/Node-Minecraft-Protocol",
|
||||
},
|
||||
{
|
||||
name: { text: "TestBot", color: "aqua", bold: false },
|
||||
authors: ["Blackilykat"],
|
||||
foundation: "Java/MCProtocolLib",
|
||||
prefixes: ["-"],
|
||||
},
|
||||
{
|
||||
name: { text: "UBot", color: "grey", bold: false },
|
||||
authors: ["HexWoman"],
|
||||
exclaimer: "UwU OwO",
|
||||
|
||||
foundation: "NodeJS/node-minecraft-protocol",
|
||||
prefixes: ['"'],
|
||||
},
|
||||
{
|
||||
name: { text: "ChomeNS Bot Java", color: "yellow", bold: false },
|
||||
authors: ["chayapak"],
|
||||
exclaimer: "wow its my bot !! ! 4374621q43567%^&#%67868-- chayapak",
|
||||
foundation: "Java/MCProtocolLib",
|
||||
prefixes: ["*", "cbot ", "/cbot "],
|
||||
},
|
||||
{
|
||||
name: { text: "ChomeNS Bot NodeJS", color: "yellow", bold: false },
|
||||
authors: ["chayapak"],
|
||||
|
||||
foundation: "NodeJS/Node-Minecraft-Protocol",
|
||||
prefixes: ["*", "cbot", "/cbot"],
|
||||
},
|
||||
{
|
||||
name: { text: "RecycleBot", color: "dark_green", bold: false },
|
||||
foundation: ["MorganAnkan"],
|
||||
exclaimer: "nice bot",
|
||||
language: "NodeJS/node-minecraft-protocol",
|
||||
prefixes: ["="],
|
||||
},
|
||||
{
|
||||
name: { text: "neobot", color: "blue", bold: false },
|
||||
exclaimer: "n e o b o t ;oslkdfj;salkdfj;ladsjf",
|
||||
authors: ["mirkokral"],
|
||||
foundation: "java/MCProtocolLib",
|
||||
prefixes: ["_"],
|
||||
},
|
||||
{
|
||||
name: { text: "ManBot", color: "dark_green", bold: false },
|
||||
exclaimer:
|
||||
"(more like men bot :skull:) OH HAAAAAAAAAAAAAAIIILL LOGINTIMEDOUT",
|
||||
authors: ["Man/LogintimedOut"],
|
||||
foundation: "NodeJS/mineflayer",
|
||||
prefixes: ["(Note:I dont remember!!)"],
|
||||
},
|
||||
{
|
||||
name: [
|
||||
{ text: "Useless", color: "red", bold: false },
|
||||
{ text: "Bot", color: "gray", bold: false },
|
||||
],
|
||||
exclaimer: "it isnt useless its a good bot................",
|
||||
authors: ["IuCC"],
|
||||
foundation: "NodeJS/node-minecraft-protocol",
|
||||
prefixes: ["["],
|
||||
},
|
||||
{
|
||||
name: [
|
||||
{ text: "Blurry", color: "dark_purple", bold: false },
|
||||
{ text: "Bot", color: "red" },
|
||||
],
|
||||
exclaimer: "",
|
||||
authors: ["SirLennox"],
|
||||
foundation: "Java/custom",
|
||||
prefixes: [","],
|
||||
},
|
||||
{
|
||||
name: [{ text: "SnifferBot", color: "gold", bold: false }],
|
||||
exclaimer: "sniff sniff FNFBoyfriendBot simp",
|
||||
authors: ["popbob"],
|
||||
foundation: "NodeJS/Node-minecraft-protocol",
|
||||
prefixes: [">"],
|
||||
},
|
||||
{
|
||||
name: [{ text: "XBot", color: "dark_purple", bold: false }],
|
||||
exclaimer: "",
|
||||
authors: ["popbob"],
|
||||
foundation: "ts-Node/Node-minecraft-protocol",
|
||||
prefixes: ["$"],
|
||||
},
|
||||
{
|
||||
name: [
|
||||
{ text: "Kitty", color: "gold", bold: false },{text:"Corp", color:'aqua',bold:false},
|
||||
{ text: "Bot", color: "yellow",bold:false },
|
||||
],
|
||||
exclaimer: "3 words ginlang is gay",
|
||||
authors: ["ginlang , G6_, ArrayBuffer, and i guess more??"],
|
||||
foundation: "NodeJS/node-minecraft-protocol",
|
||||
prefixes: ["^"],
|
||||
},
|
||||
|
||||
{
|
||||
name: [
|
||||
{ text: "FNF", color: "dark_purple", bold: false },
|
||||
{ text: "Boyfriend", color: "aqua", bold: false },
|
||||
{ text: "Bot", color: "dark_red", bold: false },
|
||||
{ text: " nmp", color: "black", bold: false },
|
||||
],
|
||||
authors: [
|
||||
{ text: "Parker2991", color: "dark_red" },
|
||||
{ text: " _ChipMC_", color: "dark_green", bold: false },
|
||||
{ text: " chayapak", color: "yellow", bold: false },
|
||||
{ text: " _yfd", color: "light_purple", bold: false },
|
||||
{ text: "popbob", color: "gold" },
|
||||
],
|
||||
exclaimer: "FNFBoyfriendBot NMP Rewrite",
|
||||
foundation: "NodeJS/node-minecraft-protocol",
|
||||
prefixes: ["~ % &"],
|
||||
},
|
||||
{
|
||||
name: [
|
||||
{ text: "FNF", color: "dark_purple", bold: false },
|
||||
{ text: "Boyfriend", color: "aqua", bold: false },
|
||||
{ text: "Bot", color: "dark_red", bold: false },
|
||||
{ text: " legacy", color: "green", bold: false },
|
||||
],
|
||||
authors: [
|
||||
{ text: "Parker2991", color: "dark_red" },
|
||||
{ text: " _ChipMC_", color: "dark_green", bold: false },
|
||||
],
|
||||
exclaimer:
|
||||
"1037 LINES OF CODE WTFARD!??! also this version is in console commands only",
|
||||
foundation: "NodeJS/mineflayer",
|
||||
prefixes: [],
|
||||
},
|
||||
];
|
||||
name: [{ text:'FNF', color: 'dark_purple', bold: false}, {text:'Boyfriend', color: 'aqua', bold:false}, {text:'Bot', color:'dark_red', bold:false}, {text:' Mineflayer', color:'green', bold:false}],
|
||||
authors: [{text:'Parker2991', color:'dark_red' }, {text:' _ChipMC_', color:'dark_green', bold:false }],
|
||||
exclaimer:'1037 LINES OF CODE WTFARD!??! also this version is in console commands only' ,
|
||||
foundation: 'NodeJS/mineflayer',
|
||||
prefixes: []
|
||||
}
|
||||
]
|
||||
|
||||
module.exports = {
|
||||
name: "bots",
|
||||
description: ["shows a list of known bots"],
|
||||
aliases: ["knownbots"],
|
||||
trustLevel: 0,
|
||||
execute(context) {
|
||||
const query = context.arguments.join(" ").toLowerCase();
|
||||
const bot = context.bot;
|
||||
name: 'bots',
|
||||
description:['shows a list of known bots'],
|
||||
execute (context) {
|
||||
const query = context.arguments.join(' ').toLowerCase()
|
||||
|
||||
if (query.length === 0) {
|
||||
const list = [];
|
||||
const list = []
|
||||
|
||||
for (const info of bots) {
|
||||
if (list.length !== 0) list.push({ text: ", ", color: "gray" }); // list.push(info.name)
|
||||
list.push(info.name);
|
||||
if (list.length !== 0) list.push({ text: ', ', color: 'gray' })
|
||||
list.push(info.name)
|
||||
}
|
||||
|
||||
context.source.sendFeedback(
|
||||
["Known bots (", bots.length, ") - ", ...list],
|
||||
false,
|
||||
);
|
||||
return;
|
||||
context.source.sendFeedback(['Known bots (', bots.length, ') - ', ...list], false)
|
||||
return
|
||||
}
|
||||
|
||||
for (const info of bots) {
|
||||
const plainName = String(
|
||||
context.bot.getMessageAsPrismarine(info.name),
|
||||
).toLowerCase();
|
||||
if (plainName.includes(query)) this.sendBotInfo(info, context.bot);
|
||||
const plainName = String(context.bot.getMessageAsPrismarine(info.name)).toLowerCase()
|
||||
if (plainName.includes(query)) this.sendBotInfo(info, context.bot)
|
||||
}
|
||||
},
|
||||
|
||||
sendBotInfo(info, bot) {
|
||||
const component = [""];
|
||||
component.push("Name: ", info.name);
|
||||
if (info.exclaimer) component.push("\n", "Exclaimer: ", info.exclaimer);
|
||||
sendBotInfo (info, bot) {
|
||||
const component = ['']
|
||||
component.push('Name: ', info.name)
|
||||
if (info.exclaimer) component.push('\n', 'Exclaimer: ', info.exclaimer)
|
||||
if (info.authors && info.authors.length !== 0) {
|
||||
component.push("\n", "Authors: ");
|
||||
component.push('\n', 'Authors: ')
|
||||
for (const author of info.authors) {
|
||||
component.push(author, { text: ", ", color: "gray" });
|
||||
component.push(author, { text: ', ', color: 'gray' })
|
||||
}
|
||||
component.pop();
|
||||
component.pop()
|
||||
}
|
||||
if (info.foundation) component.push("\n", "Foundation: ", info.foundation);
|
||||
if (info.foundation) component.push('\n', 'Foundation: ', info.foundation)
|
||||
if (info.prefixes && info.prefixes.length !== 0) {
|
||||
component.push("\n", "Prefixes: ");
|
||||
component.push('\n', 'Prefixes: ')
|
||||
for (const prefix of info.prefixes) {
|
||||
component.push(prefix, { text: ", ", color: "gray" });
|
||||
component.push(prefix, { text: ', ', color: 'gray' })
|
||||
}
|
||||
component.pop();
|
||||
component.pop()
|
||||
}
|
||||
bot.tellraw([component]);
|
||||
},
|
||||
}; //it doing it just for the ones i added lol
|
||||
bot.tellraw([component])
|
||||
}
|
||||
}//it doing it just for the ones i added lol
|
||||
// prob a replit moment, it probably thinks there are regexes in the strings
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'bruhify',
|
||||
description:['bruhify text'],
|
||||
aliases:['bruhifytext', 'bruh'],
|
||||
trustLevel: 0,
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
bot.bruhifyText = args.join(' ')
|
||||
|
||||
context.source.sendFeedback(JSON.stringify(bot.bruhifyText))
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
|
||||
module.exports = {
|
||||
|
||||
name: 'cai',
|
||||
description:['a broken asf command thats supposed to connect to beta.character.ai'],
|
||||
execute (context) {
|
||||
//throw new CommandError('locked cuz of Error: Failed to fetch a lazy token')
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
const args = context.arguments;
|
||||
const CharacterAI = require("node_characterai");
|
||||
const characterAI = new CharacterAI();
|
||||
|
||||
(async () => {
|
||||
// Authenticating as a guest (use `.authenticateWithToken()` to use an account)
|
||||
await characterAI.authenticateAsGuest();
|
||||
|
||||
// Place your character's id here
|
||||
const characterId = "-LojS2FMmI6dLLG4cPzCm1xIIpgwVktHwjHRIImfXSE";
|
||||
|
||||
const chat = await characterAI.createOrContinueChat(characterId);
|
||||
const response = await chat.sendAndAwaitResponse(message, true);
|
||||
try {
|
||||
source.sendFeedback(response)
|
||||
|
||||
} catch (e) {
|
||||
source.sendFeedback({ text: e.stack, color: 'red' })
|
||||
}
|
||||
|
||||
})();
|
||||
}
|
||||
}
|
||||
|
||||
/* try {
|
||||
const page = await wiki.page(args.join(' '))
|
||||
const summary = await page.summary()
|
||||
//const definitions = await urban.define(args.join(' '))
|
||||
|
||||
|
||||
source.sendFeedback({ text: summary.extract, color: 'green' })
|
||||
|
||||
} catch (e) {
|
||||
source.sendFeedback({ text: e.stack, color: 'red' })
|
||||
*/
|
||||
//https://beta.character.ai/chat?char=-LojS2FMmI6dLLG4cPzCm1xIIpgwVktHwjHRIImfXSE
|
||||
|
||||
/*const CharacterAI = require("node_characterai");
|
||||
const characterAI = new CharacterAI();
|
||||
|
||||
(async () => {
|
||||
// Authenticating as a guest (use `.authenticateWithToken()` to use an account)
|
||||
await characterAI.authenticateAsGuest();
|
||||
|
||||
// Place your character's id here
|
||||
const characterId = "8_1NyR8w1dOXmI1uWaieQcd147hecbdIK7CeEAIrdJw";
|
||||
|
||||
const chat = await characterAI.createOrContinueChat(characterId);
|
||||
|
||||
// Send a message
|
||||
const response = await chat.sendAndAwaitResponse("Hello discord mod!", true);
|
||||
|
||||
console.log(response);
|
||||
// Use `response.text` to use it as a string
|
||||
})();
|
||||
*/
|
||||
@@ -2,8 +2,6 @@ const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'calculator',
|
||||
description:['calculate maths'],
|
||||
trustLevel: 0,
|
||||
aliases:['calc'],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
+273
-29
@@ -1,48 +1,294 @@
|
||||
|
||||
const bots = [
|
||||
{//
|
||||
name: { text: 'v5.0.0-Beta', color: 'blue', bold:false },
|
||||
authors: ['Monochrome'],
|
||||
{
|
||||
name: { text: 'v0.1.0 - v0.5.0-beta', color: 'blue', bold:false },
|
||||
authors: ['Prototypes'],
|
||||
|
||||
foundation: '12/18/23',
|
||||
exclaimer:'added owner validation to the bot thats about it',
|
||||
foundation: '11/22/22 - 1/24/23',
|
||||
exclaimer:'ehh nothing much just the release of the betas',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v5.0.0', color: 'dark_red', bold:false },
|
||||
authors: ['Monochrome'],
|
||||
{
|
||||
name: { text: 'v1.0.0-beta', color: 'blue', bold:false },
|
||||
authors: ['in console test'],
|
||||
|
||||
foundation: '12/20/23',
|
||||
exclaimer:'since the old validation system was able to barely handle owner validation it was completely remove and replaced with trust levels which handle validation way better also added command aliases (shoutouts to poopbob with the command aliases). made a whole new changelog command for v5.0.0 and renamed the old one changelogv4.3.4. also fixed the issue with the console not properly refreshing lines that are sent',
|
||||
foundation: '1/25/23',
|
||||
exclaimer:'original commands:!cloop bcraw,!cloop sudo,!troll,!say,!op (broke),!deop (broke), !gms (broke),!freeze,!icu <--- these commands no longer can be used in game but in console for beta 1.0 commands added: fake kick,ban,kick,crashserver,stop,gmc,greetin,test(broken idk),bypass,entity spam ,gms ,stop,tntspam ,prefix ,annoy (broke results in a complete server crash keeping ayunboom down for 3 to 5 hours),freeze,crashserver,troll ,trol(more destructive),icu ,say,sudo,cloop',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v5.0.1', color: 'green', bold:false },
|
||||
{
|
||||
name: { text: 'v1.0.0', color: 'dark_red', bold:false },
|
||||
authors: ['FNFBoyfriendBot'],
|
||||
|
||||
foundation: '1/26/23',
|
||||
exclaimer:'FNFBoyfriendBot. commands added: BOOM,deop,troll and trol(added extra code to both commands),kaboom,serverdeop, commands fixed:tp,gms,annoy(attemps to crash the server but not as bad as it was) commands untested:prefix command Broke:icu,freeze,tntspam,entityspam,tntspam? changed name to &b &lFNFBoyfriendBot may change later idk',
|
||||
},
|
||||
{
|
||||
name: { text: 'v1.0.1', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: 'added botsrun for the funni along with making the bot be able to auto refill its core now and fill the core from a command block(edit: nevermind its very buggy reverting it back to how it originally filled its core) and adding a hover event to netmsg along with having the test command tellraw the players display name in the command and added support for 3 command prefixes',
|
||||
exclaimer:'12/23/23',
|
||||
foundation: '1/26/23',
|
||||
exclaimer:'reworked the kaboom command and fixed the description commands but thats about it. also reworked the greeting command',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v5.0.2', color: 'green', bold:false },
|
||||
{
|
||||
name: { text: 'v1.1.0', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '12/26/23',
|
||||
exclaimer:'fixed the issue with the cpu checking in the info command added discord hashing back into the bot to work along side the keys made it check to see if the config file is in the directory and if not it will recreate the config from default.js',
|
||||
foundation: '1/26/23 2:00pm',
|
||||
exclaimer:'nothing much just added extra stuff to the troll, trol and that is about it',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v5.0.3', color: 'green', bold:false },
|
||||
{
|
||||
name: { text: 'v1.2.0', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '12/29/23',
|
||||
exclaimer:'mabe the bot last update of 2023 cuz next year will be 2024 www but anyway expanded the disconnect messages for both console and discord but thats pretty much it',
|
||||
foundation: '1/28/23 1:51',
|
||||
exclaimer:'for ppl me making me really mad -.- got released early',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v5.0.4', color: 'green', bold:false },
|
||||
{
|
||||
name: { text: 'v2.0.0', color: 'dark_red', bold:false },
|
||||
authors: ['Major'],
|
||||
|
||||
foundation: '2/07/23 8:01pm',
|
||||
exclaimer:'added DREAMSTANALERT,technoblade,GODSWORD,KFC,MYLEG,OHHAIL,altcrash,MyHead Reworked tntspam,entityspam,soundbreaker added Spim to the whitelist of the bot released too early than it was planned gonna be released due do the code almost leaked it had to be released early',
|
||||
},
|
||||
{
|
||||
name: { text: 'v2.1.0', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '1/12/24',
|
||||
exclaimer:'first update of 2024 for the bot but anyway merged the test and errortest commands into cmdtest, changed the colors for the help command public is #00FFFF, trusted is dark_purple and owner remained as dark red. moved the module loader from bot.js to index.js to split the boot time in half which now allows module functions like bot.chat() to be used in bot.js and also since the command manager is a module it also loads the commands thats a w on all ends also removed some modules to improve the bots boot time and moved the functions for the sctoggle command into the command itself and not as a module which helped the boot time as well and last but not least merged the memused usage in the info command with the serverinfo usage and made the memusage command use the bossbar and not the actionbar',
|
||||
foundation: '2/11/23 5:30pm',
|
||||
exclaimer:'added: refillcore(had early prototypes of this was original), vanish,deop,cloopdeop,mute,cloopmute reworked: op (supposed to already op the bot but didnt work until this release) and reworked gmc (same problem with op) (had early prototypes of vanish,refillcore,gmc,and op but these were original gonna be automatic but after alot of attempts i said screw it and added 2 commands refillcore, and vanish reworked gmc and op and got them working finally) removed Spim because come to find out he couldnt be trusted',
|
||||
},
|
||||
]//
|
||||
{
|
||||
name: { text: 'v2.2.0', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '2/20/23',
|
||||
exclaimer:'added ckill(added back after trial and error),serversuicidal changed username of the bot from hex code to FNFBoyfriendBot because hex code for the username was confusing as it changes everytime',
|
||||
},
|
||||
{
|
||||
name: { text: 'v3.0.0-Beta', color: 'blue', bold:false },
|
||||
authors: ['blue-balled corruption'],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'was canceled due to ayunboom being rewriten and renamed to creayun barely usable on there because commands blocks are disabled which i created a bot for that server that has no command blocks just finished the final build of the Creayun build of the bot due to chip announcing that he may make a kaboom clone yk what 1.5.2 and 1.8 support but anyway onto what is in the v3.0-beta well the beta for right now commands added:discord,version,online,list,iownyou,endmysuffering,wafflehouse,whopper,bcraw,destroycore Notes:the original say command was reworked into talking in chat without bcraw and command blocks which the bcraw chatting code is still in the bot but was reworked into the bcraw commmand. maybe some commands removed? i dont know yet edit there is 2 commands removed commands removed:tpe and serverdeop??? reworked commands :say command for right now relay chat mabe will be added as a seperate repl i dont know yet possible would need a whole code rewrite for relay chat',
|
||||
},
|
||||
{
|
||||
name: { text: 'v3.0.0', color: 'dark_red', bold:false },
|
||||
authors: ['Sky Remanifested'],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'the full release of 3.0 the rewrite has been pushed back to 4.0 due to 3.0 already pass its release date and the code i had on hand was done but the rewrite wasnt done Added: SelfCare Made during development:Relay chat prototypes for several servers',
|
||||
},
|
||||
{
|
||||
name: { text: 'v3.0.5', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'bug fixes',
|
||||
},
|
||||
{
|
||||
name: { text: 'v3.0.9', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'commands added:Help(finally added after about a year),consolelog(added cuz yes),cloopconsolelog(added cuz yes)',
|
||||
},
|
||||
{
|
||||
name: { text: 'v3.3.0', color: 'dark_red', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'switched it base to 4.0s base during 4.0s development',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.0-beta', color: 'blue', bold:false },
|
||||
authors: ['FNFBoyfriendBot Ultimate'],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'all of the command removed and or rewriten from version 3.0.9 Commands added or rewriten:ban,buyrealminecraft,cloop,discord,echo,errortest,freeze,help,icu,info,kick,bots,skids,romncitrash,say,selfdestruct,serversuicidal,sudo,test,trol,troll (note that this is different and is not CommandModules)Modules Added:discord,chat,chat_command_handler,command_manager,position,registry,reconnect,command_core CustomChats added:kaboom(for normal chat) (note that this is different and is not Modules)CommandModules Added:command_error,Command_source a beta release for rn',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.0-Alpha ', color: 'aqua', bold:false },
|
||||
authors: ['FNFBoyfriendBot Ultimate'],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'Commands added: calculator,ckill,evaljs,urban,crash,cloopcrash,core,list,ping,netmsg,skin,tpr Commands Removed:Buyrealminecraft (note that this is different and is not CommandModules)Modules Added:op selfcare,gmc selfcare,vanish selfcare,cspy selfcare,console (note that this is different and is not Modules)CustomChats Added:u2O3a(for custom chat) added util with between(for urban) eval_colors(for evaljs)',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.0', color: 'dark_red', bold:false },
|
||||
authors: ['FNFBoyfriendBotX'],
|
||||
|
||||
foundation: '8/11/23',
|
||||
exclaimer:'Bot is finished with the rewrite thank you ChipMC and chayapak for helping me rewrite the bot Heres the commands ban (mabe removing), blacklist (currently being worked on), botdevhistory, bots, calculator, changelog, ckill, cloop, cloopcrash(probably removing), core, crash, creators, discord, echo, errortest, evaljs, freeze, help, icu, list, meminfo, mineflayerbot, netmsg (Hello World!), ping (pong!), reconnect, say, selfdestruct, serversuicidal (probably removing because theres ckill), skin, sudo, test, tpr, trol (mabe renaming it to troll), troll (mabe removing it and replacing it with the trol command), urban (ong sus asf), validate, version',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.5', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '8/17/23',
|
||||
exclaimer:'bug fixes, did what i said i was gonna do in the last update',
|
||||
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.6', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '8/22/23',
|
||||
exclaimer:'added 1 console command along with updating console.js so that the bot sends a message to 1 server at a time and not a message to all the servers at a time',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.7', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/4/23',
|
||||
exclaimer:'merged server and botusername commands and naming the command logininfo cuz it now shows the server ip, server port, Minecraft java Version, and the Bots Username',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.8', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/7/23',
|
||||
exclaimer:'added the wiki command even though its semi working. bug fixes. some bugs still in the bot is netmsg showing the bots username when i used the netmsg cmd from my end and not the console i find it funny asf though',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.8A', color: 'gold', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/7/23',
|
||||
exclaimer:'added some things to the changelog cmd. still needing to fix the issue with custom chat and netmsg also added a bugs command to check what bugs are needing to be fixed',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.8B', color: 'gold', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/8/23',
|
||||
exclaimer:'made it to where it sends more messages on start up and made it to where the buildstring is in secrets',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.8C', color: 'gold', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/14/23',
|
||||
exclaimer:'added the nodejs version to the version command but thats about it still fixing the bugs with the relay chat and mabe rewriting the validation system in the bot',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.8D', color: 'gold', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/16/23',
|
||||
exclaimer:'added onto the changelog command along with adding spambot and lol commands (cuz yes) along with removing the bugs command maybe adding it back sometime later also the discord relay chat and validation system mabe getting a rewrite and also updated node from v18 to v20.6.0',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.8E', color: 'gold', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/17/23',
|
||||
exclaimer:'changed the name for meminfo to serverinfo along with adding onto it and moving the nodejs, node-minecraft-protocol, and discord.js versions from the version command to the serverinfo command',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.8F', color: 'gold', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/24/23',
|
||||
exclaimer:'added filesdirectories command but thats about it',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.9', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/26/23',
|
||||
exclaimer:'added a hover event to the custom chat for the bot',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.1.0', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/27/23',
|
||||
exclaimer:'Finally changed how the validation/hashing works in the bot instead of it being sent in discord there will be a key for trusted to validate',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.1.1', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/28/23',
|
||||
exclaimer:'added uppercase and lowercase function for commands and soon gonna be completely overhauling the validation system in the bot again',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.1.2', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '10/02/23',
|
||||
exclaimer:'added uptime as a command but thats it',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.1.4', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '10/03/23',
|
||||
exclaimer:'moved the custom chat text and cmd block text to config.js',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.1.6', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '10/08/23',
|
||||
exclaimer:'fixed the relay chat and fixed the cr issue with urban and also fixed reconnect',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.1.7', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '10/08/03',
|
||||
exclaimer:'added mute, tag, and skin to selfcare',
|
||||
}, // am I even gonna be credited?
|
||||
{
|
||||
name: { text: 'v4.1.8', color: 'green', bold:false },
|
||||
authors: [''],//cai cee mmm deee sus
|
||||
|
||||
foundation: '10/11/23',
|
||||
exclaimer:'fixed the issue with memused cee mmm dee',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v4.1.9', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '10/12/23',
|
||||
exclaimer:'rewrote evaljs its now using isolated-vm and not vm2',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v4.2.0', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '10/19/23',
|
||||
exclaimer:'fixed the disconnect message for discord and the bug with the say command',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v4.2.1', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '10/24/23',
|
||||
exclaimer:'rewrote the help command to allow descriptions finally along with adding things to the base of the bot for the descriptions',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v4.2.2', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '10/25/23',
|
||||
exclaimer:'merged serverinfo, memused, discord, logininfo, creators, version, uptime together',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v4.2.3', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '10/30/23',
|
||||
exclaimer:'added a antiskid measure (thanks _yfd)',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v4.2.4', color: 'green', bold:false },
|
||||
authors: ['Spooky update (note: might as well give it a codename since its halloween)'],
|
||||
|
||||
foundation: '10/31/23',
|
||||
exclaimer:'merged fard and reconnect together making recend, added more crash methods to the crash command, and remove 12 commands',
|
||||
},
|
||||
]
|
||||
//back
|
||||
|
||||
|
||||
@@ -56,8 +302,6 @@ const bots = [
|
||||
module.exports = {
|
||||
name: 'changelog',
|
||||
description:['check the bots changelog'],
|
||||
trustLevel: 0,
|
||||
aliases:['cl', 'changes'],
|
||||
execute (context) {
|
||||
const query = context.arguments.join(' ').toLowerCase()
|
||||
|
||||
|
||||
@@ -1,409 +0,0 @@
|
||||
|
||||
const bots = [
|
||||
{
|
||||
name: { text: 'v0.1.0 - v0.5.0-beta', color: 'blue', bold:false },
|
||||
authors: ['Prototypes'],
|
||||
|
||||
foundation: '11/22/22 - 1/24/23',
|
||||
exclaimer:'ehh nothing much just the release of the betas',
|
||||
},
|
||||
{
|
||||
name: { text: 'v1.0.0-beta', color: 'blue', bold:false },
|
||||
authors: ['in console test'],
|
||||
|
||||
foundation: '1/25/23',
|
||||
exclaimer:'original commands:!cloop bcraw,!cloop sudo,!troll,!say,!op (broke),!deop (broke), !gms (broke),!freeze,!icu <--- these commands no longer can be used in game but in console for beta 1.0 commands added: fake kick,ban,kick,crashserver,stop,gmc,greetin,test(broken idk),bypass,entity spam ,gms ,stop,tntspam ,prefix ,annoy (broke results in a complete server crash keeping ayunboom down for 3 to 5 hours),freeze,crashserver,troll ,trol(more destructive),icu ,say,sudo,cloop',
|
||||
},
|
||||
{
|
||||
name: { text: 'v1.0.0', color: 'dark_red', bold:false },
|
||||
authors: ['FNFBoyfriendBot'],
|
||||
|
||||
foundation: '1/26/23',
|
||||
exclaimer:'FNFBoyfriendBot. commands added: BOOM,deop,troll and trol(added extra code to both commands),kaboom,serverdeop, commands fixed:tp,gms,annoy(attemps to crash the server but not as bad as it was) commands untested:prefix command Broke:icu,freeze,tntspam,entityspam,tntspam? changed name to &b &lFNFBoyfriendBot may change later idk',
|
||||
},
|
||||
{
|
||||
name: { text: 'v1.0.1', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '1/26/23',
|
||||
exclaimer:'reworked the kaboom command and fixed the description commands but thats about it. also reworked the greeting command',
|
||||
},
|
||||
{
|
||||
name: { text: 'v1.1.0', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '1/26/23 2:00pm',
|
||||
exclaimer:'nothing much just added extra stuff to the troll, trol and that is about it',
|
||||
},
|
||||
{
|
||||
name: { text: 'v1.2.0', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '1/28/23 1:51',
|
||||
exclaimer:'for ppl me making me really mad -.- got released early',
|
||||
},
|
||||
{
|
||||
name: { text: 'v2.0.0', color: 'dark_red', bold:false },
|
||||
authors: ['Major'],
|
||||
|
||||
foundation: '2/07/23 8:01pm',
|
||||
exclaimer:'added DREAMSTANALERT,technoblade,GODSWORD,KFC,MYLEG,OHHAIL,altcrash,MyHead Reworked tntspam,entityspam,soundbreaker added Spim to the whitelist of the bot released too early than it was planned gonna be released due do the code almost leaked it had to be released early',
|
||||
},
|
||||
{
|
||||
name: { text: 'v2.1.0', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '2/11/23 5:30pm',
|
||||
exclaimer:'added: refillcore(had early prototypes of this was original), vanish,deop,cloopdeop,mute,cloopmute reworked: op (supposed to already op the bot but didnt work until this release) and reworked gmc (same problem with op) (had early prototypes of vanish,refillcore,gmc,and op but these were original gonna be automatic but after alot of attempts i said screw it and added 2 commands refillcore, and vanish reworked gmc and op and got them working finally) removed Spim because come to find out he couldnt be trusted',
|
||||
},
|
||||
{
|
||||
name: { text: 'v2.2.0', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '2/20/23',
|
||||
exclaimer:'added ckill(added back after trial and error),serversuicidal changed username of the bot from hex code to FNFBoyfriendBot because hex code for the username was confusing as it changes everytime',
|
||||
},
|
||||
{
|
||||
name: { text: 'v3.0.0-Beta', color: 'blue', bold:false },
|
||||
authors: ['blue-balled corruption'],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'was canceled due to ayunboom being rewriten and renamed to creayun barely usable on there because commands blocks are disabled which i created a bot for that server that has no command blocks just finished the final build of the Creayun build of the bot due to chip announcing that he may make a kaboom clone yk what 1.5.2 and 1.8 support but anyway onto what is in the v3.0-beta well the beta for right now commands added:discord,version,online,list,iownyou,endmysuffering,wafflehouse,whopper,bcraw,destroycore Notes:the original say command was reworked into talking in chat without bcraw and command blocks which the bcraw chatting code is still in the bot but was reworked into the bcraw commmand. maybe some commands removed? i dont know yet edit there is 2 commands removed commands removed:tpe and serverdeop??? reworked commands :say command for right now relay chat mabe will be added as a seperate repl i dont know yet possible would need a whole code rewrite for relay chat',
|
||||
},
|
||||
{
|
||||
name: { text: 'v3.0.0', color: 'dark_red', bold:false },
|
||||
authors: ['Sky Remanifested'],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'the full release of 3.0 the rewrite has been pushed back to 4.0 due to 3.0 already pass its release date and the code i had on hand was done but the rewrite wasnt done Added: SelfCare Made during development:Relay chat prototypes for several servers',
|
||||
},
|
||||
{
|
||||
name: { text: 'v3.0.5', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'bug fixes',
|
||||
},
|
||||
{
|
||||
name: { text: 'v3.0.9', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'commands added:Help(finally added after about a year),consolelog(added cuz yes),cloopconsolelog(added cuz yes)',
|
||||
},
|
||||
{
|
||||
name: { text: 'v3.3.0', color: 'dark_red', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'switched it base to 4.0s base during 4.0s development',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.0-beta', color: 'blue', bold:false },
|
||||
authors: ['FNFBoyfriendBot Ultimate'],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'all of the command removed and or rewriten from version 3.0.9 Commands added or rewriten:ban,buyrealminecraft,cloop,discord,echo,errortest,freeze,help,icu,info,kick,bots,skids,romncitrash,say,selfdestruct,serversuicidal,sudo,test,trol,troll (note that this is different and is not CommandModules)Modules Added:discord,chat,chat_command_handler,command_manager,position,registry,reconnect,command_core CustomChats added:kaboom(for normal chat) (note that this is different and is not Modules)CommandModules Added:command_error,Command_source a beta release for rn',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.0-Alpha ', color: 'aqua', bold:false },
|
||||
authors: ['FNFBoyfriendBot Ultimate'],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'Commands added: calculator,ckill,evaljs,urban,crash,cloopcrash,core,list,ping,netmsg,skin,tpr Commands Removed:Buyrealminecraft (note that this is different and is not CommandModules)Modules Added:op selfcare,gmc selfcare,vanish selfcare,cspy selfcare,console (note that this is different and is not Modules)CustomChats Added:u2O3a(for custom chat) added util with between(for urban) eval_colors(for evaljs)',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.0', color: 'dark_red', bold:false },
|
||||
authors: ['FNFBoyfriendBotX'],
|
||||
|
||||
foundation: '8/11/23',
|
||||
exclaimer:'Bot is finished with the rewrite thank you ChipMC and chayapak for helping me rewrite the bot Heres the commands ban (mabe removing), blacklist (currently being worked on), botdevhistory, bots, calculator, changelog, ckill, cloop, cloopcrash(probably removing), core, crash, creators, discord, echo, errortest, evaljs, freeze, help, icu, list, meminfo, mineflayerbot, netmsg (Hello World!), ping (pong!), reconnect, say, selfdestruct, serversuicidal (probably removing because theres ckill), skin, sudo, test, tpr, trol (mabe renaming it to troll), troll (mabe removing it and replacing it with the trol command), urban (ong sus asf), validate, version',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.5', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '8/17/23',
|
||||
exclaimer:'bug fixes, did what i said i was gonna do in the last update',
|
||||
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.6', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '8/22/23',
|
||||
exclaimer:'added 1 console command along with updating console.js so that the bot sends a message to 1 server at a time and not a message to all the servers at a time',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.7', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/4/23',
|
||||
exclaimer:'merged server and botusername commands and naming the command logininfo cuz it now shows the server ip, server port, Minecraft java Version, and the Bots Username',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.8', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/7/23',
|
||||
exclaimer:'added the wiki command even though its semi working. bug fixes. some bugs still in the bot is netmsg showing the bots username when i used the netmsg cmd from my end and not the console i find it funny asf though',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.8A', color: 'gold', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/7/23',
|
||||
exclaimer:'added some things to the changelog cmd. still needing to fix the issue with custom chat and netmsg also added a bugs command to check what bugs are needing to be fixed',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.8B', color: 'gold', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/8/23',
|
||||
exclaimer:'made it to where it sends more messages on start up and made it to where the buildstring is in secrets',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.8C', color: 'gold', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/14/23',
|
||||
exclaimer:'added the nodejs version to the version command but thats about it still fixing the bugs with the relay chat and mabe rewriting the validation system in the bot',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.8D', color: 'gold', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/16/23',
|
||||
exclaimer:'added onto the changelog command along with adding spambot and lol commands (cuz yes) along with removing the bugs command maybe adding it back sometime later also the discord relay chat and validation system mabe getting a rewrite and also updated node from v18 to v20.6.0',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.8E', color: 'gold', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/17/23',
|
||||
exclaimer:'changed the name for meminfo to serverinfo along with adding onto it and moving the nodejs, node-minecraft-protocol, and discord.js versions from the version command to the serverinfo command',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.8F', color: 'gold', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/24/23',
|
||||
exclaimer:'added filesdirectories command but thats about it',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.9', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/26/23',
|
||||
exclaimer:'added a hover event to the custom chat for the bot',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.1.0', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/27/23',
|
||||
exclaimer:'Finally changed how the validation/hashing works in the bot instead of it being sent in discord there will be a key for trusted to validate',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.1.1', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/28/23',
|
||||
exclaimer:'added uppercase and lowercase function for commands and soon gonna be completely overhauling the validation system in the bot again',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.1.2', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '10/02/23',
|
||||
exclaimer:'added uptime as a command but thats it',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.1.4', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '10/03/23',
|
||||
exclaimer:'moved the custom chat text and cmd block text to config.js',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.1.6', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '10/08/23',
|
||||
exclaimer:'fixed the relay chat and fixed the cr issue with urban and also fixed reconnect',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.1.7', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '10/08/03',
|
||||
exclaimer:'added mute, tag, and skin to selfcare',
|
||||
}, // am I even gonna be credited?
|
||||
{
|
||||
name: { text: 'v4.1.8', color: 'green', bold:false },
|
||||
authors: [''],//cai cee mmm deee sus
|
||||
|
||||
foundation: '10/11/23',
|
||||
exclaimer:'fixed the issue with memused cee mmm dee',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v4.1.9', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '10/12/23',
|
||||
exclaimer:'rewrote evaljs its now using isolated-vm and not vm2',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v4.2.0-restore', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '10/19/23',
|
||||
exclaimer:'fixed the disconnect message for discord and the bug with the say command',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v4.2.1', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '10/24/23',
|
||||
exclaimer:'rewrote the help command to allow descriptions finally along with adding things to the base of the bot for the descriptions',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v4.2.2', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '10/25/23',
|
||||
exclaimer:'merged serverinfo, memused, discord, logininfo, creators, version, uptime together',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v4.2.3', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '10/30/23',
|
||||
exclaimer:'added a antiskid measure (thanks _yfd)',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v4.2.4', color: 'green', bold:false },
|
||||
authors: ['Spooky update (note: might as well give it a codename since its halloween)'],
|
||||
|
||||
foundation: '10/31/23',
|
||||
exclaimer:'merged fard and reconnect together making recend, added more crash methods to the crash command, and remove 12 commands',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v4.2.5', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '11/8/23',
|
||||
exclaimer:'patched the exploit in the discordmsg command and made it to were with the netmsg command players cannot send empty messages',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v4.3.0', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '11/16/23',
|
||||
exclaimer:`color coded the console logs are LOGS in the color gold consoleserver are in the category INFO in the color green, errors after start up are in the category WARN in the color yellow, Fatal Errors/start-up errors are in the category ERROR in the color red and hashs/validation codes sent to console are in the category HASH in the color green. added the command servereval. changed config.json to config.js and moved the username() function from the end of bot.js to the end of config.js and replacing where username() after options.username with 'Player' + Math.floor(Math.random() * 1000) and added player ping/latency to list along with fixing the bug with cloop list`,
|
||||
},
|
||||
{//
|
||||
name: { text: 'v4.3.1', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '11/21/23 one day till the bots anniversary?!?!',
|
||||
exclaimer:'modified the bots boot originally it would spam the bots buildstring each time it logged into a server on boot but now it will only send it once to console on boot along with it now sending the foundationbuildstring after the buildstring sent in console. ported some commands over since chomens is pretty much dead along with adding chat support for chat.type.text and chat.type.emote',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v4.3.2', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '11/23/23',
|
||||
exclaimer:'made the bots selfcare, the selfcares interval and console toggle-able along with making default options for the selfcare and its interval, the bots prefix, the bots discord prefix, the reconnectDelay interval, the core customname, and the console, partically fixed the issue with the trusted commands no being able to be ran in discord, edited the bots boot again it now also logs the amount of files its loading on boot its discord username its logged in with(also added the discord username to the info command)',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v4.3.3', color: 'dark_red', bold:false },
|
||||
authors: ["Lullaby Girlfriend's LostCause"],
|
||||
|
||||
foundation: '12/3/23',
|
||||
exclaimer:'added hover events to the help command for command descriptions, trust console and name along with click events for them added memusage and fixed the category issue with the console and added toggles to the bot for console, selfcare, and skin',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v4.3.4', color: 'dark_red', bold:false },
|
||||
authors: ['Suffering Siblings'],
|
||||
|
||||
foundation: '12/12/23',
|
||||
exclaimer:'overhauled the console and discord relay chat fixing trusted roles and making the selfcare toggleable in game also fixing the issue with hiding console only commands (thank you poopbob for helping me with that)',
|
||||
},
|
||||
]//§4Lullaby §cGirlfriend's §cLost§bCause
|
||||
//back
|
||||
|
||||
|
||||
/*{//
|
||||
name: { text: '', color: 'gray', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'',
|
||||
},*/
|
||||
module.exports = {
|
||||
name: 'changelogv4.3.4',
|
||||
description:['check the bots changelog'],
|
||||
trustLevel: 0,
|
||||
aliases:['clv4.3.4', 'changesv4.3.4'],
|
||||
execute (context) {
|
||||
const query = context.arguments.join(' ').toLowerCase()
|
||||
|
||||
if (query.length === 0) {
|
||||
const list = []
|
||||
|
||||
for (const info of bots) {
|
||||
if (list.length !== 0) list.push({ text: ', ', color: 'gray' })
|
||||
list.push(info.name)
|
||||
}
|
||||
const category = {
|
||||
translate: ' (%s%s%s%s%s%s%s%s%s) ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
|
||||
{ color: 'aqua', text: 'Alpha Release'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'blue', text: 'Beta Release'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'green', text: 'Minor release'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'gold', text: 'Revision Release'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'dark_red', text: 'Major Release'},
|
||||
|
||||
]
|
||||
}
|
||||
context.source.sendFeedback(['Changelogs (', bots.length, ')', category, ' - ', ...list], false)
|
||||
return
|
||||
}
|
||||
|
||||
for (const info of bots) {
|
||||
const plainName = String(context.bot.getMessageAsPrismarine(info.name)).toLowerCase()
|
||||
if (plainName.includes(query)) this.sendBotInfo(info, context.bot)
|
||||
}
|
||||
},
|
||||
|
||||
sendBotInfo (info, bot) {
|
||||
const component = ['']
|
||||
component.push('', info.name)
|
||||
if (info.exclaimer) component.push('\n', ' ', info.exclaimer)
|
||||
if (info.authors && info.authors.length !== 0) {
|
||||
component.push('\n', 'Codename ')
|
||||
for (const author of info.authors) {
|
||||
component.push(author, { text: ', ', color: 'gray' })
|
||||
}
|
||||
component.pop()
|
||||
}
|
||||
if (info.foundation) component.push('\n', 'Date: ', info.foundation)
|
||||
if (info.prefixes && info.prefixes.length !== 0) {
|
||||
component.push('\n', '')
|
||||
for (const prefix of info.prefixes) {
|
||||
component.push(prefix, { text: ' ', color: 'gray' })
|
||||
}
|
||||
component.pop()
|
||||
}
|
||||
bot.tellraw([component])
|
||||
}
|
||||
}//it doing it just for the ones i added lol
|
||||
// prob a replit moment, it probably thinks there are regexes in the strings
|
||||
@@ -0,0 +1,252 @@
|
||||
/*/*
|
||||
* This example demonstrates how easy it is to create a bot
|
||||
* that sends chat messages whenever something interesting happens
|
||||
* on the server you are connected to.
|
||||
*
|
||||
* Below you can find a wide range of different events you can watch
|
||||
* but remember to check out the API documentation to find even more!
|
||||
*
|
||||
* Some events may be commented out because they are very frequent and
|
||||
* may flood the chat, feel free to check them out for other purposes though.
|
||||
*
|
||||
* This bot also replies to some specific chat messages so you can ask him
|
||||
* a few informations while you are in game.
|
||||
*/
|
||||
|
||||
const crypto = require('crypto')
|
||||
|
||||
module.exports = {
|
||||
name: 'chatterboxbot',
|
||||
|
||||
hashOnly:true,
|
||||
description:['please dont omfg'],
|
||||
execute (context) {
|
||||
const mineflayer = require('mineflayer')
|
||||
const { Vec3 } = require('vec3')
|
||||
|
||||
const randomstring = require('randomstring')
|
||||
const bot = mineflayer.createBot({
|
||||
host: context.bot.options.host,
|
||||
|
||||
username:randomstring.generate(16),
|
||||
|
||||
})
|
||||
|
||||
bot.on('chat', (username, message) => {
|
||||
if (username === bot.username) return
|
||||
const result = /canSee (-?[0-9]+),(-?[0-9]+),(-?[0-9]+)/.exec(message)
|
||||
if (result) {
|
||||
canSee(new Vec3(result[1], result[2], result[3]))
|
||||
return
|
||||
}
|
||||
switch (message) {
|
||||
case 'pos':
|
||||
sayPosition(username)
|
||||
break
|
||||
case 'wearing':
|
||||
sayEquipment()
|
||||
break
|
||||
case 'nick':
|
||||
sayNick()
|
||||
break
|
||||
case 'spawn':
|
||||
saySpawnPoint()
|
||||
break
|
||||
case 'block':
|
||||
sayBlockUnder(username)
|
||||
break
|
||||
case 'quit':
|
||||
quit(username)
|
||||
break
|
||||
default:
|
||||
bot.chat("i am https://doin-your.mom")
|
||||
}
|
||||
|
||||
function canSee (pos) {
|
||||
const block = bot.blockAt(pos)
|
||||
const r = bot.canSeeBlock(block)
|
||||
if (r) {
|
||||
bot.chat(`I can see the block of ${block.displayName} at ${pos}`)
|
||||
} else {
|
||||
bot.chat(`I cannot see the block of ${block.displayName} at ${pos}`)
|
||||
}
|
||||
}
|
||||
|
||||
function sayPosition (username) {
|
||||
bot.chat(`I am at ${bot.entity.position}`)
|
||||
bot.chat(`You are at ${bot.players[username].entity.position}`)
|
||||
}
|
||||
|
||||
function sayEquipment () {
|
||||
const eq = bot.players[username].entity.equipment
|
||||
const eqText = []
|
||||
if (eq[0]) eqText.push(`holding a ${eq[0].displayName}`)
|
||||
if (eq[1]) eqText.push(`wearing a ${eq[1].displayName} on your feet`)
|
||||
if (eq[2]) eqText.push(`wearing a ${eq[2].displayName} on your legs`)
|
||||
if (eq[3]) eqText.push(`wearing a ${eq[3].displayName} on your torso`)
|
||||
if (eq[4]) eqText.push(`wearing a ${eq[4].displayName} on your head`)
|
||||
if (eqText.length) {
|
||||
bot.chat(`You are ${eqText.join(', ')}.`)
|
||||
} else {
|
||||
bot.chat('You are naked!')
|
||||
}
|
||||
}
|
||||
|
||||
function saySpawnPoint () {
|
||||
bot.chat(`Spawn is at ${bot.spawnPoint}`)
|
||||
}
|
||||
|
||||
function sayBlockUnder () {
|
||||
const block = bot.blockAt(bot.players[username].entity.position.offset(0, -1, 0))
|
||||
bot.chat(`Block under you is ${block.displayName} in the ${block.biome.name} biome`)
|
||||
console.log(block)
|
||||
}
|
||||
|
||||
function quit (username) {
|
||||
bot.quit(`${username} told me to`)
|
||||
}
|
||||
|
||||
function sayNick () {
|
||||
bot.chat(`My name is ${bot.player.displayName}`)
|
||||
}
|
||||
})
|
||||
|
||||
bot.on('whisper', (username, message, rawMessage) => {
|
||||
console.log(`I received a message from ${username}: ${message}`)
|
||||
bot.whisper(username, 'I can tell secrets too.')
|
||||
})
|
||||
bot.on('nonSpokenChat', (message) => {
|
||||
console.log(`Non spoken chat: ${message}`)
|
||||
})
|
||||
|
||||
bot.on('login', () => {
|
||||
bot.chat('Hi everyone!')
|
||||
})
|
||||
bot.on('spawn', () => {
|
||||
bot.chat('I spawned, watch out!')
|
||||
})
|
||||
bot.on('spawnReset', (message) => {
|
||||
bot.chat('Oh noez! My bed is broken.')
|
||||
})
|
||||
bot.on('forcedMove', () => {
|
||||
bot.chat(`I have been forced to move to ${bot.entity.position}`)
|
||||
})
|
||||
bot.on('health', () => {
|
||||
bot.chat(`I have ${bot.health} health and ${bot.food} food`)
|
||||
})
|
||||
bot.on('death', () => {
|
||||
bot.chat('I died x.x')
|
||||
})
|
||||
bot.on('kicked', (reason) => {
|
||||
console.log(`I got kicked for ${reason}`)
|
||||
})
|
||||
|
||||
bot.on('time', () => {
|
||||
bot.chat('i am https://doin-your.mom')
|
||||
})
|
||||
bot.on('rain', () => {
|
||||
if (bot.isRaining) {
|
||||
bot.chat('It started raining.')
|
||||
} else {
|
||||
bot.chat('It stopped raining.')
|
||||
}
|
||||
})
|
||||
bot.on('noteHeard', (block, instrument, pitch) => {
|
||||
bot.chat(`Music for my ears! I just heard a ${instrument.name}`)
|
||||
})
|
||||
bot.on('chestLidMove', (block, isOpen) => {
|
||||
const action = isOpen ? 'open' : 'close'
|
||||
bot.chat(`Hey, did someone just ${action} a chest?`)
|
||||
})
|
||||
bot.on('pistonMove', (block, isPulling, direction) => {
|
||||
const action = isPulling ? 'pulling' : 'pushing'
|
||||
bot.chat(`A piston is ${action} near me, i can hear it.`)
|
||||
})
|
||||
|
||||
bot.on('playerJoined', (player) => {
|
||||
if (player.username !== bot.username) {
|
||||
bot.chat(`Hello, ${player.username}! Welcome to the server.`)
|
||||
}
|
||||
})
|
||||
bot.on('playerLeft', (player) => {
|
||||
if (player.username === bot.username) return
|
||||
bot.chat(`Bye ${player.username}`)
|
||||
})
|
||||
bot.on('playerCollect', (collector, collected) => {
|
||||
if (collector.type === 'player') {
|
||||
const item = collected.getDroppedItem()
|
||||
bot.chat(`${collector.username !== bot.username ? ("I'm so jealous. " + collector.username) : 'I '} collected`)
|
||||
}
|
||||
})
|
||||
|
||||
bot.on('entitySpawn', (entity) => {
|
||||
if (entity.type === 'mob') {
|
||||
console.log(`Look out! A ${entity.displayName} spawned at ${entity.position}`)
|
||||
} else if (entity.type === 'player') {
|
||||
bot.chat(`Look who decided to show up: ${entity.username}`)
|
||||
} else if (entity.type === 'object') {
|
||||
console.log(`There's a ${entity.displayName} at ${entity.position}`)
|
||||
} else if (entity.type === 'global') {
|
||||
bot.chat('Ooh lightning!')
|
||||
} else if (entity.type === 'orb') {
|
||||
bot.chat('Gimme dat exp orb!')
|
||||
}
|
||||
})
|
||||
bot.on('entityHurt', (entity) => {
|
||||
if (entity.type === 'mob') {
|
||||
bot.chat(`Haha! The ${entity.displayName} got hurt!`)
|
||||
} else if (entity.type === 'player') {
|
||||
bot.chat(`Aww, poor ${entity.username} got hurt. Maybe you shouldn't have a ping of ${bot.players[entity.username].ping}`)
|
||||
}
|
||||
})
|
||||
bot.on('entitySwingArm', (entity) => {
|
||||
bot.chat(`${entity.username}, I see that your arm is working fine.`)
|
||||
})
|
||||
bot.on('entityCrouch', (entity) => {
|
||||
bot.chat(`${entity.username}: you so sneaky.`)
|
||||
})
|
||||
bot.on('entityUncrouch', (entity) => {
|
||||
bot.chat(`${entity.username}: welcome back from the land of hunchbacks.`)
|
||||
})
|
||||
bot.on('entitySleep', (entity) => {
|
||||
bot.chat(`Good night, ${entity.username}`)
|
||||
})
|
||||
bot.on('entityWake', (entity) => {
|
||||
bot.chat(`Top of the morning, ${entity.username}`)
|
||||
})
|
||||
bot.on('entityEat', (entity) => {
|
||||
bot.chat(`${entity.username}: OM NOM NOM NOMONOM. That's what you sound like.`)
|
||||
})
|
||||
bot.on('entityAttach', (entity, vehicle) => {
|
||||
if (entity.type === 'player' && vehicle.type === 'object') {
|
||||
bot.chat(`Sweet, ${entity.username} is riding that ${vehicle.displayName}`)
|
||||
}
|
||||
})
|
||||
bot.on('entityDetach', (entity, vehicle) => {
|
||||
if (entity.type === 'player' && vehicle.type === 'object') {
|
||||
bot.chat(`Lame, ${entity.username} stopped riding the ${vehicle.displayName}`)
|
||||
}
|
||||
})
|
||||
bot.on('entityEquipmentChange', (entity) => {
|
||||
console.log('entityEquipmentChange', entity)
|
||||
})
|
||||
bot.on('entityEffect', (entity, effect) => {
|
||||
console.log('entityEffect', entity, effect)
|
||||
})
|
||||
bot.on('entityEffectEnd', (entity, effect) => {
|
||||
console.log('entityEffectEnd', entity, effect)
|
||||
})
|
||||
|
||||
}//this isnt how..
|
||||
}//./commands/tellraw.js
|
||||
// Done!
|
||||
//are ya able to help with the validation/hashing in mine?
|
||||
// Make a copy of this
|
||||
//ahh ok
|
||||
//whos not
|
||||
|
||||
// Can cars fly?
|
||||
//fr
|
||||
// look at the console
|
||||
// watch console rq
|
||||
// Rip our ram lmao
|
||||
+5
-17
@@ -1,19 +1,12 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'cloop',
|
||||
//hashOnly: true,
|
||||
// consoleOnly:false,
|
||||
// ownerOnly:false,
|
||||
trustLevel: 1,
|
||||
description:['command loop commands, the args are add, remove, clear, and list'],
|
||||
aliases:['commandloop'],
|
||||
hashOnly: true,
|
||||
description:['command loop commands'],
|
||||
execute (context, selector) {
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
|
||||
// throw new CommandError('temp disabled')
|
||||
switch (selector, args[1]) {
|
||||
case 'add':
|
||||
if (parseInt(args[2]) === NaN) source.sendFeedback({ text: 'Invalid interval', color: 'red' }, false)
|
||||
@@ -25,7 +18,6 @@ module.exports = {
|
||||
|
||||
source.sendFeedback({
|
||||
translate: 'Added \'%s\' with interval %s to the cloops',
|
||||
color:'green',
|
||||
with: [ command, interval ]
|
||||
})
|
||||
|
||||
@@ -39,7 +31,6 @@ module.exports = {
|
||||
|
||||
source.sendFeedback({
|
||||
translate: 'Removed cloop %s',
|
||||
color: 'green',
|
||||
with: [ index ]
|
||||
})
|
||||
|
||||
@@ -47,10 +38,10 @@ module.exports = {
|
||||
case 'clear':
|
||||
bot.cloop.clear()
|
||||
|
||||
source.sendFeedback({ text: 'Cleared all cloops', color:'green' }, false)
|
||||
source.sendFeedback({ text: 'Cleared all cloops' }, false)
|
||||
|
||||
break
|
||||
case 'list':
|
||||
case 'list':
|
||||
const component = []
|
||||
|
||||
const listComponent = []
|
||||
@@ -58,7 +49,6 @@ module.exports = {
|
||||
for (const cloop of bot.cloop.list) {
|
||||
listComponent.push({
|
||||
translate: '%s \u203a %s (%s)',
|
||||
color: 'green',
|
||||
with: [
|
||||
i,
|
||||
cloop.command,
|
||||
@@ -74,14 +64,12 @@ module.exports = {
|
||||
|
||||
component.push({
|
||||
translate: 'Cloops (%s):',
|
||||
color:'green',
|
||||
with: [ bot.cloop.list.length ]
|
||||
})
|
||||
component.push('\n')
|
||||
component.push(listComponent)
|
||||
|
||||
source.sendFeedback(component, true)
|
||||
//console.log(`tellraw @a ${JSON.stringify(component)}`)
|
||||
source.sendFeedback(component)
|
||||
|
||||
break
|
||||
default:
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const CommandSource = require('../CommandModules/command_source')
|
||||
module.exports = {
|
||||
name: 'cmdtest',
|
||||
description:['usages are test and msg error'],
|
||||
trustLevel: 0,
|
||||
aliases:['cmdtst', 'commandtest', 'commandtst'],
|
||||
execute (context) {
|
||||
|
||||
const bot = context.bot
|
||||
|
||||
const player = context.source.player.profile.name
|
||||
const uuid = context.source.player.uuid
|
||||
const message = context.arguments.join(' ') // WHY SECTION SIGNS!!
|
||||
const args = context.arguments
|
||||
switch (args[0]) {
|
||||
case 'msg':
|
||||
const component = {
|
||||
translate: '[%s] %s %s %s %s %s',
|
||||
with: [
|
||||
{
|
||||
translate: '%s%s%s',
|
||||
bold:false,
|
||||
with: [
|
||||
{
|
||||
text: 'FNF',
|
||||
bold: true,
|
||||
color: 'dark_purple'
|
||||
|
||||
},
|
||||
{
|
||||
text: 'Boyfriend',
|
||||
bold: true,
|
||||
color: 'aqua'
|
||||
},
|
||||
{
|
||||
text: 'Bot',
|
||||
bold: true,
|
||||
color: 'dark_red'
|
||||
},
|
||||
],
|
||||
clickEvent: bot.options.Core.customName ? { action: 'open_url', value: bot.options.Core.customName } : undefined,
|
||||
hoverEvent: { action: 'show_text', contents: `idfk what to put here` }
|
||||
},
|
||||
{
|
||||
text:'Hello, World!,'
|
||||
},{
|
||||
text:'Player:'
|
||||
},
|
||||
|
||||
|
||||
context.source.player.displayName ?? context.source.player.profile.name,
|
||||
{
|
||||
text:`, uuid: ${uuid}, `
|
||||
},
|
||||
//entry.displayName
|
||||
{text:`Argument: ${args.slice(1).join(' ')}`}
|
||||
]//command.split(' ')[0]
|
||||
}
|
||||
bot.tellraw([component])
|
||||
|
||||
break
|
||||
case 'error':
|
||||
|
||||
throw new Error(args.slice(1).join(' '))
|
||||
|
||||
break
|
||||
default:
|
||||
context.source.sendError([{ text: 'Invalid action', color: 'dark_red', bold:false }])
|
||||
context.source.sendError([{ text: 'the usages are msg and error', color: 'gray', bold:false }])
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
||||
*/
|
||||
//context.source.player.displayName ?? context.source.player.profile.name,
|
||||
@@ -1,47 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const buildstring = process.env['buildstring']
|
||||
const foundation = process.env['FoundationBuildString']
|
||||
module.exports = {
|
||||
name: 'console',
|
||||
trustLevel: 3,
|
||||
description:['no :)'],
|
||||
// description:['make me say something in custom chat'],
|
||||
execute (context) {
|
||||
|
||||
const message = context.arguments.join(' ')
|
||||
const bot = context.bot
|
||||
|
||||
const prefix = {
|
||||
translate: '[%s] %s \u203a %s',
|
||||
color:'dark_gray',
|
||||
with: [
|
||||
{
|
||||
text: 'FNFBoyfriendBot Console', color:'#00FFFF'
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
selector: `${bot.username}`, color:'#00FFFF',
|
||||
clickEvent: { action: 'suggest_command', value: '~help' }
|
||||
},
|
||||
{
|
||||
text: '',
|
||||
extra: [`${message}`],
|
||||
color:'white'
|
||||
},
|
||||
|
||||
],
|
||||
hoverEvent: { action:"show_text", value: 'FNF Sky is a fangirl but a simp for boyfriend confirmed??'},
|
||||
clickEvent: bot.options.Core.customName ? { action: 'open_url', value: bot.options.Core.customName } : undefined,
|
||||
}
|
||||
|
||||
bot.tellraw([prefix])
|
||||
}
|
||||
}
|
||||
//[%s] %s › %s
|
||||
//was it showing like that before?
|
||||
// just do text bc too sus rn ig
|
||||
// You should remove the with thing and the translate and replace
|
||||
|
||||
// Parker, why is hashing just random characters???
|
||||
//wdym
|
||||
+21
-33
@@ -1,47 +1,35 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'consoleserver',
|
||||
|
||||
trustLevel: 3,
|
||||
consoleOnly: true,
|
||||
description:['consoleserver'],
|
||||
aliases:['csvr'],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
|
||||
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
|
||||
|
||||
const servers = bot.bots.map(eachBot => eachBot.options.host)
|
||||
const ports = bot.bots.map(eachBot => eachBot.options.port)
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
for (const eachBot of bot.bots) {
|
||||
|
||||
|
||||
if (args.join(' ').toLowerCase() === 'all') {
|
||||
|
||||
eachBot.console.consoleServer = 'all'
|
||||
bot.console.info(` Set the console server to all servers`)
|
||||
|
||||
//Set the console server to all servers
|
||||
continue
|
||||
|
||||
|
||||
}//.repeat(Math.floor((32767 - 22) / 16))
|
||||
//"a".repeat(10)
|
||||
|
||||
const server = servers.find(server => server.toLowerCase().includes(args[0]))
|
||||
|
||||
const servers = bot.bots.map(eachBot => eachBot.options.host)
|
||||
|
||||
for (const eachBot of bot.bots) {
|
||||
if (args.join(' ').toLowerCase() === 'all') {
|
||||
eachBot.console.consoleServer = 'all'
|
||||
|
||||
source.sendFeedback('Set the console server to all servers')
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
const server = servers.find(server => server.toLowerCase().includes(args.join(' ')))
|
||||
|
||||
if (!server) {
|
||||
source.sendFeedback({ text: 'Invalid server', color: 'red' })
|
||||
source.sendFeedback({ text: 'Invalid server', color: 'red' })
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
bot.console.info(`Set the console server to ` + server)
|
||||
eachBot.console.consoleServer = server
|
||||
// eachBot.console.consoleServer = port
|
||||
|
||||
|
||||
eachBot.console.consoleServer = server
|
||||
|
||||
source.sendFeedback('Set the console server to ' + server)
|
||||
}
|
||||
}//[${now} \x1b[0m\x1b[33mLOGS\x1b[0m\x1b[90m] [${options.host}:${options.port}] ${ansi}
|
||||
}//\x1b[0m\x1b[92m[INFO]\x1b[0m\x1b[90m Set the console server to
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,26 +3,13 @@ const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'core',
|
||||
description:['make me run a command in core'],
|
||||
aliases:['cb','corerun','run','commandblockrun','cbrun'],
|
||||
trustLevel: 0,
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
// const client = context.client
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
const message = context.arguments.join(' ')
|
||||
// if (args.length === 0){
|
||||
//source.sendFeedback({translate:"Too few Arguments!", color:"red"})
|
||||
if (args[0] === undefined){
|
||||
source.sendFeedback({translate:"Too few Arguments!", color:"red"})
|
||||
}
|
||||
if (message.startsWith('/')) {
|
||||
bot.core.run(message.substring(1))
|
||||
return
|
||||
}
|
||||
bot.core.run(message)
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+7
-9
@@ -3,17 +3,16 @@ const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'cowsay',
|
||||
description:['mooooo'],
|
||||
aliases:['cws', 'cow'],
|
||||
trustLevel: 0,
|
||||
execute (context, selector) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const args = context.arguments.join(' ')
|
||||
const component = ['']
|
||||
// const args = context.arguments
|
||||
const source = context.source
|
||||
const cowsay = require('cowsay2')
|
||||
const cows = require('cowsay2/cows')
|
||||
if (args[0].toLowerCase() === 'list') {
|
||||
throw new CommandError('too lazy to work on it right now')
|
||||
if (args[0] === 'list') {
|
||||
const listed = Object.keys(cows)
|
||||
|
||||
let primary = true
|
||||
@@ -30,13 +29,12 @@ module.exports = {
|
||||
})
|
||||
}
|
||||
|
||||
bot.tellraw(message)
|
||||
source.sendFeedback(`${source} ${message}`)
|
||||
} else {
|
||||
bot.tellraw({ text: cowsay.say(args.slice(1).join(' '), { cow: cows[args[0]] }) })
|
||||
source.sendFeedback(`\n ${cowsay.say(args)} ${cows[args[0]] }`)
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
// bot.tellraw({ text: cowsay.say(context.arguments.join(' ').slice(1), { cow: cows[args[0]] })
|
||||
|
||||
//const listed = JSON.parse(cows)
|
||||
|
||||
+1
-3
@@ -3,12 +3,10 @@ const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'crash',
|
||||
description:['crashes a server'],
|
||||
trustLevel: 1,
|
||||
aliases:['crashserver', '69'],//69 cuz yes
|
||||
hashOnly: true,
|
||||
execute (context) {
|
||||
|
||||
const bot = context.bot
|
||||
// throw new CommandError('temp disabled')
|
||||
const args = context.arguments
|
||||
if (!args && !args[0] && !args[1] && !args[2]) return
|
||||
switch (args[1]) {
|
||||
|
||||
+6
-31
@@ -1,37 +1,12 @@
|
||||
const CommandError = require("../CommandModules/command_error")
|
||||
|
||||
module.exports = {
|
||||
name: 'discordmsg',
|
||||
description:['make me say something in discord'],
|
||||
trustLevel: 0,
|
||||
aliases:['discordmessage', 'ddmsg'],
|
||||
execute (context) {
|
||||
//const args = context.args
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
|
||||
// if (args.translate !== '\u202e')
|
||||
// throw new CommandError('u202e detected')
|
||||
if (!args[0]) {
|
||||
context.source.sendFeedback({text:'Message is empty', color:'red'}, false)
|
||||
} else {
|
||||
bot.discord.channel.send(args.join(' '))
|
||||
console.log(args[0])
|
||||
context.source.sendFeedback({ text: `Recieved: ${args.join(' ')}`, color:'green'})
|
||||
|
||||
}
|
||||
}
|
||||
const bot = context.bot
|
||||
const player = context.player
|
||||
|
||||
bot.discord.channel.send(args.join(' '))
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//bot.discord.channel.send(args.join(' '))
|
||||
/*
|
||||
if(!args[0])
|
||||
context.source.sendFeedback('message is empty')
|
||||
|
||||
else if (args[0])
|
||||
bot.discord.channel.send(args[0])
|
||||
console.log(args[0])
|
||||
context.source.sendFeedback(`Recieved: ${args[0]}`)
|
||||
return;
|
||||
*/
|
||||
@@ -1,8 +1,6 @@
|
||||
module.exports = {
|
||||
name: 'echo',
|
||||
description:['make me say something in chat'],
|
||||
aliases:['chatsay'],
|
||||
trustLevel: 0,
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'end',
|
||||
description:['/kill the bot or make it /suicide'],
|
||||
trustLevel: 1,
|
||||
aliases:['kys','kill','suicide'],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
source.sendFeedback(`${bot.username} fell out of the world`)
|
||||
process.exit()
|
||||
}
|
||||
}
|
||||
/*context.source.sendFeedback('farding right now....')
|
||||
process.exit(1)
|
||||
*/
|
||||
@@ -0,0 +1,12 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'errortest',
|
||||
description:['test errors'],
|
||||
execute (context) {
|
||||
const message = context.arguments.join(' ')
|
||||
context.source.sendFeedback('hint hover your mouse over the error')
|
||||
throw new Error(message)
|
||||
|
||||
}
|
||||
}
|
||||
+9
-18
@@ -2,12 +2,14 @@ const ivm = require('isolated-vm');//new ivm.Isolate(options)
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
// const isolate = new ivm.isolate({ memoryLimit: 128 });
|
||||
const { stylize } = require('../util/eval_colors')
|
||||
// 32 seems fine
|
||||
const options = {
|
||||
timeout: 1000//?
|
||||
}
|
||||
let isolate = new ivm.Isolate({ memoryLimit: 50 }) // 32 seems fine
|
||||
|
||||
module.exports = {
|
||||
name: 'evaljs',
|
||||
trustLevel: 1,
|
||||
aliases:['evaljsisolatedvm', 'evaljsnew', 'evaljsivm', 'eval', 'evalivm', 'evalisolatedvm', 'evaljsnew'],
|
||||
hashOnly:true, // vm owners please dont get mad at me ;-;
|
||||
description:['run code in a vm note: amcforum members had a sh##fit over this command'],
|
||||
async execute (context) {
|
||||
const bot = context.bot
|
||||
@@ -22,19 +24,11 @@ trustLevel: 1,
|
||||
{ color: 'dark_green', text: 'EvalJS'},
|
||||
]
|
||||
}
|
||||
// throw new CommandError('temp disabled')
|
||||
/* bot.tellraw(selector, { text: util.inspect(bot.vm.run(args.slice(1).join(' ')), { stylize }).substring(0, 32000) })
|
||||
} catch (err) {
|
||||
bot.tellraw(selector, { text: util.inspect(err).replaceAll('runner', 'Parker2991'), color: 'red' })
|
||||
*/
|
||||
//let hash = bot.hash
|
||||
const options = {
|
||||
timeout: 1000//?
|
||||
}
|
||||
|
||||
|
||||
let isolate = new ivm.Isolate({ memoryLimit: 50, options, global, cachedData: true })
|
||||
//let cachedData = true
|
||||
if (!args && !args[0] && !args[1] && !args[2]) return
|
||||
switch (args[1]) {
|
||||
case `run`:
|
||||
@@ -54,18 +48,15 @@ trustLevel: 1,
|
||||
|
||||
// YOU KILLED THE TERMINAL LMFAO
|
||||
|
||||
//let context = await isolate.createContext({ inspector: true });
|
||||
//let script = await isolate.compileScript('for(;;)debugger;', { filename: 'example.js' });
|
||||
// await script.run(context);
|
||||
//fr
|
||||
try {
|
||||
let nerd = "";
|
||||
const script = await args.slice(2).join(' '); // Ensure script is a string
|
||||
const cOmtext = await isolate.createContextSync({options});
|
||||
|
||||
const script = args.slice(2).join(' '); // Ensure script is a string
|
||||
const cOmtext = isolate.createContext();
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
let result = await (await cOmtext).evalSync(script, options, {
|
||||
let result = await (await cOmtext).eval(script, {
|
||||
timeout: 1000
|
||||
})
|
||||
nerd = result;
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
const { VM } = require('vm2')
|
||||
const util = require('util')
|
||||
const { stylize } = require('../util/eval_colors')
|
||||
|
||||
const options = {
|
||||
timeout: 1000
|
||||
}
|
||||
let vm = new VM(options)
|
||||
|
||||
module.exports = {
|
||||
name: 'evaljsvm2',
|
||||
trustLevel: 1,
|
||||
description:['old evaljs code'],
|
||||
aliases:['evaljsold', 'evalvm2', 'evalold'],
|
||||
execute (context) {
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
const cmd = {
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'dark_green', text: 'EvalJS Cmd'},
|
||||
]
|
||||
}
|
||||
// throw new CommandError('temp disabled')
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
switch (args[1]) {
|
||||
case 'run':
|
||||
try {
|
||||
const output = vm.run(args.slice(2).join(' '))
|
||||
|
||||
source.sendFeedback([cmd, { text: util.inspect(output, { stylize }) }])
|
||||
} catch (e) {
|
||||
source.sendFeedback([cmd, { text: e.stack, color: 'black' }])
|
||||
}
|
||||
|
||||
break
|
||||
case 'reset':
|
||||
vm = new VM(options)
|
||||
|
||||
source.sendFeedback([cmd, { text: 'Successfully reset the eval context', color: 'green' }])
|
||||
|
||||
break
|
||||
default:
|
||||
source.sendFeedback([cmd, { text: 'Invalid option!', color: 'dark_red' }])
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'filter',
|
||||
hashOnly: true,
|
||||
description:['filter players (not functional)'],
|
||||
execute (context) {
|
||||
|
||||
const target = context.arguments.join(' ')
|
||||
const bot = context.bot
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
const crypto = require('crypto')
|
||||
|
||||
module.exports = {
|
||||
name: 'botval',
|
||||
|
||||
trustLevel: 3,
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
|
||||
const prefix = '~' // mabe not hardcode the prefix
|
||||
|
||||
const args = context.arguments
|
||||
|
||||
const key = process.env['FNFBoyfriendBot_Owner_key']
|
||||
//al
|
||||
const time = Math.floor(Date.now() / 11000)
|
||||
|
||||
const value = bot.uuid + args[0] + time + key
|
||||
|
||||
const hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + key).digest('hex').substring(0, 16)
|
||||
|
||||
const command = `${prefix}${args.shift()} ${hash} ${args.join(' ')}`
|
||||
const customchat = {
|
||||
translate: '[%s] %s \u203a %s',
|
||||
color:'gray',
|
||||
with: [
|
||||
{ text: 'FNFBoyfriendBot', color:'#00FFFF'},
|
||||
{ selector: `${bot.username}`, color:'#00FFFF'},
|
||||
{ text: '', extra: [`${command}`], color:'white'},
|
||||
|
||||
],
|
||||
hoverEvent: { action:"show_text", value: 'FNF Sky is a fangirl but a simp for boyfriend confirmed??'},
|
||||
clickevent: { action:"open_url", value: "https://doin-your.mom"}
|
||||
}
|
||||
|
||||
context.bot.tellraw(customchat)
|
||||
}
|
||||
}
|
||||
//const interval = setInterval(() => {
|
||||
// bot.hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + config.keys.normalKey).digest('hex').substring(0, 16)
|
||||
// bot.ownerHash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + config.keys.ownerHashKey).digest('hex').substring(0, 16)
|
||||
|
||||
|
||||
// Make a copy of this
|
||||
+107
-170
@@ -1,10 +1,10 @@
|
||||
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'help',
|
||||
aliases:['heko', 'cmd', '?', 'commands', 'cmds' ],
|
||||
aliases:['heko'],
|
||||
description:['shows the command list'],
|
||||
trustLevel: 0,
|
||||
async execute (context) {
|
||||
const bot = context.bot
|
||||
const commandList = []
|
||||
@@ -23,9 +23,9 @@ module.exports = {
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: '#00FFFF', text: 'Public'},
|
||||
{ color: 'green', text: 'Public'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'dark_purple', text: 'Trusted'},
|
||||
{ color: 'red', text: 'Trusted'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'dark_red', text: 'Owner'},
|
||||
]
|
||||
@@ -33,32 +33,21 @@ module.exports = {
|
||||
|
||||
if (args[0]) {
|
||||
let valid
|
||||
for (const commands in bot.commandManager.commandlist) { // i broke a key woops
|
||||
const command = bot.commandManager.commandlist[commands]
|
||||
|
||||
if (args[0].toLowerCase() === command.name )
|
||||
// if (args[0].toLowerCase() === command.aliases)
|
||||
{//text:`Trust Level: `,color:'white'},
|
||||
//{text:`${command.trustLevel}\n`,color:'red'},
|
||||
for (const fard in bot.commandManager.amogus) { // i broke a key woops
|
||||
const command = bot.commandManager.amogus[fard]
|
||||
if (args[0].toLowerCase() === command.name) {
|
||||
valid = true
|
||||
source.sendFeedback([cmd, `Description: ${command.description}`])
|
||||
|
||||
source.sendFeedback([cmd, {text:`Trust Level: ${command.trustLevel}`}])
|
||||
|
||||
source.sendFeedback([cmd, `aliases: ${command.aliases}`])
|
||||
break
|
||||
} else valid = false
|
||||
}
|
||||
//source is defined btw
|
||||
}//source is defined btw
|
||||
//source.sendFeedback([cmd, 'This command is ' + valid + ' to this for loop'])
|
||||
if (valid) {
|
||||
|
||||
} else {
|
||||
const args = context.arguments
|
||||
source.sendFeedback([cmd, {translate: `Unknown command %s. Type "${bot.options.commands.MainPrefix}help" for help or click on this for the command`,color:'red', with: [args[0]], clickEvent: bot.options.Core.customName ? { action: 'suggest_command', value: `${bot.options.commands.MainPrefix}help` } : undefined}])
|
||||
// bot.tellraw([cmd, {translate: `Unknown command %s. Type "${bot.options.commands.prefix}help" for help or click on this for the command`, with: [args[0]], clickEvent: bot.options.Core.customName ? { action: 'suggest_command', value: `${bot.options.commands.prefix}help`, color:'red' } : undefined}])
|
||||
source.sendFeedback([cmd, {text: 'Unknown command.', color: 'dark_red'}])
|
||||
}//i will add the descriptions reading as tests and action add the descriptions for the commands after
|
||||
const length = context.bot.commandManager.commandlist.length // ok
|
||||
const length = context.bot.commandManager.amogus.length // ok
|
||||
//i guess i did delete smh woops
|
||||
|
||||
//context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...commandList], false)
|
||||
@@ -67,157 +56,105 @@ module.exports = {
|
||||
let t_rust = []
|
||||
let own_her = []
|
||||
let cons_ole = []
|
||||
for (const commands in bot.commandManager.commandlist) {
|
||||
const command = bot.commandManager.commandlist[commands]
|
||||
|
||||
// if (command.consoleOnly == true) return console.log(command);
|
||||
if(command.trustLevel === 3) {
|
||||
cons_ole.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
color: 'blue',
|
||||
|
||||
|
||||
translate:"",
|
||||
hoverEvent:{
|
||||
action:"show_text",
|
||||
value:[
|
||||
{
|
||||
text:`Command:${command.name}\n`,
|
||||
color:'white'
|
||||
},{
|
||||
text:"HashOnly:",
|
||||
color:'white'},
|
||||
{text:`${command.hashOnly}\n`,color:'red'},
|
||||
{text:'consoleOnly:',color:'white'},
|
||||
{text:`${command.consoleOnly && !context.console}\n`, color:'red'},
|
||||
{text:`${command.description}\n`, color:'white'},
|
||||
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
|
||||
{text:'click on me to use me :)'},
|
||||
]
|
||||
}
|
||||
}
|
||||
)// copypasted from below, and removed stuff that wont work in the console
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
if (command.trustLevel === 2) {
|
||||
own_her.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
color: 'dark_red',
|
||||
|
||||
|
||||
translate:"",
|
||||
hoverEvent:{
|
||||
action:"show_text",
|
||||
value:[
|
||||
{
|
||||
text:`Command:${command.name}\n`,
|
||||
color:'white'
|
||||
}, {text:`Trust Level: `,color:'white'},
|
||||
{text:`${command.trustLevel}\n`,color:'dark_red'},
|
||||
{text:`${command.description}\n`, color:'white'},
|
||||
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
|
||||
{text:'click on me to use me :)'},
|
||||
]
|
||||
},clickEvent:{
|
||||
action:"run_command",value:`${bot.options.commands.MainPrefix}${command.name}`
|
||||
},
|
||||
// ${command.name}\nhashOnly:§c${command.hashOnly}§r\nconsoleOnly:§c${command.consoleOnly && !context.console}§r\n${command.description}
|
||||
|
||||
///tellraw @a {"translate":"","hoverEvent":{"action":"show_text","value":[{"text":""},{"text":""}]},"clickEvent":{"action":"run_command","value":"a"}}
|
||||
|
||||
}
|
||||
)//my w
|
||||
}
|
||||
// let valid
|
||||
else if (command.trustLevel === 1){
|
||||
t_rust.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
color: 'dark_purple',
|
||||
|
||||
|
||||
translate:"",
|
||||
hoverEvent:{
|
||||
action:"show_text",
|
||||
value:[
|
||||
{
|
||||
text:`Command:${command.name}\n`,
|
||||
color:'white'
|
||||
}, {text:`Trust Level: `,color:'white'},
|
||||
{text:`${command.trustLevel}\n`,color:'red'}, {text:`${command.description}\n`, color:'white'},
|
||||
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
|
||||
{text:'click on me to use me :)'},
|
||||
]
|
||||
},clickEvent:{
|
||||
action:"run_command",value:`${bot.options.commands.MainPrefix}${command.name}`
|
||||
},
|
||||
// ${command.name}\nhashOnly:§c${command.hashOnly}§r\nconsoleOnly:§c${command.consoleOnly && !context.console}§r\n${command.description}
|
||||
|
||||
///tellraw @a {"translate":"","hoverEvent":{"action":"show_text","value":[{"text":""},{"text":""}]},"clickEvent":{"action":"run_command","value":"a"}}
|
||||
// clickEvent: command.name ? { action: 'suggest_command', value: `~${command.name}` },
|
||||
|
||||
}
|
||||
)
|
||||
//my w
|
||||
}
|
||||
else if (command.trustLevel === 0){
|
||||
pub_lick.push(
|
||||
for (const fard in bot.commandManager.amogus) {
|
||||
const command = bot.commandManager.amogus[fard]
|
||||
if (command.hashOnly) {
|
||||
t_rust.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
color: '#00FFFF',
|
||||
translate:"",
|
||||
hoverEvent:{
|
||||
action:"show_text", // Welcome to Kaboom!\n > Free OP - Anarchy - Creative (frfr)
|
||||
value:[
|
||||
{
|
||||
text:`Command:${command.name}\n`,
|
||||
color:'white'
|
||||
},{
|
||||
text:`Trust Level: `,color:'white'},
|
||||
{text:`${command.trustLevel}\n`,color:'red'},
|
||||
{text:`${command.description}\n`, color:'white'},
|
||||
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
|
||||
{text:'click on me to use me :)'},
|
||||
]
|
||||
},clickEvent:{
|
||||
action:"suggest_command",value:`${bot.options.commands.MainPrefix}${command.name}`}
|
||||
|
||||
})
|
||||
|
||||
// copypasted from below, and removed stuff that wont work in the console
|
||||
}
|
||||
//{command.consoleOnly && !source.sources.console
|
||||
//${command.description}
|
||||
color: 'red'
|
||||
}
|
||||
)
|
||||
} else {
|
||||
pub_lick.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
color: 'green'
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// for (const command of context.bot.commandManager.getCommands()) {
|
||||
// if (command.consoleOnly && !context.console) continue
|
||||
for (const command of context.bot.commandManager.getCommands()) {
|
||||
if (command.consoleOnly && !context.console) continue
|
||||
}
|
||||
// console.log(pub_lick)
|
||||
// console.log(t_rust)
|
||||
|
||||
// i could do context.source.sources.console
|
||||
// but i want to do it like this
|
||||
// if its buggy change to that
|
||||
const isConsole = context.source.player ? false : true
|
||||
|
||||
if(isConsole) {
|
||||
// mabe idk
|
||||
const length = context.bot.commandManager.commandlist.length
|
||||
|
||||
context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust, own_her, cons_ole], false)
|
||||
} else {
|
||||
const length = context.bot.commandManager.commandlist.filter(c => c.trustLevel != 3).length
|
||||
//trustlevel
|
||||
context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust ,own_her], false)
|
||||
|
||||
// bot.tellraw([own_her])
|
||||
//console.log(t_rust)
|
||||
}//
|
||||
const length = context.bot.commandManager.amogus.length
|
||||
context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust], false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
if (args[0]) {
|
||||
for (const command of bot.command_handler.commands) {
|
||||
function run () {
|
||||
let alias = command.name
|
||||
|
||||
if (command.alias.toString() !== '') {
|
||||
alias = command.alias.join(', ')
|
||||
}
|
||||
|
||||
const usage = []
|
||||
if (typeof command.usage === 'string') {
|
||||
usage.push({ text: `${prefix}${command.name} `, color: 'gold' })
|
||||
usage.push({ text: command.usage, color: 'aqua' })
|
||||
} else {
|
||||
for (const value of command.usage) {
|
||||
usage.push({ text: `${prefix}${command.name} `, color: 'gold' })
|
||||
usage.push({ text: value, color: 'aqua' })
|
||||
usage.push('\n')
|
||||
}
|
||||
usage.pop()
|
||||
}
|
||||
|
||||
const component = []
|
||||
component.push({ text: prefix + command.name, color: 'gold' })
|
||||
component.push({ text: ` (${alias})`, color: 'white' })
|
||||
component.push({ text: ' - ', color: 'gray' })
|
||||
component.push({ text: command.description, color: 'gray' })
|
||||
|
||||
component.push('\n')
|
||||
|
||||
component.push({ text: 'Trust level: ', color: 'green' })
|
||||
component.push({ text: command.trusted, color: 'yellow' })
|
||||
|
||||
component.push('\n')
|
||||
|
||||
component.push({ text: 'Supported on Discord: ', color: 'green' })
|
||||
component.push({ text: command.discordExecute ? 'true' : 'false', color: 'gold' })
|
||||
|
||||
component.push('\n')
|
||||
|
||||
component.push(usage)
|
||||
|
||||
bot.tellraw(selector, component)
|
||||
}
|
||||
|
||||
if (command.name === args[0]) run()
|
||||
for (const alias of command.alias) {
|
||||
if (alias === args[0]) run()
|
||||
}
|
||||
};
|
||||
} else {
|
||||
const generalCommands = []
|
||||
const trustedCommands = []
|
||||
const ownerCommands = []
|
||||
function component (command, color) {
|
||||
return {
|
||||
text: command.name + ' ',
|
||||
color,
|
||||
hoverEvent: {
|
||||
action: 'show_text',
|
||||
contents: [{
|
||||
text: 'Click here to see the information for this command',
|
||||
color: 'green'
|
||||
}]
|
||||
},
|
||||
clickEvent: {
|
||||
action: 'run_command',
|
||||
value: `${prefix}help ${command.name}`
|
||||
}
|
||||
}
|
||||
};
|
||||
*/
|
||||
+129
-475
@@ -1,477 +1,141 @@
|
||||
const CommandError = require("../CommandModules/command_error");
|
||||
|
||||
const path = require("path");
|
||||
const fs = require("fs/promises");
|
||||
const packageJSON = require("../package.json");
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
const path = require('path')
|
||||
const fs = require('fs/promises')
|
||||
const packageJSON = require("../package.json")
|
||||
async function getCpuModelName () {
|
||||
const cpuInfo = await fs.readFile('/proc/cpuinfo')
|
||||
const lines = cpuInfo.toString().split('\n')
|
||||
// among us way of doing it
|
||||
const modelName = lines.find((line) => line.startsWith('model name')).split('\t: ')
|
||||
return modelName[1]
|
||||
}
|
||||
module.exports = {
|
||||
name: "info",
|
||||
description: [
|
||||
"check the bots info. the usages are version, discord, serverinfo, logininfo, uptime, creators",
|
||||
],
|
||||
aliases: ["information"],
|
||||
trustLevel: 0,
|
||||
async execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
// const client = context.client
|
||||
const cmd = {
|
||||
//test.js
|
||||
translate: "[%s] ",
|
||||
name: 'info',
|
||||
description:['check the bots info. the args are version, discord, serverinfo, logininfo, uptime, memused, creators'],
|
||||
async execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const cmd = {//test.js
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
color: "white",
|
||||
with: [{ color: "gold", text: "Info Cmd" }],
|
||||
};
|
||||
|
||||
const buildstring = process.env["buildstring"];
|
||||
const foundationbuildstring = process.env["FoundationBuildString"];
|
||||
const source = context.source;
|
||||
switch (args[0]) {
|
||||
case "version":
|
||||
const discordJSVersion = packageJSON.dependencies["discord.js"];
|
||||
const MinecraftProtocolVersion =
|
||||
packageJSON.dependencies["minecraft-protocol"];
|
||||
|
||||
context.source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `${process.env["buildstring"]}`,
|
||||
});
|
||||
|
||||
context.source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `${process.env["FoundationBuildString"]}`,
|
||||
});
|
||||
|
||||
const date = new Date().toLocaleDateString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
|
||||
context.source.sendFeedback({
|
||||
text: `Bot Release: 11/22/2022 `,
|
||||
color: "gray",
|
||||
});
|
||||
|
||||
context.source.sendFeedback({
|
||||
text: `BotEngine:Node-Minecraft-Protocol @${MinecraftProtocolVersion}`,
|
||||
color: "gray",
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
text: "Node-Minecraft-protocol",
|
||||
color: "gray",
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "open_url",
|
||||
value: `https://github.com/PrismarineJS/node-minecraft-protocol`,
|
||||
},
|
||||
});
|
||||
|
||||
context.source.sendFeedback({
|
||||
text: `Discord.js @${discordJSVersion}`,
|
||||
color: "gray",
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
text: "Discord.js",
|
||||
color: "gray",
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "open_url",
|
||||
value: `https://github.com/discordjs/discord.js`,
|
||||
},
|
||||
});
|
||||
context.source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `Node js Version @${process.version}`,
|
||||
});
|
||||
// context.source.sendFeedback({color: 'gray', text:`npm Version:@${npmVersion}`})
|
||||
|
||||
break;
|
||||
case "thankyou":
|
||||
var prefix =
|
||||
"&8&l&m[&4&mParker2991&8]&8&m[&b&mBOYFRIEND&8]&8&m[&b&mCONSOLE&8]&r ";
|
||||
bot.core.run(
|
||||
"bcraw " +
|
||||
prefix +
|
||||
"Thank you for all that helped and contributed with the bot, it has been one hell of a ride with the bot hasnt it? From November 22, 2022 to now, 0.1 beta to 4.0 alpha, Mineflayer to Node-Minecraft-Protocol. I have enjoyed all the new people i have met throughout the development of the bot back to the days when the bot used mineflayer for most of its lifespan to the present as it now uses node-minecraft-protocol. Its about time for me to tell how development went in the bot well here it is, back in 0.1 beta of the bot it was skidded off of menbot 1.0 reason why? Well because LoginTimedout gave me the bot when ayunboom was still a thing and he helped throughout that time period bot and when 1.0 beta came around he he just stopped helping me on it why? because he had servers to run so yeah but anyway back then i didnt know what skidded like i do now so i thought i could get away with but i was wrong 💀. Early names considered for the bot were &6&lParkerBot &4&lDEMONBot &b&lWoomyBot &b&lBoyfriendBot,&r i kept the name &b&lBoyfriendBot&r throughout most of the early development but i got sick and tired of being harassed about the name being told it was gay but people really didnt know what it meant did they? It was referenced to Boyfriend from Friday Night Funkin’ so right around 1.0 released i renamed it to &b&lFNFBoyfriend&4&lBot &rand around 2.0 changed it to &5&lFNF&b&lBoyfriend&4&lBot &rand luckily avoided the harassment when i changed it i love coding and i want to learn how to code more thank you all!",
|
||||
);
|
||||
break;
|
||||
case "discord":
|
||||
source.sendFeedback({
|
||||
text: bot.options.discord.invite,
|
||||
color: "gray",
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
text: "click here to join!",
|
||||
color: "gray",
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "open_url",
|
||||
value: `${bot.options.discord.invite}`,
|
||||
},
|
||||
});
|
||||
|
||||
break;
|
||||
case "serverinfo":
|
||||
const os = require("os");
|
||||
context.source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `Hostname: ${os.hostname()}`,
|
||||
});
|
||||
context.source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `Working Directory: ${path.join(__dirname, "..")}`,
|
||||
});
|
||||
context.source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `OS architecture: ${os.arch()}`,
|
||||
});
|
||||
context.source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `OS platform: ${os.platform()}`,
|
||||
});
|
||||
context.source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `OS name: ${os.version()}`,
|
||||
});
|
||||
context.source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `CPU cores: ${os.cpus().length}`,
|
||||
});
|
||||
|
||||
/*
|
||||
if (os.platform() !== 'linux'){
|
||||
source.sendFeedback({text:'cannot find the cpu model are you sure the bot is running on linux?', color:'red'})
|
||||
}
|
||||
else if (os.platform() === 'linux') {
|
||||
*/ source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `CPU model: ${os.cpus()[0].model}`,
|
||||
});
|
||||
source.sendFeedback({
|
||||
translate:'%s%s%s',
|
||||
color: "gray",
|
||||
with: [{text:`Server Memory Usage `, color:'gray'},{text:`${Math.floor(
|
||||
os.freemem() / 1048576,
|
||||
)} `,color:'gray'},{text: `MiB / ${Math.floor(os.totalmem() / 1048576)} MiB`, color:'gray'}],
|
||||
});
|
||||
break;
|
||||
case "logininfo":
|
||||
source.sendFeedback({
|
||||
text: `Bot Username: "${bot.username}"`,
|
||||
color: "gray",
|
||||
});
|
||||
source.sendFeedback({ text: `Bot uuid:"${bot.uuid}"`, color: "gray" });
|
||||
|
||||
source.sendFeedback({
|
||||
text: `Minecraft Java Version: "${bot.version}"`,
|
||||
color: "gray",
|
||||
});
|
||||
|
||||
source.sendFeedback({
|
||||
text: `Server: "${bot.options.host}:${bot.options.port}"`,
|
||||
color: "gray",
|
||||
});
|
||||
|
||||
source.sendFeedback({
|
||||
text: `Main Prefix: "${bot.options.commands.MainPrefix}"`,
|
||||
color: "gray",
|
||||
});
|
||||
source.sendFeedback({
|
||||
text: `Secondary Prefix: "${bot.options.commands.SecondaryPrefix}"`,
|
||||
color: "gray",
|
||||
});
|
||||
source.sendFeedback({
|
||||
text: `Tertiary Prefix: "${bot.options.commands.TertiaryPrefix}"`,
|
||||
color: "gray",
|
||||
});
|
||||
source.sendFeedback({
|
||||
text: `Discord Prefix: "${bot.options.discord.commandPrefix}"`,
|
||||
color: "gray",
|
||||
});
|
||||
|
||||
source.sendFeedback({
|
||||
text: `Discord Username: "${bot.discord.client.user.username}#${bot.discord.client.user.discriminator}"`,
|
||||
color: "gray",
|
||||
});
|
||||
|
||||
source.sendFeedback({
|
||||
text: `Discord Channel: ${bot.discord.channel.name}`,
|
||||
});
|
||||
source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `ConsoleServer:"${bot.console.consoleServer}"`,
|
||||
});
|
||||
|
||||
const amonger = bot.bots.map((eachBot) => eachBot.options.host + "\n");
|
||||
const port = bot.bots.map((eachBot) => eachBot.options.port);
|
||||
|
||||
if (amonger.length === 0) {
|
||||
const list = [];
|
||||
for (const host of bots) {
|
||||
if (list.length !== 0) {
|
||||
list.push(host.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
source.sendFeedback({ text: `Servers in Config ${amonger.length}` });
|
||||
/* if (query.length === 0) {
|
||||
const list = []
|
||||
|
||||
for (const host of bots) {
|
||||
if (list.length !== 0) list.push({ text: ', ', color: 'gray' })// list.push(info.name)
|
||||
list.push(info.name)
|
||||
|
||||
}
|
||||
|
||||
context.source.sendFeedback([], false)
|
||||
return
|
||||
}*/
|
||||
/*
|
||||
if (query.length === 0) {
|
||||
const list = []
|
||||
|
||||
for (const info of bots) {
|
||||
if (list.length !== 0) list.push({ text: ', ', color: 'gray' })// list.push(info.name)
|
||||
list.push(info.name)
|
||||
|
||||
}
|
||||
|
||||
context.source.sendFeedback(['Known bots (', bots.length, ') - ', ...list], false)
|
||||
return
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'gold', text: 'Info Cmd'},
|
||||
]
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
//real
|
||||
/*
|
||||
const util = fs.readdir('./util')
|
||||
source.sendFeedback({text:`Util Files loaded: ${util.length}`, color:'gray'})
|
||||
|
||||
const modules = fs.readdir('./modules')
|
||||
source.sendFeedback({text:`Modules Files loaded: ${modules.length}`, color:'gray'})
|
||||
const commands = fs.readdir('./commands')
|
||||
source.sendFeedback({text:`Commands Files loaded: ${commands.length}`, color:'gray'})
|
||||
const CommandModules = fs.readdir('./CommandModules')
|
||||
source.sendFeedback({text:`CommandModules Files loaded: ${CommandModules.length}`, color:'gray'})
|
||||
const chat = fs.readdir('./chat')
|
||||
source.sendFeedback({text:`Chat Files loaded: ${chat.length}`, color:'gray'})
|
||||
/*
|
||||
const = '../'
|
||||
fs.readdir(, (err, files) => {
|
||||
source.sendFeedback({text:` Files loaded: ${file.length}`, color:'gray'})
|
||||
});
|
||||
*/
|
||||
/*context.source.sendFeedback(`${buildstring}`, false)
|
||||
context.source.sendFeedback(`${foundationbuildstring}`)
|
||||
context.source.sendFeedback('BotEngine:Node-Minecraft-Protocol', false)
|
||||
*/
|
||||
|
||||
/*context.source.sendFeedback({
|
||||
translate: '\n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s',
|
||||
|
||||
const buildstring = process.env['buildstring']
|
||||
const foundationbuildstring = process.env['FoundationBuildString']
|
||||
|
||||
switch (args[0]) {
|
||||
case 'version':
|
||||
context.source.sendFeedback({
|
||||
translate: '\n %s \n %s \n %s ',
|
||||
with: [
|
||||
{ color: "gray", text: `Bot Username: "${bot.username}"`},
|
||||
{ color: "gray", text: `Bot uuid: "${bot.uuid}"`, clickEvent: {action:"copy_to_clipboard", value: `${context.bot.uuid}`}},
|
||||
{ color: "gray", text: `Minecraft Java Version: "${bot.version}"`},
|
||||
{ color: "gray", text: `Server: "${bot.host}:${bot.port}"`},
|
||||
{ color: "gray", text: `Prefix: "${bot.options.commands.prefix}"`},
|
||||
{ color: "gray", text: `Discord Prefix: "${bot.options.discord.commandPrefix}"`},
|
||||
{ color: "gray", text: `Discord Username: "${bot.discord.client.user.username}#${bot.discord.client.user.discriminator}"`},
|
||||
{ color: "gray", text: `ConsoleServer:"${bot.console.consoleServer}"`}
|
||||
{ color: "green", text: `${buildstring}`},
|
||||
{ color: "green", text: `${foundationbuildstring}`},
|
||||
{ color: "green", text: 'BotEngine:Node-Minecraft-Protocol'},
|
||||
]
|
||||
});
|
||||
|
||||
*/
|
||||
// clickevent: { action:"open_url", value: `${context.bot.discord.invite}`},
|
||||
|
||||
break;
|
||||
case "test":
|
||||
// bot.tellraw('test')
|
||||
// const porta = bot.bots.map(eachBot => eachBot.options.port)
|
||||
const amongerus = bot.bots.map(
|
||||
(eachBot) => eachBot.options.host + ":" + eachBot.options.port + "\n",
|
||||
);
|
||||
/*
|
||||
if (amonger.length === 0){
|
||||
const list = [];
|
||||
for (const host of bots){
|
||||
if (list.length !== 0) {
|
||||
list.push({text:`Server Count: ${host.name}`})
|
||||
}
|
||||
}
|
||||
|
||||
} */
|
||||
//source.sendFeedback()
|
||||
source.sendFeedback(amongerus);
|
||||
// source.sendFeedback(amonger)
|
||||
break;
|
||||
case "uptime":
|
||||
function format(seconds) {
|
||||
function pad(s) {
|
||||
return (s < 10 ? "0" : "") + s;
|
||||
}
|
||||
var hours = Math.floor(seconds / (60 * 60));
|
||||
var minutes = Math.floor((seconds % (60 * 60)) / 60);
|
||||
var seconds = Math.floor(seconds % 60);
|
||||
|
||||
return (
|
||||
pad(`hours: ${hours}`) +
|
||||
" " +
|
||||
pad(`Mins: ${minutes}`) +
|
||||
" " +
|
||||
pad(`Seconds: ${seconds}`)
|
||||
);
|
||||
}
|
||||
|
||||
var uptime = process.uptime();
|
||||
|
||||
source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `Bot Uptime: ${format(uptime)}`,
|
||||
break
|
||||
case 'discord':
|
||||
context.source.sendFeedback({
|
||||
clickevent: { action:"open_url", value: `${context.bot.discord.invite}`},
|
||||
translate: '%s',
|
||||
with: [
|
||||
{ color: "green", text: `${context.bot.discord.invite}`},
|
||||
]
|
||||
});
|
||||
|
||||
break;
|
||||
break
|
||||
case 'serverinfo':
|
||||
const discordJSVersion = packageJSON.dependencies["discord.js"];
|
||||
const MinecraftProtocolVersion = packageJSON.dependencies["minecraft-protocol"];
|
||||
|
||||
const os = require('os')
|
||||
context.source.sendFeedback({
|
||||
translate: '\n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s',
|
||||
with: [
|
||||
{ color: "green", text: `Hostname: ${os.hostname()}`},
|
||||
{ color: "green", text: `Working Directory: ${path.join(__dirname, '..')}`},
|
||||
{ color: "green", text: `OS architecture: ${os.arch()}`},
|
||||
{ color: "green", text: `OS platform: ${os.platform()}`},
|
||||
{ color: "green", text: `OS name: ${os.version()}`},
|
||||
{ color: "green", text: `CPU cores: ${os.cpus().length}`},
|
||||
{ color: "green", text: `CPU model: ${await getCpuModelName()}`},
|
||||
{ color: "green", text: `Node js Version @${process.version}`},
|
||||
{ color: "green", text: `Minecraft-Protocol Version @${MinecraftProtocolVersion}`},
|
||||
{ color: "green", text: `Discord.js @${discordJSVersion}`},
|
||||
|
||||
]
|
||||
});
|
||||
break
|
||||
case 'logininfo':
|
||||
context.source.sendFeedback({
|
||||
translate: '\n %s \n %s \n %s \n %s \n %s',
|
||||
with: [
|
||||
{ color: "green", text: `Bot Username: ${bot.username}`},
|
||||
{ color: "green", text: `Bot uuid: ${context.bot.uuid}`, clickEvent: {action:"copy_to_clipboard", value: `${context.bot.uuid}`}},
|
||||
{ color: "green", text: `Minecraft Java Version: ${context.bot.options.version}`},
|
||||
{ color: "green", text: `Server: ${context.bot.options.host}`},
|
||||
{ color: "green", text: `Port: ${context.bot.options.port}`},
|
||||
]
|
||||
});// clickevent: { action:"open_url", value: `${context.bot.discord.invite}`},
|
||||
|
||||
break
|
||||
|
||||
case 'uptime':
|
||||
function format(seconds){
|
||||
function pad(s){
|
||||
return (s < 10 ? '0' : '') + s;
|
||||
}
|
||||
var hours = Math.floor(seconds / (60*60));
|
||||
var minutes = Math.floor(seconds % (60*60) / 60);
|
||||
var seconds = Math.floor(seconds % 60);
|
||||
|
||||
return pad(`hours: ${hours}`) + ' ' + pad(`Mins: ${minutes}`) + ' ' + pad(`Seconds: ${seconds}`);
|
||||
}
|
||||
|
||||
var uptime = process.uptime();
|
||||
|
||||
context.source.sendFeedback({
|
||||
translate: '\n %s',
|
||||
with: [
|
||||
{ color: "green", text: `Bot Uptime: ${format(uptime)}`},
|
||||
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
case "creators":
|
||||
source.sendFeedback({
|
||||
color: "gray",
|
||||
text: "Thank you to all that helped!",
|
||||
});
|
||||
source.sendFeedback({
|
||||
translate: "%s%s",
|
||||
with: [
|
||||
{ color: "dark_red", text: "Parker" },
|
||||
{ color: "black", text: "2991" },
|
||||
],
|
||||
break
|
||||
case 'memused':
|
||||
const os2 = require('os')
|
||||
context.source.sendFeedback({
|
||||
translate: '\n %s',
|
||||
with: [
|
||||
{ color: "green", text: `§aMem §aused §a${Math.floor(os2.freemem() / 1048576)} §aMiB §a/ §a${Math.floor(os2.totalmem() / 1048576)} MiB`},
|
||||
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
text: "FNF",
|
||||
color: "dark_purple",
|
||||
bold: true,
|
||||
},
|
||||
{
|
||||
text: "Boyfriend",
|
||||
color: "aqua",
|
||||
bold: true,
|
||||
},
|
||||
{
|
||||
text: "Bot ",
|
||||
color: "dark_red",
|
||||
bold: true,
|
||||
},
|
||||
{
|
||||
text: "Discord",
|
||||
color: "blue",
|
||||
bold: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "open_url",
|
||||
value: `${bot.options.discord.invite}`,
|
||||
},
|
||||
});
|
||||
source.sendFeedback({
|
||||
text: "_ChipMC_",
|
||||
color: "dark_green",
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
text: "chipmunk dot land",
|
||||
color: "green",
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "open_url",
|
||||
value: `https://chipmunk.land`,
|
||||
},
|
||||
});
|
||||
source.sendFeedback({
|
||||
text: "chayapak",
|
||||
color: "yellow",
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
text: "Chomens ",
|
||||
color: "yellow",
|
||||
},
|
||||
{
|
||||
text: "Discord",
|
||||
color: "blue",
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "open_url",
|
||||
value: `https://discord.gg/xdgCkUyaA4`,
|
||||
},
|
||||
});
|
||||
source.sendFeedback({
|
||||
text: "_yfd",
|
||||
color: "light_purple",
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
text: "ABot ",
|
||||
color: "gold",
|
||||
bold: true,
|
||||
},
|
||||
{
|
||||
text: "Discord",
|
||||
color: "blue",
|
||||
bold: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "open_url",
|
||||
value: `https://discord.gg/CRfP2ZbG8T`,
|
||||
},
|
||||
});
|
||||
source.sendFeedback({ text: "Poopcorn(Poopbob???)", color: "gold" });
|
||||
]
|
||||
});
|
||||
|
||||
/*
|
||||
text:bot.options.discord.invite,
|
||||
color:'gray',
|
||||
translate:"",
|
||||
hoverEvent:{
|
||||
action:"show_text",
|
||||
value:[
|
||||
{
|
||||
text:'click here to join!',
|
||||
color:'gray',
|
||||
|
||||
}
|
||||
]
|
||||
},clickEvent:{
|
||||
action:"open_url",value:`${bot.options.discord.invite}`
|
||||
}
|
||||
})
|
||||
*/
|
||||
/*
|
||||
break
|
||||
|
||||
|
||||
case 'creators':
|
||||
|
||||
context.source.sendFeedback({
|
||||
translate: '\n %s \n %s%s \n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s',
|
||||
with: [
|
||||
{ color: 'gray', text: 'Thank you to all that helped!' },
|
||||
{ color: 'green', text: 'Thank you to all that helped!' },
|
||||
{ color: 'dark_red', text: 'Parker' },
|
||||
{ color: 'black', text: '2991' },
|
||||
|
||||
@@ -480,29 +144,19 @@ module.exports = {
|
||||
{ color: 'yellow', text: 'chayapak' },
|
||||
|
||||
{ color: 'light_purple', text: '_yfd' },
|
||||
{ color: 'yellow', text: 'ChomeNS Discord Server: https://discord.gg/xdgCkUyaA4' },
|
||||
{ color: 'aqua', text: 'FNFBoyfriendBot Discord Server: https://discord.gg/GCKtG4erux' },
|
||||
{ color: 'green', text: 'ChomeNS Discord Server: https://discord.gg/xdgCkUyaA4' },
|
||||
{ color: 'green', text: 'FNFBoyfriendBot Discord Server: https://discord.gg/GCKtG4erux' },
|
||||
{ color: 'green', text: '(sadly chip doesnt have a discord server) _ChipMC_s Website https://chipmunk.land' },
|
||||
{ color: 'light_purple', text: '_yfds discord server: https://discord.gg/BKYKBxfDrs' },
|
||||
{ color: 'yellow', text: 'chayapaks discord username: chayapak' },
|
||||
{ color: 'green', text: '_yfds discord server: https://discord.gg/BKYKBxfDrs' },
|
||||
{ color: 'green', text: 'chayapaks discord username: chayapak' },
|
||||
{ color: 'green', text: '_ChipMC_s discord username: chipmunkmc' },
|
||||
]
|
||||
});
|
||||
*/
|
||||
break;
|
||||
|
||||
break
|
||||
default:
|
||||
context.source.sendError([
|
||||
cmd,
|
||||
{ text: "Invalid action", color: "dark_red", bold: false },
|
||||
]);
|
||||
context.source.sendError([
|
||||
cmd,
|
||||
{
|
||||
text: "the usages are version, discord, serverinfo, logininfo, uptime, creators",
|
||||
color: "gray",
|
||||
bold: false,
|
||||
},
|
||||
]);
|
||||
context.source.sendError([cmd, { text: 'Invalid action', color: 'dark_red', bold:false }])
|
||||
context.source.sendError([cmd, { text: 'the args for the info command is version, discord, serverinfo, logininfo, uptime, memused, creators', color: 'green', bold:false }])
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+3
-6
@@ -4,13 +4,10 @@ let timer = null
|
||||
|
||||
module.exports = {
|
||||
name: 'kick',
|
||||
|
||||
description:['kicks a player'],
|
||||
|
||||
trustLevel: 1,
|
||||
aliases:[],
|
||||
hashOnly:true,//now its not
|
||||
description:['kicks a player(not functional)'],
|
||||
execute(context) {
|
||||
// throw new CommandError('temp disabled')
|
||||
|
||||
//throw new CommandError('command temporarily disabled until hashing is implemented')
|
||||
const args = context.arguments
|
||||
|
||||
|
||||
+6
-14
@@ -3,27 +3,19 @@ const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'list',
|
||||
description:['check the player list'],
|
||||
trustLevel: 0,
|
||||
aliases:['playerlist', 'plist', 'pl'],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
|
||||
const players = bot.players
|
||||
const source = context.source
|
||||
|
||||
const component = []
|
||||
// if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
if (args.length !== 0){
|
||||
throw new CommandError({translate:"Too many Arguments!", color:"red"})
|
||||
}
|
||||
for (const player of players) {
|
||||
for (const player of players) {
|
||||
component.push({
|
||||
translate: '%s \u203a %s [%s] %s',
|
||||
translate: '%s \u203a %s ',
|
||||
with: [
|
||||
|
||||
player.displayName ?? player.profile.name,
|
||||
player.uuid,
|
||||
{text: `Ping: ${player.latency}`, color:'green'},
|
||||
player.gamemode
|
||||
player.uuid
|
||||
]
|
||||
})
|
||||
|
||||
@@ -32,7 +24,7 @@ throw new CommandError({translate:"Too many Arguments!", color:"red"})
|
||||
|
||||
component.pop()
|
||||
|
||||
source.sendFeedback(component, false)
|
||||
context.source.sendFeedback(component, false)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
//command.unknown.argument command.unknown.command //command.context.here
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const os = require('os')
|
||||
|
||||
module.exports = {
|
||||
name: 'lol',
|
||||
description:['idfk dont ask'],
|
||||
execute (context) {
|
||||
throw new CommandError('idfk lmao')
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'memusage',
|
||||
//<< this one line of code broke it lmao
|
||||
description:['check the bots memusage'],
|
||||
trustLevel: 0,
|
||||
aliases:['memoryusage', 'memused','memoryused'],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3] && !args[4] ) return
|
||||
switch (args[0]) {
|
||||
case 'on':
|
||||
bot.memusage.on()
|
||||
|
||||
source.sendFeedback({text: 'Memusage is now enabled', color:'green'})
|
||||
break
|
||||
case 'off':
|
||||
bot.memusage.off()
|
||||
/ source.sendFeedback({text:'Memusage is now disabled', color:'red'})
|
||||
|
||||
break
|
||||
default:
|
||||
throw new CommandError('Invalid argument')
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
//[%s] %s › %s
|
||||
//was it showing like that before?
|
||||
// just do text bc too sus rn ig
|
||||
// You should remove the with thing and the translate and replace
|
||||
|
||||
// Parker, why is hashing just random characters???
|
||||
//wdym
|
||||
+10
-107
@@ -2,120 +2,23 @@ const CommandError = require('../CommandModules/command_error.js')
|
||||
module.exports = {
|
||||
name: 'netmsg',
|
||||
description:['send a message to other servers'],
|
||||
trustLevel: 0,
|
||||
aliases:['networkmessage', 'netmessage', 'networkmsg'],
|
||||
execute (context) {
|
||||
|
||||
const message = context.arguments.join(' ')
|
||||
function tryParse (json) {
|
||||
try {
|
||||
return JSON.parse(json)
|
||||
} catch (error) {
|
||||
return { text: '' }
|
||||
}
|
||||
}
|
||||
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
|
||||
const source = context.source
|
||||
const player = context.source.player.displayName
|
||||
//throw n
|
||||
//throw new CommandError('ohio')
|
||||
const component = {
|
||||
translate: '[%s] [%s] %s \u203a %s',
|
||||
translate: '[%s%s%s] [%s] %s \u203a %s',
|
||||
with: [
|
||||
{
|
||||
translate: '%s%s%s',
|
||||
bold:false,
|
||||
with: [
|
||||
{
|
||||
text: 'FNF',
|
||||
bold: true,
|
||||
color: 'dark_purple'
|
||||
|
||||
},
|
||||
{
|
||||
text: 'Boyfriend',
|
||||
bold: true,
|
||||
color: '#00FFFF'
|
||||
},
|
||||
{
|
||||
text: 'Bot',
|
||||
bold: true,
|
||||
color: 'dark_red'
|
||||
},
|
||||
],
|
||||
clickEvent: bot.options.Core.customName ? { action: 'open_url', value: bot.options.Core.customName } : undefined,
|
||||
hoverEvent: { action: 'show_text', contents: `idfk what to put here` }
|
||||
},
|
||||
{
|
||||
text:`${bot.options.host}:${bot.options.port}`,
|
||||
bold:false,
|
||||
color:'white',
|
||||
translate:"",
|
||||
hoverEvent:{
|
||||
action:"show_text",
|
||||
value:[
|
||||
{
|
||||
text:`Server: ${bot.options.host}:${bot.options.port}`,
|
||||
color:'white',
|
||||
}
|
||||
],
|
||||
clickEvent:{
|
||||
action:"copy_to_clipboard",value:`${bot.options.host}:${bot.options.port}`}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
context.source.player.displayName ?? context.source.player.profile.name,
|
||||
|
||||
//entry.displayName
|
||||
{text:message}
|
||||
]//command.split(' ')[0]
|
||||
{ color: 'dark_purple', text: 'FNF',bold: true },
|
||||
{ color: 'aqua', text: 'Boyfriend',bold: true },
|
||||
{ color: 'dark_red', text: 'Bot',bold: true },
|
||||
bot.options.host + ':' + bot.options.port,
|
||||
context.source.player.displayName ?? context.source.player.profile.name,
|
||||
message
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
// context.source.player.displayName ?? context.source.player.profile.name,
|
||||
/*
|
||||
function tryParse (json) {
|
||||
try {
|
||||
return JSON.parse(json)
|
||||
} catch (error) {
|
||||
return { text: '' }
|
||||
}
|
||||
}
|
||||
*///obj
|
||||
/*
|
||||
const amogus2 = {text:`${JSON.stringify(context.source.player.displayName ?? context.source.player.profile.name)}`}
|
||||
|
||||
bot.tellraw({text:'amogus ' + JSON.parse(context.source.player.displayName)})
|
||||
*/ //context.source.sendFeedback({text:`Hello, World!, Player: ${player}, uuid: ${uuid}, Argument: ${message}`})
|
||||
if (!message[0]) {
|
||||
context.source.sendFeedback({text:'Message is empty', color:'red'}, false)
|
||||
} else {
|
||||
|
||||
for (const eachBot of bot.bots) eachBot.tellraw(component)
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
translate:"",
|
||||
hoverEvent:{
|
||||
action:"show_text", // Welcome to Kaboom!\n > Free OP - Anarchy - Creative (frfr)
|
||||
value:[
|
||||
{
|
||||
text:`Command:${command.name}\n`,
|
||||
color:'white'
|
||||
},{
|
||||
text:`Trust Level: `,color:'white'},
|
||||
{text:`${command.trustLevel}\n`,color:'red'},
|
||||
{text:`${command.description}\n`, color:'white'},
|
||||
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
|
||||
{text:'click on me to use me :)'},
|
||||
]
|
||||
},clickEvent:{
|
||||
action:"suggest_command",value:`${bot.options.commands.MainPrefix}${command.name}`}
|
||||
|
||||
})
|
||||
*/
|
||||
@@ -1,8 +1,6 @@
|
||||
module.exports = {
|
||||
name: 'rc',
|
||||
description:['refill the bots core'],
|
||||
trustLevel: 0,
|
||||
aliases:['refillcore'],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'recend',
|
||||
description:['reconnect or end the bot the usages are end, and reconnect'],
|
||||
hashOnly:true,
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
const args = context.arguments
|
||||
//throw new CommandError('disabled until owner hash is added')
|
||||
if (!args && !args[0] && !args[1] && !args[2]) return
|
||||
switch (args[1]) {
|
||||
case `end`:
|
||||
context.source.sendFeedback('farding right now....')
|
||||
process.exit(1)
|
||||
break
|
||||
case `reconnect`:
|
||||
const randomstring = require('randomstring')
|
||||
context.source.sendFeedback({ text: `Reconnecting to ${bot.options.host}:${bot.options.port}`, color: 'dark_green'})
|
||||
|
||||
|
||||
bot.chat(randomstring.generate(300))
|
||||
break
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
default:
|
||||
const cmd = {//test.js
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'gold', text: 'recend Cmd'},
|
||||
]
|
||||
}
|
||||
context.source.sendError([cmd, { text: 'Invalid action', color: 'dark_red', bold:false }])
|
||||
context.source.sendError([cmd, { text: 'the args for the info command is reconnect, and end', color: 'green', bold:false }])
|
||||
}
|
||||
}
|
||||
}
|
||||
/*context.source.sendFeedback('farding right now....')
|
||||
process.exit(1)
|
||||
*/
|
||||
@@ -1,20 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'reconnect',
|
||||
description:['reconnect the bot when?'],
|
||||
trustLevel: 1,
|
||||
aliases:['rec'],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
context.source.sendFeedback({ text: `Reconnecting to ${bot.options.host}:${bot.options.port}`, color: 'dark_green'})
|
||||
|
||||
|
||||
bot._client.end()
|
||||
}
|
||||
}
|
||||
/*context.source.sendFeedback('farding right now....')
|
||||
process.exit(1)
|
||||
*/
|
||||
+25
-44
@@ -1,54 +1,35 @@
|
||||
const CommandError = require("../CommandModules/command_error");
|
||||
const buildstring = process.env["buildstring"];
|
||||
const foundation = process.env["FoundationBuildString"];
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const buildstring = process.env['buildstring']
|
||||
const foundation = process.env['FoundationBuildString']
|
||||
module.exports = {
|
||||
name: "say",
|
||||
//<< this one line of code broke it lmao
|
||||
description: ["make me say something in custom chat"],
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
"tellrawsay",
|
||||
"tellrawmsg",
|
||||
"trmessage",
|
||||
"tellrawmessage",
|
||||
"sourcesendfeedbacksay",
|
||||
"sourcesendfeedbackmsg",
|
||||
"sourcesendfeedbackmessage",
|
||||
"ssfbmsg",
|
||||
"ssfmessage",
|
||||
],
|
||||
execute(context) {
|
||||
const message = context.arguments.join(" ");
|
||||
const bot = context.bot;
|
||||
name: 'say',
|
||||
//<< this one line of code broke it lmao
|
||||
description:['make me say something in custom chat'],
|
||||
execute (context) {
|
||||
|
||||
const message = context.arguments.join(' ')
|
||||
const bot = context.bot
|
||||
|
||||
const prefix = {
|
||||
translate: "[%s%s%s] \u203a %s",
|
||||
bold: false,
|
||||
color: "white",
|
||||
with: [
|
||||
{
|
||||
color: "dark_purple",
|
||||
text: "FNF",
|
||||
bold: true,
|
||||
},
|
||||
{
|
||||
color: "#00FFFF",
|
||||
text: "Boyfriend",
|
||||
bold: true,
|
||||
},
|
||||
{ color: "dark_red", text: "Bot", bold: true },
|
||||
translate: '[%s] %s \u203a %s',
|
||||
color:'gray',
|
||||
with: [
|
||||
{ text: 'FNFBoyfriendBot', color:'#00FFFF'},
|
||||
{ selector: `${bot.username}`, color:'#00FFFF'},
|
||||
{ text: '', extra: [`${message}`], color:'white'},
|
||||
|
||||
{ color: "green", text: `${message}` },
|
||||
],
|
||||
};
|
||||
],
|
||||
hoverEvent: { action:"show_text", value: 'FNF Sky is a fangirl but a simp for boyfriend confirmed??'},
|
||||
clickevent: { action:"open_url", value: "https://doin-your.mom"}
|
||||
}
|
||||
|
||||
bot.tellraw([prefix]);
|
||||
},
|
||||
};
|
||||
bot.tellraw([prefix])
|
||||
}
|
||||
}
|
||||
//[%s] %s › %s
|
||||
//was it showing like that before?
|
||||
// just do text bc too sus rn ig
|
||||
// You should remove the with thing and the translate and replace
|
||||
// You should remove the with thing and the translate and replace
|
||||
|
||||
// Parker, why is hashing just random characters???
|
||||
//wdym
|
||||
//wdym
|
||||
@@ -1,107 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'sctoggle',
|
||||
//<< this one line of code broke it lmao
|
||||
description:['selfcare toggle'],
|
||||
aliases:['selfcaretoggle'],
|
||||
trustLevel: 1,
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
if (!args && !args[0] && !args[1] && !args[2]) return
|
||||
switch (args[1]) {
|
||||
case 'vanishon':
|
||||
bot.options.selfcare.vanished = true
|
||||
source.sendFeedback({text:'Vanish selfcare on', color:'green'})
|
||||
break
|
||||
case'vanishoff':
|
||||
source.sendFeedback({text:'Vanish selfcare off', color:'red'})
|
||||
bot.options.selfcare.vanished = false
|
||||
bot.command('vanish off')
|
||||
|
||||
break
|
||||
case 'muteon':
|
||||
source.sendFeedback({text:'Mute selfcare on', color:'green'})
|
||||
bot.options.selfcare.unmuted = true
|
||||
break
|
||||
case 'muteoff':
|
||||
source.sendFeedback({text:'Mute selfcare off', color:'red'})
|
||||
bot.options.selfcare.unmuted = false
|
||||
break
|
||||
case 'tptoggleon':
|
||||
bot.options.selfcare.tptoggle = false
|
||||
bot.command('tptoggle on')
|
||||
source.sendFeedback({text:'Tptoggle on', color:'red'})
|
||||
break
|
||||
case 'tptoggleoff':
|
||||
bot.options.selfcare.tptoggle = true
|
||||
|
||||
source.sendFeedback({text:'Tptoggle off', color: 'green'})
|
||||
break
|
||||
case 'godon':
|
||||
bot.options.selfcare.god = true
|
||||
source.sendFeedback({text:'God selfcare on', color: 'green'})
|
||||
break
|
||||
case 'godoff':
|
||||
bot.options.selfcare.god= false
|
||||
source.sendFeedback({text:'Tptoggle off', color: 'red'})
|
||||
break
|
||||
case 'prefixon':
|
||||
bot.options.selfcare.prefix = true
|
||||
source.sendFeedback({text: 'Prefix selfcare on', color: 'green'})
|
||||
break
|
||||
case 'prefixoff':
|
||||
bot.options.selfcare.prefix = false
|
||||
source.sendFeedback({text:'Prefix selfcare off', color:'red'})
|
||||
break
|
||||
case 'usernameoff':
|
||||
bot.options.selfcare.username = false
|
||||
source.sendFeedback({text:'Username selfcare off', color: 'red'})
|
||||
break
|
||||
case 'usernameon':
|
||||
bot.options.selfcare.username = true
|
||||
source.sendFeedback({text:'Username selfcare on', color:'green'})
|
||||
break
|
||||
case 'skinon':
|
||||
bot.options.selfcare.skin = true
|
||||
source.sendFeedback({text:'Skin selfcare on', color:'green'})
|
||||
break
|
||||
case 'skinoff':
|
||||
bot.options.selfcare.skin = false
|
||||
source.sendFeedback({text:'Skin selfcare off', color:'red'})
|
||||
break
|
||||
case 'cspyon':
|
||||
bot.options.selfcare.cspy = true
|
||||
source.sendFeedback({text:'Cspy selfcare on', color:'green'})
|
||||
break
|
||||
case 'cspyoff':
|
||||
bot.options.selfcare.cspy = false
|
||||
source.sendFeedback({text:'Cspy selfcare off', color:'red'})
|
||||
break
|
||||
case 'nicknameon':
|
||||
bot.options.selfcare.nickname= true
|
||||
source.sendFeedback({text:'Nickname selfcare on', color:'green'})
|
||||
break
|
||||
case 'nicknameoff':
|
||||
bot.options.selfcare.nickname = false
|
||||
source.sendFeedback({text:'Nickname selfcare off', color:'red'})
|
||||
break
|
||||
|
||||
default:
|
||||
source.sendFeedback({text:'Invalid argument', color:'red'})
|
||||
source.sendFeedback({text:'the on arguments are vanishon, muteon, tptoggleon, godon, prefixon, usernameon, skinon, cspyon, nicknameon'})
|
||||
source.sendFeedback({text:'the off arguments are vanishoff, muteoff, tptoggleoff, godoff, prefixoff, usernameoff, skinoff, cspyoff, nicknameoff'})
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
//[%s] %s › %s
|
||||
//was it showing like that before?
|
||||
// just do text bc too sus rn ig
|
||||
// You should remove the with thing and the translate and replace
|
||||
|
||||
// Parker, why is hashing just random characters???
|
||||
//wdym
|
||||
@@ -5,11 +5,9 @@ let timer = null
|
||||
module.exports = {
|
||||
name: 'selfdestruct',
|
||||
//why i put it in here probably cuz so it can be rewritten or smh idk
|
||||
trustLevel: 2,
|
||||
aliases:['sfd'],
|
||||
hashOnly: true,
|
||||
description:['selfdestruct server'],
|
||||
execute (context) {
|
||||
//throw new CommandError('temp disabled')
|
||||
|
||||
//bot went brr
|
||||
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'servereval',
|
||||
description:['no'],
|
||||
trustLevel: 2,
|
||||
aliases:['svreval'],
|
||||
execute (context, arguments, selector) {
|
||||
const bot = context.bot
|
||||
// const args = context.arguments.join(' ')
|
||||
const source = context.source
|
||||
// throw new CommandError('temp disabled')
|
||||
const { stylize } = require('../util/eval_colors')
|
||||
const util = require('util')
|
||||
const args = context.arguments
|
||||
|
||||
const script = args.slice(1).join(' ');
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3] && !args[4] ) return
|
||||
try {
|
||||
source.sendFeedback({ text: util.inspect(eval(script), { stylize }).substring(0, 32700) })
|
||||
source.sendFeedback({ text: `Script input: ${script}` })
|
||||
} catch (err) {
|
||||
source.sendFeedback({ text: err.message, color: 'red' })
|
||||
source.sendFeedback({ text: `Script input: ${script}` })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* try {
|
||||
bot.tellraw({ text: util.inspect(eval(context.arguments.slice().join(' ')), { stylize }).substring(0, 32700) })
|
||||
} catch (err) {
|
||||
bot.tellraw({ text: util.inspect(err).replaceAll('runner', 'runner'), color: 'red' })
|
||||
}
|
||||
*/
|
||||
@@ -0,0 +1,18 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const CommandSource = require('../CommandModules/command_source')
|
||||
module.exports = {
|
||||
name: 'test',
|
||||
description:['very 1st command in the bot to test to see if things are working'],
|
||||
|
||||
execute (context) {
|
||||
|
||||
const bot = context.bot
|
||||
|
||||
const player = context.source.player.profile.name
|
||||
const uuid = context.source.player.uuid
|
||||
const message = context.arguments.join(' ') // WHY SECTION SIGNS!!
|
||||
context.source.sendFeedback(`§aHello, §aWorld!, §aPlayer: §a${player}, §auuid:§a ${uuid}, §aArgument: §a${message}`, false)
|
||||
|
||||
}
|
||||
}
|
||||
//context.source.player.displayName ?? context.source.player.profile.name,
|
||||
@@ -0,0 +1,29 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'testbench',
|
||||
//<< this one line of code broke it lmao
|
||||
description:['represents a actual error'],
|
||||
|
||||
execute (context) {
|
||||
//const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
const prefix = {
|
||||
translate: '%s%s ',
|
||||
bold: true,
|
||||
color: 'dark_gray',
|
||||
with: [
|
||||
{ color: 'dark_red', text: 'a' },
|
||||
{ color: 'gold', text: 'e' },
|
||||
|
||||
]
|
||||
}
|
||||
|
||||
bot.chat(['tellraw', prefix])
|
||||
}
|
||||
}
|
||||
//[%s] %s › %s
|
||||
//was it showing like that before?
|
||||
// just do text bc too sus rn ig
|
||||
// You should remove the with thing and the translate and replace
|
||||
@@ -1,25 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'time',
|
||||
description:['check the time'],
|
||||
aliases:['clock', 'timezone'],
|
||||
trustLevel: 0,
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
const moment = require('moment-timezone')
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
const timezone = args.join(' ')
|
||||
|
||||
if (!moment.tz.names().map((zone) => zone.toLowerCase()).includes(timezone.toLowerCase())) {
|
||||
throw new CommandError('Invalid timezone')
|
||||
}
|
||||
|
||||
const momented = moment().tz(timezone).format('dddd, MMMM Do, YYYY, hh:mm:ss A')
|
||||
const component = [{ text: 'The current date and time for the timezone ', color: 'white' }, { text: timezone, color: 'aqua' }, { text: ' is: ', color: 'white' }, { text: momented, color: 'green' }]
|
||||
|
||||
source.sendFeedback(component)
|
||||
}
|
||||
}
|
||||
+3
-5
@@ -3,19 +3,17 @@ const between = require('../util/between')
|
||||
module.exports = {
|
||||
name: 'tpr',
|
||||
description:['teleport to a random place'],
|
||||
trustLevel: 0,
|
||||
aliases:['rtp', 'teleportrandom', 'randomteleport'],
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const sender = context.source.player
|
||||
const source = context.source
|
||||
|
||||
if (!sender) return
|
||||
|
||||
const x = between(-1_000_000, 1_000_000)
|
||||
const y = 100
|
||||
const z = between(-1_000_000, 1_000_000)
|
||||
source.sendFeedback(`Randomly Teleported: ${sender.profile.name} to x:${x} y:${y} z:${z} `)
|
||||
|
||||
bot.core.run(`tp ${sender.uuid} ${x} ${y} ${z}`)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'tpsbar',
|
||||
//<< this one line of code broke it lmao
|
||||
description:['tps'],
|
||||
trustLevel: 0,
|
||||
aliases:['tickspersecondbar', 'tickspersecond', 'tps'],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
switch (args[0]) {
|
||||
case 'on':
|
||||
bot.tps.on()
|
||||
|
||||
source.sendFeedback({text: 'TPSBar is now enabled', color:'green'})
|
||||
break
|
||||
case 'off':
|
||||
bot.tps.off()
|
||||
source.sendFeedback({text:'TPSBar is now disabled', color:'red'})
|
||||
|
||||
break
|
||||
default:
|
||||
throw new CommandError('Invalid argument')
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
//[%s] %s › %s
|
||||
//was it showing like that before?
|
||||
// just do text bc too sus rn ig
|
||||
// You should remove the with thing and the translate and replace
|
||||
|
||||
// Parker, why is hashing just random characters???
|
||||
//wdym
|
||||
@@ -1,32 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'translate',
|
||||
//<< this one line of code broke it lmao
|
||||
description:['<language 1> <language 2> <message>'],
|
||||
aliases:['translation'],
|
||||
trustLevel: 0,
|
||||
async execute (context) {
|
||||
const { translate } = require('@vitalets/google-translate-api')
|
||||
const message = context.arguments.join(' ')
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const amonger = args.slice(1).join(' ');
|
||||
const source = context.source
|
||||
try {
|
||||
const res = await translate(args.slice(2).join(' '), { from: args.slice(1).join(' '), to: args[1] })
|
||||
bot.tellraw([{ text: 'Result: ', color: 'gold' }, { text: res.text, color: 'green' }])
|
||||
} catch (e) {
|
||||
source.sendFeedback({ text: e, color: 'red' })
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
//[%s] %s › %s
|
||||
//was it showing like that before?
|
||||
// just do text bc too sus rn ig
|
||||
// You should remove the with thing and the translate and replace
|
||||
|
||||
// Parker, why is hashing just random characters???
|
||||
//wdym
|
||||
+5
-43
@@ -3,8 +3,7 @@ const urban = require('urban-dictionary')
|
||||
module.exports = {
|
||||
name: 'urban',
|
||||
description:['urban dictionary'],
|
||||
aliases:['urbandictionary'],
|
||||
trustLevel: 0,
|
||||
|
||||
async execute (context) {
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
@@ -16,53 +15,16 @@ trustLevel: 0,
|
||||
{ color: 'dark_red', text: 'Urban Cmd'},
|
||||
]
|
||||
}
|
||||
const example = {
|
||||
translate: '%s - ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'dark_gray', text: 'Example text'},
|
||||
]
|
||||
}
|
||||
const definition5 = {
|
||||
translate: '%s - ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'dark_gray', text: 'Definition text'},
|
||||
]
|
||||
}
|
||||
|
||||
try {
|
||||
const definitions = await urban.define(args.join(' '))
|
||||
const definitions2 = await urban.define(args.join(' '))
|
||||
//const definitions2 = await urban.example(args.join(' '))
|
||||
|
||||
for (const definition of definitions) {
|
||||
source.sendFeedback([cmd, example, { text: definition.example.replaceAll("\r", ""), color: 'gray' }, { text: ' - ', color: 'white' }])
|
||||
source.sendFeedback([cmd, definition5,{ text: definition.definition.replaceAll("\r", ""), color: 'gray' } ])
|
||||
}
|
||||
urban.define(args.join(' ')).then((results) => {
|
||||
source.sendFeedback([cmd,{text:`Definition: ${results[0].word}`, color:'dark_gray'}])
|
||||
source.sendFeedback([cmd,{text:`Author: ${results[0].author}`, color:'dark_gray'}])
|
||||
//source.sendFeedback(results[0].thumbs_down)
|
||||
source.sendFeedback([cmd,{text:`👍 ${results[0].thumbs_up} | 👎 ${results[0].thumbs_down}`, color:'gray'}])
|
||||
|
||||
|
||||
//source.sendFeedback(results[0].written_on)
|
||||
|
||||
//thumbs_down
|
||||
|
||||
|
||||
//source.sendFeedback(results[0].data)
|
||||
})
|
||||
// source.sendFeedback([cmd, { text: definitions2.replaceAll("\r", ""), color: 'white' }, { text: ' - ', color: 'white' }, { text: definition.definition.replaceAll("\r", ""), color: 'white' }])
|
||||
//console.log(urban.define.definition.example(args.join(' ')))
|
||||
|
||||
|
||||
//text: definition.word text: definition.definition
|
||||
source.sendFeedback([cmd, { text: definition.word.replaceAll("\r", ""), color: 'white' }, { text: ' - ', color: 'white' }, { text: definition.definition.replaceAll("\r", ""), color: 'white' }])
|
||||
}//text: definition.word text: definition.definition
|
||||
} catch (e) {
|
||||
source.sendFeedback([cmd,{ text: e.toString(), color: 'red' }])
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-16
@@ -2,23 +2,11 @@ module.exports = {
|
||||
name: 'validate',
|
||||
description:['validate in the bot'],
|
||||
|
||||
trustLevel: 1,
|
||||
aliases:['val'],
|
||||
hashOnly: true,
|
||||
execute (context) {
|
||||
const source = context.source
|
||||
const bot = context.bot
|
||||
const hash = bot.hash
|
||||
const args = context.arguments
|
||||
const ownerhash = bot.owner
|
||||
const discordHash = bot.hashing.hash
|
||||
if (args[0] === hash) {
|
||||
source.sendFeedback({ text: 'Valid Hash', color: 'green' })
|
||||
}else if (args[0] === ownerhash) {
|
||||
source.sendFeedback({text: 'Valid OwnerHash', color:'green'})
|
||||
}
|
||||
else if (discordHash) {
|
||||
source.sendFeedback({ text: 'Valid Hash', color: 'green' })
|
||||
}
|
||||
|
||||
|
||||
source.sendFeedback({ text: 'Valid Hash', color: 'dark_green' })
|
||||
}
|
||||
}
|
||||
//if (args[0] === hash) {
|
||||
@@ -1,29 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
//const fetch = import("node-fetch");
|
||||
module.exports = {
|
||||
name: 'website',
|
||||
trustLevel:1,
|
||||
aliases:['web','websitedata','webdata'],
|
||||
description:['check website data'],
|
||||
async execute (context) {
|
||||
try{
|
||||
const fetch = require("node-fetch");
|
||||
const source = context.source
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
const args = context.arguments
|
||||
if (!args && !args[0] && !args[1] && !args[2]) return
|
||||
const response = await fetch(args[1]);
|
||||
const body = await response.text();
|
||||
|
||||
bot.tellraw({text:body,color:'green'})
|
||||
|
||||
} catch(e) {
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
// source.sendFeedback({text:e.stack, color:'dark_red'})
|
||||
source.sendFeedback({text:e.toString(), color:'dark_red'})
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
-20
@@ -2,31 +2,20 @@ const wiki = require('wikipedia') //
|
||||
module.exports = {
|
||||
name: 'wiki',
|
||||
description:['wikipedia'],
|
||||
trustLevel: 0,
|
||||
aliases:['wikipedia'],
|
||||
|
||||
async execute (context) {
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
const cmd = {
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'dark_green', text: 'Wiki Cmd'},
|
||||
]
|
||||
}
|
||||
try {
|
||||
try {
|
||||
const page = await wiki.page(args.join(' '))
|
||||
// const summary = await page.images()
|
||||
const summary2 = await page.intro()
|
||||
|
||||
//const definitions = await urban.define(args.join(' '))
|
||||
/// console.log(summary)
|
||||
|
||||
// source.sendFeedback({ text: JSON.stringify(summary), color: 'green' })
|
||||
source.sendFeedback([cmd,{ text:`${summary2}`, color: 'green' }])
|
||||
const summary = await page.summary()
|
||||
//const definitions = await urban.define(args.join(' '))
|
||||
|
||||
|
||||
source.sendFeedback({ text: summary.extract, color: 'green' })
|
||||
|
||||
} catch (e) {
|
||||
source.sendFeedback([cmd, { text: `${e}`, color: 'red' }])
|
||||
source.sendFeedback({ text: e.stack, color: 'red' })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
|
||||
{
|
||||
"bots": [
|
||||
{
|
||||
"host": "kaboom.pw",
|
||||
|
||||
"version":"1.20.2",
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
},
|
||||
"Core": {
|
||||
"customName":"https://doin-your.mom"
|
||||
},
|
||||
"discord": {
|
||||
"channelId": "1106441703046529084",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"host": "24.69.170.247",
|
||||
"version":"1.20.2",
|
||||
|
||||
"reconnectDelay": 10000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
|
||||
},
|
||||
"Core": {
|
||||
"customName":"https://doin-your.mom"
|
||||
},
|
||||
|
||||
"discord": {
|
||||
"channelId": "1155826836954157136",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"host": "kaboom.fusselig.xyz",
|
||||
"version":"1.20.2",
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
|
||||
},
|
||||
"Core": {
|
||||
"customName":"https://doin-your.mom"
|
||||
},
|
||||
|
||||
"discord": {
|
||||
"channelId": "1106393124110086174",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
},
|
||||
{
|
||||
"host": "mc.opengamesllc.com",
|
||||
"version":"1.20.2",
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
|
||||
},
|
||||
"Core": {
|
||||
"customName":"https://doin-your.mom"
|
||||
},
|
||||
|
||||
"discord": {
|
||||
"channelId": "1167253115557400726",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
-54
@@ -1,54 +0,0 @@
|
||||
|
||||
{
|
||||
module.exports = {
|
||||
|
||||
bots: [
|
||||
{
|
||||
host: "server ip here or comment this out and refer to the bot.js file",
|
||||
version:"1.20.1",//version here
|
||||
reconnectDelay: 6000,
|
||||
username:username(),
|
||||
console:true,
|
||||
input: true,
|
||||
Core: {
|
||||
customName:"core custom name here",
|
||||
core: true,
|
||||
interval:180000
|
||||
},
|
||||
discord: {
|
||||
channelId: "discord channel ip here",
|
||||
invite: "discord invite link here",
|
||||
commandPrefix: "discord command prefix here"
|
||||
},
|
||||
selfcare: {
|
||||
vanished: true,
|
||||
unmuted: true,
|
||||
prefix: true,
|
||||
cspy: true,
|
||||
tptoggle:true,
|
||||
skin:true,
|
||||
gmc:true,
|
||||
op:true,
|
||||
nickname:true,
|
||||
username:true,
|
||||
god: true,
|
||||
interval:500,
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function username() {
|
||||
const characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; // remove sus characters like ` or like ( or whatever because it breaks whatever
|
||||
let username = '';
|
||||
for (let i = 0; i < 9; i++) {
|
||||
const randomIndex = Math.floor(Math.random() * characters.length);
|
||||
username += characters[randomIndex];
|
||||
}
|
||||
return username;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
{
|
||||
"bots": [
|
||||
{
|
||||
"host": "localhost",
|
||||
|
||||
"version":"1.20.1",
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "default~"
|
||||
},
|
||||
"Core": {
|
||||
"customName":"CoreCustomNameHere"
|
||||
},
|
||||
|
||||
"discord": {
|
||||
"channelId": "discordchannelidhere",
|
||||
"invite": "discordlinkhere",
|
||||
"commandPrefix": "default~"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
{
|
||||
"host": "kaboom.pw",
|
||||
|
||||
"version":"1.20.1",
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
},
|
||||
|
||||
"discord": {
|
||||
"channelId": "1106441703046529084",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
},
|
||||
{
|
||||
"host": "kitsune.icu",
|
||||
"version":"1.20.1",
|
||||
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
|
||||
},
|
||||
|
||||
|
||||
"discord": {
|
||||
"channelId": "1136358568354910309",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"host": "chipmunk.land",
|
||||
"version":"1.20.1",
|
||||
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
|
||||
},
|
||||
|
||||
|
||||
"discord": {
|
||||
"channelId": "1134168126083305603",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"host": "kaboom.fusselig.xyz",
|
||||
"version":"1.20.1",
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
|
||||
},
|
||||
|
||||
|
||||
"discord": {
|
||||
"channelId": "1106393124110086174",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"host": "24.69.170.247",
|
||||
"version":"1.20.1",
|
||||
"port":"25564",
|
||||
"reconnectDelay": 10000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
|
||||
},
|
||||
"Core": {
|
||||
"customName":"https://doin-your.mom"
|
||||
},
|
||||
"CustomChat": {
|
||||
|
||||
"text":"FNFBoyfriendBot",
|
||||
"color":"#00FFFF"
|
||||
},
|
||||
"discord": {
|
||||
"channelId": "1160591700327145512",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
},
|
||||
{
|
||||
"host": "24.69.170.247",
|
||||
"version":"1.20.1",
|
||||
"port":"25564",
|
||||
"reconnectDelay": 10000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
|
||||
},
|
||||
"Core": {
|
||||
"customName":"https://doin-your.mom"
|
||||
},
|
||||
"CustomChat": {
|
||||
|
||||
"text":"FNFBoyfriendBot",
|
||||
"color":"#00FFFF"
|
||||
},
|
||||
"discord": {
|
||||
"channelId": "1160591700327145512",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"host": "172.126.70.0",
|
||||
"version":"1.20.1",
|
||||
"reconnectDelay": 10000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
|
||||
},
|
||||
"Core": {
|
||||
"customName":"https://doin-your.mom"
|
||||
},
|
||||
"CustomChat": {
|
||||
|
||||
"text":"FNFBoyfriendBot",
|
||||
"color":"#00FFFF"
|
||||
},
|
||||
"discord": {
|
||||
"channelId": "1155826772403814491",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
},
|
||||
@@ -1,94 +1,26 @@
|
||||
const util = require("util");
|
||||
const createBot = require("./bot.js");
|
||||
|
||||
const createBot = require('./bot.js')
|
||||
//const chomensjs = require('./ChomensJS')
|
||||
// TODO: Load a default config
|
||||
const fs = require("fs");
|
||||
const fileExist = require("./util/file-exists");
|
||||
const path = require("path");
|
||||
const readline = require("readline");
|
||||
const config = require('./config.json')
|
||||
const readline = require('readline')
|
||||
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
});
|
||||
})
|
||||
require('dotenv').config()
|
||||
const bots = []
|
||||
for (const options of config.bots) {
|
||||
const bot = createBot(options)
|
||||
bots.push(bot)
|
||||
bot.bots = bots
|
||||
bot.console.useReadlineInterface(rl)
|
||||
|
||||
function load() {
|
||||
//const config = require('./config.js')
|
||||
|
||||
require("dotenv").config();
|
||||
const bots = [];
|
||||
for (const options of config.bots) {
|
||||
const bot = createBot(options);
|
||||
bots.push(bot);
|
||||
bot.bots = bots;
|
||||
bot.options.username;
|
||||
bot.loadModule = (module) => module(bot, options);
|
||||
|
||||
for (const filename of fs.readdirSync(path.join(__dirname, "modules"))) {
|
||||
try {
|
||||
const module = require(path.join(__dirname, "modules", filename));
|
||||
bot.loadModule(module);
|
||||
} catch (error) {
|
||||
console.error(
|
||||
"\x1b[0m\x1b[91m[ERROR]: \x1b[0m\x1b[90mFailed to load module",
|
||||
filename,
|
||||
":",
|
||||
error,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
bot.console.useReadlineInterface(rl);
|
||||
|
||||
// bot.on('error', (error), util.inspect(error))
|
||||
|
||||
try {
|
||||
bot.on("error", console.error);
|
||||
} catch (error) {
|
||||
console.log(error.stack);
|
||||
}
|
||||
}
|
||||
bot.on('error', console.error)
|
||||
}
|
||||
|
||||
const modules = "./modules";
|
||||
const util2 = "./util";
|
||||
const CommandModules = "./CommandModules";
|
||||
const commands = "./commands";
|
||||
const chat = "./chat";
|
||||
fs.readdir(util2, (err, files) => {
|
||||
console.log("Successfully loaded: " + files.length + " util files");
|
||||
});
|
||||
fs.readdir(modules, (err, files) => {
|
||||
console.log("Successfully loaded: " + files.length + " module files");
|
||||
});
|
||||
fs.readdir(commands, (err, files) => {
|
||||
console.log("Successfully loaded: " + files.length + " command files");
|
||||
});
|
||||
fs.readdir(CommandModules, (err, files) => {
|
||||
console.log("Successfully loaded: " + files.length + " CommandModule files");
|
||||
});
|
||||
fs.readdir(chat, (err, files) => {
|
||||
console.log("Successfully loaded: " + files.length + " chat files");
|
||||
});
|
||||
|
||||
async function checkConfig() {
|
||||
if (!(await fileExist(path.join(__dirname, "config.js")))) {
|
||||
console.error("Config not found! Creating a new Config from ");
|
||||
await fs.copyFile(
|
||||
path.join(__dirname, "default.js"),
|
||||
path.join(__dirname, "config.js"),
|
||||
);
|
||||
}
|
||||
if (await fileExist(path.join(__dirname, "config.js"))) {
|
||||
console.log("Config found! loading config please wait,......");
|
||||
}
|
||||
|
||||
config = require("./config.js");
|
||||
|
||||
load();
|
||||
if (process.env['anti-skid'] !== 'amogus is sus') {
|
||||
console.log('just no')
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
checkConfig();
|
||||
|
||||
process.on("uncaughtException", (e) => {
|
||||
console.log("uncaught " + e.stack);
|
||||
});
|
||||
//https://beta.character.ai/chat?char=-LojS2FMmI6dLLG4cPzCm1xIIpgwVktHwjHRIImfXSE
|
||||
|
||||
+337
-1120
File diff suppressed because it is too large
Load Diff
@@ -1,27 +0,0 @@
|
||||
const convert = require('color-convert')
|
||||
|
||||
function bruhify (bot) {
|
||||
bot.bruhifyText = ''
|
||||
let startHue = 0
|
||||
const timer = setInterval(() => {
|
||||
if (bot.bruhifyText === '') return
|
||||
let tag = 'bruhify'
|
||||
let hue = startHue
|
||||
const displayName = bot.bruhifyText
|
||||
const increment = (360 / Math.max(displayName.length, 20))
|
||||
const component = []
|
||||
for (const character of displayName) {
|
||||
const color = convert.hsv.hex(hue, 100, 100)
|
||||
component.push({ text: character, color: `#${color}` })
|
||||
hue = (hue + increment) % 360
|
||||
}
|
||||
bot.core.run(`minecraft:title @a actionbar ${JSON.stringify(component)}`)
|
||||
|
||||
startHue = (startHue + increment) % 360
|
||||
}, 100)
|
||||
|
||||
bot.on('end', () => {
|
||||
// clearInterval(timer)
|
||||
})
|
||||
}
|
||||
module.exports = bruhify
|
||||
+20
-190
@@ -2,9 +2,8 @@ const loadPrismarineChat = require('prismarine-chat')
|
||||
const kaboomChatParser = require('../chat/kaboom')
|
||||
const chipmunkmodChatParser = require('../chat/chipmunkmod')
|
||||
const chipmunkmodblackilykatverChatParser = require('../chat/chipmunkmodBlackilyKatVer')
|
||||
const typetextChatParser = require('../chat/chatTypeText')
|
||||
const typeemotetextChatParser = require('../chat/chatTypeEmote')
|
||||
const fs = require('fs')
|
||||
const lang = require('../lolus.json')
|
||||
|
||||
function tryParse (json) {
|
||||
try {
|
||||
return JSON.parse(json)
|
||||
@@ -13,13 +12,13 @@ function tryParse (json) {
|
||||
}
|
||||
}
|
||||
//what was changed??
|
||||
function chat (bot, context) {
|
||||
function inject (bot) {
|
||||
let ChatMessage
|
||||
bot.on('registry_ready', registry => {
|
||||
ChatMessage = loadPrismarineChat(registry)
|
||||
})
|
||||
|
||||
bot.chatParsers = [kaboomChatParser, chipmunkmodChatParser, chipmunkmodblackilykatverChatParser, typetextChatParser, typeemotetextChatParser]
|
||||
|
||||
bot.chatParsers = [kaboomChatParser, chipmunkmodChatParser, chipmunkmodblackilykatverChatParser]
|
||||
|
||||
bot.on('packet.profileless_chat', packet => {
|
||||
const message = tryParse(packet.message)
|
||||
@@ -42,23 +41,25 @@ function chat (bot, context) {
|
||||
//packet.chatType_
|
||||
bot.on('packet.player_chat', packet => {
|
||||
const unsigned = tryParse(packet.unsignedChatContent)
|
||||
|
||||
|
||||
bot.emit('player_chat', { plain: packet.plainMessage, unsigned, senderUuid: packet.senderUuid})
|
||||
const message = tryParse(packet.content)
|
||||
|
||||
|
||||
bot.emit('message', unsigned)
|
||||
|
||||
var vanillakeys = [
|
||||
'chat.type.text',
|
||||
'chat.type.announcement',
|
||||
'chat.type.emote'
|
||||
]
|
||||
|
||||
|
||||
tryParsingMessage(unsigned, { senderUuid: packet.senderUuid, players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine})
|
||||
|
||||
})
|
||||
tryParsingMessage(unsigned, { senderUuid: packet.senderUuid, players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine, chatType: vanillakeys})
|
||||
|
||||
})
|
||||
|
||||
bot.on('packet.system_chat', packet => {
|
||||
const message = tryParse(packet.content)
|
||||
|
||||
if (message.translate === 'advMode.setCommand.success') return // Ignores command set messages
|
||||
|
||||
|
||||
bot.emit('system_chat', { message, actionbar: packet.isActionBar })
|
||||
|
||||
if (packet.isActionBar) {
|
||||
@@ -69,13 +70,7 @@ function chat (bot, context) {
|
||||
|
||||
tryParsingMessage(message, { players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine })
|
||||
})
|
||||
/*bot.on('message', async (chatMessage) => {
|
||||
if (typeof chatMessage.translate === 'string' && chatMessage.translate.startsWith('advMode.')) return
|
||||
console.log(chatMessage.toAnsi())
|
||||
*/
|
||||
if (fs.existsSync('../FridayNightFunkinBoyfriendBot') == false) {
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
function tryParsingMessage (message, data) {
|
||||
let parsed
|
||||
for (const parser of bot.chatParsers) {
|
||||
@@ -108,7 +103,6 @@ function chat (bot, context) {
|
||||
bot._client.write('chat_message', {
|
||||
message,
|
||||
timestamp: BigInt(Date.now()),
|
||||
|
||||
salt: 0n,
|
||||
offset: 0,
|
||||
acknowledged: bitset
|
||||
@@ -116,172 +110,8 @@ function chat (bot, context) {
|
||||
})
|
||||
|
||||
}
|
||||
/*
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('amogus')) {
|
||||
bot.chat('amongus is very sus &4&lඞ')
|
||||
} return
|
||||
})
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('fard')) {
|
||||
bot.chat('fart')
|
||||
} return
|
||||
})
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('stroke')) {
|
||||
bot.chat('&4&l&kfaslkjdfhlaskdjfhlaskjfhlakjdfhluiqwhefloewhfkjhasdlfkjhaldkfjhaslfdjhlhadfhlafdshlksajdfhkajsdfhkhjfaslkjdfhlaskdjfhlaskjfhlakjdfhluiqwhefloewhfkjhasdlfkjhaldkfjhaslfdjhlhadfhlafdshlksajdfhkajsdfhkhj')
|
||||
} return
|
||||
})/*
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('true')) {
|
||||
bot.chat(' false')
|
||||
} return
|
||||
})
|
||||
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('false')) {
|
||||
bot.chat(' true')
|
||||
} return
|
||||
})
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('beep')) {
|
||||
bot.chat('bee do ba')
|
||||
} return
|
||||
})
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('maniaplay')) {
|
||||
bot.chat('&4[&c&lOP&4] &cmaniaplay: i hate command cores i hope everyone who uses them dies in their sleep 😊')
|
||||
} return
|
||||
})
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('null')) {
|
||||
bot.chat('n u l l')
|
||||
|
||||
} return
|
||||
})
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('undefined')) {
|
||||
bot.chat('my brain is undefined')
|
||||
|
||||
} return
|
||||
})
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('nya')) {
|
||||
bot.chat(' nya~')
|
||||
|
||||
} return
|
||||
})
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('mrrow')) {
|
||||
bot.chat(' mrrow')
|
||||
|
||||
} return
|
||||
})
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('uwu')) {
|
||||
bot.chat(' OwO')
|
||||
|
||||
} return
|
||||
})
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('owo')) {
|
||||
bot.chat(' UwU')
|
||||
|
||||
} return
|
||||
})
|
||||
|
||||
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('what time is it')) {
|
||||
bot.chat('time for you to get a watch')
|
||||
} return
|
||||
})
|
||||
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('69')) {
|
||||
bot.chat('funni number')
|
||||
} return
|
||||
})
|
||||
/* bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('real')) {
|
||||
bot.chat('very')
|
||||
} return
|
||||
})*/
|
||||
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('meow')) {
|
||||
bot.chat(' :3')
|
||||
} return
|
||||
})
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('qwerty')) {
|
||||
bot.chat(' qwerty')
|
||||
} return
|
||||
})
|
||||
/*
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('')) {
|
||||
bot.chat('')
|
||||
} return
|
||||
})
|
||||
*/
|
||||
|
||||
|
||||
bot.command = command => {
|
||||
bot._client.write('chat_command', {
|
||||
command,
|
||||
@@ -298,4 +128,4 @@ function chat (bot, context) {
|
||||
bot.tellraw = (message, selector = '@a') => bot.core.run('minecraft:tellraw @a ' + JSON.stringify(message)) // ? Should this be here?
|
||||
}
|
||||
|
||||
module.exports = chat
|
||||
module.exports = inject
|
||||
|
||||
@@ -1,89 +1,35 @@
|
||||
const CommandSource = require("../CommandModules/command_source");
|
||||
const CommandError = require("../CommandModules/command_error");
|
||||
const CommandSource = require('../CommandModules/command_source')
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
function chat_command_handler(bot) {
|
||||
bot.on("parsed_message", (data) => {
|
||||
if (data.type !== "minecraft:chat") return;
|
||||
function inject (bot) {
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString();
|
||||
if (
|
||||
!plainMessage.startsWith(bot.commandManager.MainPrefix) &&
|
||||
!plainMessage.startsWith(bot.commandManager.SecondaryPrefix) &&
|
||||
!plainMessage.startsWith(bot.commandManager.TertiaryPrefix)
|
||||
)
|
||||
return;
|
||||
// else if (!plainMessage.startsWith(bot.commandManager.prefix2)) return
|
||||
// MainPrefix: "~",
|
||||
// SecondaryPrefix:'%',
|
||||
//TertiaryPrefix:'@'
|
||||
|
||||
const command = plainMessage.substring(
|
||||
bot.commandManager.MainPrefix.length ||
|
||||
plainMessage.substring(
|
||||
bot.commandManager.SecondaryPrefix.length ||
|
||||
plainMessage.substring(bot.commandManager.TertiaryPrefix.length),
|
||||
),
|
||||
); // if the prefixes are the same length just make it 1 or the length
|
||||
/*
|
||||
lifes sus
|
||||
*/
|
||||
const source = new CommandSource(
|
||||
data.sender,
|
||||
{ discord: false, console: false },
|
||||
true,
|
||||
);
|
||||
source.sendFeedback = (message) => {
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (!plainMessage.startsWith(bot.commandManager.prefix)) return
|
||||
const command = plainMessage.substring(bot.commandManager.prefix.length)
|
||||
|
||||
const source = new CommandSource(data.sender, { discord: false, console: false }, true)
|
||||
source.sendFeedback = message => {
|
||||
const prefix = {
|
||||
translate: "[%s%s%s] \u203a ",
|
||||
bold: false,
|
||||
color: "dark_gray",
|
||||
with: [
|
||||
{
|
||||
color: "dark_purple",
|
||||
text: "FNF",
|
||||
bold: true,
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: `${process.env["buildstring"]}\n${process.env["FoundationBuildString"]}`,
|
||||
},
|
||||
clickEvent: bot.options.Core.customName
|
||||
? { action: "open_url", value: bot.options.Core.customName }
|
||||
: undefined,
|
||||
},
|
||||
{
|
||||
color: "#00FFFF",
|
||||
text: "Boyfriend",
|
||||
bold: true,
|
||||
clickEvent: bot.options.discord.invite
|
||||
? { action: "open_url", value: bot.options.discord.invite }
|
||||
: undefined,
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: `Bot Username: ${bot.username}\nBot UUID: ${bot.uuid}\nServer Host: ${bot.options.host}:${bot.options.port}\nBot Minecraft Java Version: ${bot.options.version}`,
|
||||
},
|
||||
},
|
||||
{
|
||||
color: "dark_red",
|
||||
text: "Bot",
|
||||
bold: true,
|
||||
clickEvent: bot.options.discord.invite
|
||||
? { action: "open_url", value: "https://code.chipmunk.land" }
|
||||
: undefined,
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: "§aMan i like frogs - _ChipMC_",
|
||||
},
|
||||
}, //§aMan i like frogs - _ChipMC_
|
||||
translate: '[%s%s%s] \u203a ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'dark_purple', text: 'FNF', bold:true },
|
||||
{ color: 'aqua', text: 'Boyfriend', bold:true },
|
||||
{ color: 'dark_red', text: 'Bot', bold:true},
|
||||
|
||||
{ color: "green", text: command.split(" ")[0] },
|
||||
],
|
||||
};
|
||||
{ color: 'green', text: command.split(' ')[0] }
|
||||
]
|
||||
}
|
||||
|
||||
bot.tellraw(['', prefix, message])
|
||||
}
|
||||
|
||||
bot.tellraw(["", prefix, message]);
|
||||
};
|
||||
bot.commandManager.executeString(source, command)
|
||||
|
||||
bot.commandManager.executeString(source, command);
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = chat_command_handler;
|
||||
module.exports = inject
|
||||
+8
-32
@@ -1,5 +1,4 @@
|
||||
const nbt = require('prismarine-nbt');
|
||||
async function command_core (bot, options) {
|
||||
function inject (bot, options) {
|
||||
bot.core = {
|
||||
// what you think im doing? look at line 17
|
||||
area: {
|
||||
@@ -15,11 +14,9 @@ async function command_core (bot, options) {
|
||||
|
||||
if (!pos) return
|
||||
|
||||
bot.command(`fill ${pos.x + start.x} ${pos.y + start.y} ${pos.z + start.z} ${pos.x + end.x} ${pos.y + end.y} ${pos.z + end.z} repeating_command_block{CustomName: '{"text":"${bot.options.Core.customName}","color":"#00FFFF","clickEvent":{"action":"open_url","value":"https://chipmunk.land"}}'} destroy`)
|
||||
|
||||
bot.command(`fill ${pos.x + start.x} ${pos.y + start.y} ${pos.z + start.z} ${pos.x + end.x} ${pos.y + end.y} ${pos.z + end.z} repeating_command_block{CustomName: '{"text":"${bot.options.Core.customName}","color":"dark_red","clickEvent":{"action":"open_url","value":"${bot.options.Core.customName}"}}'} destroy`)
|
||||
},
|
||||
|
||||
|
||||
move (pos = bot.position) {
|
||||
bot.core.position = {
|
||||
x: Math.floor(pos.x / 16) * 16,
|
||||
@@ -32,7 +29,7 @@ async function command_core (bot, options) {
|
||||
currentBlock () {
|
||||
const relativePosition = bot.core.currentBlockRelative
|
||||
const corePosition = bot.core.position
|
||||
if (!corePosition) return -1
|
||||
if (!corePosition) return null
|
||||
return { x: relativePosition.x + corePosition.x, y: relativePosition.y + corePosition.y, z: relativePosition.z + corePosition.z }
|
||||
},
|
||||
|
||||
@@ -63,37 +60,16 @@ async function command_core (bot, options) {
|
||||
const location = bot.core.currentBlock()
|
||||
if (!location) return
|
||||
|
||||
bot._client.write('update_command_block', { command: command.substring(0, 32767), location, mode: 1, flags: 0b100 })
|
||||
bot._client.write('update_command_block', { command, location, mode: 1, flags: 0b100 })
|
||||
|
||||
bot.core.incrementCurrentBlock()
|
||||
|
||||
// added .substring(0, 32767) so it won't kick the bot if the command is too long.
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
/*
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith(':3')) {
|
||||
bot.chat(' :3')
|
||||
} return
|
||||
})
|
||||
*/
|
||||
if (!bot.options.Core.core) return
|
||||
bot.on('move', () => {
|
||||
bot.core.move(bot.position)
|
||||
//setTimeout(() => bot.core.run('say hi'), 100)
|
||||
// setTimeout(() => bot.core.run('say Hello, world!'), 1000)
|
||||
})
|
||||
bot.on('packet.login', (data) =>{
|
||||
const timer = setInterval(() => {
|
||||
bot.core.refill()
|
||||
}, bot.options.Core.interval)
|
||||
bot.on('end', (bot) => {
|
||||
clearInterval(timer)
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
module.exports = command_core
|
||||
|
||||
module.exports = inject
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
function command_loop_manager (bot, options) {
|
||||
function inject (bot, options) {
|
||||
bot.cloop = {
|
||||
list: [],
|
||||
|
||||
@@ -16,7 +16,6 @@ function command_loop_manager (bot, options) {
|
||||
this.list = []
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = command_loop_manager
|
||||
module.exports = inject
|
||||
|
||||
+79
-172
@@ -1,185 +1,92 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const CommandError = require("../CommandModules/command_error.js");
|
||||
//check command_source
|
||||
//it would be both the command_source.js and command_manager.js files
|
||||
function command_manager(bot, options) {
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const CommandError = require('../CommandModules/command_error.js')
|
||||
|
||||
function inject (bot, options) {
|
||||
bot.commandManager = {
|
||||
MainPrefix: options.commands.MainPrefix ?? "default",
|
||||
SecondaryPrefix: options.commands.SecondaryPrefix ?? "default",
|
||||
TertiaryPrefix: options.commands.TertiaryPrefix ?? "default",
|
||||
prefix: options.commands?.prefix ?? 'default',
|
||||
commands: {},
|
||||
commandlist: [],
|
||||
//ohio
|
||||
execute(source, commandName, args, message) {
|
||||
const command = this.getCommand(commandName.toLowerCase());
|
||||
//Unknown command. Type "/help" for help
|
||||
const now = new Date().toLocaleString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
amogus: [],
|
||||
//ohio
|
||||
execute (source, commandName, args) {
|
||||
const command = this.getCommand(commandName.toLowerCase())
|
||||
//Unknown command. Type "/help" for help
|
||||
try {
|
||||
if (!command || !command.execute)
|
||||
throw new CommandError({
|
||||
translate: `Unknown command %s. Type "${bot.options.commands.MainPrefix}help" for help or click on this for the command`,
|
||||
with: [commandName],
|
||||
clickEvent: bot.options.Core.customName
|
||||
? {
|
||||
action: "suggest_command",
|
||||
value: `${bot.options.commands.MainPrefix}help`,
|
||||
}
|
||||
: undefined,
|
||||
}); //ohio
|
||||
if (!command || !command.execute) throw new CommandError({ translate: 'Unknown command %s. Type "~help" for help', with: [commandName]})
|
||||
//command.unknown.argument command.unknown.command
|
||||
//command.context.here
|
||||
let hash = 1
|
||||
let owner = 2
|
||||
if (command.consoleOnly && !source.sources.console) throw new CommandError({ translate: 'This command can only be executed via console', color: 'dark_red' })
|
||||
if (command.hash && args.length === 0 && source.hash) throw new CommandError({ translate: 'Please provide a hash', color: 'red' })
|
||||
if (command.owner && args.length === 0 && source.owner) throw new CommandError({ translate: 'Please provide a OwnerHash', color: 'dark_red' })
|
||||
if (command.hashOnly && source.hash) {
|
||||
// debug
|
||||
// console.log(`${args} args0 ${args[0]}`) //too sus
|
||||
const hash = `${args[0]}` // this is undefined
|
||||
console.log(hash) // input hash
|
||||
console.log(bot.hash) // actual hash
|
||||
//but look in hashing.js
|
||||
if (hash !== bot.hash) throw new CommandError({ translate: 'Invalid hash', color: 'dark_red' }) // so true
|
||||
//im guessing its smh in hashing.js
|
||||
bot.updatehash
|
||||
} else if (command.hashOnly && source.sources.discord) {
|
||||
const event = source.discordMessageEvent
|
||||
|
||||
if (command.trustLevel > 0) {
|
||||
const event = source?.discordMessageEvent;
|
||||
const roles = event.member?.roles?.cache
|
||||
//1106399617635061810
|
||||
const hasRole = roles.some(role => role.name === '1106399617635061810')
|
||||
|
||||
const roles = event?.member?.roles?.cache;
|
||||
|
||||
if (
|
||||
source?.sources?.discord &&
|
||||
command.trustLevel === 1 &&
|
||||
!roles?.some(
|
||||
(role) =>
|
||||
role?.name == "trusted" ||
|
||||
role?.name == "FNFBoyfriendBot Owner",
|
||||
)
|
||||
? true
|
||||
: false
|
||||
)
|
||||
throw new CommandError({
|
||||
text: "You are not Trusted!",
|
||||
color: "red",
|
||||
});
|
||||
if (
|
||||
!source?.sources?.discord &&
|
||||
command.trustLevel === 1 &&
|
||||
args[0] !== bot.hash &&
|
||||
args[0] !== bot.owner &&
|
||||
args[0] !== bot.hashing.hash
|
||||
)
|
||||
throw new CommandError({
|
||||
text: "Invalid Hash or Invalid Owner Hash",
|
||||
color: "red",
|
||||
});
|
||||
bot.hashing.updateHash();
|
||||
const now = new Date().toLocaleString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
const player = source?.player?.profile?.name;
|
||||
const uuid = source?.player?.uuid;
|
||||
const time = new Date().toLocaleTimeString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
const date = new Date().toLocaleDateString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
|
||||
bot.console.hash = function (error, source) {
|
||||
console.log(
|
||||
`<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] ` +
|
||||
`[\x1b[0m\x1b[92mHash\x1b[0m]: \x1b[0m\x1b[92mPlayer\x1b[0m: ${player}, \x1b[0m\x1b[92mUUID\x1b[0m:${uuid}, \x1b[0m\x1b[92mHash\x1b[0m:${
|
||||
bot.hash || bot.hashing.hash
|
||||
}\x1b[0m]`,
|
||||
);
|
||||
};
|
||||
bot.console.discordHash = function (error, source) {
|
||||
console.log(
|
||||
`<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] ` +
|
||||
`[\x1b[0m\x1b[92mHash\x1b[0m]: \x1b[0m\x1b[92mPlayer\x1b[0m: ${player}, \x1b[0m\x1b[92mUUID\x1b[0m:${uuid}, \x1b[0m\x1b[92mHash\x1b[0m:${bot.hashing.hash}\x1b[0m]`,
|
||||
);
|
||||
};
|
||||
bot.console.ownerHash = function (error, source) {
|
||||
console.log(
|
||||
`<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] ` +
|
||||
`[\x1b[0m\x1b[31mOwnerHash\x1b[0m]: \x1b[0m\x1b[92mPlayer\x1b[0m: ${player}, \x1b[0m\x1b[92mUUID\x1b[0m:${uuid}, \x1b[0m\x1b[31mOwnerHash\x1b[0m:${bot.owner}\x1b[0m]`,
|
||||
);
|
||||
};
|
||||
if (args[0] === bot.hash) {
|
||||
bot.console.hash();
|
||||
} else if (args[0] === bot.owner) {
|
||||
bot.console.ownerHash();
|
||||
}
|
||||
if (
|
||||
source?.sources?.discord &&
|
||||
command.trustLevel === 2 &&
|
||||
!roles?.some((role) => role.name === "FNFBoyfriendBot Owner")
|
||||
)
|
||||
throw new CommandError({
|
||||
text: "You are not the Owner!",
|
||||
color: "dark_red",
|
||||
});
|
||||
const owner = `${args[0]}`;
|
||||
if (
|
||||
!source?.sources?.discord &&
|
||||
command.trustLevel === 2 &&
|
||||
owner !== bot.owner
|
||||
)
|
||||
throw new CommandError({
|
||||
text: "Invalid Owner Hash",
|
||||
color: "dark_red",
|
||||
});
|
||||
|
||||
if (command.trustLevel === 3 && !source?.sources?.console)
|
||||
throw new CommandError({
|
||||
translate: "This command can only be executed via console",
|
||||
color: "blue",
|
||||
});
|
||||
if (!hasRole) throw new CommandError({ translate: 'You are not trusted!' })
|
||||
}
|
||||
return command.execute({ bot, source, arguments: args });
|
||||
} catch (error) {
|
||||
const now = new Date().toLocaleString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
bot.console.warn(error.stack);
|
||||
if (error instanceof CommandError) source.sendError(error._message);
|
||||
|
||||
else
|
||||
source.sendError({
|
||||
translate: "An Error has occured because the bot shot itself 🔫",
|
||||
color: "red",
|
||||
hoverEvent: { action: "show_text", contents: String(error.stack) },
|
||||
});
|
||||
if (source.sources.discord) {
|
||||
source.sendError(error);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
executeString(source, command) {
|
||||
const [commandName, ...args] = command.split(" ");
|
||||
return this.execute(source, commandName, args);
|
||||
},
|
||||
|
||||
register(command) {
|
||||
this.commands[command.name] = command;
|
||||
|
||||
if (command.aliases) {
|
||||
command.aliases.map((a) => (this.commands[a] = command));
|
||||
}
|
||||
},
|
||||
getCommand(name) {
|
||||
return this.commands[name];
|
||||
},
|
||||
|
||||
getCommands() {
|
||||
return Object.values(this.commands);
|
||||
},
|
||||
};
|
||||
//
|
||||
commandlist = [];
|
||||
|
||||
for (const filename of fs.readdirSync(path.join(__dirname, "../commands"))) {
|
||||
/*
|
||||
for (const filename of fs.readdirSync(path.join(__dirname, '../commands'))) {
|
||||
try {
|
||||
const command = require(path.join(__dirname, "../commands", filename));
|
||||
bot.commandManager.register(command);
|
||||
bot.commandManager.commandlist.push(command);
|
||||
const command = require(path.join(__dirname, '../commands', filename))
|
||||
bot.commandManager.register(command)
|
||||
} catch (error) {
|
||||
console.error("Failed to load command", filename, ":", error);
|
||||
console.error('Failed to load command', filename, ':', error)
|
||||
}
|
||||
*/
|
||||
return command.execute({ bot, source, arguments: args })
|
||||
} catch (error) {
|
||||
console.error(error)//const filename of fs.readdirSync(path.join(__dirname, '../commands'
|
||||
//console.error('Failed to load command', filename, ':', error)
|
||||
|
||||
if (error instanceof CommandError) source.sendError(error._message)
|
||||
|
||||
else source.sendError({ translate: 'command.failed', hoverEvent: { action: 'show_text', contents: String(error.stack) } })
|
||||
}
|
||||
},
|
||||
//
|
||||
executeString (source, command) {
|
||||
const [commandName, ...args] = command.split(' ')
|
||||
return this.execute(source, commandName, args)
|
||||
},
|
||||
|
||||
if (process.env["anti-skid"] !== "amogus is sus") {
|
||||
process.exit(0);
|
||||
register (command) {
|
||||
this.commands[command.name] = command
|
||||
},
|
||||
|
||||
getCommand (name) {
|
||||
return this.commands[name]
|
||||
},
|
||||
|
||||
getCommands () {
|
||||
return Object.values(this.commands)
|
||||
}
|
||||
}
|
||||
//
|
||||
amogus = []
|
||||
for (const filename of fs.readdirSync(path.join(__dirname, '../commands'))) {
|
||||
try {
|
||||
const command = require(path.join(__dirname, '../commands', filename))
|
||||
bot.commandManager.register(command)
|
||||
bot.commandManager.amogus.push(command)
|
||||
} catch (error) {
|
||||
console.error('Failed to load command', filename, ':', error)
|
||||
}
|
||||
|
||||
}
|
||||
module.exports = command_manager;
|
||||
}
|
||||
module.exports = inject
|
||||
|
||||
+43
-163
@@ -1,173 +1,53 @@
|
||||
const CommandSource = require("../CommandModules/command_source");
|
||||
//const logger = require('../util/logger')
|
||||
const CommandSource = require('../CommandModules/command_source')
|
||||
//const log = require('../logger')
|
||||
|
||||
function Console(bot, options, context, source) {
|
||||
function inject (bot, options) {
|
||||
|
||||
bot.console = {
|
||||
readline: null,
|
||||
username: bot.username,
|
||||
consoleServer: "all",
|
||||
//bot._client.username,
|
||||
useReadlineInterface(rl) {
|
||||
this.readline = rl;
|
||||
|
||||
rl.on("line", (line) => {
|
||||
if (
|
||||
bot.options.host !== this.consoleServer &&
|
||||
this.consoleServer !== "all"
|
||||
)
|
||||
return;
|
||||
consoleServer: 'all',
|
||||
|
||||
if (line.startsWith(".")) {
|
||||
return bot.commandManager.executeString(
|
||||
bot.console.source,
|
||||
useReadlineInterface (rl) {
|
||||
this.readline = rl
|
||||
|
||||
line.substring(1),
|
||||
//null
|
||||
`${process.env["FNFBoyfriendBot_Owner_key"]}`,
|
||||
);
|
||||
}
|
||||
rl.on('line', line => {
|
||||
if (bot.options.host !== this.consoleServer && this.consoleServer !== 'all') return
|
||||
|
||||
bot.commandManager.executeString(bot.console.source, line)
|
||||
})
|
||||
|
||||
if (line === ",kill") process.exit();
|
||||
if (line === ",reconnect") bot._client.end();
|
||||
rl.on('close', () => {
|
||||
this.readline = null
|
||||
})
|
||||
|
||||
//probably gotta somehow have it get its username
|
||||
//tried that already didnt work just errored
|
||||
//profile or smh :shrug:
|
||||
// what does it have to be
|
||||
|
||||
if (line.startsWith("")) {
|
||||
return bot.commandManager.executeString(
|
||||
bot.console.source,
|
||||
"console " + line.substring(0),
|
||||
);
|
||||
}
|
||||
|
||||
//bot.commandManager.executeString(bot.console.source, line)
|
||||
});
|
||||
|
||||
const now = new Date().toLocaleString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
const time = new Date().toLocaleTimeString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
const date = new Date().toLocaleDateString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
|
||||
// const source = context.source
|
||||
|
||||
const prefix = `<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] `;
|
||||
|
||||
function log(...args) {
|
||||
rl.output.write("\x1b[2K\r");
|
||||
console.log(args.toString());
|
||||
rl._refreshLine();
|
||||
}
|
||||
|
||||
bot.console.warn = function (error) {
|
||||
log(prefix + `[\x1b[0m\x1b[93mWARN\x1b[0m]: ${error}`);
|
||||
};
|
||||
bot.console.error = function (error) {
|
||||
log(prefix + `[\x1b[0m\x1b[31mERROR\x1b[0m]: ${error}`);
|
||||
};
|
||||
|
||||
bot.console.info = function (message) {
|
||||
log(prefix + `[\x1b[0m\x1b[32mInfo\x1b[0m]: ` + message);
|
||||
};
|
||||
bot.console.log = function (message, ansi) {
|
||||
log(prefix + `[\x1b[0m\x1b[33mLOGS\x1b[0m]: ` + message);
|
||||
};
|
||||
bot.console.debug = function (message, ansi) {
|
||||
log(prefix + `[\x1b[0m\x1b[33mDEBUG\x1b[0m]: ` + message);
|
||||
};
|
||||
|
||||
/* const ansimap = {
|
||||
0: '\x1b[0m\x1b[30m',
|
||||
1: '\x1b[0m\x1b[34m',
|
||||
2: '\x1b[0m\x1b[32m',
|
||||
3: '\x1b[0m\x1b[36m',
|
||||
4: '\x1b[0m\x1b[31m',
|
||||
5: '\x1b[0m\x1b[35m',
|
||||
6: '\x1b[0m\x1b[33m',
|
||||
7: '\x1b[0m\x1b[37m',
|
||||
8: '\x1b[0m\x1b[90m',
|
||||
9: '\x1b[0m\x1b[94m',
|
||||
a: '\x1b[0m\x1b[92m',
|
||||
b: '\x1b[0m\x1b[96m',
|
||||
c: '\x1b[0m\x1b[91m',
|
||||
d: '\x1b[0m\x1b[95m',
|
||||
e: '\x1b[0m\x1b[93m',
|
||||
f: '\x1b[0m\x1b[97m',
|
||||
r: '\x1b[0m',
|
||||
l: '\x1b[1m',
|
||||
o: '\x1b[3m',
|
||||
n: '\x1b[4m',
|
||||
m: '\x1b[9m',
|
||||
k: '\x1b[6m'
|
||||
}*/
|
||||
const isConsole = bot.username ? true : false;
|
||||
bot.console.source = new CommandSource(bot.username, {
|
||||
console: true,
|
||||
discord: false,
|
||||
});
|
||||
bot.console.source.sendFeedback = (message) => {
|
||||
|
||||
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi();
|
||||
|
||||
if (!bot.options.input) return;
|
||||
if (!bot.options.console) return;
|
||||
bot.console.info(ansi);
|
||||
};
|
||||
|
||||
bot.on("parsed_message", (data) => {
|
||||
if (data.type !== "minecraft:chat") return;
|
||||
|
||||
const plainMessage = bot
|
||||
.getMessageAsPrismarine(data.contents)
|
||||
?.toString();
|
||||
if (plainMessage.startsWith("frog")) {
|
||||
bot.chat("frok :)");
|
||||
}
|
||||
return;
|
||||
});
|
||||
bot.on("message", (message) => {
|
||||
function log(...args) {
|
||||
rl.output.write("\x1b[2K\r");
|
||||
console.log(args.toString());
|
||||
rl._refreshLine();
|
||||
}
|
||||
const time = new Date().toLocaleTimeString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
const date = new Date().toLocaleDateString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
const prefixy = `<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] `;
|
||||
|
||||
bot.console.logs = function (message, ansi) {
|
||||
log(prefixy + `[\x1b[0m\x1b[33mLOGS\x1b[0m]: ` + message);
|
||||
};
|
||||
const lang = require(`../util/language/lolus.json`);
|
||||
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi(lang);
|
||||
const string = bot.getMessageAsPrismarine(message)?.toString();
|
||||
|
||||
const now = new Date().toLocaleString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
const time2 = new Date().toLocaleTimeString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
const date2 = new Date().toLocaleDateString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
|
||||
|
||||
if (!bot.options.input) return;
|
||||
if (!bot.options.console) return;
|
||||
bot.console.logs(`${ansi}`);
|
||||
});
|
||||
},
|
||||
};
|
||||
const originalConsole = console
|
||||
this.log = (...args) => {
|
||||
rl.output.write('\x1b[2K\r')
|
||||
originalConsole.log(args.toString())
|
||||
rl._refreshLine()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bot.console.source = new CommandSource(null, { console: true, discord: false });
|
||||
bot.console.source.sendFeedback = message => {
|
||||
const lang = require('../lolus.json')
|
||||
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi(lang)
|
||||
bot.console.log(ansi)
|
||||
}
|
||||
bot.on('message', message => {
|
||||
const lang = require('../lolus.json')//idk Parker I can help
|
||||
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi(lang)
|
||||
const string = bot.getMessageAsPrismarine(message)?.toString()
|
||||
|
||||
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
|
||||
//new Date().toLocaleString("en-US",{timeZone:"America/LOS_ANGELES"})
|
||||
bot.console.log(`[${now}] [${options.host}:${options.port}] ${ansi}`)
|
||||
//`[${now}] [${options.host}${options.port !== 25565 ? `:${options.port}` : ''}] ${ansi}`
|
||||
|
||||
// log(`[${now}] [${options.host}:${options.port}] ${string}`, true, false)
|
||||
})
|
||||
}
|
||||
module.exports = Console;
|
||||
module.exports = inject
|
||||
|
||||
+30
-84
@@ -9,7 +9,7 @@ const client = new Client({ intents: [Guilds, GuildMessages, MessageContent] })
|
||||
const util = require('util')
|
||||
client.login(process.env.discordtoken)
|
||||
|
||||
function discord (bot, options) {
|
||||
function inject (bot, options) {
|
||||
if (!options.discord?.channelId) {
|
||||
bot.discord = { invite: options.discord?.invite }
|
||||
return
|
||||
@@ -20,35 +20,26 @@ function discord (bot, options) {
|
||||
channel: undefined,
|
||||
invite: options.discord.invite || undefined,
|
||||
commandPrefix: options.discord.commandPrefix
|
||||
|
||||
}
|
||||
|
||||
client.on('ready', (context) => {
|
||||
//setMaxListeners(Infinity)
|
||||
client.setMaxListeners(25)
|
||||
|
||||
bot.discord.channel = client.channels.cache.get(options.discord.channelId)
|
||||
bot.discord.channel.send(`\`\`\`\nStarting ${process.env["buildstring"]}......\n\`\`\``)
|
||||
bot.discord.channel.send(`\`\`\`\nFoundation: ${process.env["FoundationBuildString"]}\n\`\`\``)
|
||||
bot.discord.channel.send(`\`\`\`\nSuccessfully logged into discord as ${bot.discord.client.user.username}#${bot.discord.client.user.discriminator}\n\`\`\``)
|
||||
bot.console.info(`Successfully logged into discord as ${bot.discord.client.user.username}#${bot.discord.client.user.discriminator}`)
|
||||
client.on('ready', () => {
|
||||
bot.discord.channel = client.channels.cache.get(options.discord.channelId)
|
||||
|
||||
})
|
||||
|
||||
// I feel like this is a modified version of ChomeNS Bot's discord plugin (the js one ofc) lol - chayapak
|
||||
|
||||
let discordQueue = []
|
||||
setInterval(() => {
|
||||
if (discordQueue.length === 0) return
|
||||
let discordQueue = '' // too lazy to make an array mabe
|
||||
setInterval(async () => {
|
||||
if (discordQueue === '') return
|
||||
try {
|
||||
bot.discord.channel.send(`\`\`\`ansi\n${discordQueue.join('\n').substring(0, 1984)}\n\`\`\``)
|
||||
await bot.discord.channel.send(discordQueue.substring(0, 2000))
|
||||
} catch (error) {
|
||||
//ansi real
|
||||
bot.console.error(error.stack)
|
||||
|
||||
}//im pretty sure the discord code is as old as the discord relay prototypes lmao
|
||||
console.error(error)
|
||||
}
|
||||
//sus
|
||||
discordQueue = []
|
||||
}, 2000)
|
||||
discordQueue = ''
|
||||
}, 1000)
|
||||
//const ansi = bot.getMessageAsPrismarine(message).toAnsi(lang).replaceAll('``\`\`\u200b\ansi\n\`\`\u001b[9', '\u001b[3\n`\`\`')
|
||||
/* bot.on('message', (message) => {
|
||||
const cleanMessage = escapeMarkdown(message.toAnsi(), true)
|
||||
@@ -62,9 +53,9 @@ function discord (bot, options) {
|
||||
*/
|
||||
|
||||
function sendDiscordMessage (message) {
|
||||
discordQueue.push(message)
|
||||
discordQueue += message + '\n'
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
const cleanMessage = escapeMarkdown(message.toAnsi(), true)
|
||||
const discordMsg = cleanMessage
|
||||
@@ -72,10 +63,9 @@ function discord (bot, options) {
|
||||
.replaceAll('http', 'http\u200b')
|
||||
.replaceAll('\u001b[9', '\u001b[3')
|
||||
*/
|
||||
//`\`\`\`\n \n\`\`\`
|
||||
function sendComponent (message) {
|
||||
const lang = require(`../util/language/lolus.json`)
|
||||
const ansi = bot.getMessageAsPrismarine(message).toAnsi(lang).replaceAll('```\u001b[9```' + '```\u001b[3```')// I have a function to fix ansi :shrug:
|
||||
const lang = require('../lolus.json')
|
||||
const ansi = bot.getMessageAsPrismarine(message).toAnsi().replaceAll('```\u001b[9```' + '```\u001b[3```') // I have a function to fix ansi :shrug:
|
||||
|
||||
/*
|
||||
would it be better to do
|
||||
@@ -96,15 +86,14 @@ function discord (bot, options) {
|
||||
```
|
||||
*/
|
||||
|
||||
|
||||
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})//real
|
||||
|
||||
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
|
||||
try {
|
||||
sendDiscordMessage(fixansi(ansi.replaceAll('`', '`\u200b')))
|
||||
//'```ansi\n' + fixansi(ansi.replaceAll('\u200b').substring(0, 1983)) + '\n```'
|
||||
sendDiscordMessage('```ansi\n' + fixansi(ansi.replaceAll('\u200b`').substring(0, 1983)) + '\n```')
|
||||
|
||||
} catch (e) {
|
||||
//i was gonna try to get it to debug via console
|
||||
bot.console.error(`Error sending a message to Discord:\n${e.message}`)
|
||||
sendDiscordMessage(e.message)
|
||||
console.error(`Error sending a message to Discord:\n${e.message}`)
|
||||
//already tried ansi
|
||||
}//send isnt defined
|
||||
} // its still doing the ansi crap
|
||||
@@ -120,13 +109,11 @@ function discord (bot, options) {
|
||||
if (message.author.id === bot.discord.client.user.id) return
|
||||
|
||||
if (message.channel.id !== bot.discord.channel.id) return
|
||||
//
|
||||
|
||||
if (message.content.startsWith(bot.discord.commandPrefix)) { // TODO: Don't hardcode this
|
||||
const source = new CommandSource({ profile: { name: message?.member?.displayName } }, { discord: true, console: false }, false, message)
|
||||
|
||||
const source = new CommandSource({ profile: { name: message.member.displayName } }, { discord: true, console: false }, false, message)
|
||||
source.sendFeedback = message => {
|
||||
sendComponent(message)
|
||||
console.log(message.content)
|
||||
}
|
||||
|
||||
bot.commandManager.executeString(source, message.content.substring(bot.discord.commandPrefix.length))
|
||||
@@ -165,61 +152,20 @@ function discord (bot, options) {
|
||||
clickEvent: bot.discord.invite ? { action: 'open_url', value: bot.discord.invite } : undefined,
|
||||
hoverEvent: { action: 'show_text', contents: 'Click to join the discord' }
|
||||
},
|
||||
{ text: message?.member?.displayName },
|
||||
{ text: message.member.displayName },
|
||||
message.content
|
||||
]
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
client.on('messageCreate', messageCreate)
|
||||
bot.on('error', (error) => {
|
||||
console.log(error.stack)
|
||||
sendDiscordMessage(`\`\`\`ansi\nDisconnected: ${util.inspect(error.stack)}\n\`\`\``)
|
||||
|
||||
bot.on('kick_disconnect', reason => {
|
||||
|
||||
sendDiscordMessage('server 🔫 itself and or was 💣 or even 💩 itself ' + JSON.stringify(reason))
|
||||
|
||||
//sendDiscordMessage(reason)
|
||||
|
||||
})
|
||||
bot.on('disconnect', reason => {
|
||||
|
||||
sendDiscordMessage(JSON.stringify(reason))
|
||||
|
||||
//sendDiscordMessage(reason)
|
||||
|
||||
})
|
||||
bot.on('end', reason => {
|
||||
|
||||
sendDiscordMessage(JSON.stringify(reason))
|
||||
|
||||
//sendDiscordMessage(reason)
|
||||
|
||||
})
|
||||
bot.on('error', (error, reason, data) => {
|
||||
sendDiscordMessage('🔫 shot itself')
|
||||
sendDiscordMessage(`Disconnected: ${error.stack}`)
|
||||
|
||||
//sendDiscordMessage(reason)
|
||||
|
||||
})
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('purr')) {
|
||||
bot.chat(' puuuuuuuuuurrrrrrrrrrrr~')
|
||||
|
||||
} return
|
||||
})
|
||||
/*bot.on('end', (reason, event) => {
|
||||
sendDiscordMessage('event:' + event)
|
||||
sendDiscordMessage('Reason:' + util.inspect(reason))
|
||||
|
||||
})*/
|
||||
//client.on('end', reason => { bot.emit('end', reason)
|
||||
//client.on('keep_alive', ({ keepAliveId }) => {
|
||||
//bot.emit('keep_alive', { keepAliveId })
|
||||
|
||||
}
|
||||
/* bot.console.info(
|
||||
`Disconnected from ${bot.server.host} (${event} event): ${util.inspect(reason)}`
|
||||
)
|
||||
@@ -251,6 +197,6 @@ function fixansi(message) {
|
||||
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
module.exports = discord
|
||||
module.exports = inject
|
||||
|
||||
+24
-112
@@ -1,118 +1,30 @@
|
||||
|
||||
// * Not real hashing
|
||||
const crypto = require('crypto')
|
||||
const ownerkey = process.env['FNFBoyfriendBot_Owner_key']
|
||||
const trustedkey = process.env['FNFBoyfriendBot_key']
|
||||
function hashgen (bot) {
|
||||
bot.hash = ''
|
||||
bot.owner = ''
|
||||
bot.updatehashes = update
|
||||
|
||||
let hash
|
||||
let owner
|
||||
let interval = setInterval(() => {
|
||||
hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + trustedkey).digest('hex').substring(0, 16)
|
||||
owner = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + ownerkey).digest('hex').substring(0, 16)
|
||||
bot.hash = hash
|
||||
bot.owner = owner
|
||||
|
||||
}, 2000)
|
||||
|
||||
function update() {
|
||||
hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + trustedkey).digest('hex').substring(0, 16)
|
||||
owner = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + ownerkey).digest('hex').substring(0, 16)
|
||||
bot.hash = hash
|
||||
bot.owner = owner
|
||||
|
||||
//this should work right?
|
||||
/*
|
||||
bot.discord.channel = client.channels.cache.get(options.discord.channelId)
|
||||
*/
|
||||
// ok
|
||||
/*
|
||||
bot.on('end', () => {
|
||||
if (interval) clearInterval(interval)
|
||||
})
|
||||
*/
|
||||
}
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('fnf sky')) {
|
||||
bot.chat('sky the fangirl!?!? i simp for her :)')
|
||||
} return
|
||||
})
|
||||
let _hash = generateHash()
|
||||
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
|
||||
const time = new Date().toLocaleTimeString("en-US", {timeZone:"America/CHICAGO"})
|
||||
const date = new Date().toLocaleDateString("en-US", {timeZone:"America/CHICAGO"})
|
||||
|
||||
//bot.hashing = ''
|
||||
bot.hashing = {
|
||||
_hash: crypto.randomBytes(4).toString('hex').substring(0,16),
|
||||
//const key = process.env['FNFBoyfriendBotX_key']
|
||||
get hash () { return this._hash },
|
||||
set hash (value) {
|
||||
this._hash = value
|
||||
this.discordChannel?.send('```ansi\nTime: ' + time + ' ' + date + ' ' + '```' + '```ansi\n Hash for server ' + `${bot.options.host}:${bot.options.port}: ` + bot.hashing.hash + '\n```')
|
||||
},
|
||||
//`Hash for server ${bot.options.host}:${bot.options.port}: ${value}`
|
||||
generateHash () {
|
||||
return crypto.randomBytes(4).toString('hex').substring(0, 16)
|
||||
},
|
||||
|
||||
updateHash () {
|
||||
this.hash = this.generateHash()
|
||||
}
|
||||
}
|
||||
|
||||
bot.discord.client?.on('ready', () => {
|
||||
//bot.discord.client?.setMaxListeners(25)
|
||||
bot.hashing.discordChannel = bot.discord.client.channels.cache.get('1188677777336057987')
|
||||
//bot.hashing.discordChannel?.send()
|
||||
bot.hashing.discordChannel?.send('```ansi\nTime: ' + time + ' ' + date + ' ' + '```' + '```ansi\n Hash for server ' + `${bot.options.host}:${bot.options.port}: ` + bot.hashing.hash + '\n```')
|
||||
})// + bot.hashing.hash
|
||||
}//`Hash for server ${bot.options.host}:${bot.options.port}: ${value}`
|
||||
//nvm what?
|
||||
function generateHash () {
|
||||
return crypto.randomBytes(4).toString('hex')
|
||||
}
|
||||
module.exports = hashgen
|
||||
|
||||
|
||||
|
||||
|
||||
/* const crypto = require('crypto')
|
||||
|
||||
let _hash = generateHash()
|
||||
|
||||
const key = process.env['FNFBoyfriendBot_key']
|
||||
function inject (bot) {
|
||||
bot.hashing = {
|
||||
_hash: crypto.randomBytes(4).toString('hex').substring(0,16),
|
||||
//const key = process.env['FNFBoyfriendBotX_key']
|
||||
get hash () { return this._hash },
|
||||
set hash (value) {
|
||||
this._hash = value
|
||||
this.discordChannel?.send('```ansi\n Hash for server ' + `${bot.options.host}:${bot.options.port}: ${value}` + '\n```')
|
||||
},
|
||||
//`Hash for server ${bot.options.host}:${bot.options.port}: ${value}`
|
||||
generateHash () {
|
||||
return crypto.randomBytes(4).toString('hex').substring(0, 16)
|
||||
},
|
||||
|
||||
updateHash () {
|
||||
this.hash = this.generateHash()
|
||||
bot.hash = ''
|
||||
bot.ownerhash = ''
|
||||
bot.updatehashes = update
|
||||
let hash
|
||||
let owner
|
||||
const interval = setInterval(() => {
|
||||
hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + key).digest('hex').substring(0, 16)
|
||||
owner = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + ownerkey).digest('hex').substring(0, 16)
|
||||
bot.hash = hash
|
||||
bot.ownerhash = owner
|
||||
}, 2000)
|
||||
function update() {
|
||||
hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + key).digest('hex').substring(0, 16)
|
||||
owner = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + ownerkey).digest('hex').substring(0, 16)
|
||||
bot.hash = hash
|
||||
bot.ownerhash = owner
|
||||
}
|
||||
//this should work right?
|
||||
|
||||
// ok
|
||||
bot.on('end', () => {
|
||||
clearInterval(interval)
|
||||
})
|
||||
}
|
||||
|
||||
bot.discord.client?.on('ready', () => {
|
||||
bot.hashing.discordChannel = bot.discord.client.channels.cache.get('1120122720001208390')
|
||||
bot.hashing.discordChannel?.send('```ansi\n Hash for server ' + `${bot.options.host}:${bot.options.port}: ` + bot.hashing.hash + '\n```')
|
||||
})// + bot.hashing.hash
|
||||
}//`Hash for server ${bot.options.host}:${bot.options.port}: ${value}`
|
||||
//nvm what?
|
||||
function generateHash () {
|
||||
return crypto.randomBytes(4).toString('hex')
|
||||
}
|
||||
*/
|
||||
module.exports = inject
|
||||
@@ -1,52 +0,0 @@
|
||||
function memusage(bot, options) {
|
||||
const clamp = require("../util/clamp");
|
||||
const bossbarName = "memusage";
|
||||
|
||||
const os = require("os");
|
||||
let enabled = false;
|
||||
let tag = "FNFBoyfriendBotMemusage";
|
||||
bot.memusage = {
|
||||
on() {
|
||||
enabled = true;
|
||||
},
|
||||
off() {
|
||||
enabled = false;
|
||||
bot.core.run(`minecraft:bossbar remove ${bossbarName}`);
|
||||
},
|
||||
};//
|
||||
|
||||
|
||||
const interval = setInterval(() => {
|
||||
if (!enabled) return;
|
||||
|
||||
/* const component = {
|
||||
text: `Mem used ${Math.floor(
|
||||
process.memoryUsage().heapUsed / 1000 / 1000,
|
||||
)} MiB / ${Math.floor(
|
||||
process.memoryUsage().heapTotal / 1000 / 1000,
|
||||
)} MiB. `,
|
||||
color: "dark_gray",
|
||||
};*/
|
||||
const component = {
|
||||
translate: `memusage %s`,
|
||||
color: "gray",
|
||||
bold: false,
|
||||
with: [{ text: `Memory used ${Math.floor(
|
||||
process.memoryUsage().heapUsed / 1000 / 1000,
|
||||
)} Mebibytes / ${Math.floor(
|
||||
process.memoryUsage().heapTotal / 1000 / 1000,
|
||||
)} Mebibytes.`, color: "green" }],
|
||||
};
|
||||
//process.cpuUsage
|
||||
bot.core.run(`minecraft:bossbar add ${bossbarName} ""`);
|
||||
bot.core.run(`minecraft:bossbar set ${bossbarName} players @a`);
|
||||
bot.core.run(`minecraft:bossbar set ${bossbarName} color yellow`);
|
||||
bot.core.run(`minecraft:bossbar set ${bossbarName} visible true`);
|
||||
bot.core.run(`minecraft:bossbar set ${bossbarName} style progress`);
|
||||
bot.core.run(
|
||||
`minecraft:bossbar set ${bossbarName} name ${JSON.stringify(component)}`,
|
||||
);
|
||||
bot.core.run(`minecraft:bossbar set ${bossbarName} max 20`);
|
||||
}, 100); //process.memoryUsage().heapUsed /1024 / 1024
|
||||
}
|
||||
module.exports = memusage;
|
||||
@@ -1,180 +0,0 @@
|
||||
const path = require('path')
|
||||
const { Midi } = require('@tonejs/midi')
|
||||
const { convertMidi } = require('../util/midi_converter')
|
||||
const convertNBS = require('../util/nbs_converter')
|
||||
const parseTXTSong = require('../util/txt_song_parser')
|
||||
|
||||
const soundNames = {
|
||||
harp: 'minecraft:block.note_block.harp',
|
||||
basedrum: 'minecraft:block.note_block.basedrum',
|
||||
snare: 'minecraft:block.note_block.snare',
|
||||
hat: 'minecraft:block.note_block.hat',
|
||||
bass: 'minecraft:block.note_block.bass',
|
||||
flute: 'minecraft:block.note_block.flute',
|
||||
bell: 'minecraft:block.note_block.bell',
|
||||
guitar: 'minecraft:block.note_block.guitar',
|
||||
chime: 'minecraft:block.note_block.chime',
|
||||
xylophone: 'minecraft:block.note_block.xylophone',
|
||||
iron_xylophone: 'minecraft:block.note_block.iron_xylophone',
|
||||
cow_bell: 'minecraft:block.note_block.cow_bell',
|
||||
didgeridoo: 'minecraft:block.note_block.didgeridoo',
|
||||
bit: 'minecraft:block.note_block.bit',
|
||||
banjo: 'minecraft:block.note_block.banjo',
|
||||
pling: 'minecraft:block.note_block.pling'
|
||||
}
|
||||
|
||||
function music (bot) {
|
||||
bot.music = function () {}
|
||||
bot.music.song = null
|
||||
bot.music.loop = 0
|
||||
bot.music.queue = []
|
||||
let time = 0
|
||||
let startTime = 0
|
||||
let noteIndex = 0
|
||||
bot.music.skip = function () {
|
||||
if (bot.music.loop === 2) {
|
||||
bot.music.queue.push(bot.music.queue.shift())
|
||||
bot.music.play(bot.music.queue[0])
|
||||
} else {
|
||||
bot.music.queue.shift()
|
||||
}
|
||||
resetTime()
|
||||
}
|
||||
|
||||
const bossbarName = 'music' // maybe make this in the config?
|
||||
|
||||
const selector = '@a[tag=!nomusic,tag=!nomusic]'
|
||||
|
||||
const interval = setInterval(async () => {
|
||||
if (!bot.music.queue.length) return
|
||||
bot.music.song = bot.music.queue[0]
|
||||
time = Date.now() - startTime
|
||||
/*
|
||||
// bot.core.run('minecraft:title @a[tag=!nomusic] actionbar ' + JSON.stringify(toComponent()))
|
||||
|
||||
*/
|
||||
bot.core.run(`title @a actionbar ${JSON.stringify(toComponent())}`)
|
||||
|
||||
while (bot.music.song?.notes[noteIndex]?.time <= time) {
|
||||
const note = bot.music.song.notes[noteIndex]
|
||||
const floatingPitch = 2 ** ((note.pitch - 12) / 12.0)
|
||||
bot.core.run(`minecraft:execute as ${selector} at @s run playsound ${soundNames[note.instrument]} record @s ~ ~ ~ ${note.volume} ${floatingPitch}`)
|
||||
noteIndex++
|
||||
if (noteIndex >= bot.music.song.notes.length) {
|
||||
bot.tellraw('@a', [
|
||||
{
|
||||
text: 'Finished playing '
|
||||
},
|
||||
{
|
||||
text: bot.music.song.name,
|
||||
color: 'gold'
|
||||
}
|
||||
])
|
||||
|
||||
if (bot.music.loop === 1) {
|
||||
resetTime()
|
||||
return
|
||||
}
|
||||
if (bot.music.loop === 2) {
|
||||
resetTime()
|
||||
bot.music.queue.push(bot.music.queue.shift())
|
||||
bot.music.play(bot.music.queue[0])
|
||||
return
|
||||
}
|
||||
bot.music.queue.shift()
|
||||
bot.music.song = null // useless?
|
||||
if (!bot.music.queue[0]) {
|
||||
bot.music.stop()
|
||||
return
|
||||
}
|
||||
if (bot.music.queue[0].notes.length > 0) {
|
||||
if (bot.music.queue.length !== 1) resetTime()
|
||||
bot.music.play(bot.music.queue[0])
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 50)
|
||||
|
||||
bot.on('end', () => {
|
||||
clearInterval(interval)
|
||||
})
|
||||
|
||||
bot.music.load = async function (buffer, fallbackName = '[unknown]') {
|
||||
let song
|
||||
switch (path.extname(fallbackName)) {
|
||||
case '.nbs':
|
||||
song = convertNBS(buffer)
|
||||
if (song.name === '') song.name = fallbackName
|
||||
break
|
||||
case '.txt':
|
||||
song = parseTXTSong(buffer.toString())
|
||||
song.name = fallbackName
|
||||
break
|
||||
default:
|
||||
// TODO: use worker_threads so the entire bot doesn't freeze (for example parsing we are number 1 black midi)
|
||||
|
||||
// eslint-disable-next-line no-case-declarations
|
||||
const midi = new Midi(buffer)
|
||||
song = convertMidi(midi)
|
||||
if (song.name === '') song.name = fallbackName
|
||||
break
|
||||
}
|
||||
return song
|
||||
}
|
||||
|
||||
bot.music.play = function (song) {
|
||||
if (bot.music.queue.length === 1) resetTime()
|
||||
}
|
||||
|
||||
bot.music.stop = function () {
|
||||
bot.music.song = null
|
||||
bot.music.loop = 0
|
||||
bot.music.queue = []
|
||||
resetTime()
|
||||
}
|
||||
|
||||
function resetTime () {
|
||||
time = 0
|
||||
startTime = Date.now()
|
||||
noteIndex = 0
|
||||
bot.core.run(`minecraft:bossbar remove ${bossbarName}`) // maybe not a good place to put it here but idk
|
||||
}
|
||||
if (process.env["buildstring"] !== "§5FridayNightFunkin§bBoyfriend§4Bot §8v5.0.4 §8Build:340")
|
||||
{
|
||||
process.exit(1)
|
||||
}
|
||||
function formatTime (time) {
|
||||
const seconds = Math.floor(time / 1000)
|
||||
|
||||
return `${Math.floor(seconds / 60)}:${(seconds % 60).toString().padStart(2, '0')}`
|
||||
}
|
||||
|
||||
function toComponent () {
|
||||
const component = [
|
||||
|
||||
{ text: bot.music.song.name, color: 'green' },
|
||||
{ text: ' | ', color: 'dark_gray' },
|
||||
{ text: formatTime(time), color: 'gray' },
|
||||
{ text: ' / ', color: 'dark_gray' },
|
||||
{ text: formatTime(bot.music.song.length), color: 'gray' },
|
||||
{ text: ' | ', color: 'dark_gray' },
|
||||
{ text: noteIndex, color: 'gray' },
|
||||
{ text: ' / ', color: 'dark_gray' },
|
||||
{ text: bot.music.song.notes.length, color: 'gray' }
|
||||
]
|
||||
|
||||
if (bot.music.loop === 1) {
|
||||
component.push({ text: ' | ', color: 'dark_gray' })
|
||||
component.push({ text: 'Looping Current', color: 'green' })
|
||||
}
|
||||
if (bot.music.loop === 2) {
|
||||
component.push({ text: ' | ', color: 'dark_gray' })
|
||||
component.push({ text: 'Looping All', color: 'green' })
|
||||
}
|
||||
|
||||
return component
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = music
|
||||
+5
-29
@@ -1,4 +1,4 @@
|
||||
function player_list (bot) {
|
||||
function inject (bot) {
|
||||
bot.players = []
|
||||
//chayapak you mentally ok?
|
||||
bot.on('packet.player_info', packet => {
|
||||
@@ -18,44 +18,20 @@ function player_list (bot) {
|
||||
}
|
||||
})
|
||||
|
||||
bot.on('packet.player_remove', ({ players }) => {
|
||||
/*bot.on('packet.player_remove', ({ players }) => {
|
||||
for (const player of players) {
|
||||
bot.players = bot.players.filter(entry => entry.uuid !== player)
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
function removePlayer (player, packet) {
|
||||
const fullPlayer = bot.players.getPlayer(player)
|
||||
//const players = tabCompletePlayerList.list
|
||||
*/
|
||||
|
||||
if (fullPlayer && players.some((name) => name === fullPlayer.name)) {
|
||||
bot.emit('player_vanished', player)
|
||||
} else {
|
||||
bot.on('packet.player_remove', ({ players }) => {
|
||||
for (const player of players) {
|
||||
bot.players = bot.players.filter(entry => entry.uuid !== player)
|
||||
|
||||
}
|
||||
|
||||
bot.players = bot.players.filter(entry => entry.uuid !== player)
|
||||
})
|
||||
|
||||
bot.players.removePlayer(player)
|
||||
if (!target) return
|
||||
target.removePlayer = entry.removePlayer
|
||||
}
|
||||
}//
|
||||
if (process.env['FoundationBuildString'] !== 'Ultimate Foundation v2.0.4 Build:240')
|
||||
{
|
||||
process.exit(1)
|
||||
}
|
||||
function addPlayer (entry) {
|
||||
bot.players = bot.players.filter(_entry => _entry.uuid !== entry.uuid)
|
||||
bot.players.push({
|
||||
uuid: entry.uuid,
|
||||
profile: { name: entry.player.name, properties: entry.player.properties },
|
||||
removePlayer:undefined,
|
||||
|
||||
chatSession: undefined,
|
||||
gamemode: undefined,
|
||||
listed: undefined,
|
||||
@@ -103,7 +79,7 @@ removePlayer:undefined,
|
||||
bot.on('end', () => (bot.players = []))
|
||||
}
|
||||
|
||||
module.exports = player_list
|
||||
module.exports = inject
|
||||
/*function addPlayer (player, packet) {
|
||||
if (bot.players.getPlayer(player)) bot.emit('player_unvanished', player, packet)
|
||||
else bot.emit('player_added', player, packet)
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
function position (bot) {
|
||||
function inject (bot) {
|
||||
bot.position = null
|
||||
|
||||
bot.on('packet.position', packet => {
|
||||
@@ -6,7 +6,7 @@ function position (bot) {
|
||||
x: packet.flags & 1 ? (this.x + packet.x) : packet.x,
|
||||
y: packet.flags & 2 ? (this.y + packet.y) : packet.y,
|
||||
z: packet.flags & 4 ? (this.z + packet.z) : packet.z
|
||||
}//this looks right?
|
||||
}
|
||||
|
||||
bot._client.write('teleport_confirm', { teleportId: packet.teleportId })
|
||||
|
||||
@@ -16,4 +16,4 @@ function position (bot) {
|
||||
bot.on('end', () => { bot.position = null })
|
||||
}
|
||||
|
||||
module.exports = position
|
||||
module.exports = inject
|
||||
|
||||
@@ -3,15 +3,12 @@ const mc = require('minecraft-protocol')
|
||||
function reconnect (bot, options) {
|
||||
bot.reconnectDelay = options.reconnectDelay ?? 5200 // Set from 1000 to 5200 - yfd
|
||||
|
||||
bot.on('end', (reason) => {
|
||||
bot.on('end', () => {
|
||||
if (bot.reconnectDelay < 0) return
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
|
||||
const client = options.client ?? mc.createClient(options)
|
||||
bot._client = client
|
||||
bot.emit('init_client', client)
|
||||
|
||||
bot._client = mc.createClient(options)
|
||||
bot.emit('init_client', bot._client)
|
||||
}, bot.reconnectDelay)
|
||||
})
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
const createRegistry = require('prismarine-registry')
|
||||
|
||||
function registry (bot) {
|
||||
function inject (bot) {
|
||||
bot.on('packet.login', packet => {
|
||||
bot.registry = createRegistry(bot._client.version)
|
||||
bot.registry.loadDimensionCodec(packet.dimensionCodec)
|
||||
@@ -8,4 +8,4 @@ function registry (bot) {
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = registry
|
||||
module.exports = inject
|
||||
|
||||
+17
-67
@@ -4,19 +4,15 @@ const util = require('util')
|
||||
const COMMANDSPY_ENABLED_MESSAGE = { text: 'Successfully enabled CommandSpy' }
|
||||
const COMMANDSPY_DISABLED_MESSAGE = { text: 'Successfully disabled CommandSpy' }
|
||||
//You now have the tag: &8[&bPrefix &4d~&8]
|
||||
function selfcare (bot) {
|
||||
function inject (bot) {
|
||||
let entityId
|
||||
let gameMode
|
||||
let permissionLevel = 2
|
||||
let unmuted = false
|
||||
let muted = false
|
||||
let commandSpyEnabled = false
|
||||
let vanished = false
|
||||
let prefix = false
|
||||
let skin = false
|
||||
let username = false
|
||||
let nickname = false
|
||||
let god = false
|
||||
let tptoggle = false
|
||||
/* if (data.toString().startsWith('You have been muted')) muted = true
|
||||
if (data.toString() === 'You have been unmuted.') muted = false
|
||||
*/
|
||||
@@ -24,56 +20,20 @@ let unmuted = false
|
||||
bot.on('message', (message, data) => {
|
||||
// Successfully removed your skin
|
||||
const stringmessage = bot.getMessageAsPrismarine(message)?.toString()
|
||||
if (stringmessage.startsWith('You have been muted')) unmuted = true
|
||||
else if (stringmessage === "You have been unmuted.") unmuted = false
|
||||
if (stringmessage.startsWith('You have been muted')) muted = true
|
||||
else if (stringmessage === "You have been unmuted.") muted = false
|
||||
else if (util.isDeepStrictEqual(message, COMMANDSPY_ENABLED_MESSAGE)) commandSpyEnabled = true
|
||||
else if (util.isDeepStrictEqual(message, COMMANDSPY_DISABLED_MESSAGE)) commandSpyEnabled = false
|
||||
else if (stringmessage === `You now have the tag: &8[&bPrefix &4${bot.options.commands.MainPrefix}&8]`) {
|
||||
else if (stringmessage === `You now have the tag: &8[&bPrefix &4${bot.options.commands.prefix}&8]`) {
|
||||
prefix = true
|
||||
return
|
||||
}
|
||||
else if (stringmessage.startsWith("You now have the tag: ") || stringmessage === "You no longer have a tag") prefix = false
|
||||
|
||||
else if (stringmessage === "Successfully set your skin to Parker2991's") {
|
||||
else if (stringmessage === `Successfully set your skin to Parker2991's`) {
|
||||
skin = true
|
||||
return
|
||||
}
|
||||
//Successfully set your skin to Parker2991's
|
||||
//Successfully removed your skin
|
||||
else if (stringmessage.startsWith("Successfully set your skin to ") || stringmessage === "Successfully removed your skin") skin = false
|
||||
|
||||
else if (stringmessage === `Successfully set your username to "${bot.username}"`) {
|
||||
username = true
|
||||
return
|
||||
}//"Successfully set your username to "${bot.username}"""
|
||||
else if (stringmessage.startsWith("Successfully set your username to ")) username = false
|
||||
else if (stringmessage === `You already have the username "${bot.username}"`) username = true
|
||||
//That name is already in use.
|
||||
//Error: Nicknames must be alphanumeric.
|
||||
//You no longer have a nickname.
|
||||
//Your nickname is now sus.
|
||||
else if (stringmessage === `You no longer have a nickname.`) {
|
||||
nickname = true
|
||||
return
|
||||
}//"Successfully set your username to "${bot.username}"""
|
||||
else if (stringmessage.startsWith("Your nickname is now ")) nickname = false
|
||||
// else if (stringmessage === `Error: Nicknames must be alphanumeric.`) nickname = false
|
||||
else if (stringmessage === `You no longer have a nickname.`) nickname = false
|
||||
//else if (stringmessage === `That name is already in use.`) nickname = false
|
||||
//God mode enabled.
|
||||
//God mode disabled.
|
||||
else if (stringmessage === `God mode enabled.`) {
|
||||
god = true
|
||||
return
|
||||
}
|
||||
else if (stringmessage === 'God mode disabled.') god = false
|
||||
else if (stringmessage === `Teleportation enabled.`) {
|
||||
tptoggle = false
|
||||
return
|
||||
}
|
||||
else if (stringmessage === 'Teleportation disabled.') tptoggle = true
|
||||
|
||||
|
||||
else if (stringmessage.startsWith("Successfully removed your skin") || stringmessage === "Successfully removed your skin") skin = false
|
||||
if (message?.text !== '' || !Array.isArray(message.extra) || message.extra.length < 2 || !message.extra[0]?.text?.startsWith('Vanish for') || message.extra[0].color !== 'gold') return
|
||||
|
||||
const suffix = message.extra[message.extra.length - 1]
|
||||
@@ -105,37 +65,27 @@ let unmuted = false
|
||||
gameMode = packet.gameMode
|
||||
|
||||
timer = setInterval(() => {
|
||||
if (permissionLevel < 2 && bot.options.selfcare.op) bot.command('op @s[type=player]')
|
||||
|
||||
if (!commandSpyEnabled && bot.options.selfcare.cspy) bot.command('commandspy:commandspy on')
|
||||
|
||||
else if (unmuted && bot.options.selfcare.unmuted) bot.core.run(`essentials:mute ${bot.uuid}`)
|
||||
else if (!prefix && bot.options.selfcare.prefix) bot.command(`prefix &8[&bPrefix &4${bot.options.commands.MainPrefix}&8]`)
|
||||
else if (gameMode !== 1 && bot.options.selfcare.gmc) bot.command('gamemode creative @s[type=player]')
|
||||
else if (!skin && bot.options.selfcare.skin) bot.command('skin Parker2991')
|
||||
else if (!username && bot.options.selfcare.username) bot.command(`username ${bot.username}`)
|
||||
else if (!nickname && bot.options.selfcare.nickname) bot.command(`nick off`)
|
||||
else if (!god && bot.options.selfcare.god) bot.command('god on')
|
||||
else if (!tptoggle && bot.options.selfcare.tptoggle) bot.command('tptoggle off')
|
||||
else if (!vanished && bot.options.selfcare.vanished) bot.core.run(`essentials:vanish ${bot.username} enable`)
|
||||
}, bot.options.selfcare.interval)
|
||||
if (permissionLevel < 2) bot.command('op @s[type=player]')
|
||||
else if (!commandSpyEnabled) bot.command('commandspy:commandspy on')
|
||||
else if (!vanished) bot.command('essentials:vanish enable')
|
||||
else if (muted) bot.core.run(`essentials:mute ${bot.uuid}`)
|
||||
else if (!prefix) bot.command(`prefix &8[&bPrefix &4${bot.options.commands.prefix}&8]`)
|
||||
else if (gameMode !== 1) bot.command('gamemode creative @s[type=player]')
|
||||
else if (!skin) bot.command('skin Parker2991')
|
||||
}, 500)
|
||||
})
|
||||
|
||||
bot.on('end', () => {
|
||||
if (timer) clearInterval(timer)
|
||||
prefix = false
|
||||
muted = false
|
||||
commandSpyEnabled = false
|
||||
commandSpyEnabled = false
|
||||
vanished = false
|
||||
skin = false
|
||||
username = false
|
||||
nickname = false
|
||||
god = false
|
||||
tptoggle = false
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = selfcare
|
||||
module.exports = inject
|
||||
/*const buildstring = process.env['buildstring']
|
||||
bot.on('login', async () => {
|
||||
console.log(`starting ${buildstring}`)
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
const assert = require('assert')
|
||||
|
||||
module.exports = ClientSettings
|
||||
|
||||
const chatToBits = {
|
||||
enabled: 0,
|
||||
commandsOnly: 1,
|
||||
disabled: 2
|
||||
}
|
||||
|
||||
const handToBits = {
|
||||
left: 1,
|
||||
right: 1
|
||||
}
|
||||
|
||||
const viewDistanceToBits = {
|
||||
far: 12,
|
||||
normal: 10,
|
||||
short: 8,
|
||||
tiny: 6
|
||||
}
|
||||
const controls = {
|
||||
forward: false,
|
||||
back: false,
|
||||
left: false,
|
||||
right: false,
|
||||
jump: false,
|
||||
sprint: false,
|
||||
sneak: false
|
||||
}
|
||||
function ClientSettings (bot, options) {
|
||||
function setSettings (settings) {
|
||||
extend(bot.settings, settings)
|
||||
|
||||
// chat
|
||||
const chatBits = chatToBits[bot.settings.chat]
|
||||
assert.ok(chatBits != null, `invalid chat setting: ${bot.settings.chat}`)
|
||||
|
||||
// view distance
|
||||
let viewDistanceBits = null
|
||||
if (typeof bot.settings.viewDistance === 'string') {
|
||||
viewDistanceBits = viewDistanceToBits[bot.settings.viewDistance]
|
||||
} else if (typeof bot.settings.viewDistance === 'number' && bot.settings.viewDistance > 0) { // Make sure view distance is a valid # || should be 2 or more
|
||||
viewDistanceBits = bot.settings.viewDistance
|
||||
}
|
||||
assert.ok(viewDistanceBits != null, `invalid view distance setting: ${bot.settings.viewDistance}`)
|
||||
|
||||
// hand
|
||||
const handBits = handToBits[bot.settings.mainHand]
|
||||
assert.ok(handBits != null, `invalid main hand: ${bot.settings.mainHand}`)
|
||||
|
||||
// skin
|
||||
// cape is inverted, not used at all (legacy?)
|
||||
// bot.settings.showCape = !!bot.settings.showCape
|
||||
const skinParts = bot.settings.skinParts.showCape << 0 |
|
||||
bot.settings.skinParts.showJacket << 1 |
|
||||
bot.settings.skinParts.showLeftSleeve << 2 |
|
||||
bot.settings.skinParts.showRightSleeve << 3 |
|
||||
bot.settings.skinParts.showLeftPants << 4 |
|
||||
bot.settings.skinParts.showRightPants << 5 |
|
||||
bot.settings.skinParts.showHat << 6
|
||||
|
||||
// write the packet
|
||||
bot._client.write('settings', {
|
||||
locale: bot.settings.locale || 'en_US',
|
||||
viewDistance: viewDistanceBits,
|
||||
chatFlags: chatBits,
|
||||
chatColors: bot.settings.colorsEnabled,
|
||||
skinParts,
|
||||
mainHand: handBits,
|
||||
enableTextFiltering: bot.settings.enableTextFiltering,
|
||||
enableServerListing: bot.settings.enableServerListing
|
||||
})
|
||||
}
|
||||
|
||||
bot.settings = {
|
||||
chat: options.chat || 'enabled',
|
||||
colorsEnabled: options.colorsEnabled == null
|
||||
? true
|
||||
: options.colorsEnabled,
|
||||
viewDistance: options.viewDistance || 'short',
|
||||
difficulty: options.difficulty == null
|
||||
? 2
|
||||
: options.difficulty,
|
||||
skinParts: options.skinParts == null
|
||||
? {
|
||||
showCape: true,
|
||||
showJacket: true,
|
||||
showLeftSleeve: true,
|
||||
showRightSleeve: true,
|
||||
showLeftPants: true,
|
||||
showRightPants: true,
|
||||
showHat: true
|
||||
}
|
||||
: options.skinParts,
|
||||
mainHand: options.mainHand || 'left',
|
||||
// offHand: options.offHand || 'left',
|
||||
enableTextFiltering: options.enableTextFiltering || false,
|
||||
enableServerListing: options.enableServerListing || true
|
||||
}
|
||||
|
||||
bot._client.on('login', () => {
|
||||
setSettings({})
|
||||
})
|
||||
|
||||
bot.setSettings = setSettings
|
||||
}
|
||||
|
||||
const hasOwn = {}.hasOwnProperty
|
||||
function extend (obj, src) {
|
||||
for (const key in src) {
|
||||
if (hasOwn.call(src, key)) obj[key] = src[key]
|
||||
}
|
||||
return obj
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
function inject (bot, context) {
|
||||
|
||||
const buildstring = process.env['buildstring']
|
||||
const util = require('node:util')
|
||||
const { EventEmitter } = require('events')
|
||||
console.log(`Starting ${buildstring} .......`)
|
||||
console.log(`Username: ${bot.options.username}`)
|
||||
console.log(`Host: ${bot.options.host}:${bot.options.port}`)
|
||||
console.log(`Minecraft java version: ${bot.options.version}`)
|
||||
|
||||
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
@@ -1,10 +0,0 @@
|
||||
function test (bot, options, context) {
|
||||
const randomstring = require("randomstring")
|
||||
bot.test = {
|
||||
amonger () {
|
||||
bot.tellraw('Hello World!')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = test
|
||||
@@ -1,78 +0,0 @@
|
||||
const clamp = require("../util/clamp");
|
||||
function tpsbar(bot, config) {
|
||||
const bossbarName = "tps";
|
||||
|
||||
let enabled = false;
|
||||
bot.tps = {
|
||||
on() {
|
||||
enabled = true;
|
||||
},
|
||||
off() {
|
||||
enabled = false;
|
||||
bot.core.run(`minecraft:bossbar remove ${bossbarName}`);
|
||||
},
|
||||
};
|
||||
|
||||
const tickRates = [];
|
||||
let nextIndex = 0;
|
||||
let timeLastTimeUpdate = -1;
|
||||
let timeGameJoined;
|
||||
|
||||
const interval = setInterval(() => {
|
||||
if (!enabled) return;
|
||||
|
||||
const component = {
|
||||
translate: `https://doin-your.mom TPS - %s`,
|
||||
color: "gray",
|
||||
bold: false,
|
||||
with: [{ text: getTickRate(), color: "green" }],
|
||||
};
|
||||
bot.core.run(`minecraft:bossbar add ${bossbarName} ""`);
|
||||
bot.core.run(`minecraft:bossbar set ${bossbarName} players @a`);
|
||||
bot.core.run(`minecraft:bossbar set ${bossbarName} color yellow`);
|
||||
bot.core.run(`minecraft:bossbar set ${bossbarName} visible true`);
|
||||
bot.core.run(`minecraft:bossbar set ${bossbarName} style progress`);
|
||||
bot.core.run(
|
||||
`minecraft:bossbar set ${bossbarName} name ${JSON.stringify(component)}`,
|
||||
);
|
||||
bot.core.run(`minecraft:bossbar set ${bossbarName} max 20`);
|
||||
bot.core.run(
|
||||
`minecraft:bossbar set ${bossbarName} value ${Math.floor(getTickRate())}`,
|
||||
);
|
||||
// bot.tellraw(Math.floor(getTickRate()))
|
||||
}, 100);
|
||||
|
||||
function getTickRate() {
|
||||
if (Date.now() - timeGameJoined < 4000) return "Calculating...";
|
||||
|
||||
let numTicks = 0;
|
||||
let sumTickRates = 0.0;
|
||||
for (const tickRate of tickRates) {
|
||||
if (tickRate > 0) {
|
||||
sumTickRates += tickRate;
|
||||
numTicks++;
|
||||
}
|
||||
}
|
||||
|
||||
const value = (sumTickRates / numTicks).toFixed(2);
|
||||
if (value > 20) return 20;
|
||||
else return value;
|
||||
}
|
||||
|
||||
bot.on("login", () => {
|
||||
nextIndex = 0;
|
||||
timeGameJoined = timeLastTimeUpdate = Date.now();
|
||||
});
|
||||
|
||||
bot._client.on("update_time", () => {
|
||||
const now = Date.now();
|
||||
const timeElapsed = (now - timeLastTimeUpdate) / 1000.0;
|
||||
tickRates[nextIndex] = clamp(20.0 / timeElapsed, 0.0, 20.0);
|
||||
nextIndex = (nextIndex + 1) % tickRates.length;
|
||||
timeLastTimeUpdate = now;
|
||||
});
|
||||
|
||||
bot.on("end", () => clearInterval(interval));
|
||||
}
|
||||
|
||||
module.exports = tpsbar;
|
||||
Generated
+5290
-3075
File diff suppressed because it is too large
Load Diff
+17
-12
@@ -1,35 +1,40 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@npmcli/arborist": "^7.2.0",
|
||||
"@npmcli/metavuln-calculator": "^7.0.0",
|
||||
"@tonejs/midi": "^2.0.28",
|
||||
"@vitalets/google-translate-api": "^9.2.0",
|
||||
"axios": "^1.6.2",
|
||||
"chalk": "^5.3.0",
|
||||
"axios": "^1.5.1",
|
||||
"chromium": "^3.0.3",
|
||||
"color-convert": "^2.0.1",
|
||||
"cowsay2": "^2.0.4",
|
||||
"discord.js": "^14.14.1",
|
||||
"dockerode": "^4.0.0",
|
||||
"discord.js": "^14.12.1",
|
||||
"dotenv": "^16.3.1",
|
||||
"isolated-vm": "^4.6.0",
|
||||
"minecraft-data": "^3.53.0",
|
||||
"minecraft-protocol": "^1.45.0",
|
||||
"minecraft-data": "^3.46.2",
|
||||
"minecraft-protocol": "^1.44.0",
|
||||
"minecraft-protocol-forge": "^1.0.0",
|
||||
"mineflayer": "^4.14.0",
|
||||
"mineflayer-cmd": "^1.1.3",
|
||||
"moment-timezone": "^0.5.43",
|
||||
"node-fetch": "^2.7.0",
|
||||
"npm": "^9.5.1",
|
||||
"node_characterai": "^1.1.3",
|
||||
"node_characterai_edited": "^1.1.5",
|
||||
"node-weatherunderground": "^1.2.0",
|
||||
"openweather-api-node": "^3.1.2",
|
||||
"prismarine-chat": "^1.9.1",
|
||||
"prismarine-nbt": "^2.2.1",
|
||||
"prismarine-physics": "^1.8.0",
|
||||
"prismarine-registry": "^1.7.0",
|
||||
"randomstring": "^1.3.0",
|
||||
"readline": "^1.3.0",
|
||||
"sharp": "^0.32.6",
|
||||
"urban-dictionary": "git+https://code.chipmunk.land/ChipmunkMC/urban-dictionary.git",
|
||||
"urban-dictionary-client": "^3.1.0",
|
||||
"urban-dictionary": "^3.0.2",
|
||||
"uuid-by-string": "^4.0.0",
|
||||
"vec3": "^0.1.8",
|
||||
"vm2": "^3.9.19",
|
||||
"wikipedia": "^2.1.1"
|
||||
"vm2-fixed": "^0.0.1",
|
||||
"weather-js": "^2.0.0",
|
||||
"wikipedia": "^2.1.1",
|
||||
"wunderground-api": "^1.1.4",
|
||||
"yo-mamma": "^1.3.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
function clamp (value, min, max) {
|
||||
if (value < min) return min
|
||||
return Math.min(value, max)
|
||||
}
|
||||
|
||||
module.exports = clamp
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user