Compare commits

..
2 Commits
Author SHA1 Message Date
Parker2991 deed3b28b3 Add README.md 2025-01-07 07:53:51 -05:00
Parker2991 0cec6661f4 v4.0.0-alpha 2025-01-07 06:44:42 -06:00
24 changed files with 216 additions and 385 deletions
-204
View File
@@ -1,204 +0,0 @@
const mineflayer = require('mineflayer')
const discord = require('discord.js')
function createBot (host, port, channelId, client) {
let discordQueue = '' // too lazy to make an array mabe
const channel = client.channels.cache.get(channelId)
const randomstring = require('randomstring');
const bot = mineflayer.createBot({
host,
port,
username: randomstring.generate(6), // max 16 chars
version: '1.8.8',
hideErrors: false
});
var sleep = t => new Promise(a => setTimeout(a, t)),
sendChat = async function(m) { bot.chat(m.slice(0, 256)); await sleep(200); }
function between(min, max) {
return Math.floor(
Math.random() * (max - min) + min
)
}
// discord queue interval
setInterval(() => {
if (discordQueue === '') return
channel.send(discordQueue.substring(0, 2000))
discordQueue = ''
}, 1000)
function sendDiscordMessage (message) {
discordQueue += message
}
//variables
var prefix = '&8&l[&5&lFNF&b&lBoyfriend&4&lBot&8&l]';
function randomchar() {
const crypto = require("crypto");
var hash = crypto.createHash("md5");
var randomBytes = crypto.randomBytes(16);
hash.update(randomBytes);
var hashi = hash.digest(Math.round(Math.random()) ? "hex" : "Base64");
return hashi.substring(0, 16);
}
function log(message) {
console.log(`[${host}:${port}] ${message}`)
}
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 });
}
bot.on('login', async () => {
log('Bot has logged in to the server!');
bot.chat('/prefix [&5&lFNF&b&lBF&4&lBot&9&lDiscord&8&l]')
await sendChat('type ~help for commands')
})
//hexman what are you doing
const cmd = require('mineflayer-cmd').plugin
cmd.allowConsoleInput = false // Optional config argument
bot.loadPlugin(cmd)
function discordCommand(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(' ')
sendChat('https://www.discord.gg/GCKtG4erux')
resolve()
})
}
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(' ')
sendChat(message + '')
resolve()
})
}
function versionCommand(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(' ')
sendChat('join the FNFBoyfriendBot discord for more features')
resolve()
})
}
bot.once('cmd_ready', () => {
bot.cmd.registerCommand('version', versionCommand, // Create a new command called 'say' and set the executor function
'version', // help text
'~version') // usage text
})
bot.once('cmd_ready', () => {
bot.cmd.registerCommand('say', sayCommand, // Create a new command called 'say' and set the executor function
'make me say smh', // help text
'~say') // usage text
})
bot.once('cmd_ready', () => {
bot.cmd.registerCommand('discord', discordCommand, // Create a new command called 'say' and set the executor function
'Discord', // help text
'~discord') // usage text
})
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
//var ansi = bot.getMessageAsPrismarine(chatMessage)?.toAnsi()
//var string = bot.getMessageAsPrismarine(chatMessage)?.toString()
var now = new Date().toLocaleString()
console.log(`[${now}] [${host}${port !== 25565 ? `:${port}` : ''}] ` + chatMessage.toAnsi())
//[${now}] [${host}${port !== 25565 ? `:${port}` : ''}] ${toAnsi}
sendDiscordMessage('```ansi\n' + chatMessage.toAnsi().replaceAll("\u001b[9", "\u001b[3").replaceAll('`', '\u200b`') + '\n```')
})
function messageCreate (message) {
if (message.author.id === client.user.id) return
if (message.channel.id !== channel.id) return
bot.chat('&8&l[&5&lFNF&b&lBoyfriend&4&lBot&9&lDiscord&8&l] ' + `${message.member.displayName.replaceAll('\xa7', '&')}&r: ${message.content}`)
}
client.on('messageCreate', messageCreate)
bot.on('end', (reason) => {
log(`Disconnected: ${reason}`)
channel.send(`Disconnected: ${reason}`)
client.off('messageCreate', messageCreate)
bot.removeAllListeners()
setTimeout(() => createBot(host, port, channelId, client), 1000 * 7)
})
}
module.exports = { createBot }
//kk
//idk
-15
View File
@@ -1,15 +0,0 @@
const reconnect = require('./reconnect.js')
module.exports = {
servers: [
{
host: 'sus.shhnowisnottheti.me',
port:'25565',
discordChannelId : '1138891614299897987',
reconnect: '6000'
},
]
}
//1114036256951783514
-25
View File
@@ -1,25 +0,0 @@
const mineflayer = require('mineflayer')
//run in the shell if any of the relay chats isnt working
//pidof node | awk 'BEGIN { RS = " " } { print $1}' | while read line ; do kill $line ; done
//and then run kill 1
//const CreayunAndFoliaboom = require('./Relay chat(creayun and foliaboom)')
const { createBot } = require('./bot.js')
const config = require('./config.js')
const { Client, GatewayIntentBits } = require('discord.js')
const { MessageContent, GuildMessages, Guilds } = GatewayIntentBits
const client = new Client({ intents: [Guilds, GuildMessages, MessageContent] })
let channel;
client.on('ready', () => {
for (const server of config.servers) {
createBot(server.host, server.port, server.discordChannelId, client)
}
})
require('dotenv').config()
client.login(process.env['discordtoken'])
-14
View File
@@ -1,14 +0,0 @@
const mc = require('minecraft-protocol')
function inject (bot, options) {
bot.reconnectDelay = options.reconnectDelay ?? 1000
bot.on('end', () => {
if (bot.reconnectDelay < 0) return
bot._client = mc.createClient(options)
bot.emit('init_client', bot._client)
})
}
module.exports = inject
-1
View File
@@ -1,2 +1 @@
# FNFBoyfriendBotX4.0
this is a lost version of FNFBoyfriendBot found
+3
View File
@@ -0,0 +1,3 @@
chayapak mc server discord id 1106446640824455188
+2 -15
View File
@@ -5,10 +5,10 @@ const path = require('path')
function createBot(options = {}) {
const bot = new EventEmitter()
const randomstring = require('randomstring')
// Set some default values in options
options.host ??= 'localhost'
options.username ??= randomstring.generate(6)
options.username ??= 'Player'
options.hideErrors ??= true // HACK: Hide errors by default as a lazy fix to console being spammed with them
bot.options = options
@@ -50,18 +50,5 @@ const randomstring = require('randomstring')
return bot
}
const bot = new EventEmitter()
bot.on('end', (reason) => {
log(`Disconnected: ${reason}`)
channel.send(`Disconnected: ${reason}`)
client.off('messageCreate', messageCreate)
bot.removeAllListeners()
setTimeout(() => createBot(host, port, channelId, client), 1000 * 7)
})
module.exports = createBot
+80
View File
@@ -0,0 +1,80 @@
module.exports = {
name: 'cloop',
hashOnly: true,
execute (context) {
const args = context.arguments
const bot = context.bot
const source = context.source
switch (args[0]) {
case 'add':
if (parseInt(args[1]) === NaN) source.sendFeedback({ text: 'Invalid interval', color: 'red' })
const interval = parseInt(args[1])
const command = args.slice(2).join(' ')
bot.cloop.add(command, interval)
source.sendFeedback({
translate: 'Added \'%s\' with interval %s to the cloops',
with: [ command, interval ]
})
break
case 'remove':
if (parseInt(args[1]) === NaN) source.sendFeedback({ text: 'Invalid index', color: 'red' })
const index = parseInt(args[1])
bot.cloop.remove(index)
source.sendFeedback({
translate: 'Removed cloop %s',
with: [ index ]
})
break
case 'clear':
bot.cloop.clear()
source.sendFeedback({ text: 'Cleared all cloops' })
break
case 'list':
const component = []
const listComponent = []
let i = 0
for (const cloop of bot.cloop.list) {
listComponent.push({
translate: '%s \u203a %s (%s)',
with: [
i,
cloop.command,
cloop.interval
]
})
listComponent.push('\n')
i++
}
listComponent.pop()
component.push({
translate: 'Cloops (%s):',
with: [ bot.cloop.list.length ]
})
component.push('\n')
component.push(listComponent)
source.sendFeedback(component)
break
default:
source.sendFeedback({ text: 'Invalid action', color: 'red' })
break
}
}
}
-25
View File
@@ -1,25 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'console',
consoleOnly: true,
execute (context) {
const message = context.arguments.join(' ')
const prefix = {
translate: '[%s%s%s%s][%s] ',
bold: true,
color: 'gray',
with: [
{ color: 'dark_purple', text: 'FNF' },
{ color: 'aqua', text: 'Boyfriend' },
{ color: 'dark_red', text: 'Bot' },
{ color: 'black', text: 'X' },
{ color: 'dark_green', text: 'Console' },
]
}
context.bot.tellraw(['', prefix, message])
}
}
-17
View File
@@ -1,17 +0,0 @@
const CommandError = require('../CommandModules/command_error')
const os = require('os')
module.exports = {
name: 'meminfo',
execute (context) {
context.source.sendFeedback(`${os.cpus().length} cores cpu`, false)
context.source.sendFeedback(`${Math.floor(os.totalmem() / 1024 / 1024)} MB of ram`, false)
context.source.sendFeedback('32 GB of storage', false)
context.source.sendFeedback('Running on Github Codespaces', false)
context.source.sendFeedback('Device: Dell Chromebook 3100 with 2 GB of ram and 15 GB of storage and intel r celeron r dual core cpu :skull:', false)
}
}
// Math.floor(process.memoryUsage.heapUsed / 1024 / 1024)} / ${Math.floor(process.memoryUsage.heapTotal / 1024 / 1024)}
+2 -1
View File
@@ -7,7 +7,7 @@ module.exports = {
const message = context.arguments.join(' ')
const prefix = {
translate: '[%s%s%s%s] ',
translate: '[%s%s%s%s][%s] ',
bold: true,
color: 'white',
with: [
@@ -15,6 +15,7 @@ module.exports = {
{ color: 'aqua', text: 'Boyfriend' },
{ color: 'dark_red', text: 'Bot' },
{ color: 'black', text: 'X' },
{ color: 'green', text: 'Console'},
]
}
+1 -1
View File
@@ -2,7 +2,7 @@ const urban = require('urban-dictionary')
module.exports = {
name: 'urban',
hashOnly: true,
async execute (context) {
const source = context.source
const args = context.arguments
+4 -4
View File
@@ -4,10 +4,10 @@ module.exports = {
name: 'version',
execute (context) {
context.source.sendFeedback('v4.0.0', false)
context.source.sendFeedback('Foundation:Ultimate v1.0.0 Build:30')
context.source.sendFeedback('v4.0.0-Alpha', false)
context.source.sendFeedback('Foundation:Ultimate v1.0.0 Build:20')
context.source.sendFeedback('BotEngine:Node-Minecraft-Protocol', false)
context.source.sendFeedback('FridayNightFunkinBoyfriendBotX nmp rewrite of the FNFBoyfriendBot along with being a continuation of the bot', false)
context.source.sendFeedback('FridayNightFunkinBoyfriendBot Build:85')
context.source.sendFeedback('FNFBoyfriendBotX nmp rewrite of the FNFBoyfriendBot along with being a continuation of the bot', false)
context.source.sendFeedback('FNFBoyfriendBot Build:80')
}
}
+21 -3
View File
@@ -3,7 +3,7 @@
"bots": [
{
"host": "kaboom.pw",
"username": "FNFBoyfriendBotX",
"version":"1.20.1",
"reconnectDelay": 6000,
@@ -18,11 +18,29 @@
}
},
{
"host": "kitsune.icu",
"version":"1.20.1",
"username": "FNFBoyfriendBotX",
"reconnectDelay": 6000,
"commands": {
"prefix": "~"
},
"discord": {
"channelId": "1136358568354910309",
"invite": "https://discord.gg/GCKtG4erux",
"commandPrefix": "~"
}
},
{
"host": "kaboom.fusselig.xyz",
"version":"1.20.1",
"username": "FNFBoyfriendBotX",
"reconnectDelay": 6000,
"commands": {
@@ -40,7 +58,7 @@
{
"host": "chipmunk.land",
"version":"1.20.1",
"username": "FNFBoyfriendBotX",
"reconnectDelay": 6000,
"commands": {
+1 -19
View File
@@ -81,22 +81,4 @@
"invite": "https://discord.gg/GCKtG4erux",
"commandPrefix": "~"
}
},
{
"host": "kitsune.icu",
"version":"1.20.1",
"username": "FNFBoyfriendBotX",
"reconnectDelay": 6000,
"commands": {
"prefix": "~"
},
"discord": {
"channelId": "1136358568354910309",
"invite": "https://discord.gg/GCKtG4erux",
"commandPrefix": "~"
}
},
},
+36
View File
@@ -0,0 +1,36 @@
const { VM } = require('jvm')
const util = require('util')
const { stylize } = require('../util/eval_colors')
const options = {
timeout: 1000
}
let vm = new VM(options)
module.exports = {
name: 'evaljava',
execute (context) {
const source = context.source
const args = context.arguments
switch (args[0]) {
case 'run':
try {
const output = vm.run(args.slice(1).join(' '))
source.sendFeedback({ text: util.inspect(output, { stylize }) })
} catch (e) {
source.sendFeedback({ text: String(e), color: 'black' })
}
break
case 'reset':
vm = new VM(options)
source.sendFeedback('Successfully reset the eval context')
break
}
}
}
+5
View File
@@ -0,0 +1,5 @@
function generateHash () {
const sha256 = crypto.createHash('sha256')
sha256.update(Math.floor(Date.now() / 10000) + config.keys.normalKey).digest('hex').substring(0, 16)
}
//can i rename this to hash.js rq?
+6
View File
@@ -0,0 +1,6 @@
function generateHash (command, key, senderUUID, timestamp = Date.now()) {
const sha256 = crypto.createHash('sha256')
sha256.update(Math.floor(Date.now() / 10000) + config.keys.normalKey)
.digest('hex').substring(0, 16)
}
+3 -3
View File
@@ -1,6 +1,6 @@
const createBot = require('./bot.js')
const CreayunBot = require('./CreayunBot')
//const FoliaboomBot = require('./FoliaboomBot')
//const ohio = require('./creayunbot :skull:')
//const createcorelessbot = require('./creayun foliaboom bot/index.js')
// TODO: Load a default config
const config = require('./config.json')
const readline = require('readline')
@@ -8,7 +8,7 @@ const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
})
require('dotenv').config()
const bots = []
for (const options of config.bots) {
const bot = createBot(options)
+25 -7
View File
@@ -25,15 +25,13 @@ function inject (bot, options) {
bot.discord.channel = client.channels.cache.get(options.discord.channelId)
})
// I feel like this is a modified version of ChomeNS Bot's discord plugin (the js one ofc) lol - chayapak
let discordQueue = '' // too lazy to make an array mabe
setInterval(async () => {
if (discordQueue === '') return
try {
const maxLength = 2000 - ('```ansi\n' + '\n```').length
if (discordQueue.length >= maxLength) discordQueue = discordQueue.substring(0, maxLength)
await bot.discord.channel.send('```ansi\n' + discordQueue + '\n```')
await bot.discord.channel.send(discordQueue.substring(0, 2000))
} catch (error) {
console.error(error)
}
@@ -42,13 +40,33 @@ function inject (bot, options) {
}, 1000)
//???
function sendDiscordMessage (message) {
discordQueue += discordQueue !== '' ? '\n' + message : message
discordQueue += message
}
function sendComponent (message) {
const ansi = bot.getMessageAsPrismarine(message).toAnsi().replaceAll('\u001b[9', '\u001b[3')
sendDiscordMessage(ansi.replaceAll('`', '\u200b`'))
/*
would it be better to do
```
message1
message2
message3...
```
instead of
```
message1
```
````
message2
````
````
message3...
```?
*/
sendDiscordMessage('```ansi\n' + ansi.replaceAll('`', '\u200b`').substring(0, 2000) + '\n```')
}
bot.on('message', message => {
+1 -18
View File
@@ -1,5 +1,5 @@
{
"name": "FNFBoyfriendBotX4.0",
"name": "FNFBoyfriendBotX-Version-40",
"lockfileVersion": 2,
"requires": true,
"FNFBoyfriendBot-nmp-version": "0.5",
@@ -7,7 +7,6 @@
"": {
"dependencies": {
"discord.js": "^14.11.0",
"dotenv": "^16.3.1",
"illegal-symbols": "^1.0.0",
"jvm": "^0.5.3",
"man-db": "^1.0.3",
@@ -425,17 +424,6 @@
"node": ">=16.9.0"
}
},
"node_modules/dotenv": {
"version": "16.3.1",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz",
"integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/motdotla/dotenv?sponsor=1"
}
},
"node_modules/ecdsa-sig-formatter": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz",
@@ -1693,11 +1681,6 @@
"ws": "^8.13.0"
}
},
"dotenv": {
"version": "16.3.1",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz",
"integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ=="
},
"ecdsa-sig-formatter": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz",
-1
View File
@@ -1,7 +1,6 @@
{
"dependencies": {
"discord.js": "^14.11.0",
"dotenv": "^16.3.1",
"illegal-symbols": "^1.0.0",
"jvm": "^0.5.3",
"man-db": "^1.0.3",
-12
View File
@@ -1,12 +0,0 @@
{ pkgs }: {
deps = [
pkgs.python39Full
pkgs.nodejs
pkgs.nodejs-18_x
pkgs.nodejs-16_x
pkgs.nodejs-19_x
pkgs.nodePackages.typescript-language-server
pkgs.yarn
pkgs.replitPackages.jest
];
}
+26
View File
@@ -0,0 +1,26 @@
mconst CommandError = require('../CommandModules/command_error')
function hash() {
const crypto = require("crypto");
var hash = crypto.createHash("md5");
var randomBytes = crypto.randomBytes(6);
hash.update(randomBytes);
var hashi = hash.digest(Math.round(Math.random()) ? "hex" : "Base64");
return hashi.substring(0, 6);
}
module.exports = {
name: 'validate',
execute (context) {
const hashList = []
for (const hash of context.bothash.hash()) {
if (commandList.length !== 0) hash.push(' ')
}
const length = context.bot.botha.gethash().length
context.source.sendFeedback(['hash (', length, ') '], false)
}
}
//channel id 1120122720001208390