mirror of
https://code.chipmunk.land/Parker2991/NitoriBot/
synced 2026-11-30 06:05:40 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
229f4c5664 | ||
|
|
37e19521a4 | ||
|
|
799b49569e | ||
|
|
c522270815 | ||
|
|
e92153bb81 | ||
|
|
25ee0ce1e4 | ||
|
|
b9ae2a3bf7 | ||
|
|
3a1d335753 | ||
|
|
668312461f | ||
|
|
18e2278ebd | ||
|
|
1fd50ab7fa | ||
|
|
6d43ecc249 | ||
|
|
7eadb4eccd | ||
|
|
59ab5966c4 | ||
|
|
697eed1616 | ||
|
|
ffbe6f72a8 | ||
|
|
124778fd4b | ||
|
|
e690e1006c | ||
|
|
2075f57443 | ||
|
|
2e50641297 | ||
|
|
3a5b5bdbbc | ||
|
|
122e8e7df0 | ||
|
|
23288717ab | ||
|
|
639a2b0eaa | ||
|
|
f60f5c4a15 | ||
|
|
572e09989c | ||
|
|
ad4f35bb4c | ||
|
|
e655f831d3 | ||
|
|
a140a2d12e | ||
|
|
8f61177250 | ||
|
|
ab87e748f9 | ||
|
|
ca45444dd5 | ||
|
|
ac2f59d14d | ||
|
|
ee887d5081 | ||
|
|
0a637e0c8f | ||
|
|
3344fc6e2e | ||
|
|
0aed4d7d7a | ||
|
|
831fda8607 | ||
|
|
c6f77b0ac3 | ||
|
|
e75576a488 | ||
|
|
0b264d7aaf | ||
|
|
fda85555fc | ||
|
|
6c77eb0405 | ||
|
|
86dee2fc1c | ||
|
|
0e3d337f03 | ||
|
|
ab0bee81fb | ||
|
|
43d7ab7b82 | ||
|
|
166abfcae8 | ||
|
|
9585f64ab7 | ||
|
|
648f4431d7 | ||
|
|
2a812961e1 | ||
|
|
e5741ffac1 | ||
|
|
b295cc2d0f | ||
|
|
6eeb079ced | ||
|
|
5e08befb6b | ||
|
|
088e0a4c02 | ||
|
|
2a7819cf09 | ||
|
|
2f48ffea12 | ||
|
|
2604709b53 | ||
|
|
210c69ed07 | ||
|
|
d571a1654e | ||
|
|
0b31c50a29 | ||
|
|
bca181e8ec | ||
|
|
7c85c53eb1 | ||
|
|
47ff57eeb6 | ||
|
|
ebd52989bf | ||
|
|
21040143c7 | ||
|
|
2d49c8003f |
@@ -0,0 +1,4 @@
|
||||
node_modules
|
||||
config.js
|
||||
.git
|
||||
src/modules/exploits.js
|
||||
@@ -1,80 +0,0 @@
|
||||
beta 0.1 - 0.2 0.5 release 2022 (first release)
|
||||
ParkerBot/DEMONBOT/Woomybot/Boyfriend
|
||||
ehh nothing much just the release of the betas
|
||||
--------------------------------------
|
||||
beta 1.0 release 1/25/23 codename: in console test.
|
||||
original commands:!cloop bcraw,!cloop sudo,!troll,!say,!op (broke),!deop (broke), !gms (broke),!freeze,!icu <--- these commands no longer can be used in game but in console for beta 1.0
|
||||
commands added: fake kick,ban,kick,crashserver,stop,gmc,greetin,test(broken idk),bypass,entity spam(broken idk),gms(broke),stop,tntspam (broke idk),prefix (not tested yet),annoy (broke results in a complete server crash keeping ayunboom down for 3 to 5 hours),freeze(i dont even know what this do since i cant do !freeze),crashserver,troll(more destructive),trol(more destructive),icu(broke idk),say,sudo,cloop
|
||||
-------------------------------------
|
||||
1.0 release 1/26/23 1:47am codename:
|
||||
FNFBoyfriendBot.
|
||||
commands added: BOOM,deop,troll and trol(added extra code to both commands),kaboom,serverdeop,
|
||||
commands fixed:tp,gms,annoy(attemps to crash the server but not as bad as it was)
|
||||
commands untested:prefix
|
||||
command Broke:icu,freeze,tntspam,entityspam,tntspam?
|
||||
changed name to &b &lFNFBoyfriendBot may change later idk
|
||||
-------------------------------------
|
||||
1.0 revision 1 release 1/26/23 2:00pm
|
||||
codename revision 1.
|
||||
reworked the kaboom command and fixed the description commands but thats about it. also reworked the greeting command
|
||||
--------------------------------------
|
||||
1.1 release 1/28/23 1:51
|
||||
nothing much just added extra stuff to the troll, trol and that is about it
|
||||
-------------------------------------
|
||||
1.2 release 1/30/32 no codename
|
||||
for ppl me making me really mad -.- got released early
|
||||
--------------------------------------
|
||||
|
||||
|
||||
2.0 2/07/23 8:01pm codename: Major
|
||||
added DREAMSTANALERT,technoblade,GODSWORD,KFC,MYLEG,OHHAIL,altcrash,MyHead
|
||||
Reworked tntspam,entityspam,soundbreaker
|
||||
added Spim to the whitelist of the bot
|
||||
released too early than it was planned gonna be released due do the code almost leaked it had to be released early
|
||||
--------------------------------------
|
||||
|
||||
|
||||
2.1 release 2/11/23 5:30pm
|
||||
added: refillcore(had early prototypes of this was original), vanish,deop,cloopdeop,mute,cloopmute
|
||||
reworked: op (supposed to already op the bot but didnt work until this release) and reworked gmc (same problem with op)
|
||||
(had early prototypes of vanish,refillcore,gmc,and op but these were original gonna be automatic but after alot of attempts i said screw it and added 2 commands refillcore, and vanish reworked gmc and op and got them working finally) removed Spim because come to find out he couldnt be trusted
|
||||
--------------------------------------
|
||||
2.2 release 2/20/23 4:21pm central time
|
||||
bug fixes
|
||||
added ckill(added back after trial and error),serversuicidal
|
||||
changed username of the bot from hex code to FNFBoyfriendBot because hex code for the username was confusing as it changes everytime
|
||||
---------------------------------------
|
||||
3.0 Beta codename: blue-balled corruption
|
||||
was canceled due to ayunboom being rewriten and renamed to creayun barely usable on there because commands blocks are disabled which i created a bot for that server that has no command blocks https://replit.com/@Parker2991/FNFBoyfriendbotcreayun-bot-final-build#index.js just finished the final build of that bot due to chip announcing that he may make a kaboom clone yk what 1.5.2 and 1.8 support but anyway onto what is in the 3.0 beta well the beta for right now
|
||||
commands added:discord,version,online,list,iownyou,endmysuffering,wafflehouse,whopper,bcraw,destroycore
|
||||
Notes:the original say command was reworked into talking in chat without bcraw and command blocks which the bcraw chatting code is still in the bot but was reworked into the bcraw commmand. maybe some commands removed? i dont know yet edit there is 2 commands removed
|
||||
commands removed:tpe and serverdeop???
|
||||
reworked commands :say command for right now
|
||||
relay chat mabe will be added as a seperate repl i dont know yet possible would need a whole code rewrite for relay chat
|
||||
-----------------------------------------
|
||||
3.0 full release CodeName:Sky Remanifested
|
||||
the full release of 3.0 the rewrite has been pushed back to 4.0 due to 3.0 already pass its release date and the code i had on hand was done but the rewrite wasnt done
|
||||
Added: SelfCare
|
||||
Made during development:Relay chat prototypes for several servers
|
||||
---------------------
|
||||
3.0.5 release
|
||||
Bug fixes
|
||||
-----------
|
||||
3.0.9
|
||||
commands added:Help(finally added after about a year),consolelog(added cuz yes),cloopconsolelog(added cuz yes)
|
||||
-------------------
|
||||
4.0 beta Codename:FNFBoyfriendBot Ultimate
|
||||
all of the command removed and or rewriten from version 3.0.9
|
||||
Commands added or rewriten:ban,buyrealminecraft,cloop,discord,echo,errortest,freeze,help,icu,info,kick,bots,skids,romncitrash,say,selfdestruct,serversuicidal,sudo,test,trol,troll
|
||||
(note that this is different and is not CommandModules)Modules Added:discord,chat,chat_command_handler,command_manager,position,registry,reconnect,command_core
|
||||
CustomChats added:kaboom(for normal chat)
|
||||
(note that this is different and is not Modules)CommandModules Added:command_error,Command_source
|
||||
a beta release for rn
|
||||
-----------------------------
|
||||
4.0 Alpha Codename:FNFBoyfriendBot Ulitmate
|
||||
Commands added: calculator,ckill,evaljs,urban,crash,cloopcrash,core,list,ping,netmsg,skin,tpr
|
||||
Commands Removed:Buyrealminecraft
|
||||
(note that this is different and is not CommandModules)Modules Added:op selfcare,gmc selfcare,vanish selfcare,cspy selfcare,console
|
||||
(note that this is different and is not Modules)CustomChats Added:u2O3a(for custom chat)
|
||||
added util with between(for urban) eval_colors(for evaljs)
|
||||
----------------------------------
|
||||
@@ -1,17 +0,0 @@
|
||||
// TODO: Improve how messages are stringified
|
||||
const ChatMessage = require('prismarine-chat')('1.20.1')
|
||||
const stringify = message => new ChatMessage(message).toString()
|
||||
|
||||
class CommandError extends Error {
|
||||
constructor (message, filename, lineError) {
|
||||
super(stringify(message), filename, lineError)
|
||||
this.name = 'CommandError'
|
||||
this._message = message
|
||||
|
||||
}
|
||||
|
||||
get message () {
|
||||
return stringify(this._message)
|
||||
}
|
||||
}
|
||||
module.exports = CommandError
|
||||
@@ -1,16 +0,0 @@
|
||||
class CommandSource {
|
||||
constructor (player, sources, hash = false, discordMessageEvent = null) {
|
||||
this.player = player
|
||||
this.sources = sources
|
||||
this.hash = hash
|
||||
this.discordMessageEvent = discordMessageEvent
|
||||
}
|
||||
|
||||
sendFeedback () {}
|
||||
|
||||
sendError (message) {
|
||||
this.sendFeedback([{ text: '', color: 'dark_red' }, message], false)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = CommandSource
|
||||
@@ -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
|
||||
@@ -1,15 +0,0 @@
|
||||
const reconnect = require('./reconnect.js')
|
||||
module.exports = {
|
||||
servers: [
|
||||
{
|
||||
host: 'sus.shhnowisnottheti.me',
|
||||
port:'25565',
|
||||
discordChannelId : '1138891614299897987',
|
||||
reconnect: '6000'
|
||||
},
|
||||
|
||||
|
||||
]
|
||||
}
|
||||
|
||||
//1114036256951783514
|
||||
@@ -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'])
|
||||
@@ -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,2 +1,17 @@
|
||||
# FNFBoyfriendBotX4.0
|
||||
this is a lost version of FNFBoyfriendBot found
|
||||
# FNFBoyfriendBot
|
||||
|
||||
some things were git ignored from the repo that are needed for some things to work so you gotta recreate them
|
||||
|
||||
|
||||
FNFBoyfriendBot is a minecraft java bot made for the server kaboom.pw
|
||||
|
||||
# Setup:
|
||||
1. make sure to have nodejs npm and git installed
|
||||
|
||||
2. run npm i
|
||||
|
||||
3. fix some modules and stuff
|
||||
|
||||
4. edit the config
|
||||
|
||||
5. node src
|
||||
|
||||
@@ -1,459 +0,0 @@
|
||||
const mineflayer = require('mineflayer')
|
||||
var server = '<Server IP>'
|
||||
|
||||
|
||||
|
||||
|
||||
const randomstring = require('randomstring');
|
||||
const bot = mineflayer.createBot({
|
||||
host: server,
|
||||
port: 25565,
|
||||
username: randomstring.generate(8),
|
||||
version: 1.16,
|
||||
})
|
||||
|
||||
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
|
||||
)
|
||||
}
|
||||
|
||||
//variables
|
||||
var prefix = '<Prefix Here>';
|
||||
var consoleprefix = '<Console Prefix Here>';
|
||||
|
||||
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 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 () => { // time in ms
|
||||
|
||||
|
||||
|
||||
|
||||
await sendChat('/c')
|
||||
|
||||
|
||||
await sendChat('/night')
|
||||
await sendChat('/gamerule doMobSpawning false')
|
||||
await sendChat('/worldborder set 10000000')
|
||||
await sendChat('/de')
|
||||
await sendChat('/online')
|
||||
await sendChat('/cspy on')
|
||||
|
||||
|
||||
await sendChat('')
|
||||
await sendChat(`/fill ${Math.floor(bot.entity.position.x)} 0 ${Math.floor(bot.entity.position.z)} ${Math.floor(bot.entity.position.x) - 15} 2 ${Math.floor(bot.entity.position.z - 15)} command_block replace`);
|
||||
|
||||
|
||||
|
||||
})
|
||||
|
||||
const cmd = require('mineflayer-cmd').plugin
|
||||
|
||||
cmd.allowConsoleInput = true // Optional config argument
|
||||
bot.loadPlugin(cmd)
|
||||
//kill command function
|
||||
function killCommand(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(' ')
|
||||
if (sender == '<Username Here>') {
|
||||
runInCore('bcraw ' + prefix + 'Kill Cloop Executed')
|
||||
setInterval(function() { runInCore('ekill ' + message), 1 })
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function freezeCommand(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(' ')
|
||||
if (sender == '<Username Here>') {
|
||||
runInCore('bcraw ' + prefix + + ' ' + message + ' Is Frozen')
|
||||
setInterval(function() { runInCore('tp ' + message + ' ' + message), 1 })
|
||||
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
}
|
||||
function deopCommand(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(' ')
|
||||
if (sender == '<Username Here>') {
|
||||
runInCore('bcraw ' + prefix + 'Deop Cloop Executed')
|
||||
setInterval(function() { runInCore('execute run deop ' + message), 1 })
|
||||
resolve()
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
function deopallCommand(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(' ')
|
||||
if (sender == '<Username Here>') {
|
||||
runInCore('bcraw ' + prefix + 'Deop Cloop Executed')
|
||||
setInterval(function() { runInCore('deop @a'), 1 })
|
||||
setInterval(function() { runInCore('op @s[type=player]'), 1 })
|
||||
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function survivalCommand(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(' ')
|
||||
if (sender == '<Username Here>') {
|
||||
runInCore('bcraw ' + prefix + 'Gamemode Survival For All')
|
||||
runInCore('execute at @a run gamemode survival @a')
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function helpCommand(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(' ')
|
||||
if (sender == '<Username Here>') {
|
||||
runInCore('bcraw ' + prefix + ' !ckill <player> to spam kill any player ')
|
||||
runInCore('bcraw ' + prefix + ' !trol <player> to abuse a player ingame')
|
||||
runInCore('bcraw ' + prefix + ' !deop <player> to deop a player forever')
|
||||
runInCore('bcraw ' + prefix + ' !icu <player> spam tp a player to you(control them)')
|
||||
runInCore('bcraw ' + prefix + ' !say <message> make the bot say a message')
|
||||
runInCore('bcraw ' + prefix + ' !cloop <message> to spam any message')
|
||||
runInCore('bcraw ' + prefix + ' !troll TROLL THE ENTIRE SERVER')
|
||||
runInCore('bcraw ' + prefix + ' !help <message> list of commands')
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function opCommand(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(' ')
|
||||
if (sender == '<Username Here>') {
|
||||
runInCore('bcraw ' + prefix + 'Op Cloop Executed XD')
|
||||
setInterval(function() { runInCore('execute run op ' + message), 1 })
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
}
|
||||
function icuCommand(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(' ')
|
||||
if (sender == '<Username Here>') {
|
||||
runInCore('bcraw ' + prefix + 'ICU CONTROL HAS STARTED')
|
||||
setInterval(function() { runInCore('tp ' + message + ' ' + sender), 200 })
|
||||
setInterval(function() { runInCore('deop ' + message), 200 })
|
||||
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(' ')
|
||||
|
||||
runInCore(consoleprefix + message)
|
||||
resolve()
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
function sudoCommand(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(' ')
|
||||
|
||||
runInCore('sudo ' + message)
|
||||
resolve()
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
function cloopCommand(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(' ')
|
||||
if (sender == '<Username Here>') {
|
||||
setInterval(function() { runInCore('/' + message), 1 })
|
||||
runInCore('bcraw ' + prefix + ' Cloop Has Started')
|
||||
resolve()
|
||||
}
|
||||
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
function lagCommand(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(' ')
|
||||
if (sender == '<Username Here>') {
|
||||
setInterval(function() { runInCore('day'), 1 })
|
||||
setInterval(function() { runInCore('night'), 1 })
|
||||
setInterval(function() { runInCore('clear @a'), 1 })
|
||||
setInterval(function() { runInCore('effect give @a nausea'), 1 })
|
||||
setInterval(function() { runInCore('effect give @a slowness'), 1 })
|
||||
setInterval(function() { runInCore('give @a bedrock'), 1 })
|
||||
setInterval(function() { runInCore('give @a sand'), 1 })
|
||||
setInterval(function() { runInCore('give @a dirt'), 1 })
|
||||
setInterval(function() { runInCore('give @a diamond'), 1 })
|
||||
setInterval(function() { runInCore('give @a tnt'), 1 })
|
||||
setInterval(function() { runInCore('give @a crafting_table'), 1 })
|
||||
setInterval(function() { runInCore('give @a diamond_block'), 1 })
|
||||
setInterval(function() { runInCore('execute run op ' + randomchar), 1 })
|
||||
|
||||
resolve()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
resolve()
|
||||
})
|
||||
}
|
||||
function trollCommand(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(' ')
|
||||
if (sender == '<Username Here>') {
|
||||
setInterval(function() { runInCore('clear ' + message), 1 })
|
||||
setInterval(function() { runInCore('effect give ' + message + ' nausea'), 1 })
|
||||
setInterval(function() { runInCore('effect give ' + message + ' nausea'), 1 })
|
||||
setInterval(function() { runInCore('give ' + message + ' bedrock'), 1 })
|
||||
setInterval(function() { runInCore('give ' + message + ' diamond'), 1 })
|
||||
setInterval(function() { runInCore('give ' + message + 'tnt'), 1 })
|
||||
setInterval(function() { runInCore('give ' + message + ' diamond_block'), 1 })
|
||||
setInterval(function() { runInCore('give ' + message + ' sand'), 1 })
|
||||
setInterval(function() { runInCore('give ' + message + ' bedrock'), 1 })
|
||||
setInterval(function() { runInCore('execute run deop ' + message), 1 })
|
||||
setInterval(function() { runInCore('gms ' + message), 1 })
|
||||
runInCore('bcraw ' + prefix + ' ' + message + ' Is Getting Trolled')
|
||||
resolve()
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
bot.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('troll', lagCommand, // Create a new command called 'say' and set the executor function
|
||||
'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.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('icu', icuCommand, // Create a new command called 'say' and set the executor function
|
||||
'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.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('sudo', sudoCommand, // Create a new command called 'say' and set the executor function
|
||||
'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.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('trol', trollCommand, // Create a new command called 'say' and set the executor function
|
||||
'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.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('ckill', killCommand,
|
||||
'ckill player', // help text
|
||||
'ckill <player>') // 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.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('deop', deopCommand,
|
||||
'deop player', // help text
|
||||
'deop <player>') // 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.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('op', opCommand,
|
||||
'op player', // help text
|
||||
'op <player>') // 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.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.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('cloop', cloopCommand,
|
||||
'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.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('freeze', freezeCommand,
|
||||
'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.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('deopall', deopallCommand,
|
||||
'stop the server',
|
||||
'stop')
|
||||
|
||||
|
||||
.addFlag('color', 1, ['color code'], 'Changes the chat color')
|
||||
|
||||
|
||||
.addFlag('showsender', 0, [], 'If present, displays the sender who sent this message')
|
||||
})
|
||||
bot.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('gms', survivalCommand,
|
||||
'stop the server',
|
||||
'stop')
|
||||
|
||||
|
||||
.addFlag('color', 1, ['color code'], 'Changes the chat color')
|
||||
|
||||
|
||||
.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())
|
||||
})
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,32 +0,0 @@
|
||||
function inject (bot) {
|
||||
let permissionLevel = 4
|
||||
let gamemode = 1
|
||||
|
||||
bot._client.on('entity_status', packet => {
|
||||
if (packet.entityId !== bot.entity.id || packet.entityStatus < 24 || packet.entityStatus > 28) return
|
||||
permissionLevel = packet.entityStatus - 24
|
||||
})
|
||||
|
||||
bot._client.on('login', packet => {
|
||||
gamemode = packet.gameMode
|
||||
})
|
||||
|
||||
bot._client.on('game_state_change', packet => {
|
||||
if (packet.reason === 3) gamemode = packet.gameMode
|
||||
})
|
||||
|
||||
let timer
|
||||
|
||||
bot.on('login', () => {
|
||||
timer = setInterval(() => {
|
||||
if (permissionLevel < 2) bot.chat('/op @s[type=player]')
|
||||
else if (gamemode !== 1) bot.chat('/gamemode creative')
|
||||
}, 200)
|
||||
})
|
||||
|
||||
bot.on('end', () => {
|
||||
if (timer) clearInterval(timer)
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"bot": [
|
||||
|
||||
{
|
||||
"host": "mcslot.eu",
|
||||
"username":"FNFBoyfriendBot",
|
||||
"version": "1.19.4",
|
||||
"reconnectDelay": 1000
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
play.kaboom.pw
|
||||
|
||||
play.chipmunk.land
|
||||
|
||||
sus.shhnowisnottheti.me(partically works and the say command works because it doesnt use command blocks and command blocks are disabled on the server)
|
||||
|
||||
mcslot.eu
|
||||
|
||||
eaglerboom.chipmunk.land(gonna have eaglercraft support soon if it doesnt already also linked to play.chipmunk.land when off)
|
||||
discordtonystark.com
|
||||
@@ -1,444 +0,0 @@
|
||||
const ඞ = require('mineflayer')
|
||||
const keep_alive = require('./keep_alive.js')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const randomstring = require('randomstring');
|
||||
const bot = ඞ.createBot({
|
||||
host: '<Server IP Here>',
|
||||
port: 25565,
|
||||
username: '<Username Here>',
|
||||
version: '1.19'
|
||||
});
|
||||
|
||||
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
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//variables
|
||||
var prefix = '<Prefix Here>';
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
bot.on('login', () => {
|
||||
console.log('Bot has logged in to the server!');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
const cmd = require('mineflayer-cmd').plugin
|
||||
|
||||
|
||||
|
||||
cmd.allowConsoleInput = true // Optional config argument
|
||||
bot.loadPlugin(cmd)
|
||||
|
||||
|
||||
function broadcastCommand(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('/bc ' + prefix + message)
|
||||
resolve()
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
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('<Discord Link Here>')
|
||||
|
||||
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 onlineCommand(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('/online')
|
||||
resolve()
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
function cloopCommand(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(' ')
|
||||
|
||||
|
||||
setInterval(function() {
|
||||
sendChat(message), 1
|
||||
})
|
||||
|
||||
resolve()
|
||||
|
||||
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
function VanishCommand(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(' ')
|
||||
sleep(300)
|
||||
|
||||
sendChat('/v')
|
||||
resolve()
|
||||
|
||||
})
|
||||
}
|
||||
function announcementCommand(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('final build of the bot for here due to the other version of this bot the main Bot 3.0 in developement')
|
||||
resolve()
|
||||
|
||||
})
|
||||
}
|
||||
function socialspyCommand(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('/socialspy')
|
||||
|
||||
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('Version 1.0 forked of 2.2 and .5 of the main bot FNFBoyfriendBot 2.2 is no longer being worked on')
|
||||
|
||||
resolve()
|
||||
|
||||
})
|
||||
}
|
||||
function tptoggleCommand(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('/tptoggle')
|
||||
|
||||
resolve()
|
||||
|
||||
})
|
||||
}
|
||||
function prefixCommand(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(' ')
|
||||
if (sender == '') {
|
||||
sendChat('/prefix ' + '')
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
}
|
||||
function kickCommand(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('/tp ' + message + '30000000 1 30000000')
|
||||
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
}
|
||||
function icuCommand(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('ICU CONTROL HAS STARTED')
|
||||
setInterval(function() { sendChat('/tp ' + message + ' ' + sender), 200 })
|
||||
|
||||
resolve()
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
function nickCommand(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('/nick ' + args.join) + ''
|
||||
resolve()
|
||||
}
|
||||
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
function SussyCommand(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(' ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ ')
|
||||
resolve()
|
||||
}
|
||||
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
function trollCommand(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('')
|
||||
resolve()
|
||||
}
|
||||
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
bot.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('prefix', prefixCommand, // Create a new command called 'say' and set the executor function
|
||||
'set the prefix of the bot', // help text
|
||||
'!prefix message') // usage text
|
||||
|
||||
|
||||
})
|
||||
bot.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('discord', discordCommand, // Create a new command called 'say' and set the executor function
|
||||
'set the prefix of the bot', // help text
|
||||
'!prefix message') // usage text
|
||||
|
||||
|
||||
})
|
||||
bot.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('Sussy', SussyCommand, // Create a new command called 'say' and set the executor function
|
||||
'set the prefix of the bot', // help text
|
||||
'!prefix message') // usage text
|
||||
|
||||
|
||||
})
|
||||
bot.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('version', versionCommand, // Create a new command called 'say' and set the executor function
|
||||
'set the prefix of the bot', // help text
|
||||
'!prefix message') // usage text
|
||||
|
||||
|
||||
})
|
||||
bot.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('troll', trollCommand, // Create a new command called 'say' and set the executor function
|
||||
'troll a player', // help text
|
||||
'!troll playername') // usage text
|
||||
|
||||
|
||||
})
|
||||
bot.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('broadcast', broadcastCommand, // Create a new command called 'say' and set the executor function
|
||||
'make the bot broadcast', // help text
|
||||
'!broadcast message') // usage text
|
||||
|
||||
|
||||
})
|
||||
bot.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('online', onlineCommand, // Create a new command called 'say' and set the executor function
|
||||
'make the bot check whos online', // help text
|
||||
'^online') // usage text
|
||||
|
||||
|
||||
})
|
||||
bot.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('tptoggle', tptoggleCommand, // Create a new command called 'say' and set the executor function
|
||||
'tptoggle the bot', // help text
|
||||
'!tptoggle') // usage text
|
||||
|
||||
|
||||
})
|
||||
bot.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('nick', nickCommand, // Create a new command called 'mute' and set the executor function
|
||||
'make the bot change its name', // help text
|
||||
'!nick message') // usage text
|
||||
|
||||
|
||||
})
|
||||
bot.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('say', sayCommand, // Create a new command called 'say' and set the executor function
|
||||
'make the bot say smh', // help text
|
||||
'!say msg') // usage text
|
||||
|
||||
|
||||
})
|
||||
bot.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('socialspy', socialspyCommand, // Create a new command called 'say' and set the executor function
|
||||
'make me say something', // help text
|
||||
'say <message>') // usage text
|
||||
|
||||
|
||||
})
|
||||
bot.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('cloop', cloopCommand, // Create a new command called 'say' and set the executor function
|
||||
'make the bot cloop a message', // help text
|
||||
'!cloop message') // usage text
|
||||
|
||||
|
||||
})
|
||||
bot.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('vanish', VanishCommand, // Create a new command called 'say' and set the executor function
|
||||
'vanish the bot', // help text
|
||||
'!vanish') // usage text
|
||||
|
||||
|
||||
})
|
||||
bot.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('announcement', announcementCommand, // Create a new command called 'say' and set the executor function
|
||||
'announcement', // help text
|
||||
'announcement') // usage text
|
||||
|
||||
|
||||
})
|
||||
bot.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('kick', kickCommand,
|
||||
'make the bot kick', // help text
|
||||
'!kick message') // 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
|
||||
console.log(chatMessage.toAnsi())
|
||||
})
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
var http = require('http');
|
||||
|
||||
http.createServer(function (req, res) {
|
||||
res.write("I'm alive");
|
||||
res.end();
|
||||
}).listen(8080);
|
||||
@@ -1,67 +0,0 @@
|
||||
const mc = require('minecraft-protocol')
|
||||
const { EventEmitter } = require('events')
|
||||
const fs = require('fs')
|
||||
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.hideErrors ??= true // HACK: Hide errors by default as a lazy fix to console being spammed with them
|
||||
|
||||
bot.options = options
|
||||
|
||||
// Create our client object, put it on the bot, and register some events
|
||||
bot.on('init_client', client => {
|
||||
client.on('packet', (data, meta) => {
|
||||
bot.emit('packet', data, meta)
|
||||
bot.emit('packet.' + meta.name, data)
|
||||
})
|
||||
|
||||
client.on('login', () => {
|
||||
bot.uuid = client.uuid
|
||||
bot.username = client.username
|
||||
})
|
||||
|
||||
client.on('end', reason => bot.emit('end', reason))
|
||||
|
||||
client.on('error', error => bot.emit('error', error))
|
||||
})
|
||||
|
||||
const client = options.client ?? mc.createClient(options)
|
||||
bot._client = client
|
||||
bot.emit('init_client', client)
|
||||
|
||||
bot.bots = options.bots ?? [bot]
|
||||
|
||||
// Modules
|
||||
bot.loadModule = module => module(bot, options)
|
||||
|
||||
for (const filename of fs.readdirSync(path.join(__dirname, 'modules'))) {
|
||||
try {
|
||||
const module = require(path.join(__dirname, 'modules', filename))
|
||||
bot.loadModule(module)
|
||||
} catch (error) {
|
||||
console.error('Failed to load module', filename, ':', error)
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
@@ -1,27 +0,0 @@
|
||||
function parseMessage (message, data) {
|
||||
if (message === null || typeof message !== 'object') return
|
||||
|
||||
if (message.with?.length < 3 || (message.translate !== '[%s] %s › %s' && message.translate !== '%s %s › %s')) return
|
||||
|
||||
const senderComponent = message.with[1]
|
||||
const contents = message.with[2]
|
||||
|
||||
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()
|
||||
|
||||
sender = data.players.find(player => player.profile.name) //=== stringusername)
|
||||
}
|
||||
|
||||
if (!sender) return undefined
|
||||
|
||||
return { sender, contents, type: 'minecraft:chat', senderComponent }
|
||||
}
|
||||
|
||||
module.exports = parseMessage
|
||||
@@ -1,14 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'ban',
|
||||
hashOnly: true,
|
||||
execute (context) {
|
||||
throw new CommandError('mabe being replaced with blacklist')
|
||||
const target = context.arguments.join(' ')
|
||||
const bot = context.bot
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const BlacklistDeop = require('../util/blacklist util/blacklist_deop_selfcare.js')
|
||||
const BlacklistMute = require('../util/blacklist util/blacklist_mute_selfcare.js')
|
||||
module.exports = {
|
||||
name: 'blacklist',
|
||||
hashOnly:true,
|
||||
execute (context) {
|
||||
const message = context.arguments.join(' ')
|
||||
const bot = context.bot
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'botdevhistory',
|
||||
execute (context) {
|
||||
const message = context.arguments.join(' ')
|
||||
const bot = context.bot
|
||||
var prefix = '&8&l&m[&4&mParker2991&8]&8&m[&b&mBOYFRIEND&8]&8&m[&b&mCONSOLE&8]&r '
|
||||
bot.core.run('bcraw ' + prefix + 'Thank you for all that helped and contributed with the bot, it has been one hell of a ride with the bot hasnt it? From November 22, 2022 to now, 0.1 beta to 4.0 alpha, Mineflayer to Node-Minecraft-Protocol. I have enjoyed all the new people i have met throughout the development of the bot back to the days when the bot used mineflayer for most of its lifespan to the present as it now uses node-minecraft-protocol. Its about time for me to tell how development went in the bot well here it is, back in 0.1 beta of the bot it was skidded off of menbot 1.0 reason why? Well because LoginTimedout gave me the bot when ayunboom was still a thing and he helped throughout that time period bot and when 1.0 beta came around he he just stopped helping me on it why? because he had servers to run so yeah but anyway back then i didnt know what skidded like i do now so i thought i could get away with but i was wrong 💀. Early names considered for the bot were &6&lParkerBot &4&lDEMONBot &b&lWoomyBot &b&lBoyfriendBot,&r i kept the name &b&lBoyfriendBot&r throughout most of the early development but i got sick and tired of being harassed about the name being told it was gay but people really didnt know what it meant did they? It was referenced to Boyfriend from Friday Night Funkin’ so right around 1.0 released i renamed it to &b&lFNFBoyfriend&4&lBot &rand already 2.0 changed it to &5&lFNF&b&lBoyfriend&4&lBot &rand luckily avoided the harassment when i changed it i love coding and i want to learn how to code more thank you all!')
|
||||
}
|
||||
}
|
||||
@@ -1,191 +0,0 @@
|
||||
// TODO: Maybe add more authors
|
||||
const bots = [
|
||||
{
|
||||
name: { text: 'HBot', color: 'aqua', bold:true },
|
||||
authors: ['hhhzzzsss'],
|
||||
exclaimer:'HBOT HARRYBUTT LMAOOOOOOOOOOOOOOOOO',
|
||||
foundation: 'java/mcprotocollib',
|
||||
prefixes: ['#']
|
||||
},
|
||||
{
|
||||
name: [{ text: 'Evil', color: 'dark_red' }, {text:'Bot', color:'dark_purple'}],
|
||||
authors: ['FusseligerDev'],
|
||||
exclaimer:'',
|
||||
foundation: 'Java/Custom',
|
||||
prefixes: ['!']
|
||||
},
|
||||
{
|
||||
name: { text: 'SBot Java', color: 'white', bold:true }, // TODO: Gradient
|
||||
authors: ['evkc'],
|
||||
foundation: 'Java/MCProtocolLib',
|
||||
prefixes: [':']
|
||||
},
|
||||
{
|
||||
name: { text: 'SBot Rust', color: 'white', bold:true }, // TODO: Gradient
|
||||
authors: ['evkc'],
|
||||
foundation: 'Rust',
|
||||
prefixes: ['re:']
|
||||
},
|
||||
{
|
||||
name: { text: 'Z-Boy-Bot', color: 'dark_purple' }, // TODO: Gradient
|
||||
exclaimer: 'Most likely skidded along with kbot that the dev used',
|
||||
authors: ['Romnci'],
|
||||
foundation: 'NodeJS/mineflayer or Java/mcprotocollib idfk',
|
||||
prefixes: ['Z]']
|
||||
},
|
||||
{
|
||||
name: { text: 'ABot', color: 'gold', bold:true }, // TODO: Gradient
|
||||
exclaimer: '',
|
||||
authors: ['yfd'],
|
||||
foundation: 'NodeJS/Node-Minecraft-Protocol',
|
||||
prefixes: ['<']
|
||||
},
|
||||
{
|
||||
name: { text: 'FardBot', color: 'dark_purple' },
|
||||
authors: ['_yfd'],
|
||||
exclaimer: 'bot is dead lol',
|
||||
foundation: 'NodeJS/Mineflayer',
|
||||
prefixes: ['<']
|
||||
},
|
||||
|
||||
{
|
||||
name: { text: 'ChipmunkBot', color: 'green' },
|
||||
authors: ['_ChipMC_'],
|
||||
exclaimer: 'chips? also shoutout to chip and chayapak for helping in the rewrite',
|
||||
|
||||
foundation: 'Java/MCProtocolLib',
|
||||
prefixes: ["'", "/'"]
|
||||
},
|
||||
{
|
||||
name: { text: 'ChipmunkBot Old', color: 'green' },
|
||||
authors: ['_ChipMC_'],
|
||||
foundation: 'NodeJS/Node-Minecraft-Protocol',
|
||||
|
||||
},
|
||||
{
|
||||
name: { text: 'TestBot', color: 'aqua' },
|
||||
authors: ['Blackilykat'],
|
||||
foundation: 'Java/MCProtocolLib',
|
||||
prefixes: ["-"]
|
||||
},
|
||||
{
|
||||
name: { text: 'UBot', color: 'grey' },
|
||||
authors: ['HexWoman'],
|
||||
exclaimer: 'UwU OwO',
|
||||
|
||||
foundation: 'NodeJS/node-minecraft-protocol',
|
||||
prefixes: ['"']
|
||||
},
|
||||
{
|
||||
name: { text: 'ChomeNS Bot Java', color: 'yellow'},
|
||||
authors: ['chayapak'],
|
||||
exclaimer: 'wow its my bot !! ! 4374621q43567%^&#%67868-- chayapak',
|
||||
foundation: 'Java/MCProtocolLib',
|
||||
prefixes: ['*', 'cbot ', '/cbot ']
|
||||
},
|
||||
{
|
||||
name: { text: 'ChomeNS Bot NodeJS', color: 'yellow'},
|
||||
authors: ['chayapak'],
|
||||
|
||||
foundation: 'NodeJS/Node-Minecraft-Protocol',
|
||||
prefixes: ['*', 'cbot', '/cbot']
|
||||
},
|
||||
{
|
||||
name: { text: 'RecycleBot', color: 'dark_green'},
|
||||
foundation: ['MorganAnkan'],
|
||||
exclaimer: 'nice bot',
|
||||
language: 'NodeJS/node-minecraft-protocol',
|
||||
prefixes: ['=']
|
||||
},
|
||||
{
|
||||
name: { text: 'ManBot', color: 'dark_green' , },
|
||||
exclaimer: '(more like men bot :skull:) OH HAAAAAAAAAAAAAAIIILL LOGINTIMEDOUT',
|
||||
authors: ['Man/LogintimedOut'],
|
||||
foundation: 'NodeJS/mineflayer',
|
||||
prefixes: ['(Note:I dont remember!!)']
|
||||
},
|
||||
{
|
||||
name: [{ text: 'Useless', color: 'red', bold:false}, { text: 'Bot', color: 'gray', bold:false}],
|
||||
exclaimer: 'it isnt useless its a good bot................',
|
||||
authors: ['IuCC'],
|
||||
foundation: 'NodeJS/node-minecraft-protocol',
|
||||
prefixes: ['[']
|
||||
},
|
||||
{
|
||||
name: [{ text: 'Blurry', color: 'dark_purple'}, { text: 'Bot', color: 'red' }],
|
||||
exclaimer: '',
|
||||
authors: ['SirLennox'],
|
||||
foundation: 'Java/custom',
|
||||
prefixes: [',']
|
||||
},
|
||||
{
|
||||
name: [{ text: 'KittyCorp', color: 'yellow' }, { text: 'Bot', color: 'yellow' }],
|
||||
exclaimer: '3 words ginlang is gay',
|
||||
authors: ['ginlang , G6_, ArrayBuffer, and i guess more??'],
|
||||
foundation: 'NodeJS/node-minecraft-protocol',
|
||||
prefixes: ['^']
|
||||
},
|
||||
|
||||
{
|
||||
name: [{ text:'FNF', color: 'dark_purple', bold: true}, {text:'Boyfriend', color: 'aqua', bold:true}, {text:'Bot', color:'dark_red', bold:true}, {text:'X', color:'black', bold:true}],
|
||||
authors: [{ text:'Parker2991', color: 'dark_red'}, {text:' _ChipMC_', color: 'dark_green', bold:true}, {text:' chayapak', color:'yellow', bold:true}],
|
||||
exclaimer: '4.0 (this Bot) also the Ultimate version of the FNFBoyfriendBot Builds',
|
||||
foundation: 'NodeJS/node-minecraft-protocol',
|
||||
prefixes: ['~']
|
||||
},
|
||||
{
|
||||
name: [{ text:'FNF', color: 'dark_purple', bold: true}, {text:'Boyfriend', color: 'aqua', bold:true}, {text:'Bot', color:'dark_red', bold:true}, {text:' Legacy', color:'green', bold:true}],
|
||||
authors: [{text:'Parker2991', color:'dark_red' }, {text:' _ChipMC_', color:'dark_green', bold:true }],
|
||||
exclaimer:'1037 LINES OF CODE WTFARD!??! also this version is in console commands only' ,
|
||||
foundation: 'NodeJS/mineflayer',
|
||||
prefixes: []
|
||||
}
|
||||
]
|
||||
|
||||
module.exports = {
|
||||
name: 'bots',
|
||||
|
||||
execute (context) {
|
||||
const query = context.arguments.join(' ').toLowerCase()
|
||||
|
||||
if (query.length === 0) {
|
||||
const list = []
|
||||
|
||||
for (const info of bots) {
|
||||
if (list.length !== 0) list.push({ text: ', ', color: 'gray' })
|
||||
list.push(info.name)
|
||||
}
|
||||
|
||||
context.source.sendFeedback(['Known bots (', bots.length, ') - ', ...list], false)
|
||||
return
|
||||
}
|
||||
|
||||
for (const info of bots) {
|
||||
const plainName = String(context.bot.getMessageAsPrismarine(info.name)).toLowerCase()
|
||||
if (plainName.includes(query)) this.sendBotInfo(info, context.bot)
|
||||
}
|
||||
},
|
||||
|
||||
sendBotInfo (info, bot) {
|
||||
const component = ['']
|
||||
component.push('Name: ', info.name)
|
||||
if (info.exclaimer) component.push('\n', 'Exclaimer: ', info.exclaimer)
|
||||
if (info.authors && info.authors.length !== 0) {
|
||||
component.push('\n', 'Authors: ')
|
||||
for (const author of info.authors) {
|
||||
component.push(author, { text: ', ', color: 'gray' })
|
||||
}
|
||||
component.pop()
|
||||
}
|
||||
if (info.foundation) component.push('\n', 'Foundation: ', info.foundation)
|
||||
if (info.prefixes && info.prefixes.length !== 0) {
|
||||
component.push('\n', 'Prefixes: ')
|
||||
for (const prefix of info.prefixes) {
|
||||
component.push(prefix, { text: ', ', color: 'gray' })
|
||||
}
|
||||
component.pop()
|
||||
}
|
||||
bot.tellraw([component])
|
||||
}
|
||||
}//it doing it just for the ones i added lol
|
||||
// prob a replit moment, it probably thinks there are regexes in the strings
|
||||
@@ -1,72 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'calculator',
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const cmd = {
|
||||
translate: '[%s] ',
|
||||
bold: true,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'blue', text: 'Calculator Cmd'},
|
||||
]
|
||||
}
|
||||
const operation = args[0]
|
||||
const operator1 = parseFloat(args[1])
|
||||
const operator2 = parseFloat(args[2])
|
||||
|
||||
//
|
||||
switch (operation) {
|
||||
case 'add':
|
||||
context.source.sendFeedback({
|
||||
translate: '[%s] %s is %s',
|
||||
with: [
|
||||
{color: 'blue', text:'Calculator Cmd'},
|
||||
`${operator1} + ${operator2}`,
|
||||
operator1 + operator2
|
||||
]
|
||||
});
|
||||
|
||||
break
|
||||
case 'subtract':
|
||||
context.source.sendFeedback({
|
||||
translate: `[%s] %s is %s`,
|
||||
with: [
|
||||
{ color: 'blue', text: 'Calculator Cmd'},
|
||||
`${operator1} - ${operator2}`,
|
||||
operator1 - operator2
|
||||
]
|
||||
});
|
||||
|
||||
break
|
||||
case 'multiply':
|
||||
context.source.sendFeedback({
|
||||
translate: '[%s] %s is %s',
|
||||
with: [
|
||||
{ color: 'blue', text: 'Calculator Cmd'},
|
||||
`${operator1} x ${operator2}`,
|
||||
operator1 * operator2
|
||||
]
|
||||
});
|
||||
|
||||
break
|
||||
case 'divide':
|
||||
context.source.sendFeedback({
|
||||
translate: '[%s] %s is %s',
|
||||
with: [
|
||||
{ color: 'blue', text: 'Calculator Cmd'},
|
||||
`${operator1} / ${operator2}`,
|
||||
operator1 / operator2
|
||||
]
|
||||
|
||||
});
|
||||
|
||||
break
|
||||
default:
|
||||
context.source.sendError([cmd, { text: 'Invalid action', color: 'blue' }])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'cnscmd',
|
||||
consoleOnly: true,
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
|
||||
bot.chat('*' + message)
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
const crypto = require('crypto')
|
||||
|
||||
module.exports = {
|
||||
name: 'chomeval',
|
||||
|
||||
consoleOnly: true,
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
|
||||
const prefix = '*' // mabe don't 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(' ')}`
|
||||
|
||||
bot.chat(command)
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
let timer = null
|
||||
|
||||
module.exports = {
|
||||
name: 'ckill',
|
||||
hashOnly: true,
|
||||
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)
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'cloopcrash',
|
||||
hashOnly: true,
|
||||
execute (context) {
|
||||
|
||||
const bot = context.bot
|
||||
timer = setInterval(function () {
|
||||
bot.core.run(`execute as @e${' as @p[limit=99]'.repeat(Math.floor((32767 - 22) / 16))} run help`)
|
||||
}, 1)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//what is wi
|
||||
// IDK
|
||||
@@ -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])
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'core',
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
if (message.startsWith('/')) {
|
||||
bot.core.run(message.substring(1))
|
||||
return
|
||||
}
|
||||
bot.core.run(message)
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'crash',
|
||||
hashOnly: true,
|
||||
execute (context) {
|
||||
|
||||
const bot = context.bot
|
||||
|
||||
bot.core.run(`execute as @e${' as @p[limit=99]'.repeat(Math.floor((32767 - 22) / 16))} run help`)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//what is wi
|
||||
// IDK
|
||||
@@ -1,24 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'creator',
|
||||
|
||||
execute (context, prefix) {
|
||||
const message = context.arguments.join(' ')
|
||||
const Creators = {
|
||||
translate: '[%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' },
|
||||
|
||||
]
|
||||
}
|
||||
context.source.sendFeedback(['Thank you to all that helped! ', Creators])
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'discord',
|
||||
|
||||
execute (context) {
|
||||
context.source.sendFeedback(context.bot.discord.invite, false)
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
module.exports = {
|
||||
name: 'echo',
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
if (message.startsWith('/')) {
|
||||
bot.command(message.substring(1))
|
||||
return
|
||||
}
|
||||
bot.chat(message)
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'errortest',
|
||||
|
||||
execute (context) {
|
||||
const message = context.arguments.join(' ')
|
||||
throw new Error(message)
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
const { VM } = require('vm2')
|
||||
const util = require('util')
|
||||
const { stylize } = require('../util/eval_colors')
|
||||
|
||||
const options = {
|
||||
timeout: 1000
|
||||
}
|
||||
let vm = new VM(options)
|
||||
|
||||
module.exports = {
|
||||
name: 'evaljs',
|
||||
|
||||
execute (context) {
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
const cmd = {
|
||||
translate: '[%s] ',
|
||||
bold: true,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'dark_green', text: 'EvalJS Cmd'},
|
||||
]
|
||||
}
|
||||
switch (args[0]) {
|
||||
case 'run':
|
||||
try {
|
||||
const output = vm.run(args.slice(1).join(' '))
|
||||
|
||||
source.sendFeedback([cmd, { text: util.inspect(output, { stylize }) }])
|
||||
} catch (e) {
|
||||
source.sendFeedback([cmd, { text: String(e), color: 'black' }])
|
||||
}
|
||||
|
||||
break
|
||||
case 'reset':
|
||||
vm = new VM(options)
|
||||
|
||||
source.sendFeedback([cmd, { text: 'Successfully reset the eval context', color: 'green' }])
|
||||
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
let timer = null
|
||||
|
||||
module.exports = {
|
||||
name: 'freeze',
|
||||
hashOnly: true,
|
||||
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)
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'help',
|
||||
|
||||
execute (context) {
|
||||
const commandList = []
|
||||
const cmd = {
|
||||
translate: '[%s] ',
|
||||
bold: true,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'dark_blue', text: 'Help Cmd'},
|
||||
]
|
||||
}
|
||||
for (const command of context.bot.commandManager.getCommands()) {
|
||||
if (command.consoleOnly && !context.console) continue
|
||||
|
||||
if (commandList.length !== 0) commandList.push(' ')
|
||||
commandList.push(String(command.name))
|
||||
}
|
||||
|
||||
const length = context.bot.commandManager.getCommands().length
|
||||
|
||||
context.source.sendFeedback([cmd, 'Commands (', length, ') ', ...commandList], false)
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
let timer = null
|
||||
|
||||
module.exports = {
|
||||
name: 'icu',
|
||||
hashOnly: true,
|
||||
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)
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'list',
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
|
||||
const players = bot.players
|
||||
|
||||
const component = []
|
||||
for (const player of players) {
|
||||
component.push({
|
||||
translate: '%s \u203a %s',
|
||||
with: [
|
||||
player.displayName ?? player.profile.name,
|
||||
player.uuid
|
||||
]
|
||||
})
|
||||
|
||||
component.push('\n')
|
||||
}
|
||||
|
||||
component.pop()
|
||||
|
||||
context.source.sendFeedback(component, false)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//what is wi
|
||||
// IDK
|
||||
@@ -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)}
|
||||
@@ -1,89 +0,0 @@
|
||||
module.exports = {
|
||||
name: 'mineflayerbot',
|
||||
hashOnly:true,
|
||||
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',
|
||||
})
|
||||
|
||||
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())
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error.js')
|
||||
module.exports = {
|
||||
name: 'netmsg',
|
||||
|
||||
execute (context) {
|
||||
|
||||
const message = context.arguments.join(' ')
|
||||
const bot = context.bot
|
||||
//throw new CommandError('ohio')
|
||||
const component = {
|
||||
translate: '[%s%s%s%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 },
|
||||
{ color: 'black', text: 'X', bold: true },
|
||||
|
||||
bot.options.host,
|
||||
context.source.player.displayName ?? context.source.player.profile.name,
|
||||
message
|
||||
]
|
||||
}
|
||||
|
||||
for (const eachBot of bot.bots) eachBot.tellraw(component)
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
module.exports = {
|
||||
name: 'ping',
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
module.exports = {
|
||||
name: 'reconnect',
|
||||
|
||||
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'})
|
||||
|
||||
setTimeout(function() {
|
||||
|
||||
bot.chat(randomstring.generate(1000))
|
||||
}, 1)
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'say',
|
||||
//<< this one line of code broke it lmao
|
||||
execute (context) {
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
const prefix = {
|
||||
translate: '[%s%s%s%s] ',
|
||||
bold: true,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'dark_purple', text: 'FNF' },
|
||||
{ color: 'aqua', text: 'Boyfriend' },
|
||||
{ color: 'dark_red', text: 'Bot' },
|
||||
{ color: 'black', text: 'X' },
|
||||
]
|
||||
}
|
||||
|
||||
context.bot.tellraw(['', prefix, message])
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
let timer = null
|
||||
|
||||
module.exports = {
|
||||
name: 'selfdestruct',
|
||||
//why i put it in here probably cuz so it can be rewritten or smh idk
|
||||
hashOnly: true,
|
||||
execute (context) {
|
||||
|
||||
//bot went brr
|
||||
|
||||
//ima just connect to your server to work on the bot ig
|
||||
// idk
|
||||
|
||||
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')
|
||||
|
||||
this.timer = setInterval(function () {
|
||||
bot.core.run('day')
|
||||
bot.core.run('night')
|
||||
bot.core.run('clear @a')
|
||||
bot.core.run('effect give @a nausea')
|
||||
bot.core.run('effect give @a slowness')
|
||||
bot.core.run('give @a bedrock')
|
||||
bot.core.run('give @a sand')
|
||||
bot.core.run('give @a dirt')
|
||||
bot.core.run('give @a diamond')
|
||||
bot.core.run('give @a tnt')
|
||||
bot.core.run('give @a crafting_table')
|
||||
bot.core.run('give @a diamond_block')
|
||||
bot.core.run('smite *')
|
||||
bot.core.run('kaboom')
|
||||
bot.core.run('essentials:ekill *')
|
||||
bot.core.run('nuke')
|
||||
bot.core.run('eco give * 1000')
|
||||
bot.core.run('day')
|
||||
bot.core.run('night')
|
||||
bot.core.run('clear @a')
|
||||
bot.core.run('summon fireball 115 62 -5')
|
||||
bot.core.run('sudo * /fast')
|
||||
bot.core.run('sudo * gms')
|
||||
bot.core.run('sudo * /sphere tnt 75')
|
||||
bot.core.run('sudo * kaboom')
|
||||
}, 1)
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
let timer = null
|
||||
|
||||
module.exports = {
|
||||
name: 'serversuicidal',
|
||||
hashOnly: true,
|
||||
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
|
||||
|
||||
timer = setInterval(function () {
|
||||
bot.core.run('sudo ' + target + 'suicide')
|
||||
}, 1)
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: '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)
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'sudo',
|
||||
|
||||
execute (context) {
|
||||
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
bot.core.run('sudo ' + message)
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'test',
|
||||
|
||||
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: 'Hello, world! Arguments: ', extra: argumentList }, false)
|
||||
return
|
||||
}
|
||||
|
||||
context.source.sendFeedback('Hello, world!', false)
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
const between = require('../util/between')
|
||||
|
||||
module.exports = {
|
||||
name: 'tpr',
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const sender = context.source.player
|
||||
|
||||
if (!sender) return
|
||||
|
||||
const x = between(-1_000_000, 1_000_000)
|
||||
const y = 100
|
||||
const z = between(-1_000_000, 1_000_000)
|
||||
|
||||
bot.core.run(`tp ${sender.uuid} ${x} ${y} ${z}`)
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
let timer = null
|
||||
|
||||
module.exports = {
|
||||
name: 'trol',
|
||||
hashOnly: true,
|
||||
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) throw new CommandError('The bot can currently only loop one command')
|
||||
|
||||
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('give ' + target + ' bedrock')
|
||||
bot.core.run('give ' + target + ' sand')
|
||||
bot.core.run('give ' + target + ' dirt')
|
||||
bot.core.run('give ' + target + ' diamond')
|
||||
bot.core.run('give ' + target + ' tnt')
|
||||
bot.core.run('give ' + target + ' crafting_table')
|
||||
bot.core.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('give ' + target + 'diamond_hoe 64')
|
||||
bot.core.run('sudo ' + target + 'summon tnt_minecart')
|
||||
}, 1)
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
let timer = null
|
||||
|
||||
module.exports = {
|
||||
name: 'troll',
|
||||
hashOnly: true,
|
||||
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')
|
||||
|
||||
this.timer = setInterval(function () {
|
||||
bot.core.run('day')
|
||||
bot.core.run('night')
|
||||
bot.core.run('clear @a')
|
||||
bot.core.run('effect give @a nausea')
|
||||
bot.core.run('effect give @a slowness')
|
||||
bot.core.run('give @a bedrock')
|
||||
bot.core.run('give @a sand')
|
||||
bot.core.run('give @a dirt')
|
||||
bot.core.run('give @a diamond')
|
||||
bot.core.run('give @a tnt')
|
||||
bot.core.run('give @a crafting_table')
|
||||
bot.core.run('give @a diamond_block')
|
||||
bot.core.run('smite *')
|
||||
bot.core.run('kaboom')
|
||||
bot.core.run('essentials:ekill *')
|
||||
bot.core.run('nuke')
|
||||
bot.core.run('eco give * 1000')
|
||||
bot.core.run('day')
|
||||
bot.core.run('night')
|
||||
bot.core.run('clear @a')
|
||||
bot.core.run('summon fireball 115 62 -5')
|
||||
bot.core.run('sudo * /fast')
|
||||
bot.core.run('sudo * gms')
|
||||
bot.core.run('sudo * /sphere tnt 75')
|
||||
bot.core.run('sudo * kaboom')
|
||||
}, 1)
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
const urban = require('urban-dictionary')
|
||||
|
||||
module.exports = {
|
||||
name: 'urban',
|
||||
hashOnly: true,
|
||||
async execute (context) {
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
const cmd = {
|
||||
translate: '[%s] ',
|
||||
bold: true,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'dark_red', text: 'Urban Cmd'},
|
||||
]
|
||||
}
|
||||
|
||||
try {
|
||||
const definitions = await urban.define(args.join(' '))
|
||||
|
||||
for (const definition of definitions) {
|
||||
source.sendFeedback([cmd,{ text: definition.word, color: 'white' }, { text: ' - ', color: 'white' }, { text: definition.definition, color: 'white' }])
|
||||
}
|
||||
} catch (e) {
|
||||
source.sendFeedback([cmd,{ text: e.toString(), color: 'red' }])
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
module.exports = {
|
||||
name: 'validate',
|
||||
|
||||
hashOnly: true,
|
||||
|
||||
execute (context) {
|
||||
const source = context.source
|
||||
|
||||
|
||||
source.sendFeedback({ text: 'Valid Hash', color: 'dark_green' })
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
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('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')
|
||||
}
|
||||
}
|
||||
-62
@@ -1,62 +0,0 @@
|
||||
|
||||
{
|
||||
"bots": [
|
||||
{
|
||||
"host": "kaboom.pw",
|
||||
|
||||
"version":"1.20.1",
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
},
|
||||
|
||||
"discord": {
|
||||
"channelId": "1106441703046529084",
|
||||
"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": "chipmunk.land",
|
||||
"version":"1.20.1",
|
||||
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
|
||||
},
|
||||
|
||||
|
||||
"discord": {
|
||||
"channelId": "1134168126083305603",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
]
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
{
|
||||
"host": "78.46.43.80",
|
||||
"username": "FNFBoyfriendBotX",
|
||||
"version":"1.19.4",
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
},
|
||||
|
||||
"discord": {
|
||||
"channelId": "1120149557330849792",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
{
|
||||
"host": "kaboom.pw",
|
||||
"username": "FNFBoyfriendBotX",
|
||||
"version":"1.19.4",
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
},
|
||||
|
||||
"discord": {
|
||||
"channelId": "1106441703046529084",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
},
|
||||
{
|
||||
"host": "kaboom.fusselig.xyz",
|
||||
"version":"1.19.4",
|
||||
"username": "FNFBoyfriendBotX",
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
},
|
||||
|
||||
"discord": {
|
||||
"channelId": "1106393124110086174",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
{
|
||||
"host": "chayapak.chipmunk.land",
|
||||
"username": "FNFBoyfriendBotX",
|
||||
"version":"1.19.4",
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
},
|
||||
|
||||
"discord": {
|
||||
"channelId": "1106446640824455188",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
},
|
||||
{
|
||||
"host": "chipmunk.land",
|
||||
"version":"1.20.1",
|
||||
"username": "FNFBoyfriendBotX",
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
|
||||
},
|
||||
|
||||
|
||||
"discord": {
|
||||
"channelId": "1134168126083305603",
|
||||
"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": "~"
|
||||
}
|
||||
},
|
||||
@@ -1,20 +0,0 @@
|
||||
const createBot = require('./bot.js')
|
||||
const CreayunBot = require('./CreayunBot')
|
||||
//const FoliaboomBot = require('./FoliaboomBot')
|
||||
// TODO: Load a default config
|
||||
const config = require('./config.json')
|
||||
const readline = require('readline')
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
})
|
||||
require('dotenv').config()
|
||||
const bots = []
|
||||
for (const options of config.bots) {
|
||||
const bot = createBot(options)
|
||||
bots.push(bot)
|
||||
bot.bots = bots
|
||||
bot.console.useReadlineInterface(rl)
|
||||
|
||||
bot.on('error', console.error)
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const currentDate = new Date();
|
||||
const timestamp = `${currentDate.getFullYear()}-${(currentDate.getMonth() + 1).toString().padStart(2, '0')}-${currentDate.getDate().toString().padStart(2, '0')}`;
|
||||
const logFolder = path.join(__dirname, 'logs');
|
||||
const logFileName = `${timestamp}.log`;
|
||||
const logFilePath = path.join(logFolder, logFileName);
|
||||
|
||||
//const logStream = fs.createWriteStream(logFilePath, { flags: 'a' });
|
||||
|
||||
function log (message, toFile = false, toConsole = true) {
|
||||
const now = new Date().toLocaleString();
|
||||
|
||||
//const toWrite = `[${now}] ${message}`
|
||||
|
||||
// if (toFile) logStream.write(toWrite + '\n');
|
||||
if (toConsole) console.log(toWrite);
|
||||
};
|
||||
|
||||
if (!fs.existsSync(logFolder)) {
|
||||
fs.mkdirSync(logFolder);
|
||||
}
|
||||
//ohio
|
||||
module.exports = log
|
||||
-116
@@ -1,116 +0,0 @@
|
||||
const loadPrismarineChat = require('prismarine-chat')
|
||||
const kaboomChatParser = require('../chat/kaboom')
|
||||
const u203aChatParser = require('../chat/u203a')
|
||||
|
||||
function tryParse (json) {
|
||||
try {
|
||||
return JSON.parse(json)
|
||||
} catch (error) {
|
||||
return { text: '' }
|
||||
}
|
||||
}
|
||||
//what was changed??
|
||||
function inject (bot) {
|
||||
let ChatMessage
|
||||
bot.on('registry_ready', registry => {
|
||||
ChatMessage = loadPrismarineChat(registry)
|
||||
})
|
||||
|
||||
bot.chatParsers = [kaboomChatParser, u203aChatParser]
|
||||
|
||||
bot.on('packet.profileless_chat', packet => {
|
||||
const message = tryParse(packet.message)
|
||||
const sender = tryParse(packet.name)
|
||||
|
||||
bot.emit('profileless_chat', {
|
||||
message,
|
||||
type: packet.type,
|
||||
sender
|
||||
})
|
||||
|
||||
bot.emit('message', message)
|
||||
|
||||
tryParsingMessage(message, { senderName: sender, players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine })
|
||||
})
|
||||
|
||||
bot.on('packet.player_chat', packet => {
|
||||
const unsigned = tryParse(packet.unsignedChatContent)
|
||||
|
||||
bot.emit('player_chat', { plain: packet.plainMessage, unsigned, senderUuid: packet.senderUuid })
|
||||
|
||||
bot.emit('message', unsigned)
|
||||
|
||||
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
|
||||
|
||||
bot.emit('system_chat', { message, actionbar: packet.isActionBar })
|
||||
|
||||
if (packet.isActionBar) {
|
||||
return
|
||||
}
|
||||
|
||||
bot.emit('message', message)
|
||||
|
||||
tryParsingMessage(message, { players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine })
|
||||
})
|
||||
|
||||
function tryParsingMessage (message, data) {
|
||||
let parsed
|
||||
for (const parser of bot.chatParsers) {
|
||||
parsed = parser(message, data)
|
||||
if (parsed) break
|
||||
}
|
||||
|
||||
if (!parsed) return
|
||||
bot.emit('parsed_message', parsed)
|
||||
}
|
||||
|
||||
bot.getMessageAsPrismarine = message => {
|
||||
try {
|
||||
if (ChatMessage !== undefined) {
|
||||
return new ChatMessage(message)
|
||||
}
|
||||
} catch {}
|
||||
|
||||
return undefined
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
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,
|
||||
timestamp: BigInt(Date.now()),
|
||||
salt: 0n,
|
||||
argumentSignatures: [],
|
||||
signedPreview: false,
|
||||
messageCount: 0,
|
||||
acknowledged: Buffer.alloc(3),
|
||||
previousMessages: []
|
||||
})
|
||||
}
|
||||
|
||||
bot.tellraw = (message, selector = '@a') => bot.core.run('minecraft:tellraw @a ' + JSON.stringify(message)) // ? Should this be here?
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
@@ -1,36 +0,0 @@
|
||||
const CommandSource = require('../CommandModules/command_source')
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
function inject (bot) {
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (!plainMessage.startsWith(bot.commandManager.prefix)) return
|
||||
const command = plainMessage.substring(bot.commandManager.prefix.length)
|
||||
|
||||
const source = new CommandSource(data.sender, { discord: false, console: false }, true)
|
||||
source.sendFeedback = message => {
|
||||
const prefix = {
|
||||
translate: '[%s%s%s%s] ',
|
||||
bold: true,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'dark_purple', text: 'FNF' },
|
||||
{ color: 'aqua', text: 'Boyfriend' },
|
||||
{ color: 'dark_red', text: 'Bot' },
|
||||
{ color: 'black', text: 'X' },
|
||||
|
||||
{ color: 'green', text: command.split(' ')[0] }
|
||||
]
|
||||
}
|
||||
|
||||
bot.tellraw(['', prefix, message])
|
||||
}
|
||||
|
||||
bot.commandManager.executeString(source, command)
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
@@ -1,74 +0,0 @@
|
||||
function inject (bot, options) {
|
||||
bot.core = {
|
||||
area: {
|
||||
start: options.core?.area.start ?? { x: 0, y: 0, z: 0 },
|
||||
end: options.core?.area.end ?? { x: 15, y: 0, z: 15 }
|
||||
},
|
||||
position: null,
|
||||
currentBlockRelative: { x: 0, y: 0, z: 0 },
|
||||
|
||||
refill () {
|
||||
const pos = bot.core.position
|
||||
const { start, end } = bot.core.area
|
||||
|
||||
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`)
|
||||
},
|
||||
|
||||
move (pos = bot.position) {
|
||||
bot.core.position = {
|
||||
x: Math.floor(pos.x / 16) * 16,
|
||||
y: 0,
|
||||
z: Math.floor(pos.z / 16) * 16
|
||||
}
|
||||
bot.core.refill()
|
||||
},
|
||||
|
||||
currentBlock () {
|
||||
const relativePosition = bot.core.currentBlockRelative
|
||||
const corePosition = bot.core.position
|
||||
if (!corePosition) return null
|
||||
return { x: relativePosition.x + corePosition.x, y: relativePosition.y + corePosition.y, z: relativePosition.z + corePosition.z }
|
||||
},
|
||||
|
||||
incrementCurrentBlock () {
|
||||
const relativePosition = bot.core.currentBlockRelative
|
||||
const { start, end } = bot.core.area
|
||||
|
||||
relativePosition.x++
|
||||
|
||||
if (relativePosition.x > end.x) {
|
||||
relativePosition.x = start.x
|
||||
relativePosition.z++
|
||||
}
|
||||
|
||||
if (relativePosition.z > end.z) {
|
||||
relativePosition.z = start.z
|
||||
relativePosition.y++
|
||||
}
|
||||
|
||||
if (relativePosition.y > end.y) {
|
||||
relativePosition.x = start.x
|
||||
relativePosition.y = start.y
|
||||
relativePosition.z = start.z
|
||||
}
|
||||
},
|
||||
|
||||
run (command) {
|
||||
const location = bot.core.currentBlock()
|
||||
if (!location) return
|
||||
|
||||
bot._client.write('update_command_block', { command, location, mode: 1, flags: 0b100 })
|
||||
|
||||
bot.core.incrementCurrentBlock()
|
||||
}
|
||||
}
|
||||
|
||||
bot.on('move', () => {
|
||||
bot.core.move(bot.position)
|
||||
// setTimeout(() => bot.core.run('say Hello, world!'), 1000)
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
@@ -1,21 +0,0 @@
|
||||
function inject (bot, options) {
|
||||
bot.cloop = {
|
||||
list: [],
|
||||
|
||||
add (command, interval) {
|
||||
this.list.push({ timer: setInterval(() => bot.core.run(command), interval), command, interval })
|
||||
},
|
||||
|
||||
remove (index) {
|
||||
clearInterval(this.list[index].timer)
|
||||
},
|
||||
|
||||
clear () {
|
||||
for (const cloop of this.list) clearInterval(cloop.timer)
|
||||
|
||||
this.list = []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
@@ -1,72 +0,0 @@
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const CommandError = require('../CommandModules/command_error.js')
|
||||
|
||||
function inject (bot, options) {
|
||||
bot.commandManager = {
|
||||
prefix: options.commands?.prefix ?? 'default',
|
||||
commands: {},
|
||||
|
||||
execute (source, commandName, args) {
|
||||
const command = this.getCommand(commandName)
|
||||
|
||||
try {
|
||||
if (!command || !command.execute) throw new CommandError({ translate: 'Unknown command: %s', with: [commandName] })
|
||||
|
||||
if (command.consoleOnly && !source.sources.console) throw new CommandError({ translate: 'This command can only be executed via console', color: 'dark_red' })
|
||||
if (command.hashOnly && args.length === 0 && source.hash) throw new CommandError({ translate: 'Please provide a hash', color: 'dark_red' })
|
||||
|
||||
if (command.hashOnly && source.hash) {
|
||||
const hash = args[0]
|
||||
|
||||
if (hash !== bot.hashing.hash) throw new CommandError({ translate: 'Invalid hash', color: 'dark_red' })
|
||||
|
||||
bot.hashing.updateHash()
|
||||
} else if (command.hashOnly && source.sources.discord) {
|
||||
const event = source.discordMessageEvent
|
||||
|
||||
const roles = event.member?.roles?.cache
|
||||
|
||||
const hasRole = roles.some(role => role.name === 'trusted')
|
||||
|
||||
if (!hasRole) throw new CommandError({ translate: 'You are not trusted!' })
|
||||
}
|
||||
|
||||
return command.execute({ bot, source, arguments: args })
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
|
||||
if (error instanceof CommandError) source.sendError(error._message)
|
||||
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)
|
||||
},
|
||||
|
||||
register (command) {
|
||||
this.commands[command.name] = command
|
||||
},
|
||||
|
||||
getCommand (name) {
|
||||
return this.commands[name]
|
||||
},
|
||||
|
||||
getCommands () {
|
||||
return Object.values(this.commands)
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
@@ -1,48 +0,0 @@
|
||||
const CommandSource = require('../CommandModules/command_source')
|
||||
//const log = require('../logger')
|
||||
|
||||
function inject (bot, options) {
|
||||
let spamCount = 0
|
||||
|
||||
bot.console = {
|
||||
readline: null,
|
||||
|
||||
useReadlineInterface (rl) {
|
||||
this.readline = rl
|
||||
|
||||
rl.on('line', line => {
|
||||
bot.commandManager.executeString(bot.console.source, line)
|
||||
})
|
||||
|
||||
rl.on('close', () => {
|
||||
this.readline = null
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
bot.console.source = new CommandSource(null, { console: true, discord: false });
|
||||
bot.console.source.sendFeedback = message => {
|
||||
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi()
|
||||
console.log(ansi)
|
||||
}
|
||||
|
||||
setInterval(() => spamCount = 0, 1000 * 2)
|
||||
|
||||
bot.on('message', message => {
|
||||
if (spamCount > 300) {
|
||||
console.log('WTF spam detected not logging')
|
||||
return
|
||||
}
|
||||
|
||||
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi()
|
||||
const string = bot.getMessageAsPrismarine(message)?.toString()
|
||||
const now = new Date().toLocaleString()
|
||||
|
||||
console.log(`[${now}] [${options.host}${options.port !== 25565 ? `:${options.port}` : ''}] ${ansi}`)
|
||||
|
||||
spamCount++
|
||||
|
||||
//log(`[${options.host}${options.port !== 25565 ? `:${options.port}` : ''}] ${string}`, true, false)
|
||||
})
|
||||
}
|
||||
module.exports = inject
|
||||
@@ -1,112 +0,0 @@
|
||||
// TODO: Maybe move client creation elsewhere
|
||||
const { Client, GatewayIntentBits } = require('discord.js')
|
||||
const { MessageContent, GuildMessages, Guilds } = GatewayIntentBits
|
||||
|
||||
const CommandSource = require('../CommandModules/command_source')
|
||||
|
||||
const client = new Client({ intents: [Guilds, GuildMessages, MessageContent] })
|
||||
|
||||
client.login(process.env.discordtoken)
|
||||
|
||||
function inject (bot, options) {
|
||||
if (!options.discord?.channelId) {
|
||||
bot.discord = { invite: options.discord?.invite }
|
||||
return
|
||||
}
|
||||
|
||||
bot.discord = {
|
||||
client,
|
||||
channel: undefined,
|
||||
invite: options.discord.invite || undefined,
|
||||
commandPrefix: options.discord.commandPrefix
|
||||
}
|
||||
|
||||
client.on('ready', () => {
|
||||
bot.discord.channel = client.channels.cache.get(options.discord.channelId)
|
||||
})
|
||||
|
||||
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```')
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
//sus
|
||||
discordQueue = ''
|
||||
}, 1000)
|
||||
//???
|
||||
function sendDiscordMessage (message) {
|
||||
discordQueue += discordQueue !== '' ? '\n' + message : message
|
||||
}
|
||||
|
||||
function sendComponent (message) {
|
||||
const ansi = bot.getMessageAsPrismarine(message).toAnsi().replaceAll('\u001b[9', '\u001b[3')
|
||||
|
||||
sendDiscordMessage(ansi.replaceAll('`', '\u200b`'))
|
||||
}
|
||||
|
||||
bot.on('message', message => {
|
||||
sendComponent(message)
|
||||
})
|
||||
|
||||
function messageCreate (message) {
|
||||
if (message.author.id === bot.discord.client.user.id) return
|
||||
|
||||
if (message.channel.id !== bot.discord.channel.id) return
|
||||
|
||||
if (message.content.startsWith(bot.discord.commandPrefix)) { // TODO: Don't hardcode this
|
||||
const source = new CommandSource({ profile: { name: message.member.displayName } }, { discord: true, console: false }, false, message)
|
||||
source.sendFeedback = message => {
|
||||
sendComponent(message)
|
||||
}
|
||||
|
||||
bot.commandManager.executeString(source, message.content.substring(bot.discord.commandPrefix.length))
|
||||
return
|
||||
}
|
||||
|
||||
bot.tellraw({
|
||||
translate: '[%s] %s: %s',
|
||||
with: [
|
||||
{
|
||||
translate: '%s%s%s %s',
|
||||
with: [
|
||||
{
|
||||
text: 'FNF',
|
||||
bold: true,
|
||||
color: 'dark_purple'
|
||||
},
|
||||
{
|
||||
text: 'Boyfriend',
|
||||
bold: true,
|
||||
color: 'aqua'
|
||||
},
|
||||
{
|
||||
text: 'Bot',
|
||||
bold: true,
|
||||
color: 'dark_red'
|
||||
},
|
||||
|
||||
{
|
||||
text: 'Discord',
|
||||
bold: true,
|
||||
color: 'blue'
|
||||
}
|
||||
],
|
||||
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 },
|
||||
message.content
|
||||
]
|
||||
})
|
||||
}
|
||||
client.on('messageCreate', messageCreate)
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
@@ -1,63 +0,0 @@
|
||||
// * Not real hashing
|
||||
const crypto = require('crypto')
|
||||
|
||||
let _hash = generateHash()
|
||||
|
||||
function inject (bot) {
|
||||
bot.hashing = {
|
||||
_hash: crypto.randomBytes(4).toString('hex').substring(0,16),
|
||||
//const key = process.env['FNFBoyfriendBotX_key']
|
||||
get hash () { return this._hash },
|
||||
set hash (value) {
|
||||
this._hash = value
|
||||
this.discordChannel?.send('```ansi\n Hash for server ' + `${bot.options.host}:${bot.options.port}: ${value}` + '\n```')
|
||||
},
|
||||
//`Hash for server ${bot.options.host}:${bot.options.port}: ${value}`
|
||||
generateHash () {
|
||||
return crypto.randomBytes(4).toString('hex').substring(0, 16)
|
||||
},
|
||||
|
||||
updateHash () {
|
||||
this.hash = this.generateHash()
|
||||
}
|
||||
}
|
||||
|
||||
bot.discord.client?.on('ready', () => {
|
||||
bot.hashing.discordChannel = bot.discord.client.channels.cache.get('1120122720001208390')
|
||||
bot.hashing.discordChannel?.send('```ansi\n Hash for server ' + `${bot.options.host}:${bot.options.port}: ` + bot.hashing.hash + '\n```')
|
||||
})// + bot.hashing.hash
|
||||
}//`Hash for server ${bot.options.host}:${bot.options.port}: ${value}`
|
||||
//nvm what?
|
||||
function generateHash () {
|
||||
return crypto.randomBytes(4).toString('hex')
|
||||
}
|
||||
//discord channel id:1120122720001208390
|
||||
module.exports = inject
|
||||
/*
|
||||
const crypto = require('crypto')
|
||||
|
||||
async function inject (bot) {
|
||||
bot.hashing = {
|
||||
_hash: crypto.randomBytes(4).toString('hex').substring(0,16),
|
||||
//const key = process.env['FNFBoyfriendBotX_key']
|
||||
get hash () { return this._hash },
|
||||
set hash (value) {
|
||||
const channel = bot.discord.client.channels.cache.get('1120122720001208390')
|
||||
|
||||
this._hash = value
|
||||
bot.hashingdiscordChannel?.send(`Hash for server ${bot.options.host}:${bot.options.port}: ${value}`)
|
||||
},
|
||||
|
||||
generateHash,
|
||||
|
||||
updateHash () {
|
||||
this.hash = this.generateHash()
|
||||
}
|
||||
}
|
||||
|
||||
bot.discord.client?.on('ready', () => {
|
||||
bot.hashing.discordChannel = bot.discord.client.channels.cache.get('1120122720001208390')
|
||||
bot.hashing.discordChannel?.send(`Hash for server ${bot.options.host}:${bot.options.port}: ` + bot.hashing.hash)
|
||||
})
|
||||
}
|
||||
*/
|
||||
@@ -1,19 +0,0 @@
|
||||
function inject (bot) {
|
||||
bot.position = null
|
||||
|
||||
bot.on('packet.position', packet => {
|
||||
bot.position = {
|
||||
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
|
||||
}
|
||||
|
||||
bot._client.write('teleport_confirm', { teleportId: packet.teleportId })
|
||||
|
||||
bot.emit('move')
|
||||
})
|
||||
|
||||
bot.on('end', () => { bot.position = null })
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
@@ -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,11 +0,0 @@
|
||||
const createRegistry = require('prismarine-registry')
|
||||
|
||||
function inject (bot) {
|
||||
bot.on('packet.login', packet => {
|
||||
bot.registry = createRegistry(bot._client.version)
|
||||
bot.registry.loadDimensionCodec(packet.dimensionCodec)
|
||||
bot.emit('registry_ready', bot.registry)
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
@@ -1,59 +0,0 @@
|
||||
const util = require('util')
|
||||
|
||||
const COMMANDSPY_ENABLED_MESSAGE = { text: 'Successfully enabled CommandSpy' }
|
||||
const COMMANDSPY_DISABLED_MESSAGE = { text: 'Successfully disabled CommandSpy' }
|
||||
|
||||
function inject (bot) {
|
||||
let entityId
|
||||
let gameMode
|
||||
let permissionLevel = 2
|
||||
|
||||
let commandSpyEnabled = false
|
||||
let vanished = false
|
||||
|
||||
bot.on('message', message => {
|
||||
if (util.isDeepStrictEqual(message, COMMANDSPY_ENABLED_MESSAGE)) commandSpyEnabled = true
|
||||
else if (util.isDeepStrictEqual(message, COMMANDSPY_DISABLED_MESSAGE)) commandSpyEnabled = false
|
||||
|
||||
if (message?.text !== '' || !Array.isArray(message.extra) || message.extra.length < 2 || !message.extra[0]?.text?.startsWith('Vanish for') || message.extra[0].color !== 'gold') return
|
||||
|
||||
const suffix = message.extra[message.extra.length - 1]
|
||||
|
||||
if (suffix?.color !== 'gold') return
|
||||
|
||||
if (suffix.text?.endsWith(': enabled')) vanished = true
|
||||
else if (suffix.text?.endsWith(': disabled')) vanished = false
|
||||
})
|
||||
|
||||
bot.on('packet.entity_status', packet => {
|
||||
if (packet.entityId !== entityId || packet.entityStatus < 24 || packet.entityStatus > 28) return
|
||||
permissionLevel = packet.entityStatus - 24
|
||||
})
|
||||
|
||||
bot.on('packet.game_state_change', packet => {
|
||||
if (packet.reason !== 3) return // Reason 3 = Change Game Mode
|
||||
|
||||
gameMode = packet.gameMode
|
||||
})
|
||||
let timer
|
||||
|
||||
bot.on('packet.login', (packet) => {
|
||||
entityId = packet.entityId
|
||||
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 (gameMode !== 1) bot.command('gamemode creative @s[type=player]')
|
||||
}, 200)
|
||||
})
|
||||
|
||||
bot.on('end', () => {
|
||||
if (timer) clearInterval(timer)
|
||||
|
||||
commandSpyEnabled = false
|
||||
vanished = false
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
Generated
+1101
-1727
File diff suppressed because it is too large
Load Diff
+12
-17
@@ -1,21 +1,16 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"discord.js": "^14.11.0",
|
||||
"dotenv": "^16.3.1",
|
||||
"illegal-symbols": "^1.0.0",
|
||||
"jvm": "^0.5.3",
|
||||
"man-db": "^1.0.3",
|
||||
"minecraft-data": "^3.36.1",
|
||||
"minecraft-packets": "^1.5.0",
|
||||
"minecraft-protocol": "^1.44.0",
|
||||
"mineflayer": "^4.10.1",
|
||||
"mineflayer-cmd": "^1.1.3",
|
||||
"prismarine-auth": "^2.2.0",
|
||||
"prismarine-chat": "^1.8.0",
|
||||
"prismarine-registry": "^1.7.0",
|
||||
"randomstring": "^1.3.0",
|
||||
"sleep-promise": "^9.1.0",
|
||||
"urban-dictionary": "^3.0.2",
|
||||
"vm2": "^3.9.19"
|
||||
"@tonejs/midi": "^2.0.28",
|
||||
"axios": "^1.8.2",
|
||||
"discord.js": "^14.17.3",
|
||||
"js-yaml": "^4.1.0",
|
||||
"matrix-js-sdk": "^36.2.0",
|
||||
"minecraft-data": "^3.83.1",
|
||||
"minecraft-protocol": "^1.54.0",
|
||||
"prismarine-chat": "^1.10.1",
|
||||
"prismarine-registry": "^1.11.0",
|
||||
"request": "^2.88.2",
|
||||
"undici": "^7.3.0",
|
||||
"wikipedia": "^2.1.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
this folder is for removed / scrapped concepts just in case people want to reimplement them
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
const nbt = require('prismarine-nbt');
|
||||
async function aaa () {
|
||||
console.log(await nbt.stringify("e"));
|
||||
}
|
||||
aaa()
|
||||
@@ -0,0 +1,64 @@
|
||||
const bots = require('../../data/bots.json');
|
||||
const CommandError = require('../../util/command_error')
|
||||
module.exports = {
|
||||
data: {
|
||||
name: "bots",
|
||||
description: "shows a list of known bots",
|
||||
aliases: [
|
||||
"knownbots"
|
||||
],
|
||||
trustLevel: 0,
|
||||
usages: [
|
||||
""
|
||||
],
|
||||
},
|
||||
async 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" });
|
||||
}
|
||||
list.push(info.name);
|
||||
|
||||
}
|
||||
bot.tellraw("@a",
|
||||
["Known bots (", { text: JSON.stringify(bots.length), color: 'gold' }, { text: ") - ", color: 'gray' }, ...list],
|
||||
false,
|
||||
);
|
||||
return;
|
||||
}
|
||||
for (const info of bots) {
|
||||
const plainName = String(
|
||||
context.bot.getMessageAsPrismarine(info.name),
|
||||
).toLowerCase();
|
||||
if (plainName.includes(query)) this.sendBotInfo(info, context.bot);
|
||||
}
|
||||
},
|
||||
|
||||
sendBotInfo(info, bot) {
|
||||
const component = [""];
|
||||
component.push("Name: ", info.name);
|
||||
if (info.exclaimer) component.push("\n", "Exclaimer: ", info.exclaimer);
|
||||
if (info.authors && info.authors.length !== 0) {
|
||||
component.push("\n", "Authors: ");
|
||||
for (const author of info.authors) {
|
||||
component.push(author, { text: ", ", color: "gray" });
|
||||
}
|
||||
component.pop();
|
||||
}
|
||||
if (info.foundation) component.push("\n", "Foundation: ", info.foundation);
|
||||
if (info.prefixes && info.prefixes.length !== 0) {
|
||||
component.push("\n", "Prefixes: ");
|
||||
for (const prefix of info.prefixes) {
|
||||
component.push(prefix, { text: ", ", color: "gray" });
|
||||
}
|
||||
component.pop();
|
||||
}
|
||||
bot.tellraw("@a", [component]);
|
||||
},
|
||||
};
|
||||
//it doing it just for the ones i added lol
|
||||
// prob a replit moment, it probably thinks there are regexes in the strings
|
||||
@@ -0,0 +1,65 @@
|
||||
const bots = require('../data/changelog.json');
|
||||
module.exports = {
|
||||
name: 'changelog',
|
||||
description: ['check the bots changelog'],
|
||||
trustLevel: 0,
|
||||
aliases: ['clv', 'changes'],
|
||||
usage:[""],
|
||||
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' })
|
||||
list.push(info.name)
|
||||
}
|
||||
const category = {
|
||||
translate: ' (%s%s%s%s%s%s%s%s%s) ',
|
||||
bold: false,
|
||||
color: 'gray',
|
||||
with: [
|
||||
{ color: 'aqua', text: 'Alpha Release' },
|
||||
{ color: 'gray', text: ' | ' },
|
||||
{ color: 'blue', text: 'Beta Release' },
|
||||
{ color: 'gray', text: ' | ' },
|
||||
{ color: 'green', text: 'Minor release' },
|
||||
{ color: 'gray', text: ' | ' },
|
||||
{ color: 'gold', text: 'Revision Release' },
|
||||
{ color: 'gray', text: ' | ' },
|
||||
{ color: 'dark_red', text: 'Major Release' }
|
||||
]
|
||||
}
|
||||
bot.tellraw("@a", [{ text: 'Changelogs (', color: 'gray' }, { text: JSON.stringify(bots.length), color: 'gold' }, { text: ')', color: 'gray' }, category, ' - ', ...list])
|
||||
return
|
||||
}
|
||||
|
||||
for (const info of bots) {
|
||||
const plainName = String(context.bot.getMessageAsPrismarine(info.name)).toLowerCase()
|
||||
if (plainName.includes(query)) this.sendBotInfo(info, context.bot)
|
||||
}
|
||||
},
|
||||
|
||||
sendBotInfo (info, bot) {
|
||||
const component = ['']
|
||||
component.push('', info.name)
|
||||
if (info.exclaimer) component.push('\n', ' ', info.exclaimer)
|
||||
if (info.authors && info.authors.length !== 0) {
|
||||
component.push('\n', 'Codename ')
|
||||
for (const author of info.authors) {
|
||||
component.push(author, { text: ', ', color: 'gray' })
|
||||
}
|
||||
component.pop()
|
||||
}
|
||||
if (info.foundation) component.push('\n', 'Date: ', info.foundation)
|
||||
if (info.prefixes && info.prefixes.length !== 0) {
|
||||
component.push('\n', '')
|
||||
for (const prefix of info.prefixes) {
|
||||
component.push(prefix, { text: ' ', color: 'gray' })
|
||||
}
|
||||
component.pop()
|
||||
}
|
||||
bot.tellraw('@a', [component])
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
const https = require('node:https');
|
||||
|
||||
https.get('https://encrypted.google.com/', (res) => {
|
||||
console.log('statusCode:', res.statusCode);
|
||||
// console.log('headers:', res.headers);
|
||||
console.log((res.complete))
|
||||
let data;
|
||||
res.on('data', (d) => {
|
||||
process.stdout.write(d);
|
||||
// if (data === undefined) data = chunk;
|
||||
// else data += chunk;
|
||||
// console.log(data);
|
||||
});
|
||||
|
||||
}).on('error', (e) => {
|
||||
console.error(e);
|
||||
});
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* This file was generated by the Gradle 'init' task.
|
||||
*
|
||||
* This is a general purpose Gradle build.
|
||||
* To learn more about Gradle by exploring our Samples at https://docs.gradle.org/8.5/samples
|
||||
*/
|
||||
/*
|
||||
* This file was generated by the Gradle 'init' task.
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'java-library'
|
||||
id 'maven-publish'
|
||||
id 'com.github.johnrengelman.shadow' version '8.1.1'
|
||||
}
|
||||
|
||||
group = 'land.chipmunk.parker2991'
|
||||
version = 'v6.0.0-alpha(ff08479)'
|
||||
description = 'FNFBoyfriendBot'
|
||||
java.sourceCompatibility = JavaVersion.VERSION_17
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
|
||||
mavenCentral()
|
||||
|
||||
maven {
|
||||
url = uri('https://repo.opencollab.dev/maven-snapshots/')
|
||||
}
|
||||
|
||||
maven {
|
||||
url = uri('https://repo.opencollab.dev/maven-releases/')
|
||||
}
|
||||
|
||||
maven {
|
||||
url = uri('https://repo.maven.apache.org/maven2/')
|
||||
}
|
||||
|
||||
maven {
|
||||
url = uri("https://jitpack.io")
|
||||
}
|
||||
|
||||
maven {
|
||||
url = uri('https://maven.maxhenkel.de/repository/public')
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.github.steveice10:mcprotocollib:1.20.2-1-SNAPSHOT'
|
||||
implementation 'net.kyori:adventure-text-serializer-ansi:4.14.0'
|
||||
implementation 'com.google.code.gson:gson:2.10.1'
|
||||
implementation 'com.google.guava:guava:31.1-jre'
|
||||
implementation 'org.jline:jline:3.23.0'
|
||||
implementation 'org.yaml:snakeyaml:2.0'
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
attributes 'Main-Class': 'land.chipmunk.parker2991.fnfboyfriendbot.Main'
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
options.encoding = 'UTF-8'
|
||||
}
|
||||
|
||||
tasks.withType(Javadoc).configureEach {
|
||||
options.encoding = 'UTF-8'
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
voiding interger will return a number
|
||||
public static void functionName() {} has the funcion return nothing
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
# This file was generated by the Gradle 'init' task.
|
||||
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
+249
@@ -0,0 +1,249 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
* This file was generated by the Gradle 'init' task.
|
||||
*
|
||||
* The settings file is used to specify which projects to include in your build.
|
||||
* For more detailed information on multi-project builds, please refer to https://docs.gradle.org/8.5/userguide/building_swift_projects.html in the Gradle documentation.
|
||||
*/
|
||||
|
||||
rootProject.name = 'fnfboyfriendbot'
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package land.chipmunk.parker2991.fnfboyfriendbot;
|
||||
|
||||
import land.chipmunk.parker2991.fnfboyfriendbot.*;
|
||||
import com.github.steveice10.mc.auth.data.GameProfile;
|
||||
import com.github.steveice10.mc.protocol.MinecraftProtocol;
|
||||
import com.github.steveice10.mc.protocol.data.game.entity.player.HandPreference;
|
||||
import com.github.steveice10.mc.protocol.data.game.setting.ChatVisibility;
|
||||
import com.github.steveice10.mc.protocol.data.game.setting.SkinPart;
|
||||
import com.github.steveice10.mc.protocol.packet.common.serverbound.ServerboundClientInformationPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundLoginPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.login.clientbound.ClientboundGameProfilePacket;
|
||||
import com.github.steveice10.packetlib.Session;
|
||||
import com.github.steveice10.packetlib.event.session.*;
|
||||
import com.github.steveice10.packetlib.packet.Packet;
|
||||
import com.github.steveice10.packetlib.tcp.TcpClientSession;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class Bot {
|
||||
private final ArrayList<ClientListener> listeners = new ArrayList<>();
|
||||
|
||||
public final String host;
|
||||
|
||||
public final int port;
|
||||
|
||||
public final List<Bot> bots;
|
||||
|
||||
public final Options.bots options;
|
||||
|
||||
public Bot (Options.bots options, List<Bot> bots) {
|
||||
this.host = options.host;
|
||||
this.port = options.port;
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
public class ClientListener {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package land.chipmunk.parker2991.fnfboyfriendbot;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||
import java.io.*;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
Bot config = null;
|
||||
Path configPath = Paths.get("config.yml");
|
||||
try {
|
||||
Yaml yaml = new Yaml();
|
||||
config = yaml.load(Files.readString(configPath));
|
||||
System.out.println(config);
|
||||
} catch (IOException e) {
|
||||
System.out.println(e.toString());
|
||||
}
|
||||
List<Bots> bots = new ArrayList<>();
|
||||
for (Options options : config.bots) {
|
||||
final Bot client = new Bot(options, bots);
|
||||
bots.add(client);
|
||||
}
|
||||
}
|
||||
|
||||
private static class Options {
|
||||
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package land.chipmunk.parker2991.fnfboyfriendbot;
|
||||
|
||||
public class Options {
|
||||
public static class bots {
|
||||
public String host = "127.0.0.1";
|
||||
public int port = 25565;
|
||||
public long reconnectDelay;
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package land.chipmunk.parker2991.fnfboyfriendbot.commands;
|
||||
|
||||
|
||||
public class SayCommand {
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
|
||||
|
||||
|
||||
public class BruhifyModule {
|
||||
|
||||
|
||||
}
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
|
||||
|
||||
|
||||
public class ChatCommandHandlerModule {
|
||||
|
||||
|
||||
}
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
|
||||
|
||||
|
||||
public class ChatModule {
|
||||
|
||||
|
||||
}
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
|
||||
|
||||
|
||||
public class CommandCoreModule {
|
||||
|
||||
|
||||
}
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
|
||||
|
||||
|
||||
public class CommandLoopManagerModule {
|
||||
|
||||
|
||||
}
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
|
||||
|
||||
|
||||
public class CommandManagerModule {
|
||||
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
|
||||
|
||||
|
||||
public class ConsoleModule {
|
||||
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user