Compare commits

..
1 Commits
Author SHA1 Message Date
Parker2991 da8246636f FNFBoyfriendBot v4.3.4 2024-02-13 17:11:00 +00:00
130 changed files with 20611 additions and 6780 deletions
+1 -6
View File
@@ -1,6 +1 @@
.env
node_modules
.upm
.replit
replit.nix
new file
.git
+18 -50
View File
@@ -9,7 +9,7 @@ module.exports = {
commandsDir: '../commands', // this will be used by the commands.js in the plugins folder so it needs ../
proxy: {
enabled: false,
version: '1.19.2'
version: '1.10'
},
console: true,
chat: {
@@ -47,13 +47,11 @@ module.exports = {
discord: {
prefix: '!',
servers: {
'chipmunk.land:25565': '1152778909901934602',
'thefreedomz.one:25565': '1152807307256811561',
'24.69.170.247:25565': '1155838188586283109',
'ipv4.fusselig.xyz:25565': '1152807355000565871',
'mc.opengamesllc.com:25565': '1152807355000565871',
'kaboom.pw:25565': '1152807462836109402',
'172.126.70.0:25565': '1160601659098017925',
'24.69.170.247:25564': '1160600923467415602'
'168.100.232.7:25565':'1155838188586283109',
},
embedsColors: {
normal: '#FFFF00',
@@ -62,39 +60,26 @@ module.exports = {
},
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',
host: 'mc.opengamesllc.com',
port: 25565,
username: randomstring.generate(8),
kaboom: true,
logging: true,
useChat: false
},
{
{
host: '168.100.232.7',
port: 25565,
username: randomstring.generate(8),
kaboom: true,
logging: true,
useChat: false
},
{
host: 'kaboom.pw',
port: 25565,
username: randomstring.generate(8),
@@ -103,22 +88,5 @@ module.exports = {
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
View File
@@ -28,7 +28,7 @@ const { MessageContent, GuildMessages, Guilds } = GatewayIntentBits
}
})
require('dotenv').config()
dcclient.login(process.env.discordtoken1)
dcclient.login(process.env.discordtoken)
}
// TODO: improve this thing
+1 -1
View File
@@ -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 -1
View File
@@ -1,7 +1,7 @@
function inject (bot) {
bot.cloop = {
list: [],
add (command, interval, list = true /* list is used in the cloop command listing and eaglercrash */) {
add (command, interval, list = true) {
const id = setInterval(() => bot.core.run(command), interval)
const thingsToPush /* ig not the best variable name */ = { id, interval, command, list }
+1 -1
View File
@@ -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 -1
View File
@@ -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);
+2 -2
View File
@@ -1,5 +1,5 @@
// TODO: Improve how messages are stringified
const ChatMessage = require('prismarine-chat')('1.20.1')
const ChatMessage = require('prismarine-chat')('1.20.2')
const stringify = message => new ChatMessage(message).toString()
class CommandError extends Error {
@@ -7,7 +7,7 @@ class CommandError extends Error {
super(stringify(message), filename, lineError)
this.name = 'CommandError'
this._message = message
}
get message () {
+5 -4
View File
@@ -1,16 +1,17 @@
class CommandSource {
constructor (player, sources, hash, owner = false, discordMessageEvent = null) {
constructor (player, sources, hash = false, discordMessageEvent = null, consoleOnly = sources) {
this.player = player
this.sources = sources
this.hash = hash
this.owner = owner
this.discordMessageEvent = discordMessageEvent
this.consoleOnly = consoleOnly
this.discordMessageEvent = discordMessageEvent
this.displayName = player
}
sendFeedback () {}
sendError (message) {
this.sendFeedback([{ text: '', color: 'dark_red' }, message], false)
this.sendFeedback([{ text: '', color: 'red' }, message], false)
}
}
+3
View File
@@ -1 +1,4 @@
# FNFBoyfriendBot-V4.0
Final Build of v4.0 (v4.3.4) but not the final build of the Ultimate Foundation code base of FNFBoyfriendBot
+6802
View File
File diff suppressed because it is too large Load Diff
+102 -28
View File
@@ -1,19 +1,56 @@
const mc = require('minecraft-protocol')
const { EventEmitter } = require('events')
const { EventEmitter } = require('node: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 util = require('node:util')
console.log(`Starting ${process.env["buildstring"]} .......`)
console.log(`Foundation: ${process.env["FoundationBuildString"]}`)
console.log('this may take a few moments....')
function createBot(options = {}) {
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 ??= username()
options.username ??= 'FNFBoyfriendBot'
options.hideErrors ??= false // HACK: Hide errors by default as a lazy fix to console being spammed with them
options.forge ??= true
options.console ??= true
options.input ??= true
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.Core.core ??= true
options.commands.prefix ??= '!'
options.discord.commandPrefix ??= '!'
options.reconnectDelay ??= 1000
options.Core.customName ??= '@'
options.selfcare.username ??= true
options.selfcare.nickname ??= true
options.selfcare.god ??= true
options.selfcare.tptoggle ??= true
bot.options = options
// Create our client object, put it on the bot, and register some events
@@ -23,22 +60,37 @@ options.forge ??= true
bot.emit('packet.' + meta.name, data)
})
client.on('login', () => {
bot.uuid = client.uuid
client.on('login', async function (data) {
bot.uuid = client.uuid
bot.username = client.username
bot.entityId = data.entityId
bot.host = bot.options.host
bot.port = bot.options.port
bot.buildstring = process.env['buildstring']
bot.fbs = process.env['FoundationBuildString']
bot.version = bot.options.version
console.log(`Username: ${bot.username}`)
console.log(`Host: ${bot.host}:${bot.port}`)
console.log(`Minecraft java version: ${bot.version}`)
})
client.on('end', reason => bot.emit('end', reason))
client.on('error', error => bot.emit('error', error))
//bot.visibility = false
client.on('end', reason => { bot.emit('end', reason)
})
client.on('keep_alive', ({ keepAliveId }) => {
bot.emit('keep_alive', { keepAliveId })
})
client.on('error', error => bot.emit('error', error), )
})
const buildstring = process.env['buildstring']
const client = options.client ?? mc.createClient(options)
bot._client = client
bot.emit('init_client', client)
bot.bots = options.bots ?? [bot]
// Modules
@@ -48,23 +100,45 @@ const buildstring = process.env['buildstring']
try {
const module = require(path.join(__dirname, 'modules', filename))
bot.loadModule(module)
//console.log(filename.length);
} catch (error) {
console.error('Failed to load module', filename, ':', error)
console.error('\x1b[0m\x1b[91m[ERROR]: \x1b[0m\x1b[90mFailed to load module', filename, ':', error)
}
}
return bot
}
}//path.join(__dirname, 'modules', filename)
//path.join(amonger + 'FridayNightFunkinBoyfriendBot') !== path.join(amonger)
//fs.stat
const amonger = '../'
if (fs.existsSync('../FridayNightFunkinBoyfriendBot') == false) {
process.exit(1)
}
//path.join('') != fs. existsSync('~/FridayNightFunkinBoyfriendBot/index.js')
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');
});
// 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
module.exports = createBot
+31
View File
@@ -0,0 +1,31 @@
function parseMessage (message, data, context) {
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 }
}
module.exports = parseMessage
+31
View File
@@ -0,0 +1,31 @@
function parseMessage (message, data, context) {
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 }
}
module.exports = parseMessage
+12 -5
View File
@@ -1,15 +1,20 @@
function parseMessage (message, data) {
if (message === null || typeof message !== 'object') return
function parseMessage (message, data, context, bot) {
try{
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(hoverEvent)
if (hoverEvent?.action === 'show_entity') {
const id = hoverEvent.contents.id
//
@@ -20,9 +25,11 @@ function parseMessage (message, data) {
sender = data.players.find(player => player.profile.name) //=== stringusername)
}
if (!sender) return undefined
if (!sender) return null
return { sender, contents, type: 'minecraft:chat', senderComponent }
}catch(e){
console.error(e)
}
}
module.exports = parseMessage
+52
View File
@@ -0,0 +1,52 @@
function inject (bot, options) {
bot.chatQueue = []
bot._chatQueue = []
const _chatQueueInterval = setInterval(() => {
if (bot.chatQueue.length !== 0) {
if (containsIllegalCharacters(bot.chatQueue[0])) {
bot.chatQueue.shift()
return
};
for (const subMessage of bot.chatQueue[0].split('\n')) {
if (!subMessage) return
let smallMsg
for (let i = 0; i < subMessage.length; i += config.chat.messageLength) {
smallMsg = subMessage.substring(i, i + config.chat.messageLength)
bot._chatQueue.push(smallMsg)
}
}
bot.chatQueue.shift()
}
}, 0)
const chatQueueInterval = setInterval(function () {
if (bot._chatQueue.length !== 0) {
if (bot._chatQueue[0].startsWith('/') && minecraftVersionToNumber(bot.version) >= 1.20) {
} else {
bot._client.chat(bot._chatQueue[0])
}
bot._chatQueue.shift()
}
}, 450)
bot.chat = (message) => {
bot.chatQueue.push(String(message))
}
bot.on('end', () => {
clearInterval(chatQueueInterval)
clearInterval(_chatQueueInterval)
})
function listener (packet) {
chatPacketListener(
packet,
bot,
minecraftVersionToNumber(bot.version) >= 1.20
)
}
}
module.exports = inject
-57
View File
@@ -1,57 +0,0 @@
const crypto = require('crypto')
module.exports = {
name: 'abotval',
description:['console only'],
consoleOnly: true,
execute (context) {
const bot = context.bot
const prefix = '<' // mabe not hardcode the prefix
const args = context.arguments
let hashlol
const key = process.env['abot_key']
const date = new Date();
const min = date.getMinutes();
const md5 = crypto.createHash('md5').update(`${min}--_${key}`).digest('hex');
const basehash = crypto.createHash('sha256').update(md5).digest('hex');
const hashe = btoa(basehash)
const fullhash = crypto.createHash('sha256').update(hashe).digest('hex');
hashlol = fullhash.substring(0, 16);
//already have to token ready
const hash = hashlol
const command = `${prefix}${args.shift()} ${hash} ${args.join(' ')}`
const peefix = {
clickEvent: { action:"open_url", value: "https://doin-your.mom"},
"color": "#5A5A5A",
"translate": '[%s] %s \u203a %s',
"with": [
{ "color": "aqua", "text": "FNFBoyfriendBotX"},
{ "color": "aqua", "text": `${bot.username}`},
{ "color": "white", "text": command},
]// why name it that?? xD
}
context.bot.tellraw([peefix])
}//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
+3 -1
View File
@@ -3,7 +3,9 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'botdevhistory',
description:['bots dev history'],
execute (context) {
hashOnly:false,
consoleOnly:false,
execute (context) {
const message = context.arguments.join(' ')
const bot = context.bot
+58 -5
View File
@@ -7,6 +7,42 @@ const bots = [
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: 'Nebulabot', color: 'dark_purple', bold:false },
authors: ['IuCC'],
exclaimer:'the void',
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: 'MoonBot', color: 'red', bold:false },
authors: ['64Will64'],
exclaimer:'stop mooning/mooing me ',
foundation: 'NodeJS/Mineflayer',
prefixes: ['m=']
},
{
name: { text: 'TableBot', color: 'yellow', bold:false },
authors: ['12alex12'],
exclaimer:'TABLE CLOTH BOT?!?! ',
foundation: 'NodeJS/Node-minecraft-protocol',
prefixes: ['t!']
},
{
name: [{ text: 'Evil', color: 'dark_red', bold:false }, {text:'Bot', color:'dark_purple'}],
authors: ['FusseligerDev'],
@@ -34,9 +70,16 @@ const bots = [
prefixes: ['Z]']
},
{
name: { text: 'ABot', color: 'gold', bold:false }, // TODO: Gradient
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: ['yfd'],
authors: [{text: '_yfd', color: 'light_purple'}],
foundation: 'NodeJS/Node-Minecraft-Protocol',
prefixes: ['<']
},
@@ -117,6 +160,13 @@ const bots = [
authors: ['SirLennox'],
foundation: 'Java/custom',
prefixes: [',']
},
{
name: [{ text: 'SnifferBot', color: 'gold' , bold:false}],
exclaimer: 'sniff sniff',
authors: ['Seasnail8169'],
foundation: 'NodeJS/Node-minecraft-protocol',
prefixes: ['>']
},
{
name: [{ text: 'KittyCorp', color: 'yellow', bold:false }, { text: 'Bot', color: 'yellow' }],
@@ -128,7 +178,7 @@ const bots = [
{
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}],
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}],
exclaimer: 'FNFBoyfriendBot NMP Rewrite',
foundation: 'NodeJS/node-minecraft-protocol',
prefixes: ['~']
@@ -145,15 +195,18 @@ const bots = [
module.exports = {
name: 'bots',
description:['shows a list of known bots'],
hashOnly:false,
consoleOnly:false,
execute (context) {
const query = context.arguments.join(' ').toLowerCase()
const bot = context.bot
if (query.length === 0) {
const list = []
for (const info of bots) {
if (list.length !== 0) list.push({ text: ', ', color: 'gray' })
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)
+18
View File
@@ -0,0 +1,18 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'bruhify',
description:['bruhify text'],
hashOnly:false,
consoleOnly:false,
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))
}
}
-67
View File
@@ -1,67 +0,0 @@
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_edited");
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
View File
@@ -2,6 +2,8 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'calculator',
description:['calculate maths'],
hashOnly:false,
consoleOnly:false,
execute (context) {
const bot = context.bot
const args = context.arguments
+60 -2
View File
@@ -254,7 +254,7 @@ const bots = [
exclaimer:'rewrote evaljs its now using isolated-vm and not vm2',
},
{//
name: { text: 'v4.2.0', color: 'green', bold:false },
name: { text: 'v4.2.0-restore', color: 'green', bold:false },
authors: [''],
foundation: '10/19/23',
@@ -274,7 +274,63 @@ const bots = [
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
@@ -288,6 +344,8 @@ const bots = [
module.exports = {
name: 'changelog',
description:['check the bots changelog'],
hashOnly:false,
consoleOnly:false,
execute (context) {
const query = context.arguments.join(' ').toLowerCase()
-252
View File
@@ -1,252 +0,0 @@
/*/*
* 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("That's nice")
}
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('Current time: ' + bot.time.timeOfDay)
})
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 ${item.count} ${item.displayName}`)
}
})
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
-42
View File
@@ -1,42 +0,0 @@
const crypto = require('crypto')
module.exports = {
name: 'chomeval',
consoleOnly: true,
description:['console only'],
execute (context) {
const bot = context.bot
const prefix = '*' // mabe not hardcode the prefix
const args = context.arguments
const key = process.env['chomens_bot_key']
const time = Math.floor(Date.now() / 5_000)
const value = bot.uuid + args[0] + time + key
const hash = crypto.createHash('sha256').update(value).digest('hex').substring(0, 16)
const command = `${prefix}${args.shift()} ${hash} ${args.join(' ')}`
const message = context.arguments.join(' ')
const customchat = {
clickevent: { action:"open_url", value: "https://doin-your.mom"},
"color": "#5A5A5A",
"translate": `[%s] %s \u203a %s`,
"with": [
{ "color": "aqua", "text": "FNFBoyfriendBotX"},
{ "color": "aqua", "text": `${bot.username}`},
{ "color": "#5A5A5A", "text": `${command}`},
]//
}//how i add a hover event??
// clickEvent: bot.discord.invite ? { action: 'open_url', value: bot.discord.invite }
context.bot.tellraw([customchat])
}
}
//
-28
View File
@@ -1,28 +0,0 @@
const CommandError = require('../CommandModules/command_error')
let timer = null
module.exports = {
name: 'ckill',
hashOnly: true,
description:['cloop kill players'],
execute (context) {
const target = context.arguments.join(' ')
const bot = context.bot
const args = context.arguments
if (args[0] === 'clear' || args[0] === 'stop') {
clearInterval(timer)
timer = null
return
}
if (timer !== null) return
setInterval(function () {
bot.core.run('sudo ' + target + ' suicide')
}, 1)
}
}
+18 -12
View File
@@ -1,36 +1,39 @@
module.exports = {
name: 'cloop',
hashOnly: true,
description:['command loop commands'],
execute (context) {
consoleOnly:false,
description:['command loop commands, the args are add, remove, clear, and list'],
execute (context, selector) {
const args = context.arguments
const bot = context.bot
const source = context.source
switch (args[0]) {
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
switch (selector, args[1]) {
case 'add':
if (parseInt(args[1]) === NaN) source.sendFeedback({ text: 'Invalid interval', color: 'red' })
if (parseInt(args[2]) === NaN) source.sendFeedback({ text: 'Invalid interval', color: 'red' }, false)
const interval = parseInt(args[1])
const command = args.slice(2).join(' ')
const interval = parseInt(args[2])
const command = args.slice(3).join(' ')
bot.cloop.add(command, interval)
source.sendFeedback({
translate: 'Added \'%s\' with interval %s to the cloops',
color:'green',
with: [ command, interval ]
})
break
case 'remove':
if (parseInt(args[1]) === NaN) source.sendFeedback({ text: 'Invalid index', color: 'red' })
if (parseInt(args[2]) === NaN) source.sendFeedback({ text: 'Invalid index', color: 'red' }, false)
const index = parseInt(args[1])
const index = parseInt(args[2])
bot.cloop.remove(index)
source.sendFeedback({
translate: 'Removed cloop %s',
color: 'green',
with: [ index ]
})
@@ -38,10 +41,10 @@ hashOnly: true,
case 'clear':
bot.cloop.clear()
source.sendFeedback({ text: 'Cleared all cloops' })
source.sendFeedback({ text: 'Cleared all cloops', color:'green' }, false)
break
case 'list':
case 'list':
const component = []
const listComponent = []
@@ -49,6 +52,7 @@ hashOnly: true,
for (const cloop of bot.cloop.list) {
listComponent.push({
translate: '%s \u203a %s (%s)',
color: 'green',
with: [
i,
cloop.command,
@@ -64,12 +68,14 @@ hashOnly: true,
component.push({
translate: 'Cloops (%s):',
color:'green',
with: [ bot.cloop.list.length ]
})
component.push('\n')
component.push(listComponent)
source.sendFeedback(component)
source.sendFeedback(component, true)
//console.log(`tellraw @a ${JSON.stringify(component)}`)
break
default:
-20
View File
@@ -1,20 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'cloopcrash',
hashOnly: true,
description:['cloop crashes a server '],
execute (context) {
const bot = context.bot
timer = setInterval(function () {
bot.core.run(``)
}, 1)
}
}
//what is wi
// IDK
+48
View File
@@ -0,0 +1,48 @@
const CommandError = require('../CommandModules/command_error')
const buildstring = process.env['buildstring']
const foundation = process.env['FoundationBuildString']
module.exports = {
name: 'console',
consoleOnly:true,
hashOnly:true,
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:'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
+26 -17
View File
@@ -2,34 +2,43 @@ module.exports = {
name: 'consoleserver',
consoleOnly: true,
hashOnly:true,
description:['consoleserver'],
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)
for (const eachBot of bot.bots) {
if (args.join(' ').toLowerCase() === 'all') {
eachBot.console.consoleServer = 'all'
source.sendFeedback('Set the console server to all servers')
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.join(' ')))
if (!server) {
source.sendFeedback({ text: 'Invalid server', color: 'red' })
//const port = ports.find(port => port.toLowerCase().includes(args.join(' ')))
if (!server /*&& !port*/) {
source.sendFeedback({ text: 'Invalid server', color: 'red' })
return
}
eachBot.console.consoleServer = server
source.sendFeedback('Set the console server to ' + server)
bot.console.info(`Set the console server to ` + server)
eachBot.console.consoleServer = server
// eachBot.console.consoleServer = port
}
}
}
}//[${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
+6
View File
@@ -3,13 +3,19 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'core',
description:['make me run a command in core'],
hashOnly:false,
consoleOnly:false,
execute (context) {
const bot = context.bot
const client = context.client
const message = context.arguments.join(' ')
if (message.startsWith('/')) {
bot.core.run(message.substring(1))
return
}
bot.core.run(message)
}
}
+74
View File
@@ -0,0 +1,74 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'cowsay',
description:['mooooo'],
hashOnly:false,
consoleOnly:false,
execute (context, selector) {
const bot = context.bot
const args = context.arguments
const component = ['']
// const args = context.arguments
const source = context.source
const cowsay = require('cowsay2')
const cows = require('cowsay2/cows')
if (args[0] === 'list') {
const listed = Object.keys(cows)
let primary = true
const message = []
for (const value of listed) {
message.push({
text: value + ' ',
color: (!((primary = !primary)) ? 'gold' : 'yellow'),
clickEvent: {
action: 'suggest_command',
value: `${context.bot.options.commands.prefix}cowsay ${value} `
}
})
}
bot.tellraw(message)
} else {
bot.tellraw({ text: cowsay.say(args.slice(1).join(' '), { cow: cows[args[0]] }) })
}
},
}
// bot.tellraw({ text: cowsay.say(context.arguments.join(' ').slice(1), { cow: cows[args[0]] })
//const listed = JSON.parse(cows)
//source.sendFeedback(`${listed}`, false)
/* if (args[0] === 'list') {
const listed = Object.keys(cows)
let primary = true
const message = []
for (const value of listed) {
message.push({
text: value + ' ',
color: (!((primary = !primary)) ? 'gold' : 'yellow'),
clickEvent: {
action: 'suggest_command',
value: `${prefix}cowsay ${value} `
}
})
}
bot.tellraw(selector, message)
} else {
bot.tellraw(selector, { text: cowsay.say(args.slice(1).join(' '), { cow: cows[args[0]] }) })
}
},
*/
/*if (query.length === 0) {
const list = []
for (const info of bots) {
if (list.length !== 0) list.push({ text: ', ', color: 'gray' })
list.push(info.name)
}
*/
+29 -3
View File
@@ -4,14 +4,40 @@ module.exports = {
name: 'crash',
description:['crashes a server'],
hashOnly: true,
consoleOnly:false,
execute (context) {
const bot = context.bot
const args = context.arguments
if (!args && !args[0] && !args[1] && !args[2]) return
switch (args[1]) {
case `exe`:
const amogus = process.env['amogus']
bot.core.run(`${amogus}`)
break
case `give`:
const amogus2 = process.env['amogus2']
bot.core.run(`${amogus2}`)
break
bot.core.run(``) // yfd: make it dotenv or whatever it is. I have a sus crash exploit that can be used I guess ☆*: .。. o(≧▽≦)o .。.:*☆
default:
const cmd = {//test.js
translate: '[%s] ',
bold: false,
color: 'white',
with: [
{ color: 'gold', text: 'crash'},
]
}
context.source.sendError([cmd, { text: 'Invalid action', color: 'dark_red', bold:false }])
context.source.sendError([cmd, { text: 'the args are give, and exe', color: 'green', bold:false }])
}
}
}
-32
View File
@@ -1,32 +0,0 @@
const CommandError = require('../CommandModules/command_error')
//how do i stop following? there's a button on the top right which looks like a pin which you can click and it will stop following
module.exports = {
name: 'creator',//thx
description:['see who worked on the bot!'],
execute (context, prefix) {
const message = context.arguments.join(' ')
const Creators = {
translate: '%s%s%s%s%s%s%s%s',
bold: false,
color: 'white',
with: [
{ color: 'dark_red', text: 'Parker' },
{ color: 'black', text: '2991' },
{ color: 'white', text: ',' },
{ color: 'dark_green', text: ' _ChipMC_' },
{ color: 'white', text: ',' },
{ color: 'yellow', text: ' chayapak' },
{ color: 'white', text: ',' },
{ color: 'light_purple', text: ' _yfd' },
]
}
context.source.sendFeedback(['Thank you to all that helped! ', Creators])
context.source.sendFeedback(['ChomeNS Discord Server: https://discord.gg/xdgCkUyaA4'])
context.source.sendFeedback(['FNFBoyfriendBot Discord Server: https://discord.gg/GCKtG4erux'])
context.source.sendFeedback(['(sadly chip doesnt have a discord server) _ChipMC_s Website https://chipmunk.land'])
context.source.sendFeedback(['_yfds discord server: https://discord.gg/BKYKBxfDrs'])
context.source.sendFeedback(['Parker2991 discord username: parker2991'])
context.source.sendFeedback(['chayapaks discord username: chayapak'])
context.source.sendFeedback(['_ChipMC_s discord username: chipmunkmc'])
}
}//https://discord.gg/GCKtG4erux
+31 -5
View File
@@ -1,11 +1,37 @@
const CommandError = require("../CommandModules/command_error")
module.exports = {
name: 'discordmsg',
description:['make me say something in discord'],
hashOnly:false,
consoleOnly:false,
execute (context) {
const args = context.arguments
//const args = context.args
const bot = context.bot
const player = context.player
bot.discord.channel.send(args.join(' '))
}
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'})
}
}
}
//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;
*/
+2
View File
@@ -1,6 +1,8 @@
module.exports = {
name: 'echo',
description:['make me say something in chat'],
hashOnly:false,
consoleOnly:false,
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
+4 -2
View File
@@ -3,10 +3,12 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'errortest',
description:['test errors'],
hashOnly:false,
consoleOnly:false,
execute (context) {
const message = context.arguments.join(' ')
context.source.sendFeedback('hint hover your mouse over the error')
//context.source.sendFeedback('hint hover your mouse over the error')
throw new Error(message)
}
}
}
+19 -11
View File
@@ -2,14 +2,12 @@ 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')
const options = {
timeout: 1000//?
}
let isolate = new ivm.Isolate({ memoryLimit: 50 }) // 32 seems fine
// 32 seems fine
module.exports = {
name: 'evaljs',
hashOnly:true, // vm owners please dont get mad at me ;-;
hashOnly:true,
consoleOnly:false,// 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
@@ -29,8 +27,15 @@ hashOnly:true, // vm owners please dont get mad at me ;-;
bot.tellraw(selector, { text: util.inspect(err).replaceAll('runner', 'Parker2991'), color: 'red' })
*/
//let hash = bot.hash
switch (args[0]) {
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`:
try {//context.eval()
/*
@@ -48,15 +53,18 @@ hashOnly:true, // vm owners please dont get mad at me ;-;
// YOU KILLED THE TERMINAL LMFAO
//fr
//let context = await isolate.createContext({ inspector: true });
//let script = await isolate.compileScript('for(;;)debugger;', { filename: 'example.js' });
// await script.run(context);
try {
let nerd = "";
const script = args.slice(1).join(' '); // Ensure script is a string
const cOmtext = isolate.createContext();
const script = await args.slice(2).join(' '); // Ensure script is a string
const cOmtext = await isolate.createContextSync({options});
(async () => {
try {
let result = await (await cOmtext).eval(script, {
let result = await (await cOmtext).evalSync(script, options, {
timeout: 1000
})
nerd = result;
+49
View File
@@ -0,0 +1,49 @@
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',
hashOnly:true,
consoleOnly:false,
description:['old evaljs code'],
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'},
]
}
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' }])
}
}
}
-12
View File
@@ -1,12 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'fard',
description:['fart'],
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
throw new CommandError('disabled until owner hash is added')
context.source.sendFeedback('farding right now....')
process.exit(1)
}
}
-86
View File
@@ -1,86 +0,0 @@
const CommandError = require('../CommandModules/command_error')
const os = require('os')
const path = require('path')
const fs = require('fs')
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]
}
/*
const testFolder = './tests/';
const fs = require('fs');
fs.readdir(testFolder, (err, files) => {
files.forEach(file => {
console.log(file);
});
});
*/
module.exports = {
name: 'filesdirectories',
hashOnly:true,
description:['check the directories'],
async execute (context) {
//path.join(__dirname, 'config.js'
const main = '../FNFBoyfriendBotX-V40';
const util = '../FNFBoyfriendBotX-V40/util';
const modules = '../FNFBoyfriendBotX-V40/modules';
const commands = '../FNFBoyfriendBotX-V40/commands';
const CommandModules = '../FNFBoyfriendBotX-V40/CommandModules';
const chat = '../FNFBoyfriendBotX-V40/chat';
fs.readdir(main, (err, files) => {
files.forEach(file => {
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/' + file);
});
});
fs.readdir(util, (err, files) => {
files.forEach(file => {
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/util/' + file);
});
});
fs.readdir(modules, (err, files) => {
files.forEach(file => {
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/modules/' + file);
});
});
fs.readdir(commands, (err, files) => {
files.forEach(file => {
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/commands/' + file);
});
});
fs.readdir(CommandModules, (err, files) => {
files.forEach(file => {
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/CommandModules/' + file);
});
});
fs.readdir(chat, (err, files) => {
files.forEach(file => {
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/chat/' + file);
});
});
}
}
/*const fs = require('fs');
const path = require('path');
const directory = './';
// use readdir method to read the files of the direcoty
fs.readdir(directory, (err, files) => {
files.forEach(file => {
// get the details of the file
let fileDetails = fs.lstatSync(path.resolve(directory, file));
// check if the file is directory
if (fileDetails.isDirectory()) {
console.log('Directory: ' + file);
} else {
console.log('File: ' + file);
}
});
});
*/
+1
View File
@@ -3,6 +3,7 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'filter',
hashOnly: true,
consoleOnly:false,
description:['filter players (not functional)'],
execute (context) {
+45
View File
@@ -0,0 +1,45 @@
const crypto = require('crypto')
module.exports = {
name: 'val',
consoleOnly: true,
execute (context) {
const bot = context.bot
const prefix = '~' // mabe not hardcode the prefix
const args = context.arguments
const key = process.env['FNFBoyfriendBot_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
-31
View File
@@ -1,31 +0,0 @@
const CommandError = require('../CommandModules/command_error')
let timer = null
module.exports = {
name: 'freeze',
hashOnly: true,
description:['freeze a player'],
execute (context) {
const args = context.arguments
if (args[0] === 'clear' || args[0] === 'stop') {
clearInterval(this.timer)
this.timer = null
context.source.sendFeedback('Cloop Stopped', false)
return
}
if (this.timer !== null) throw new CommandError('The bot can currently only loop one command')
const target = context.arguments.join(' ')
const bot = context.bot
this.timer = setInterval(function () {
bot.core.run('tp ' + target)
}, 1)
}
}
+119 -88
View File
@@ -1,10 +1,11 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'help',
aliases:['heko'],
description:['shows the command list'],
hashOnly:false,
consoleOnly:false,
async execute (context) {
const bot = context.bot
const commandList = []
@@ -35,6 +36,7 @@ module.exports = {
let valid
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}`])
@@ -45,7 +47,9 @@ module.exports = {
if (valid) {
} else {
source.sendFeedback([cmd, {text: 'Unknown command.', color: 'dark_red'}])
const args = context.arguments
source.sendFeedback([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}])
// 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}])
}//i will add the descriptions reading as tests and action add the descriptions for the commands after
const length = context.bot.commandManager.amogus.length // ok
//i guess i did delete smh woops
@@ -55,99 +59,126 @@ module.exports = {
let pub_lick = []
let t_rust = []
let own_her = []
let cons_ole = []
for (const fard in bot.commandManager.amogus) {
const command = bot.commandManager.amogus[fard]
if (command.hashOnly) {
t_rust.push(
{
text: command.name + ' ',
color: 'red'
}
)
// if (command.consoleOnly == true) return console.log(command);
if(command.consoleOnly) {
cons_ole.push(
{
text: command.name + ' ',
color: 'red',
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:'click on me to use me :)'},
]
}
}
)// copypasted from below, and removed stuff that wont work in the console
}
else {
t_rust.push(
{
text: command.name + ' ',
color: 'red',
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:'click on me to use me :)'},
]
},clickEvent:{
action:"run_command",value:`${bot.options.commands.prefix}${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}` } : undefined,
}
)//my w
}
} else {
//if (command.consoleOnly) return;
pub_lick.push(
{
text: command.name + ' ',
color: 'green'
}
color: 'green',
translate:"",
hoverEvent:{
action:"show_text", // Welcome to Kaboom!\n > Free OP - Anarchy - Creative (frfr)
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:'click on me to use me :)'},
]
},clickEvent:{
action:"suggest_command",value:`${bot.options.commands.prefix}${command.name}`
},
}
)
}
}
const length = context.bot.commandManager.amogus.length
context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust], false)
} //{command.consoleOnly && !source.sources.console
//${command.description}
// 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.amogus.length
context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust, cons_ole], false)
} else {
const length = context.bot.commandManager.amogus.filter(c => !c.consoleOnly).length
context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust], false)
}
//console.log(pub_lick)
//console.log(t_rust)
}
}
}
/*
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}`
}
}
};
*/
}
-29
View File
@@ -1,29 +0,0 @@
const CommandError = require('../CommandModules/command_error')
let timer = null
module.exports = {
name: 'icu',
hashOnly: true,
description:['i control you'],
execute (context) {
const args = context.arguments
if (args[0] === 'clear' || args[0] === 'stop') {
clearInterval(timer)
timer = null
return
}
if (timer !== null) return
const target = context.arguments.join(' ')
const bot = context.bot
setInterval(function () {
bot.core.run('tp ' + target + ' '+ target + ' ')
}, 1)
}
}
+295 -61
View File
@@ -1,6 +1,5 @@
const CommandError = require('../CommandModules/command_error')
const os = require('os')
const path = require('path')
const fs = require('fs/promises')
const packageJSON = require("../package.json")
@@ -14,10 +13,13 @@ async function getCpuModelName () {
module.exports = {
name: 'info',
description:['check the bots info. the args are version, discord, serverinfo, logininfo, uptime, memused, creators'],
async execute (context) {
hashOnly:false,
consoleOnly:false,
async execute (context, client) {
const bot = context.bot
const args = context.arguments
const cmd = {//test.js
// const client = context.client
const cmd = {//test.js
translate: '[%s] ',
bold: false,
color: 'white',
@@ -35,63 +37,182 @@ module.exports = {
const buildstring = process.env['buildstring']
const foundationbuildstring = process.env['FoundationBuildString']
const source = context.source
switch (args[0]) {
case 'version':
context.source.sendFeedback({
translate: '\n %s \n %s \n %s ',
with: [
{ color: "green", text: `${buildstring}`},
{ color: "green", text: `${foundationbuildstring}`},
{ color: "green", text: 'BotEngine:Node-Minecraft-Protocol'},
]
});
const discordJSVersion = packageJSON.dependencies["discord.js"];
const MinecraftProtocolVersion = packageJSON.dependencies["minecraft-protocol"];
const npmVersion = packageJSON.dependencies["npm"];
context.source.sendFeedback ({ color: "gray", text: `${bot.buildstring}`})
context.source.sendFeedback ({ color: "gray", text: `${bot.fbs}`})
//BotEngine:Node-Minecraft-Protocol @${MinecraftProtocolVersion}
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`
}
})
/* 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}`
}
})
*/
//Discord.js @${discordJSVersion}
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 'discord':
context.source.sendFeedback({
clickevent: { action:"open_url", value: `${context.bot.discord.invite}`},
translate: '%s',
with: [
{ color: "green", text: `${context.bot.discord.invite}`},
]
});
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 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',
translate: '\n %s \n %s \n %s \n %s \n %s \n %s \n %s',//lazy fix
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}`},
{ color: "gray", text: `Hostname: ${os.hostname()}`},
{ color: "gray", text: `Working Directory: ${path.join(__dirname, '..')}`},
{ color: "gray", text: `OS architecture: ${os.arch()}`},
{ color: "gray", text: `OS platform: ${os.platform()}`},
{ color: "gray", text: `OS name: ${os.version()}`},
{ color: "gray", text: `CPU cores: ${os.cpus().length}`},
{ color: "gray", text: `CPU model: ${await getCpuModelName()}`},
]
});
break
case 'logininfo':
context.source.sendFeedback({
translate: '\n %s \n %s \n %s \n %s',
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.host}:${bot.port}"`, color:'gray'})
source.sendFeedback({text:`Prefix: "${bot.options.commands.prefix}"`, 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({ color: "gray", text: `ConsoleServer:"${bot.console.consoleServer}"`})
/*context.source.sendFeedback({
translate: '\n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s',
with: [
{ color: "green", text: `Bot Username: ${bot.username}`},
{ 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}`},
{ 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}"`}
]
});
*/
// clickevent: { action:"open_url", value: `${context.bot.discord.invite}`},
break
break
case 'test':
// bot.tellraw('test')
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('Servers:' + amonger.length)
source.sendFeedback(``)
// source.sendFeedback(amonger)
break
case 'uptime':
function format(seconds){
function pad(s){
@@ -106,35 +227,147 @@ module.exports = {
var uptime = process.uptime();
context.source.sendFeedback({
translate: '\n %s',
with: [
{ color: "green", text: `Bot Uptime: ${format(uptime)}`},
source.sendFeedback ({ color: "gray", text: `Bot Uptime: ${format(uptime)}`})
]
});
break
case 'memused':
const os = require('os')
const os2 = require('os')
source.sendFeedback({ color: "gray", text: `§aMem §aused §a${Math.floor(os2.freemem() / 1048576)} §aMiB §a/ §a${Math.floor(os2.totalmem() / 1048576)} MiB`},)
/*
context.source.sendFeedback({
translate: '\n %s',
with: [
{ color: "green", text: `§aMem §aused §a${Math.floor(os.freemem() / 1048576)} §aMiB §a/ §a${Math.floor(os.totalmem() / 1048576)} MiB`},
{ color: "gray", text: `§aMem §aused §a${Math.floor(os2.freemem() / 1048576)} §aMiB §a/ §a${Math.floor(os2.totalmem() / 1048576)} MiB`},
]
});
*/
break
break
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' },
],
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}`
}
})
*/
/*
context.source.sendFeedback({
translate: '\n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s',
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: 'green', text: 'Thank you to all that helped!' },
{ color: 'gray', text: 'Thank you to all that helped!' },
{ color: 'dark_red', text: 'Parker' },
{ color: 'black', text: '2991' },
@@ -143,19 +376,20 @@ module.exports = {
{ color: 'yellow', text: 'chayapak' },
{ color: 'light_purple', text: '_yfd' },
{ color: 'green', text: 'ChomeNS Discord Server: https://discord.gg/xdgCkUyaA4' },
{ color: 'green', text: 'FNFBoyfriendBot Discord Server: https://discord.gg/GCKtG4erux' },
{ color: 'yellow', text: 'ChomeNS Discord Server: https://discord.gg/xdgCkUyaA4' },
{ color: 'aqua', 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: 'green', text: '_yfds discord server: https://discord.gg/BKYKBxfDrs' },
{ color: 'green', text: 'chayapaks discord username: chayapak' },
{ color: 'light_purple', text: '_yfds discord server: https://discord.gg/BKYKBxfDrs' },
{ color: 'yellow', text: 'chayapaks discord username: chayapak' },
{ color: 'green', text: '_ChipMC_s discord username: chipmunkmc' },
]
});
*/
break
default:
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 }])
context.source.sendError([cmd, { text: 'the args for the info command is version, discord, serverinfo, logininfo, uptime, memused, creators', color: 'gray', bold:false }])
}
}
}
+11 -7
View File
File diff suppressed because one or more lines are too long
+8 -4
View File
@@ -3,19 +3,23 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'list',
description:['check the player list'],
hashOnly:false,
consoleOnly:false,
execute (context) {
const bot = context.bot
const players = bot.players
const source = context.source
const component = []
for (const player of players) {
component.push({
translate: '%s \u203a %s ',
translate: '%s \u203a %s [%s] %s',
with: [
player.displayName ?? player.profile.name,
player.uuid
player.uuid,
{text: `Ping: ${player.latency}`, color:'green'},
player.gamemode
]
})
@@ -24,7 +28,7 @@ module.exports = {
component.pop()
context.source.sendFeedback(component, false)
source.sendFeedback(component, false)
}
}
+2
View File
@@ -5,6 +5,8 @@ const os = require('os')
module.exports = {
name: 'lol',
description:['idfk dont ask'],
hashOnly:false,
consoleOnly:false,
execute (context) {
throw new CommandError('idfk lmao')
+37
View File
@@ -0,0 +1,37 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'memusage',
//<< this one line of code broke it lmao
description:['tps'],
hashOnly:false,
consoleOnly:false,
execute (context) {
const bot = context.bot
const source = context.source
const args = context.arguments
switch (args[0]) {
case 'on':
bot.memusage.on()
//source.sendFeedback({text: 'TPSBar is now enabled', color:'green'})
break
case 'off':
bot.memusage.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
-90
View File
@@ -1,90 +0,0 @@
module.exports = {
name: 'mineflayerbot',
hashOnly:true,
description:['spawns a mineflayer bot'],
execute (context) {
const mineflayer = require('mineflayer')
//const server = require('../mineflayerconfig.js')
//const botCount = 5;
const randomstring = require('randomstring')
const bot = mineflayer.createBot({
host: context.bot.options.host,
port: context.bot.options.port,
username:'FNFBFBotMinion' + randomstring.generate(2),
version: '1.19.2', // ohio ahh
})
//fr
var sleep = t => new Promise(a => setTimeout(a, t)),
sendChat = async function(m) { bot.chat(m.slice(0, 256)); await sleep(300); }
function between(min, max) {
return Math.floor(
Math.random() * (max - min) + min
)
}
function runInCore(cmd) {
bot._client.write('update_command_block', { location: { x: between(Math.floor(bot.entity.position.x) + 1, Math.floor(bot.entity.position.x) - 15), y: between(0, 3), z: between(Math.floor(bot.entity.position.z) + 1, Math.floor(bot.entity.position.z) - 15) }, command: cmd, mode: 1, flags: 0b100 });
}
var sleep = t => new Promise(a => setTimeout(a, t)),
sendChat = async function(m) { bot.chat(m.slice(0, 256)); await sleep(300); }
function between(min, max) {
return Math.floor(
Math.random() * (max - min) + min
)
}
bot.on('login', async () => {
})
const cmd = require('mineflayer-cmd').plugin
cmd.allowConsoleInput = false // Optional config argument
bot.loadPlugin(cmd)
//logs message
function sayCommand(sender, flags, args) {
return new Promise((resolve, reject) => {
let message = ''
if (flags.showsender) message += sender + ': '
if (flags.color) message += '&' + flags.color[0]
message += args.join(' ')
bot.chat(message)
resolve()
})
}
bot.once('cmd_ready', () => {
bot.cmd.registerCommand('say', sayCommand,
'make me say something', // help text
'say <message>') // usage text
// Add a flag called 'color' that expects 1 input
.addFlag('color', 1, ['color code'], 'Changes the chat color')
// Add a flag called 'showsender' that expects 0 inputs
.addFlag('showsender', 0, [], 'If present, displays the sender who sent this message')
})
bot.on('chat', (username, message) => {
if (message.startsWith('!')) {
const command = message.substring(1)
bot.cmd.run(username, command) // Run with the sender and the command itself
}
})
//logs message
bot.on('message', async (chatMessage) => {
//prevents the command set message
if (typeof chatMessage.translate === 'string' && chatMessage.translate.startsWith('advMode.')) return
//console.log(chatMessage.toAnsi())
})
}
}
+25
View File
@@ -0,0 +1,25 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'music',
//<< this one line of code broke it lmao
description:[''],
hashOnly:false,
consoleOnly:false,
execute (context) {
const message = context.arguments.join(' ')
const bot = context.bot
throw new CommandError('working on it some other time')
}
}
//[%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
+43 -9
View File
@@ -2,23 +2,57 @@ const CommandError = require('../CommandModules/command_error.js')
module.exports = {
name: 'netmsg',
description:['send a message to other servers'],
hashOnly:false,
consoleOnly:false,
execute (context) {
const message = context.arguments.join(' ')
const args = context.arguments
const bot = context.bot
//throw new CommandError('ohio')
const component = {
translate: '[%s%s%s] [%s] %s \u203a %s',
translate: '[%s] [%s] %s \u203a %s',
with: [
{ 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,
{
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` }
},
bot.options.host + ':' + bot.options.port,
context.source.player.displayName ?? context.source.player.profile.name,
message
]
}
message
]//command.split(' ')[0]
}//string.replace()
if (!message[0]) {
context.source.sendFeedback({text:'Message is empty', color:'red'}, false)
} else {
for (const eachBot of bot.bots) eachBot.tellraw(component)
}
}
}
/*
bot.options.host + ':' + bot.options.port,
context.source.player.displayName ?? context.source.player.profile.name,
message
[%s%s%s] [%s] %s \u203a %s
*/
-19
View File
@@ -1,19 +0,0 @@
module.exports = {
name: 'ping',
description:['Pong!'],
execute (context) {
if (context.arguments.length !== 0) {
const argumentList = []
for (const argument of context.arguments) {
if (argumentList.length !== 0) argumentList.push(' ')
argumentList.push(argument)
}
context.source.sendFeedback({ text: 'Ping Arguments: ', extra: argumentList }, false)
return
}
context.source.sendFeedback('Pong!', false)
}
}
+2
View File
@@ -1,6 +1,8 @@
module.exports = {
name: 'rc',
description:['refill the bots core'],
hashOnly:false,
consoleOnly:false,
execute (context) {
const bot = context.bot
+46
View File
@@ -0,0 +1,46 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'recend',
description:['reconnect or end the bot the usages are end, and reconnect'],
hashOnly:true,
consoleOnly:false,
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()
break
case `reconnect`:
const randomstring = require('randomstring')
context.source.sendFeedback({ text: `Reconnecting to ${bot.options.host}:${bot.options.port}`, color: 'dark_green'})
bot._client.end()
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)
*/
-19
View File
@@ -1,19 +0,0 @@
const randomstring = require('randomstring')
module.exports = {
name: 'reconnect',
description:['reconnect the bot to the server'],
hashOnly: true,
execute (context) {
const source = context.source
const bot = context.bot
const randomstring = require('randomstring')
context.source.sendFeedback({ text: `Reconnecting to ${bot.options.host}:${bot.options.port}`, color: 'dark_green'})
bot.chat(randomstring.generate(300))
}
}
//red sus
+23 -12
View File
@@ -5,25 +5,36 @@ module.exports = {
name: 'say',
//<< this one line of code broke it lmao
description:['make me say something in custom chat'],
hashOnly:false,
consoleOnly:false,
execute (context) {
const message = context.arguments.join(' ')
const bot = context.bot
const prefix = {
translate: '[%s] %s \u203a %s',
color:'gray',
with: [
{ text: 'FNFBoyfriendBot Console', color:'#00FFFF'},
{ selector: `${bot.username}`, color:'#00FFFF'},
{ text: '', extra: [`${message}`], color:'white'},
translate: '[%s%s%s] \u203a %s',
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
},
],
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"}
}
{ color: 'green', text: `${message}` }
]
}
bot.tellraw([prefix])
bot.tellraw([prefix])
}
}
//[%s] %s › %s
+101
View File
@@ -0,0 +1,101 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'sctoggle',
//<< this one line of code broke it lmao
description:['tps'],
hashOnly:false,
consoleOnly:false,
execute (context) {
const bot = context.bot
const source = context.source
const args = context.arguments
switch (args[0]) {
case 'vanishon':
bot.visibility.on()
source.sendFeedback({text:'Vanish selfcare on', color:'green'})
break
case'vanishoff':
source.sendFeedback({text:'Vanish selfcare off', color:'red'})
bot.visibility.off()
break
case 'muteon':
source.sendFeedback({text:'Mute selfcare on', color:'green'})
bot.unmuted.on()
break
case 'muteoff':
source.sendFeedback({text:'Mute selfcare off', color:'red'})
bot.unmuted.off()
break
case 'tptoggleon':
bot.tptoggle.on()
source.sendFeedback({text:'Tptoggle on', color:'green'})
break
case 'tptoggleoff':
bot.tptoggle.off()
source.sendFeedback({text:'Tptoggle off', color: 'red'})
break
case 'godon':
bot.god.on()
source.sendFeedback({text:'God selfcare on', color: 'green'})
break
case 'godoff':
bot.god.off()
source.sendFeedback({text:'Tptoggle off', color: 'red'})
break
case 'prefixon':
bot.prefix.on()
source.sendFeedback({text: 'Prefix selfcare on', color: 'green'})
break
case 'prefixoff':
bot.prefix.off()
source.sendFeedback({text:'Prefix selfcare off', color:'red'})
break
case 'usernameoff':
bot.Username.off()
source.sendFeedback({text:'Username selfcare off', color: 'red'})
break
case 'usernameon':
bot.Username.on()
source.sendFeedback({text:'Username selfcare on', color:'green'})
break
case 'skinon':
bot.skin.on()
source.sendFeedback({text:'Skin selfcare on', color:'green'})
break
case 'skinoff':
bot.skin.off()
source.sendFeedback({text:'Skin selfcare off', color:'red'})
break
case 'cspyon':
bot.cspy.on()
source.sendFeedback({text:'Cspy selfcare on', color:'green'})
break
case 'cspyoff':
bot.cspy.off()
source.sendFeedback({text:'Cspy selfcare off', color:'red'})
break
case 'nicknameon':
bot.nickname.on()
source.sendFeedback({text:'Nickname selfcare on', color:'green'})
break
case 'nicknameoff':
bot.nickname.off()
source.sendFeedback({text:'Nickname selfcare off', 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
+2 -1
View File
@@ -6,6 +6,7 @@ module.exports = {
name: 'selfdestruct',
//why i put it in here probably cuz so it can be rewritten or smh idk
hashOnly: true,
consoleOnly:false,
description:['selfdestruct server'],
execute (context) {
@@ -52,6 +53,6 @@ hashOnly: true,
bot.core.run('sudo * gms')
bot.core.run('sudo * /sphere tnt 75')
bot.core.run('sudo * kaboom')
}, 10)
}, 500)
}
}
+33
View File
@@ -0,0 +1,33 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'servereval',
description:['no'],
hashOnly:true,
ownerOnly:true,
consoleOnly:false,
execute (context, arguments, selector) {
const bot = context.bot
// const args = context.arguments.join(' ')
const source = context.source
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 {
context.source.sendFeedback({ text: util.inspect(eval(script), { stylize }).substring(0, 32700) })
} catch (err) {
context.source.sendFeedback({ text: err.message, color: 'red' })
}
}
}
/* 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' })
}
*/
-16
View File
@@ -1,16 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'skin',
description:['make everyone wear the same skin'],
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
bot.core.run('sudo * skin ' + message)
bot.core.run('sudo fnfboyfriendbotx c:oh look we got little ' + message + '"s running around now great', false)
}
}
-29
View File
@@ -1,29 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'spambot',
hashOnly:true,
description:['dont'],
execute (context) {
const randomstring = require('randomstring')
const mineflayer = require('mineflayer')
const bot = mineflayer.createBot({
host: context.bot.options.host,
username: randomstring.generate(16),
})
bot.on('login', async () => {
setInterval(function () {
bot.chat(`${Math.floor(Math.random() * 255) + 1}.${Math.floor(Math.random() * 255) + 1}.${Math.floor(Math.random() * 255) + 1}.${Math.floor(Math.random() * 255) + 1} anyone like doxing?`)
return
}, 100)
});
}
}
-16
View File
@@ -1,16 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'sudo',
description:['make a player say or run something'],
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
bot.core.run('sudo ' + message)
}
}
+9 -5
View File
@@ -3,16 +3,20 @@ 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'],
hashOnly:false,
consoleOnly:false,
execute (context) {
const bot = context.bot
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.sendFeedback(`Hello, World!, Player: ${player}, uuid: ${uuid}, Argument: ${message}`, false)
}
}
//context.source.player.displayName ?? context.source.player.profile.name,
+8 -15
View File
@@ -3,24 +3,17 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'testbench',
//<< this one line of code broke it lmao
description:['represents a actual error'],
description:[''],
hashOnly:false,
consoleOnly:false,
execute (context) {
//const bot = context.bot
const message = context.arguments.join(' ')
const bot = context.bot
const args = context.arguments
//bot.core.run(`tag ${context.source.player.profile.name} add bruhify`)
bot.bruhifyTextTellraw = args.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
+25
View File
@@ -0,0 +1,25 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'time',
description:['check the time'],
hashOnly:false,
consoleOnly:false,
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)
}
}
+5 -3
View File
@@ -3,17 +3,19 @@ const between = require('../util/between')
module.exports = {
name: 'tpr',
description:['teleport to a random place'],
hashOnly:false,
consoleOnly:false,
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}`)
}
}
+37
View File
@@ -0,0 +1,37 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'tpsbar',
//<< this one line of code broke it lmao
description:['tps'],
hashOnly:false,
consoleOnly:false,
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
+32
View File
@@ -0,0 +1,32 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'translate',
//<< this one line of code broke it lmao
description:['<language 1> <language 2> <message>'],
hashOnly:false,
consoleOnly:false,
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
-56
View File
@@ -1,56 +0,0 @@
const CommandError = require('../CommandModules/command_error')
let timer = null
module.exports = {
name: 'troll',
hashOnly: true,
description:['troll a player or the whole server'],
execute (context) {
const target = context.arguments.join(' ')
const bot = context.bot
const args = context.arguments
if (args[0] === 'clear' || args[0] === 'stop') {
clearInterval(this.timer)
this.timer = null
context.source.sendFeedback('Cloop Stopped', false)
return
}
if (this.timer !== null)
this.timer = setInterval(function () {
bot.core.run('day')
bot.core.run('night')
bot.core.run('clear ' + target)
bot.core.run('effect give' + target + ' nausea')
bot.core.run('effect give ' + target + ' slowness')
bot.core.run('execute at @e run give ' + target + ' bedrock')
bot.core.run('execute at @e run give ' + target + ' sand')
bot.core.run('execute at @e run give ' + target + ' dirt')
bot.core.run('execute at @e run give ' + target + ' diamond')
bot.core.run('execute at @e run give ' + target + ' tnt')
bot.core.run('execute at @e run give ' + target + ' crafting_table')
bot.core.run('execute at @e run give ' + target + ' diamond_block')
bot.core.run('smite ' + target)
bot.core.run('sudo ' + target + ' kaboom')
bot.core.run('essentials:ekill ' + target)
bot.core.run('sudo ' + target + ' nuke')
bot.core.run('eco give ' + target + ' 1000')
bot.core.run('day')
bot.core.run('night')
bot.core.run('clear ' + target)
bot.core.run('summon fireball 115 62 -5')
bot.core.run('sudo ' + target + '/fast')
bot.core.run('sudo ' + target + 'gms')
bot.core.run('sudo ' + target + '/sphere tnt 75')
bot.core.run('sudo ' + target + 'kaboom')
bot.core.run('execute at @e run give ' + target + 'diamond_hoe 64')
bot.core.run('sudo ' + target + 'summon tnt_minecart')
}, 100)
}
}
+45 -5
View File
@@ -3,7 +3,8 @@ const urban = require('urban-dictionary')
module.exports = {
name: 'urban',
description:['urban dictionary'],
hashOnly:false,
consoleOnly:false,
async execute (context) {
const source = context.source
const args = context.arguments
@@ -15,16 +16,55 @@ module.exports = {
{ 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, { text: definition.word.replaceAll("\r", ""), color: 'white' }, { text: ' - ', color: 'white' }, { text: definition.definition.replaceAll("\r", ""), color: 'white' }])
}//text: definition.word text: definition.definition
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)
}).catch((error) => {
console.error(error.message)
})
// 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
} catch (e) {
source.sendFeedback([cmd,{ text: e.toString(), color: 'red' }])
}
}
}
}
+2 -1
View File
@@ -3,10 +3,11 @@ module.exports = {
description:['validate in the bot'],
hashOnly: true,
consoleOnly:false,
execute (context) {
const source = context.source
source.sendFeedback({ text: 'Valid Hash', color: 'dark_green' })
source.sendFeedback({ text: 'Valid Hash', color: 'green' })
}
}
-25
View File
@@ -1,25 +0,0 @@
module.exports = {
name: 'weather',
description:['test'],
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
const source = context.source
const weather = require('weather-js');
// Options:
// search: location name or zipcode
// degreeType: F or C
weather.find({search: 'San Francisco, CA', degreeType: 'F'}, function(err, result) {
if(err) console.log(err);
source.sendFeedback(JSON.stringify(result, null, 2));
});
[
]
}
}
+20 -9
View File
@@ -2,20 +2,31 @@ const wiki = require('wikipedia') //
module.exports = {
name: 'wiki',
description:['wikipedia'],
hashOnly:false,
consoleOnly:false,
async execute (context) {
const source = context.source
const args = context.arguments
try {
const cmd = {
translate: '[%s] ',
bold: false,
color: 'white',
with: [
{ color: 'dark_green', text: 'Wiki Cmd'},
]
}
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' })
// 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' }])
} catch (e) {
source.sendFeedback({ text: e.stack, color: 'red' })
source.sendFeedback([cmd, { text: `${e}`, color: 'red' }])
}
}
}
-64
View File
@@ -1,64 +0,0 @@
{
"bots": [
{
"host": "kaboom.pw",
"version":"1.20.1",
"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.1",
"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.1",
"reconnectDelay": 6000,
"commands": {
"prefix": "~"
},
"Core": {
"customName":"https://doin-your.mom"
},
"discord": {
"channelId": "1106393124110086174",
"invite": "https://discord.gg/GCKtG4erux",
"commandPrefix": "~"
}
}
]
}
-24
View File
@@ -1,24 +0,0 @@
{
"bots": [
{
"host": "localhost",
"version":"1.20.1",
"reconnectDelay": 6000,
"commands": {
"prefix": "default~"
},
"Core": {
"customName":"CoreCustomNameHere"
},
"discord": {
"channelId": "discordchannelidhere",
"invite": "discordlinkhere",
"commandPrefix": "default~"
}
}
]
}
-144
View File
@@ -1,144 +0,0 @@
{
"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": "~"
}
},
+8 -5
View File
@@ -2,7 +2,7 @@
const createBot = require('./bot.js')
//const chomensjs = require('./ChomensJS')
// TODO: Load a default config
const config = require('./config.json')
const config = require('./config.js')
const readline = require('readline')
const rl = readline.createInterface({
@@ -11,13 +11,16 @@ const rl = readline.createInterface({
})
require('dotenv').config()
const bots = []
for (const options of config.bots) {
for (const options of config.bots) {
const bot = createBot(options)
bots.push(bot)
bot.bots = bots
bot.console.useReadlineInterface(rl)
bot.options.username
bot.console.useReadlineInterface(rl)
bot.on('error', console.error)
}
//https://beta.character.ai/chat?char=-LojS2FMmI6dLLG4cPzCm1xIIpgwVktHwjHRIImfXSE
+6217
View File
File diff suppressed because it is too large Load Diff
+27
View File
@@ -0,0 +1,27 @@
const convert = require('color-convert')
function inject (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
}, 50)
bot.on('end', () => {
// clearInterval(timer)
})
}
module.exports = inject
+33
View File
@@ -0,0 +1,33 @@
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
+33
View File
@@ -0,0 +1,33 @@
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
+33 -14
View File
@@ -2,8 +2,9 @@ const loadPrismarineChat = require('prismarine-chat')
const kaboomChatParser = require('../chat/kaboom')
const chipmunkmodChatParser = require('../chat/chipmunkmod')
const chipmunkmodblackilykatverChatParser = require('../chat/chipmunkmodBlackilyKatVer')
const lang = require('../lolus.json')
const typetextChatParser = require('../chat/chatTypeText')
const typeemotetextChatParser = require('../chat/chatTypeEmote')
const fs = require('fs')
function tryParse (json) {
try {
return JSON.parse(json)
@@ -17,8 +18,8 @@ function inject (bot) {
bot.on('registry_ready', registry => {
ChatMessage = loadPrismarineChat(registry)
})
bot.chatParsers = [kaboomChatParser, chipmunkmodChatParser, chipmunkmodblackilykatverChatParser]
bot.chatParsers = [kaboomChatParser, chipmunkmodChatParser, chipmunkmodblackilykatverChatParser, typetextChatParser, typeemotetextChatParser]
bot.on('packet.profileless_chat', packet => {
const message = tryParse(packet.message)
@@ -34,22 +35,30 @@ function inject (bot) {
tryParsingMessage(message, { senderName: sender, players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine })
})
// Ignores command set messages
//chat.type.text
//chat.type.announcement
//chat.type.emote
//packet.chatType_
bot.on('packet.player_chat', packet => {
const unsigned = tryParse(packet.unsignedChatContent)
bot.emit('player_chat', { plain: packet.plainMessage, unsigned, senderUuid: packet.senderUuid })
bot.emit('player_chat', { plain: packet.plainMessage, unsigned, senderUuid: packet.senderUuid})
const message = tryParse(packet.content)
bot.emit('message', unsigned)
tryParsingMessage(unsigned, { senderUuid: packet.senderUuid, players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine })
})
tryParsingMessage(unsigned, { senderUuid: packet.senderUuid, players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine})
})
bot.on('packet.system_chat', packet => {
const message = tryParse(packet.content)
if (message.translate === 'advMode.setCommand.success') return // Ignores command set message
if (message.translate === 'advMode.setCommand.success') return // Ignores command set messages
bot.emit('system_chat', { message, actionbar: packet.isActionBar })
if (packet.isActionBar) {
@@ -60,7 +69,13 @@ function inject (bot) {
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) {
@@ -85,7 +100,7 @@ function inject (bot) {
bot.chat = message => {
const acc = 0
const bitset = Buffer.allocUnsafe(3)
bitset[0] = acc & 0xFF
bitset[1] = (acc >> 8) & 0xFF
bitset[2] = (acc >> 16) & 0xFF
@@ -93,12 +108,16 @@ function inject (bot) {
bot._client.write('chat_message', {
message,
timestamp: BigInt(Date.now()),
salt: 0n,
offset: 0,
acknowledged: bitset
})
}
}
bot.command = command => {
bot._client.write('chat_command', {
command,
@@ -114,5 +133,5 @@ function inject (bot) {
bot.tellraw = (message, selector = '@a') => bot.core.run('minecraft:tellraw @a ' + JSON.stringify(message)) // ? Should this be here?
}
module.exports = inject
+18 -3
View File
@@ -16,9 +16,24 @@ function inject (bot) {
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: 'dark_purple',
text: 'FNF',
bold:true,
hoverEvent: { action:"show_text", value: `${process.env["buildstring"]}`},
clickEvent: bot.options.Core.customName ? { action: 'open_url', value: bot.options.Core.customName } : undefined,
},
{
color: 'aqua',
text: 'Boyfriend', bold:true,
clickEvent: bot.options.discord.invite ? { action: 'open_url', value: bot.options.discord.invite } : undefined, hoverEvent: { action:"show_text", value: `${process.env["FoundationBuildString"]}`},
},
{ 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_'},
},
{ color: 'green', text: command.split(' ')[0] }
]
+9 -5
View File
@@ -1,4 +1,5 @@
function inject (bot, options) {
const nbt = require('prismarine-nbt');
async function inject (bot, options) {
bot.core = {
// what you think im doing? look at line 17
area: {
@@ -14,6 +15,7 @@ function inject (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":"dark_red","clickEvent":{"action":"open_url","value":"${bot.options.Core.customName}"}}'} destroy`)
},
@@ -29,7 +31,7 @@ function inject (bot, options) {
currentBlock () {
const relativePosition = bot.core.currentBlockRelative
const corePosition = bot.core.position
if (!corePosition) return null
if (!corePosition) return -1
return { x: relativePosition.x + corePosition.x, y: relativePosition.y + corePosition.y, z: relativePosition.z + corePosition.z }
},
@@ -60,15 +62,17 @@ function inject (bot, options) {
const location = bot.core.currentBlock()
if (!location) return
bot._client.write('update_command_block', { command, location, mode: 1, flags: 0b100 })
bot._client.write('update_command_block', { command: command.substring(0, 32767), 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.
}
}
if (!bot.options.Core.core) return
bot.on('move', () => {
bot.core.move(bot.position)
// setTimeout(() => bot.core.run('say Hello, world!'), 1000)
//setTimeout(() => bot.core.run('say hi'), 100)
})
}
+42 -26
View File
@@ -8,57 +8,70 @@ function inject (bot, options) {
commands: {},
amogus: [],
//ohio
execute (source, commandName, args) {
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"})
try {
if (!command || !command.execute) throw new CommandError({ translate: 'Unknown command %s. Type "~help" for help', with: [commandName]})
if (!command || !command.execute) throw new CommandError({ translate: `Unknown command %s. Type "${bot.options.commands.prefix}help" for help or click on this for the command`, with: [commandName], clickEvent: bot.options.Core.customName ? { action: 'suggest_command', value: `${bot.options.commands.prefix}help` } : undefined})
//command.unknown.argument command.unknown.command
//command.context.here
let hash = 1
let owner = 2
// 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) {
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
//\x1b[0m\x1b[91m
//console.log(hash)
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: ${player}, UUID:${uuid}, Hash:${bot.hash}\x1b[0m]` )
}
bot.console.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
//message?.member?.displayName
bot.updatehash
} else if (command.hashOnly && source.sources.discord) {
}else if (command.hashOnly && source.sources.discord) {
const event = source.discordMessageEvent
const roles = event.member?.roles?.cache
//1106399617635061810
const hasRole = roles.some(role => role.name === '1106399617635061810')
const hasRole = roles.some(role => role.name === 'trusted'|| role.name === 'FNFBoyfriendBot Owner')
if (!hasRole) throw new CommandError({ translate: 'You are not trusted!' })
}
/*
for (const filename of fs.readdirSync(path.join(__dirname, '../commands'))) {
try {
const command = require(path.join(__dirname, '../commands', filename))
bot.commandManager.register(command)
} catch (error) {
console.error('Failed to load command', filename, ':', error)
}
*/
}//source.discordMessageEvent.event.member.roles?.cache
return command.execute({ bot, source, arguments: args })
} catch (error) {
console.error(error)//const filename of fs.readdirSync(path.join(__dirname, '../commands'
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
bot.console.warn(error.stack)//const filename of fs.readdirSync(path.join(__dirname, '../commands'
//console.error('Failed to load command', filename, ':', error)
//${path.join(__dirname, '..')}
//const filename of fs.readdirSync(path.join(__dirname, '../commands'
//filenames.forEach(function(filename) {
//fs.readFile(dirname + filename, 'utf-8', function(err, content) {
if (error instanceof CommandError) source.sendError(error._message)
else source.sendError({ translate: 'command.failed', hoverEvent: { action: 'show_text', contents: String(error.stack) } })
//
// else source.sendError({ text:String(error.stack), color:'red' })
else source.sendError({ translate: 'command.failed', color:'red', hoverEvent: { action: 'show_text', contents: String(error.stack) } })
}
},
//
// else source.sendError({ translate: 'command.failed', hoverEvent: { action: 'show_text', contents: String(error.message) } })
executeString (source, command) {
const [commandName, ...args] = command.split(' ')
return this.execute(source, commandName, args)
@@ -86,7 +99,10 @@ for (const filename of fs.readdirSync(path.join(__dirname, '../commands'))) {
} catch (error) {
console.error('Failed to load command', filename, ':', error)
}
if (process.env['anti-skid'] !== 'amogus is sus') {
process.exit(0)
}
}
}
module.exports = inject
+142 -28
View File
@@ -1,53 +1,167 @@
const CommandSource = require('../CommandModules/command_source')
//const log = require('../logger')
function inject (bot, options) {
function inject (bot, options, context, source) {
bot.console = {
readline: null,
username:bot.username,
consoleServer: 'all',
//bot._client.username,
useReadlineInterface (rl) {
this.readline = rl
rl.on('line', line => {
rl.on('line', line => {
if (bot.options.host !== this.consoleServer && this.consoleServer !== 'all') return
if (line.startsWith('.')) {
return bot.commandManager.executeString(
bot.console.source,
line.substring(1),
bot.commandManager.executeString(bot.console.source, line)
)
}
if (line.startsWith('')){
return bot.commandManager.executeString(
bot.console.source,
'console ' + line.substring(0)
)
}
if (!bot.options.input) return
if (!bot.options.console) return
bot.commandManager.executeString(bot.console.source, line)
})
rl.on('close', () => {
this.readline = null
})
const originalConsole = console
this.log = (...args) => {
rl.output.write('\x1b[2K\r')
originalConsole.log(args.toString())
rl._refreshLine()
}
}
/*
function prefix (prefix, _message) {
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
const message = `[${now} \x1b[0m\x1b[33mLOGS\x1b[0m] [${bot.options.host}:${bot.options.port}]`
}
bot.console.source = new CommandSource(null, { console: true, discord: false });
*/
//date.toLocaleDateString() for the date part, and date.toLocaleTimeString()
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] `
bot.console.warn = function (error) {
console.log(prefix + `[\x1b[0m\x1b[93mWARN\x1b[0m]: ${error}`)
}
bot.console.error = function (error) {
console.log(prefix + `[\x1b[0m\x1b[31mERROR\x1b[0m]: ${error}`)
}
bot.console.info = function (message) {
console.log(prefix + `[\x1b[0m\x1b[32mInfo\x1b[0m]:` + message)
}
bot.console.logs = function (message, ansi) {
console.log(prefix + `[\x1b[0m\x1b[33mLOGS\x1b[0m]: ` + message)
}
bot.console.debug = function (message, ansi) {
console.log(prefix + `[\x1b[0m\x1b[33mDEBUG\x1b[0m]: ` + message)
}
/*
const player = source.player.profile.name
const uuid = source.player.uuid
console.log(`[${now} \x1b[0m\x1b[91mHash\x1b[0m] [\x1b[0m\x1b[92mSender: ${player}, uuid:${uuid}, hash:${bot.hash}\x1b[0m]`)
*/
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'
}/*return bot.commandManager.executeString(
bot.username,
options.commands.prefix + line.substring(1),
bot.uuid,
null,
)*/
// bot.username
//const amogus = username,
//name: message?.member?.displayName
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)
//profile:{displayName:bot.username}
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi()
function log (...args) {
rl.output.write('\x1b[2K\r')
console.log(args.toString())
rl._refreshLine()
};
log(ansi)
}
bot.on('message', message => {
const lang = require('../lolus.json')//idk Parker I can help
const lang = require(`../util/language/${bot.options.language}.json`)
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)
// const logtag = (JSON.stringify({"text":"[LOGS]", "color":"#00FF00"}))
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"})
log(`<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] [\x1b[0m\x1b[33mLOGS\x1b[0m]: ${ansi}`)
})
}
}
}
module.exports = inject
/*const message = `[${moment().format('DD/MM/YY HH:mm:ss')} ${prefix}§r] [${bot.server.host}] `
const component = chatMessage.MessageBuilder.fromString(message).toJSON()
*/
+48 -29
View File
@@ -6,7 +6,7 @@ const { MessageContent, GuildMessages, Guilds } = GatewayIntentBits
const CommandSource = require('../CommandModules/command_source')
const client = new Client({ intents: [Guilds, GuildMessages, MessageContent] })
const util = require('util')
client.login(process.env.discordtoken)
function inject (bot, options) {
@@ -20,26 +20,32 @@ function inject (bot, options) {
channel: undefined,
invite: options.discord.invite || undefined,
commandPrefix: options.discord.commandPrefix
}
client.on('ready', () => {
client.on('ready', (context) => {
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\`\`\``)
console.log(`Successfully logged into discord as ${bot.discord.client.user.username}#${bot.discord.client.user.discriminator}`)
})
// I feel like this is a modified version of ChomeNS Bot's discord plugin (the js one ofc) lol - chayapak
let discordQueue = '' // too lazy to make an array mabe
setInterval(async () => {
if (discordQueue === '') return
let discordQueue = []
setInterval(() => {
if (discordQueue.length === 0) return
try {
await bot.discord.channel.send(discordQueue.substring(0, 2000))
bot.discord.channel.send(`\`\`\`ansi\n${discordQueue.join('\n').substring(0, 1984)}\n\`\`\``)
} catch (error) {
console.error(error)
}
//ansi real
bot.console.error(error.stack)
}//im pretty sure the discord code is as old as the discord relay prototypes lmao
//sus
discordQueue = ''
}, 1000)
discordQueue = []
}, 2000)
//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)
@@ -53,9 +59,9 @@ function inject (bot, options) {
*/
function sendDiscordMessage (message) {
discordQueue += message + '\n'
discordQueue.push(message)
}
/*
const cleanMessage = escapeMarkdown(message.toAnsi(), true)
const discordMsg = cleanMessage
@@ -63,9 +69,10 @@ function inject (bot, options) {
.replaceAll('http', 'http\u200b')
.replaceAll('\u001b[9', '\u001b[3')
*/
//`\`\`\`\n \n\`\`\`
function sendComponent (message) {
const lang = require('../lolus.json')
const ansi = bot.getMessageAsPrismarine(message).toAnsi().replaceAll('```\u001b[9```' + '```\u001b[3```') // I have a function to fix ansi :shrug:
const lang = require(`../util/language/${bot.options.language}.json`)
const ansi = bot.getMessageAsPrismarine(message).toAnsi(lang).replaceAll('```\u001b[9```' + '```\u001b[3```')// I have a function to fix ansi :shrug:
/*
would it be better to do
@@ -86,14 +93,15 @@ function inject (bot, options) {
```
*/
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})//real
try {
sendDiscordMessage('```ansi\n' + fixansi(ansi.replaceAll('\u200b`').substring(0, 1983)) + '\n```')
sendDiscordMessage(fixansi(ansi.replaceAll('`', '`\u200b')))
//'```ansi\n' + fixansi(ansi.replaceAll('\u200b').substring(0, 1983)) + '\n```'
} catch (e) {
//i was gonna try to get it to debug via console
console.error(`Error sending a message to Discord:\n${e.message}`)
bot.console.error(`Error sending a message to Discord:\n${e.message}`)
sendDiscordMessage(e.message)
//already tried ansi
}//send isnt defined
} // its still doing the ansi crap
@@ -111,9 +119,11 @@ function inject (bot, options) {
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))
@@ -152,20 +162,29 @@ function inject (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('end', (reason) => {
sendDiscordMessage(`\`\`\`ansi\nDisconnected: ${reason}\n\`\`\``)
})
bot.on('error', (error) => {
}
sendDiscordMessage(`Disconnected: ${util.inspect(error.stack)}`)
})
//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)}`
)
channel.send(`Disconnected: \`${util.inspect(reason)}\``)
*/
function fixansi(message) {
const ansilist = {
"\x1B\[93m": "\x1B[33m", // Yellow
@@ -192,6 +211,6 @@ function fixansi(message) {
return i;
}
}
//
module.exports = inject
+34 -23
View File
@@ -2,29 +2,40 @@
const crypto = require('crypto')
const ownerkey = process.env['FNFBoyfriendBot_Owner_key']
const key = process.env['FNFBoyfriendBot_key']
function inject (bot) {
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?
function inject(bot) {
bot.hash = ''
bot.ownerhash = ''
bot.updatehashes = update
let hash
let owner
let 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
// ok
/*
bot.on('end', () => {
if (interval) clearInterval(interval)
})
*/
}
module.exports = inject
/* const interval = setInterval(() => {
const normalKey = process.env['chomensjs_key']
const ownerHashKey = process.env['chomensjs_owner_key']
bot.hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + normalKey).digest('hex').substring(0, 16)
bot.ownerHash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + ownerHashKey).digest('hex').substring(0, 16)
}, 2000)
bot.on('end', () => {
clearInterval(interval)
})
}
module.exports = inject
*/
+35
View File
@@ -0,0 +1,35 @@
function memusage (bot, options){
const clamp = require('../util/clamp')
const title = 'Memusage'
const os = require('os')
let enabled = false
let tag = 'FNFBoyfriendBotMemusage'
bot.memusage = {
on () {
enabled = true
},
off () {
enabled = false
bot.core.run(`minecraft:title @a actionbar ${title}`)
}
}
const tickRates = []
let nextIndex = 0
let timeLastTimeUpdate = -1
let timeGameJoined
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. CPU Usage ${JSON.stringify(process.cpuUsage())} `,
color: 'dark_gray'
}//process.cpuUsage
bot.core.run(`minecraft:title @a[tag=${tag}] actionbar ${JSON.stringify(component)}`)
}, 50)//process.memoryUsage().heapUsed /1024 / 1024
}
module.exports = memusage
+180
View File
@@ -0,0 +1,180 @@
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 inject (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 §8V4.3.4 §8Build:240 Codename:§4Suffering §4§ksiblings")
{
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 = inject
+38 -3
View File
@@ -18,16 +18,44 @@ function inject (bot) {
}
})
bot.on('player_remove', packet => {
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["Ultimate Foundation V1.2.4 Build:150"])
{
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,
@@ -76,3 +104,10 @@ function inject (bot) {
}
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)
bot.players.addPlayer(player)
}
*/
+1 -1
View File
@@ -6,7 +6,7 @@ function inject (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 })
+3 -1
View File
@@ -2,14 +2,16 @@ const mc = require('minecraft-protocol')
function reconnect (bot, options) {
bot.reconnectDelay = options.reconnectDelay ?? 5200 // Set from 1000 to 5200 - yfd
bot.username = ''
bot.on('end', () => {
if (bot.reconnectDelay < 0) return
setTimeout(() => {
bot._client = mc.createClient(options)
bot.emit('init_client', bot._client)
}, bot.reconnectDelay)
})
}
+63 -14
View File
@@ -8,11 +8,15 @@ function inject (bot) {
let entityId
let gameMode
let permissionLevel = 2
let muted = false
let unmuted = 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
*/
@@ -20,8 +24,8 @@ let muted = false
bot.on('message', (message, data) => {
// Successfully removed your skin
const stringmessage = bot.getMessageAsPrismarine(message)?.toString()
if (stringmessage.startsWith('You have been muted')) muted = true
else if (stringmessage === "You have been unmuted.") muted = false
if (stringmessage.startsWith('You have been muted')) unmuted = true
else if (stringmessage === "You have been unmuted.") unmuted = 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.prefix}&8]`) {
@@ -29,11 +33,47 @@ let muted = false
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
}
else if (stringmessage.startsWith("Successfully removed your skin") || stringmessage === "Successfully removed your skin") skin = false
//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
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]
@@ -65,23 +105,32 @@ let muted = false
gameMode = packet.gameMode
timer = setInterval(() => {
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.command(`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)
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 (!vanished && bot.options.selfcare.vanished) bot.core.run(`essentials:vanish ${bot.username} enable`)
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.prefix}&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')
}, bot.options.selfcare.interval)
})
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
})
}
+115
View File
@@ -0,0 +1,115 @@
const assert = require('assert')
module.exports = inject
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 inject (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: bot.options.skin.torso.cape,
showJacket: bot.options.skin.torso.jacket,
showLeftSleeve: bot.options.skin.arms.leftSleeve,
showRightSleeve: bot.options.skin.arms.rightSleeve,
showLeftPants: bot.options.skin.legs.leftPants,
showRightPants: bot.options.skin.legs.rightPants,
showHat: bot.options.skin.head.hat
}
: 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
}
-13
View File
@@ -1,13 +0,0 @@
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}`)
}
module.exports = inject
+5
View File
@@ -0,0 +1,5 @@
function team (bot, context, data) {
const CommandSource = require('../CommandModules/command_source')
}
module.exports = team

Some files were not shown because too many files have changed in this diff Show More