forked from afspiegeling/NitoriBot
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fcbd9f983c | ||
|
|
fa15c03c6d | ||
|
|
5d5700b61d | ||
|
|
2f21f670e0 | ||
|
|
e33988d103 | ||
|
|
e7a8aa226c | ||
|
|
881c2a8d0e | ||
|
|
f9e0406143 | ||
|
|
232546aeab | ||
|
|
68e4836359 | ||
|
|
b71f4a2ab0 | ||
|
|
872cf09c6a | ||
|
|
a76e65b18f | ||
|
|
d2e2124fbe | ||
|
|
c99d3ab302 | ||
|
|
9d1d818d30 | ||
|
|
d7f216e441 | ||
|
|
127ec9eb42 | ||
|
|
346f1eb0de | ||
|
|
cee0a22f55 | ||
|
|
422db19bdb | ||
|
|
06258b3a0c | ||
|
|
dc08bcad37 | ||
|
|
28be25d2e6 | ||
|
|
c1c09466b4 | ||
|
|
c0149e36d1 | ||
|
|
a7c9a37481 | ||
|
|
8bd1e92381 | ||
|
|
7cb0524f24 | ||
|
|
a8a0b210be | ||
|
|
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,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 +1,17 @@
|
||||
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
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
Note: each time changes are made push them to the dev branch in the bots repo
|
||||
1. Rewrite the version argument of the info command
|
||||
2. Fix arguments for discord
|
||||
3. Try adding a argument limit for commands maybe
|
||||
4. Use the nbt parser that chayapak wrote for the bot for 1.21.5 command block output
|
||||
5. Completely remove tptoggle selfcare since it’s no longer used
|
||||
- 6. Have the bot get output from the actual core instead of a command block it places
|
||||
- 7. Add support for 1.21 and 1.21.1 while keeping support for 1.19.3 to 1.20.2
|
||||
8. Add a server check
|
||||
9. Add source.sendfeedback back maybe
|
||||
10. Add a check to sendFeedback for discord to see if the message length is longer than discord’s max message limit to output it to a file and then reply with the file in discord
|
||||
11. Add a embed function for discord maybe
|
||||
12. Have the bot output errors to a seperate file to make debugging easier
|
||||
- 13. Revert class changes for usernameGen, loadModules, between, and ansi since it wouldn’t make much sense to make them classes instead of functions (chayapaks suggestion)
|
||||
- 14. Have the bot.js class extend the event emitter (chayapak suggestion)
|
||||
15. Maybe parse cspy in the chat module and emit it as a packet maybe
|
||||
16. For the owner check module have the bot send a message to the player username thats in the config if the 18. username name is online and if theres no reply back in discord within 10 seconds (10000 ms) to start deoping, muting, kicking, and changing their gamemode
|
||||
@@ -1,62 +0,0 @@
|
||||
const mc = require('minecraft-protocol')
|
||||
const { EventEmitter } = require('events')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
// "buildstring":"FNFBoyfriendBotX V4.0.8a Build:97",
|
||||
//"FoundationBuildString":"Ultimate Foundation V1.0.1 Build:31",
|
||||
function createBot(options = {}) {
|
||||
const bot = new EventEmitter()
|
||||
const rs = require('randomstring')
|
||||
// Set some default values in options
|
||||
let r = Math.floor(Math.random() * 255) + 1;
|
||||
options.host ??= 'localhost'
|
||||
options.username ??= rs.generate({
|
||||
length:8,
|
||||
charset: ['abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()_-+=[{]}|/?.>,<`~\\\'']// Added some characters that were missing - yfd
|
||||
});
|
||||
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 buildstring = process.env['buildstring']
|
||||
|
||||
const client = options.client ?? mc.createClient(options)
|
||||
bot._client = client
|
||||
bot.emit('init_client', client)
|
||||
|
||||
bot.bots = options.bots ?? [bot]
|
||||
|
||||
// Modules
|
||||
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
|
||||
}
|
||||
|
||||
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() // TypeError: data.getMessageAsPrismarine is not a function
|
||||
|
||||
sender = data.players.find(player => player.profile.name) //=== stringusername)
|
||||
}
|
||||
|
||||
if (!sender) return undefined
|
||||
|
||||
return { sender, contents, type: 'minecraft:chat', senderComponent }
|
||||
}
|
||||
|
||||
module.exports = parseMessage
|
||||
@@ -1,27 +0,0 @@
|
||||
function parseMessage (message, data) {
|
||||
if (message === null || typeof message !== 'object') return
|
||||
|
||||
if (message.with?.length < 4 || (message.translate !== '[%s%s] %s › %s', message.color !== '#55FFFF' && message.translate !== '%s%s %s › %s', message.color !== '#55FFFF')) return
|
||||
|
||||
const senderComponent = message.with[1]
|
||||
const contents = message.with[3]
|
||||
|
||||
let sender
|
||||
|
||||
const hoverEvent = senderComponent.hoverEvent
|
||||
if (hoverEvent?.action === 'show_entity') {
|
||||
const id = hoverEvent.contents.id
|
||||
//
|
||||
sender = data.players.find(player => player.uuid === id)
|
||||
} else {
|
||||
const stringUsername = data.getMessageAsPrismarine(senderComponent).toString() // TypeError: data.getMessageAsPrismarine is not a function
|
||||
|
||||
sender = data.players.find(player => player.profile.name) //=== stringusername)
|
||||
}
|
||||
|
||||
if (!sender) return undefined
|
||||
|
||||
return { sender, contents, type: 'minecraft:chat', senderComponent }
|
||||
}
|
||||
|
||||
module.exports = parseMessage
|
||||
@@ -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() // TypeError: data.getMessageAsPrismarine is not a function
|
||||
|
||||
sender = data.players.find(player => player.profile.name) //=== stringusername)
|
||||
}
|
||||
|
||||
if (!sender) return undefined
|
||||
|
||||
return { sender, contents, type: 'minecraft:chat', senderComponent }
|
||||
}
|
||||
|
||||
module.exports = parseMessage
|
||||
@@ -1,57 +0,0 @@
|
||||
const crypto = require('crypto')
|
||||
|
||||
module.exports = {
|
||||
name: 'abotval',
|
||||
|
||||
consoleOnly: true,
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
|
||||
const prefix = '<' // mabe not hardcode the prefix
|
||||
|
||||
const args = context.arguments
|
||||
let hashlol
|
||||
const key = process.env['abot_key']
|
||||
const date = new Date();
|
||||
const min = date.getMinutes();
|
||||
|
||||
const md5 = crypto.createHash('md5').update(`${min}--_${key}`).digest('hex');
|
||||
const basehash = crypto.createHash('sha256').update(md5).digest('hex');
|
||||
const hashe = btoa(basehash)
|
||||
const fullhash = crypto.createHash('sha256').update(hashe).digest('hex');
|
||||
hashlol = fullhash.substring(0, 16);
|
||||
//already have to token ready
|
||||
|
||||
|
||||
const hash = hashlol
|
||||
|
||||
const command = `${prefix}${args.shift()} ${hash} ${args.join(' ')}`
|
||||
|
||||
const peefix = {
|
||||
|
||||
clickEvent: { action:"open_url", value: "https://doin-your.mom"},
|
||||
"color": "#5A5A5A",
|
||||
"translate": '[%s] %s \u203a %s',
|
||||
"with": [
|
||||
{ "color": "aqua", "text": "FNFBoyfriendBotX"},
|
||||
{ "color": "aqua", "text": `${bot.username}`},
|
||||
{ "color": "white", "text": command},
|
||||
]// why name it that?? xD
|
||||
}
|
||||
|
||||
|
||||
context.bot.tellraw([peefix])
|
||||
}//this isnt how..
|
||||
}//./commands/tellraw.js
|
||||
// Done!
|
||||
//are ya able to help with the validation/hashing in mine?
|
||||
// Make a copy of this
|
||||
//ahh ok
|
||||
//whos not
|
||||
|
||||
// Can cars fly?
|
||||
//fr
|
||||
// look at the console
|
||||
// watch console rq
|
||||
// Rip our ram lmao
|
||||
@@ -1,12 +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 around 2.0 changed it to &5&lFNF&b&lBoyfriend&4&lBot &rand luckily avoided the harassment when i changed it i love coding and i want to learn how to code more thank you all!')
|
||||
}
|
||||
}
|
||||
@@ -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: 'light_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,52 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const CharacterAI = require('node_characterai');
|
||||
const characterAI = new CharacterAI();
|
||||
// won't work on server nodejs. only works on windows I guess :|
|
||||
|
||||
async function start() {
|
||||
await characterAI.authenticateAsGuest();
|
||||
}
|
||||
|
||||
async function ask(key, message) {
|
||||
const characterId = key;
|
||||
|
||||
const chat = await characterAI.createOrContinueChat(characterId);
|
||||
const response = await chat.sendAndAwaitResponse(message, true);
|
||||
|
||||
return response.text
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
start,
|
||||
ask,
|
||||
name: 'cai',
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
/*
|
||||
const CharacterAI = require('node_characterai');
|
||||
const characterAI = new CharacterAI();
|
||||
|
||||
async function start() {
|
||||
await characterAI.authenticateAsGuest();
|
||||
}
|
||||
|
||||
async function ask(key, message) {
|
||||
const characterId = key;
|
||||
|
||||
const chat = await characterAI.createOrContinueChat(characterId);
|
||||
const response = await chat.sendAndAwaitResponse(message, true);
|
||||
|
||||
return response.text
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
start,
|
||||
ask
|
||||
};
|
||||
```*/
|
||||
@@ -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,264 +0,0 @@
|
||||
|
||||
const bots = [
|
||||
{
|
||||
name: { text: 'v0.1.0 - v0.5.0-beta', color: 'blue', bold:false },
|
||||
authors: ['Prototypes'],
|
||||
|
||||
foundation: '11/22/22 - 1/24/23',
|
||||
exclaimer:'ehh nothing much just the release of the betas',
|
||||
},
|
||||
{
|
||||
name: { text: 'v1.0.0-beta', color: 'blue', bold:false },
|
||||
authors: ['in console test'],
|
||||
|
||||
foundation: '1/25/23',
|
||||
exclaimer:'original commands:!cloop bcraw,!cloop sudo,!troll,!say,!op (broke),!deop (broke), !gms (broke),!freeze,!icu <--- these commands no longer can be used in game but in console for beta 1.0 commands added: fake kick,ban,kick,crashserver,stop,gmc,greetin,test(broken idk),bypass,entity spam ,gms ,stop,tntspam ,prefix ,annoy (broke results in a complete server crash keeping ayunboom down for 3 to 5 hours),freeze,crashserver,troll ,trol(more destructive),icu ,say,sudo,cloop',
|
||||
},
|
||||
{
|
||||
name: { text: 'v1.0.0', color: 'dark_red', bold:false },
|
||||
authors: ['FNFBoyfriendBot'],
|
||||
|
||||
foundation: '1/26/23',
|
||||
exclaimer:'FNFBoyfriendBot. commands added: BOOM,deop,troll and trol(added extra code to both commands),kaboom,serverdeop, commands fixed:tp,gms,annoy(attemps to crash the server but not as bad as it was) commands untested:prefix command Broke:icu,freeze,tntspam,entityspam,tntspam? changed name to &b &lFNFBoyfriendBot may change later idk',
|
||||
},
|
||||
{
|
||||
name: { text: 'v1.0.1', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '1/26/23',
|
||||
exclaimer:'reworked the kaboom command and fixed the description commands but thats about it. also reworked the greeting command',
|
||||
},
|
||||
{
|
||||
name: { text: 'v1.1.0', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '1/26/23 2:00pm',
|
||||
exclaimer:'nothing much just added extra stuff to the troll, trol and that is about it',
|
||||
},
|
||||
{
|
||||
name: { text: 'v1.2.0', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '1/28/23 1:51',
|
||||
exclaimer:'for ppl me making me really mad -.- got released early',
|
||||
},
|
||||
{
|
||||
name: { text: 'v2.0.0', color: 'dark_red', bold:false },
|
||||
authors: ['Major'],
|
||||
|
||||
foundation: '2/07/23 8:01pm',
|
||||
exclaimer:'added DREAMSTANALERT,technoblade,GODSWORD,KFC,MYLEG,OHHAIL,altcrash,MyHead Reworked tntspam,entityspam,soundbreaker added Spim to the whitelist of the bot released too early than it was planned gonna be released due do the code almost leaked it had to be released early',
|
||||
},
|
||||
{
|
||||
name: { text: 'v2.1.0', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '2/11/23 5:30pm',
|
||||
exclaimer:'added: refillcore(had early prototypes of this was original), vanish,deop,cloopdeop,mute,cloopmute reworked: op (supposed to already op the bot but didnt work until this release) and reworked gmc (same problem with op) (had early prototypes of vanish,refillcore,gmc,and op but these were original gonna be automatic but after alot of attempts i said screw it and added 2 commands refillcore, and vanish reworked gmc and op and got them working finally) removed Spim because come to find out he couldnt be trusted',
|
||||
},
|
||||
{
|
||||
name: { text: 'v2.2.0', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '2/20/23',
|
||||
exclaimer:'added ckill(added back after trial and error),serversuicidal changed username of the bot from hex code to FNFBoyfriendBot because hex code for the username was confusing as it changes everytime',
|
||||
},
|
||||
{
|
||||
name: { text: 'v3.0.0-Beta', color: 'blue', bold:false },
|
||||
authors: ['blue-balled corruption'],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'was canceled due to ayunboom being rewriten and renamed to creayun barely usable on there because commands blocks are disabled which i created a bot for that server that has no command blocks just finished the final build of the Creayun build of the bot due to chip announcing that he may make a kaboom clone yk what 1.5.2 and 1.8 support but anyway onto what is in the v3.0-beta well the beta for right now commands added:discord,version,online,list,iownyou,endmysuffering,wafflehouse,whopper,bcraw,destroycore Notes:the original say command was reworked into talking in chat without bcraw and command blocks which the bcraw chatting code is still in the bot but was reworked into the bcraw commmand. maybe some commands removed? i dont know yet edit there is 2 commands removed commands removed:tpe and serverdeop??? reworked commands :say command for right now relay chat mabe will be added as a seperate repl i dont know yet possible would need a whole code rewrite for relay chat',
|
||||
},
|
||||
{
|
||||
name: { text: 'v3.0.0', color: 'dark_red', bold:false },
|
||||
authors: ['Sky Remanifested'],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'the full release of 3.0 the rewrite has been pushed back to 4.0 due to 3.0 already pass its release date and the code i had on hand was done but the rewrite wasnt done Added: SelfCare Made during development:Relay chat prototypes for several servers',
|
||||
},
|
||||
{
|
||||
name: { text: 'v3.0.5', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'bug fixes',
|
||||
},
|
||||
{
|
||||
name: { text: 'v3.0.9', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'commands added:Help(finally added after about a year),consolelog(added cuz yes),cloopconsolelog(added cuz yes)',
|
||||
},
|
||||
{
|
||||
name: { text: 'v3.3.0', color: 'dark_red', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'switched it base to 4.0s base during 4.0s development',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.0-beta', color: 'blue', bold:false },
|
||||
authors: ['FNFBoyfriendBot Ultimate'],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'all of the command removed and or rewriten from version 3.0.9 Commands added or rewriten:ban,buyrealminecraft,cloop,discord,echo,errortest,freeze,help,icu,info,kick,bots,skids,romncitrash,say,selfdestruct,serversuicidal,sudo,test,trol,troll (note that this is different and is not CommandModules)Modules Added:discord,chat,chat_command_handler,command_manager,position,registry,reconnect,command_core CustomChats added:kaboom(for normal chat) (note that this is different and is not Modules)CommandModules Added:command_error,Command_source a beta release for rn',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.0-Alpha ', color: 'aqua', bold:false },
|
||||
authors: ['FNFBoyfriendBot Ultimate'],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'Commands added: calculator,ckill,evaljs,urban,crash,cloopcrash,core,list,ping,netmsg,skin,tpr Commands Removed:Buyrealminecraft (note that this is different and is not CommandModules)Modules Added:op selfcare,gmc selfcare,vanish selfcare,cspy selfcare,console (note that this is different and is not Modules)CustomChats Added:u2O3a(for custom chat) added util with between(for urban) eval_colors(for evaljs)',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.0', color: 'dark_red', bold:false },
|
||||
authors: ['FNFBoyfriendBotX'],
|
||||
|
||||
foundation: '8/11/23',
|
||||
exclaimer:'Bot is finished with the rewrite thank you ChipMC and chayapak for helping me rewrite the bot Heres the commands ban (mabe removing), blacklist (currently being worked on), botdevhistory, bots, calculator, changelog, ckill, cloop, cloopcrash(probably removing), core, crash, creators, discord, echo, errortest, evaljs, freeze, help, icu, list, meminfo, mineflayerbot, netmsg (Hello World!), ping (pong!), reconnect, say, selfdestruct, serversuicidal (probably removing because theres ckill), skin, sudo, test, tpr, trol (mabe renaming it to troll), troll (mabe removing it and replacing it with the trol command), urban (ong sus asf), validate, version',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.5', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '8/17/23',
|
||||
exclaimer:'bug fixes, did what i said i was gonna do in the last update',
|
||||
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.6', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '8/22/23',
|
||||
exclaimer:'added 1 console command along with updating console.js so that the bot sends a message to 1 server at a time and not a message to all the servers at a time',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.7', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/4/23',
|
||||
exclaimer:'merged server and botusername commands and naming the command logininfo cuz it now shows the server ip, server port, Minecraft java Version, and the Bots Username',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.8', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/7/23',
|
||||
exclaimer:'added the wiki command even though its semi working. bug fixes. some bugs still in the bot is netmsg showing the bots username when i used the netmsg cmd from my end and not the console i find it funny asf though',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.8A', color: 'gold', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/7/23',
|
||||
exclaimer:'added some things to the changelog cmd. still needing to fix the issue with custom chat and netmsg also added a bugs command to check what bugs are needing to be fixed',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.8B', color: 'gold', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/8/23',
|
||||
exclaimer:'made it to where it sends more messages on start up and made it to where the buildstring is in secrets',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.8C', color: 'gold', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/14/23',
|
||||
exclaimer:'added the nodejs version to the version command but thats about it still fixing the bugs with the relay chat and mabe rewriting the validation system in the bot',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.8D', color: 'gold', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/16/23',
|
||||
exclaimer:'added onto the changelog command along with adding spambot and lol commands (cuz yes) along with removing the bugs command maybe adding it back sometime later also the discord relay chat and validation system mabe getting a rewrite and also updated node from v18 to v20.6.0',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.8E', color: 'gold', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/17/23',
|
||||
exclaimer:'changed the name for meminfo to serverinfo along with adding onto it and moving the nodejs, node-minecraft-protocol, and discord.js versions from the version command to the serverinfo command',
|
||||
},
|
||||
{
|
||||
name: { text: 'v4.0.8F', color: 'gold', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '9/24/23',
|
||||
exclaimer:'added filesdirectories command but thats about it',
|
||||
},
|
||||
]
|
||||
/*{
|
||||
name: { text: '', color: 'gray', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'',
|
||||
},*/
|
||||
module.exports = {
|
||||
name: 'changelog',
|
||||
|
||||
execute (context) {
|
||||
const query = context.arguments.join(' ').toLowerCase()
|
||||
|
||||
if (query.length === 0) {
|
||||
const list = []
|
||||
|
||||
for (const info of bots) {
|
||||
if (list.length !== 0) list.push({ text: ', ', color: 'gray' })
|
||||
list.push(info.name)
|
||||
}
|
||||
const category = {
|
||||
translate: ' (%s%s%s%s%s%s%s%s%s) ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
|
||||
{ color: 'aqua', text: 'Alpha Release'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'blue', text: 'Beta Release'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'green', text: 'Minor release'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'gold', text: 'Revision Release'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'dark_red', text: 'Major Release'},
|
||||
|
||||
]
|
||||
}
|
||||
context.source.sendFeedback(['Changelogs (', bots.length, ')', category, ' - ', ...list], false)
|
||||
return
|
||||
}
|
||||
|
||||
for (const info of bots) {
|
||||
const plainName = String(context.bot.getMessageAsPrismarine(info.name)).toLowerCase()
|
||||
if (plainName.includes(query)) this.sendBotInfo(info, context.bot)
|
||||
}
|
||||
},
|
||||
|
||||
sendBotInfo (info, bot) {
|
||||
const component = ['']
|
||||
component.push('', info.name)
|
||||
if (info.exclaimer) component.push('\n', ' ', info.exclaimer)
|
||||
if (info.authors && info.authors.length !== 0) {
|
||||
component.push('\n', 'Codename ')
|
||||
for (const author of info.authors) {
|
||||
component.push(author, { text: ', ', color: 'gray' })
|
||||
}
|
||||
component.pop()
|
||||
}
|
||||
if (info.foundation) component.push('\n', 'Date: ', info.foundation)
|
||||
if (info.prefixes && info.prefixes.length !== 0) {
|
||||
component.push('\n', '')
|
||||
for (const prefix of info.prefixes) {
|
||||
component.push(prefix, { text: ' ', color: 'gray' })
|
||||
}
|
||||
component.pop()
|
||||
}
|
||||
bot.tellraw([component])
|
||||
}
|
||||
}//it doing it just for the ones i added lol
|
||||
// prob a replit moment, it probably thinks there are regexes in the strings
|
||||
@@ -1,252 +0,0 @@
|
||||
/*/*
|
||||
* This example demonstrates how easy it is to create a bot
|
||||
* that sends chat messages whenever something interesting happens
|
||||
* on the server you are connected to.
|
||||
*
|
||||
* Below you can find a wide range of different events you can watch
|
||||
* but remember to check out the API documentation to find even more!
|
||||
*
|
||||
* Some events may be commented out because they are very frequent and
|
||||
* may flood the chat, feel free to check them out for other purposes though.
|
||||
*
|
||||
* This bot also replies to some specific chat messages so you can ask him
|
||||
* a few informations while you are in game.
|
||||
*/
|
||||
|
||||
const crypto = require('crypto')
|
||||
|
||||
module.exports = {
|
||||
name: 'chatterboxbot',
|
||||
|
||||
hashOnly:true,
|
||||
|
||||
execute (context) {
|
||||
const mineflayer = require('mineflayer')
|
||||
const { Vec3 } = require('vec3')
|
||||
|
||||
const randomstring = require('randomstring')
|
||||
const bot = mineflayer.createBot({
|
||||
host: context.bot.options.host,
|
||||
|
||||
username:randomstring.generate(16),
|
||||
|
||||
})
|
||||
|
||||
bot.on('chat', (username, message) => {
|
||||
if (username === bot.username) return
|
||||
const result = /canSee (-?[0-9]+),(-?[0-9]+),(-?[0-9]+)/.exec(message)
|
||||
if (result) {
|
||||
canSee(new Vec3(result[1], result[2], result[3]))
|
||||
return
|
||||
}
|
||||
switch (message) {
|
||||
case 'pos':
|
||||
sayPosition(username)
|
||||
break
|
||||
case 'wearing':
|
||||
sayEquipment()
|
||||
break
|
||||
case 'nick':
|
||||
sayNick()
|
||||
break
|
||||
case 'spawn':
|
||||
saySpawnPoint()
|
||||
break
|
||||
case 'block':
|
||||
sayBlockUnder(username)
|
||||
break
|
||||
case 'quit':
|
||||
quit(username)
|
||||
break
|
||||
default:
|
||||
bot.chat("That's nice")
|
||||
}
|
||||
|
||||
function canSee (pos) {
|
||||
const block = bot.blockAt(pos)
|
||||
const r = bot.canSeeBlock(block)
|
||||
if (r) {
|
||||
bot.chat(`I can see the block of ${block.displayName} at ${pos}`)
|
||||
} else {
|
||||
bot.chat(`I cannot see the block of ${block.displayName} at ${pos}`)
|
||||
}
|
||||
}
|
||||
|
||||
function sayPosition (username) {
|
||||
bot.chat(`I am at ${bot.entity.position}`)
|
||||
bot.chat(`You are at ${bot.players[username].entity.position}`)
|
||||
}
|
||||
|
||||
function sayEquipment () {
|
||||
const eq = bot.players[username].entity.equipment
|
||||
const eqText = []
|
||||
if (eq[0]) eqText.push(`holding a ${eq[0].displayName}`)
|
||||
if (eq[1]) eqText.push(`wearing a ${eq[1].displayName} on your feet`)
|
||||
if (eq[2]) eqText.push(`wearing a ${eq[2].displayName} on your legs`)
|
||||
if (eq[3]) eqText.push(`wearing a ${eq[3].displayName} on your torso`)
|
||||
if (eq[4]) eqText.push(`wearing a ${eq[4].displayName} on your head`)
|
||||
if (eqText.length) {
|
||||
bot.chat(`You are ${eqText.join(', ')}.`)
|
||||
} else {
|
||||
bot.chat('You are naked!')
|
||||
}
|
||||
}
|
||||
|
||||
function saySpawnPoint () {
|
||||
bot.chat(`Spawn is at ${bot.spawnPoint}`)
|
||||
}
|
||||
|
||||
function sayBlockUnder () {
|
||||
const block = bot.blockAt(bot.players[username].entity.position.offset(0, -1, 0))
|
||||
bot.chat(`Block under you is ${block.displayName} in the ${block.biome.name} biome`)
|
||||
console.log(block)
|
||||
}
|
||||
|
||||
function quit (username) {
|
||||
bot.quit(`${username} told me to`)
|
||||
}
|
||||
|
||||
function sayNick () {
|
||||
bot.chat(`My name is ${bot.player.displayName}`)
|
||||
}
|
||||
})
|
||||
|
||||
bot.on('whisper', (username, message, rawMessage) => {
|
||||
console.log(`I received a message from ${username}: ${message}`)
|
||||
bot.whisper(username, 'I can tell secrets too.')
|
||||
})
|
||||
bot.on('nonSpokenChat', (message) => {
|
||||
console.log(`Non spoken chat: ${message}`)
|
||||
})
|
||||
|
||||
bot.on('login', () => {
|
||||
bot.chat('Hi everyone!')
|
||||
})
|
||||
bot.on('spawn', () => {
|
||||
bot.chat('I spawned, watch out!')
|
||||
})
|
||||
bot.on('spawnReset', (message) => {
|
||||
bot.chat('Oh noez! My bed is broken.')
|
||||
})
|
||||
bot.on('forcedMove', () => {
|
||||
bot.chat(`I have been forced to move to ${bot.entity.position}`)
|
||||
})
|
||||
bot.on('health', () => {
|
||||
bot.chat(`I have ${bot.health} health and ${bot.food} food`)
|
||||
})
|
||||
bot.on('death', () => {
|
||||
bot.chat('I died x.x')
|
||||
})
|
||||
bot.on('kicked', (reason) => {
|
||||
console.log(`I got kicked for ${reason}`)
|
||||
})
|
||||
|
||||
bot.on('time', () => {
|
||||
bot.chat('Current time: ' + bot.time.timeOfDay)
|
||||
})
|
||||
bot.on('rain', () => {
|
||||
if (bot.isRaining) {
|
||||
bot.chat('It started raining.')
|
||||
} else {
|
||||
bot.chat('It stopped raining.')
|
||||
}
|
||||
})
|
||||
bot.on('noteHeard', (block, instrument, pitch) => {
|
||||
bot.chat(`Music for my ears! I just heard a ${instrument.name}`)
|
||||
})
|
||||
bot.on('chestLidMove', (block, isOpen) => {
|
||||
const action = isOpen ? 'open' : 'close'
|
||||
bot.chat(`Hey, did someone just ${action} a chest?`)
|
||||
})
|
||||
bot.on('pistonMove', (block, isPulling, direction) => {
|
||||
const action = isPulling ? 'pulling' : 'pushing'
|
||||
bot.chat(`A piston is ${action} near me, i can hear it.`)
|
||||
})
|
||||
|
||||
bot.on('playerJoined', (player) => {
|
||||
if (player.username !== bot.username) {
|
||||
bot.chat(`Hello, ${player.username}! Welcome to the server.`)
|
||||
}
|
||||
})
|
||||
bot.on('playerLeft', (player) => {
|
||||
if (player.username === bot.username) return
|
||||
bot.chat(`Bye ${player.username}`)
|
||||
})
|
||||
bot.on('playerCollect', (collector, collected) => {
|
||||
if (collector.type === 'player') {
|
||||
const item = collected.getDroppedItem()
|
||||
bot.chat(`${collector.username !== bot.username ? ("I'm so jealous. " + collector.username) : 'I '} collected ${item.count} ${item.displayName}`)
|
||||
}
|
||||
})
|
||||
|
||||
bot.on('entitySpawn', (entity) => {
|
||||
if (entity.type === 'mob') {
|
||||
console.log(`Look out! A ${entity.displayName} spawned at ${entity.position}`)
|
||||
} else if (entity.type === 'player') {
|
||||
bot.chat(`Look who decided to show up: ${entity.username}`)
|
||||
} else if (entity.type === 'object') {
|
||||
console.log(`There's a ${entity.displayName} at ${entity.position}`)
|
||||
} else if (entity.type === 'global') {
|
||||
bot.chat('Ooh lightning!')
|
||||
} else if (entity.type === 'orb') {
|
||||
bot.chat('Gimme dat exp orb!')
|
||||
}
|
||||
})
|
||||
bot.on('entityHurt', (entity) => {
|
||||
if (entity.type === 'mob') {
|
||||
bot.chat(`Haha! The ${entity.displayName} got hurt!`)
|
||||
} else if (entity.type === 'player') {
|
||||
bot.chat(`Aww, poor ${entity.username} got hurt. Maybe you shouldn't have a ping of ${bot.players[entity.username].ping}`)
|
||||
}
|
||||
})
|
||||
bot.on('entitySwingArm', (entity) => {
|
||||
bot.chat(`${entity.username}, I see that your arm is working fine.`)
|
||||
})
|
||||
bot.on('entityCrouch', (entity) => {
|
||||
bot.chat(`${entity.username}: you so sneaky.`)
|
||||
})
|
||||
bot.on('entityUncrouch', (entity) => {
|
||||
bot.chat(`${entity.username}: welcome back from the land of hunchbacks.`)
|
||||
})
|
||||
bot.on('entitySleep', (entity) => {
|
||||
bot.chat(`Good night, ${entity.username}`)
|
||||
})
|
||||
bot.on('entityWake', (entity) => {
|
||||
bot.chat(`Top of the morning, ${entity.username}`)
|
||||
})
|
||||
bot.on('entityEat', (entity) => {
|
||||
bot.chat(`${entity.username}: OM NOM NOM NOMONOM. That's what you sound like.`)
|
||||
})
|
||||
bot.on('entityAttach', (entity, vehicle) => {
|
||||
if (entity.type === 'player' && vehicle.type === 'object') {
|
||||
bot.chat(`Sweet, ${entity.username} is riding that ${vehicle.displayName}`)
|
||||
}
|
||||
})
|
||||
bot.on('entityDetach', (entity, vehicle) => {
|
||||
if (entity.type === 'player' && vehicle.type === 'object') {
|
||||
bot.chat(`Lame, ${entity.username} stopped riding the ${vehicle.displayName}`)
|
||||
}
|
||||
})
|
||||
bot.on('entityEquipmentChange', (entity) => {
|
||||
console.log('entityEquipmentChange', entity)
|
||||
})
|
||||
bot.on('entityEffect', (entity, effect) => {
|
||||
console.log('entityEffect', entity, effect)
|
||||
})
|
||||
bot.on('entityEffectEnd', (entity, effect) => {
|
||||
console.log('entityEffectEnd', entity, effect)
|
||||
})
|
||||
|
||||
}//this isnt how..
|
||||
}//./commands/tellraw.js
|
||||
// Done!
|
||||
//are ya able to help with the validation/hashing in mine?
|
||||
// Make a copy of this
|
||||
//ahh ok
|
||||
//whos not
|
||||
|
||||
// Can cars fly?
|
||||
//fr
|
||||
// look at the console
|
||||
// watch console rq
|
||||
// Rip our ram lmao
|
||||
@@ -1,42 +0,0 @@
|
||||
const crypto = require('crypto')
|
||||
|
||||
module.exports = {
|
||||
name: 'chomeval',
|
||||
|
||||
consoleOnly: true,
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
|
||||
const prefix = '*' // mabe not hardcode the prefix
|
||||
|
||||
const args = context.arguments
|
||||
|
||||
const key = process.env['chomens_bot_key']
|
||||
|
||||
const time = Math.floor(Date.now() / 5_000)
|
||||
|
||||
const value = bot.uuid + args[0] + time + key
|
||||
|
||||
const hash = crypto.createHash('sha256').update(value).digest('hex').substring(0, 16)
|
||||
|
||||
const command = `${prefix}${args.shift()} ${hash} ${args.join(' ')}`
|
||||
const message = context.arguments.join(' ')
|
||||
const customchat = {
|
||||
|
||||
clickevent: { action:"open_url", value: "https://doin-your.mom"},
|
||||
"color": "#5A5A5A",
|
||||
"translate": `[%s] %s \u203a %s`,
|
||||
"with": [
|
||||
{ "color": "aqua", "text": "FNFBoyfriendBotX"},
|
||||
{ "color": "aqua", "text": `${bot.username}`},
|
||||
{ "color": "#5A5A5A", "text": `${command}`},
|
||||
]//
|
||||
}//how i add a hover event??
|
||||
// clickEvent: bot.discord.invite ? { action: 'open_url', value: bot.discord.invite }
|
||||
context.bot.tellraw([customchat])
|
||||
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
@@ -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(``)
|
||||
}, 1)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//what is wi
|
||||
// IDK
|
||||
@@ -1,35 +0,0 @@
|
||||
module.exports = {
|
||||
name: 'consoleserver',
|
||||
|
||||
consoleOnly: true,
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
|
||||
const servers = bot.bots.map(eachBot => eachBot.options.host)
|
||||
|
||||
for (const eachBot of bot.bots) {
|
||||
if (args.join(' ').toLowerCase() === 'all') {
|
||||
eachBot.console.consoleServer = 'all'
|
||||
|
||||
source.sendFeedback('Set the console server to all servers')
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
const server = servers.find(server => server.toLowerCase().includes(args.join(' ')))
|
||||
|
||||
if (!server) {
|
||||
source.sendFeedback({ text: 'Invalid server', color: 'red' })
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
eachBot.console.consoleServer = server
|
||||
|
||||
source.sendFeedback('Set the console server to ' + server)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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(``) // yfd: make it dotenv or whatever it is. I have a sus crash exploit that can be used I guess ☆*: .。. o(≧▽≦)o .。.:*☆
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//what is wi
|
||||
// IDK
|
||||
@@ -1,32 +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%s%s',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'dark_red', text: 'Parker' },
|
||||
{ color: 'black', text: '2991' },
|
||||
{ color: 'white', text: ',' },
|
||||
{ color: 'dark_green', text: ' _ChipMC_' },
|
||||
{ color: 'white', text: ',' },
|
||||
{ color: 'yellow', text: ' chayapak' },
|
||||
{ color: 'white', text: ',' },
|
||||
{ color: 'light_purple', text: ' _yfd' },
|
||||
]
|
||||
}
|
||||
context.source.sendFeedback(['Thank you to all that helped! ', Creators])
|
||||
context.source.sendFeedback(['ChomeNS Discord Server: https://discord.gg/xdgCkUyaA4'])
|
||||
context.source.sendFeedback(['FNFBoyfriendBot Discord Server: https://discord.gg/GCKtG4erux'])
|
||||
context.source.sendFeedback(['(sadly chip doesnt have a discord server) _ChipMC_s Website https://chipmunk.land'])
|
||||
context.source.sendFeedback(['_yfds discord server: https://discord.gg/BKYKBxfDrs'])
|
||||
context.source.sendFeedback(['Parker2991 discord username: parker2991'])
|
||||
context.source.sendFeedback(['chayapaks discord username: chayapak'])
|
||||
context.source.sendFeedback(['_ChipMC_s discord username: chipmunkmc'])
|
||||
}
|
||||
}//https://discord.gg/GCKtG4erux
|
||||
@@ -1,10 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'discord',
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
context.source.sendFeedback(context.bot.discord.invite, false)
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
module.exports = {
|
||||
name: 'discordmsg',
|
||||
|
||||
execute (context) {
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
const player = context.player
|
||||
|
||||
bot.discord.channel.send(args.join(' '))
|
||||
}
|
||||
}
|
||||
@@ -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,12 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'errortest',
|
||||
|
||||
execute (context) {
|
||||
const message = context.arguments.join(' ')
|
||||
context.source.sendFeedback('hint hover your mouse over the error')
|
||||
throw new Error(message)
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
const { VM } = require('vm2-fixed')
|
||||
const util = require('util')
|
||||
const { stylize } = require('../util/eval_colors')
|
||||
|
||||
const options = {
|
||||
timeout: 1000
|
||||
}
|
||||
let vm = new VM(options)
|
||||
|
||||
module.exports = {
|
||||
name: 'evaljs',
|
||||
hashOnly:true, // null
|
||||
execute (context) {
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
const cmd = {
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'dark_green', text: 'EvalJS Cmd'},
|
||||
]
|
||||
}
|
||||
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: 'white' }])
|
||||
}
|
||||
|
||||
break
|
||||
case 'reset':
|
||||
vm = new VM(options)
|
||||
|
||||
source.sendFeedback([cmd, { text: 'Successfully reset the eval context', color: 'green' }])
|
||||
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const os = require('os')
|
||||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
const packageJSON = require("../package.json")
|
||||
async function getCpuModelName () {
|
||||
const cpuInfo = await fs.readFile('/proc/cpuinfo')
|
||||
const lines = cpuInfo.toString().split('\n')
|
||||
// among us way of doing it
|
||||
const modelName = lines.find((line) => line.startsWith('model name')).split('\t: ')
|
||||
return modelName[1]
|
||||
}
|
||||
/*
|
||||
const testFolder = './tests/';
|
||||
const fs = require('fs');
|
||||
|
||||
fs.readdir(testFolder, (err, files) => {
|
||||
files.forEach(file => {
|
||||
console.log(file);
|
||||
});
|
||||
});
|
||||
*/
|
||||
module.exports = {
|
||||
name: 'filesdirectories',
|
||||
hashOnly:true,
|
||||
async execute (context) {
|
||||
//path.join(__dirname, 'config.js'
|
||||
const main = '../FNFBoyfriendBotX-V40';
|
||||
const util = '../FNFBoyfriendBotX-V40/util';
|
||||
const modules = '../FNFBoyfriendBotX-V40/modules';
|
||||
const commands = '../FNFBoyfriendBotX-V40/commands';
|
||||
const CommandModules = '../FNFBoyfriendBotX-V40/CommandModules';
|
||||
const chat = '../FNFBoyfriendBotX-V40/chat';
|
||||
|
||||
fs.readdir(main, (err, files) => {
|
||||
files.forEach(file => {
|
||||
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/' + file);
|
||||
});
|
||||
});
|
||||
fs.readdir(util, (err, files) => {
|
||||
files.forEach(file => {
|
||||
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/util/' + file);
|
||||
});
|
||||
});
|
||||
fs.readdir(modules, (err, files) => {
|
||||
files.forEach(file => {
|
||||
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/modules/' + file);
|
||||
});
|
||||
});
|
||||
fs.readdir(commands, (err, files) => {
|
||||
files.forEach(file => {
|
||||
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/commands/' + file);
|
||||
});
|
||||
});
|
||||
fs.readdir(CommandModules, (err, files) => {
|
||||
files.forEach(file => {
|
||||
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/CommandModules/' + file);
|
||||
});
|
||||
});
|
||||
fs.readdir(chat, (err, files) => {
|
||||
files.forEach(file => {
|
||||
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/chat/' + file);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/*const fs = require('fs');
|
||||
const path = require('path');
|
||||
const directory = './';
|
||||
|
||||
// use readdir method to read the files of the direcoty
|
||||
fs.readdir(directory, (err, files) => {
|
||||
files.forEach(file => {
|
||||
// get the details of the file
|
||||
let fileDetails = fs.lstatSync(path.resolve(directory, file));
|
||||
// check if the file is directory
|
||||
if (fileDetails.isDirectory()) {
|
||||
console.log('Directory: ' + file);
|
||||
} else {
|
||||
console.log('File: ' + file);
|
||||
}
|
||||
});
|
||||
});
|
||||
*/
|
||||
@@ -1,14 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'filter',
|
||||
hashOnly: true,
|
||||
execute (context) {
|
||||
|
||||
const target = context.arguments.join(' ')
|
||||
const bot = context.bot
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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,41 +0,0 @@
|
||||
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'help',
|
||||
|
||||
execute (context) {
|
||||
const commandList = []
|
||||
const cmd = {
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'dark_blue', text: 'Help Cmd'},
|
||||
]
|
||||
}
|
||||
const category = {
|
||||
translate: ' (%s%s%s%s%s) ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'green', text: 'Public'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'dark_red', text: 'Trusted'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'red', text: 'Owner'},
|
||||
]
|
||||
}
|
||||
for (const command of context.bot.commandManager.getCommands()) {
|
||||
if (command.consoleOnly && !context.console) continue
|
||||
|
||||
if (commandList.length !== 0) commandList.push(' ')
|
||||
commandList.push({ text: String(command.name), color: command.hashOnly ? 'dark_red' : 'green' })
|
||||
|
||||
}
|
||||
|
||||
const length = context.bot.commandManager.getCommands().length
|
||||
|
||||
context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...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)
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -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,14 +0,0 @@
|
||||
module.exports = {
|
||||
name: 'logininfo',
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
//context.bot.options.port
|
||||
context.source.sendFeedback(`Bot Username: ${bot.username}`)
|
||||
context.source.sendFeedback(`Minecraft Java Version: ${context.bot.options.version}`)
|
||||
context.source.sendFeedback(`Server: ${context.bot.options.host}`)
|
||||
context.source.sendFeedback(`Port: ${context.bot.options.port}`)
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
//command.unknown.argument command.unknown.command //command.context.here
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const os = require('os')
|
||||
|
||||
module.exports = {
|
||||
name: 'lol',
|
||||
|
||||
execute (context) {
|
||||
const prefix = {
|
||||
|
||||
clickevent: { action:"open_url", value: "https://doin-your.mom"},
|
||||
"color": "#5A5A5A",
|
||||
"translate": ` %s %s %s %s`,
|
||||
"with": [
|
||||
{ "color": "dark_red", text: "Incorrect argument for command"},
|
||||
{ "color": "dark_red", text: " <--[HERE]"},
|
||||
{ "color": "dark_red", text: "Unknown or incomplete command, see below for error"},
|
||||
{ "color": "dark_red", "text": "An unexpected error occurred trying to execute that command"},
|
||||
]//
|
||||
}//how i add a hover event??
|
||||
// clickEvent: bot.discord.invite ? { action: 'open_url', value: bot.discord.invite }
|
||||
context.source.sendFeedback(prefix)
|
||||
context.source.sendFeedback('[object Object]')
|
||||
context.source.sendFeedback('NaN')
|
||||
context.source.sendFeedback('null')
|
||||
context.source.sendFeedback('undefined')
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const os = require('os')
|
||||
const path = require('path')
|
||||
const fs = require('fs/promises')
|
||||
const packageJSON = require("../package.json")
|
||||
async function getCpuModelName () {
|
||||
const cpuInfo = await fs.readFile('/proc/cpuinfo')
|
||||
const lines = cpuInfo.toString().split('\n')
|
||||
// among us way of doing it
|
||||
const modelName = lines.find((line) => line.startsWith('model name')).split('\t: ')
|
||||
return modelName[1]
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
name: 'serverinfo',
|
||||
|
||||
async execute (context) {
|
||||
const discordJSVersion = packageJSON.dependencies["discord.js"];
|
||||
const MinecraftProtocolVersion = packageJSON.dependencies["minecraft-protocol"];
|
||||
|
||||
context.source.sendFeedback(`Hostname: ${os.hostname()}`, false)
|
||||
context.source.sendFeedback(`Working Directory: ${path.join(__dirname, '..')}`, false)
|
||||
context.source.sendFeedback(`OS architecture: ${os.arch()}`, false)
|
||||
context.source.sendFeedback(`OS platform: ${os.platform()}`, false)
|
||||
context.source.sendFeedback(`OS name: ${os.version()}`, false)
|
||||
context.source.sendFeedback(`CPU cores: ${os.cpus().length}`, false)
|
||||
context.source.sendFeedback(`CPU model: ${await getCpuModelName()}`, false)
|
||||
context.source.sendFeedback(`Total memory usage: ${Math.floor(os.totalmem() / 1024 / 1024)} MB`, false)
|
||||
context.source.sendFeedback(`Available memory usage: ${Math.floor(os.freemem() / 1024 / 1024)} MB`, false)
|
||||
context.source.sendFeedback(`Node js Version @${process.version}`, false)
|
||||
context.source.sendFeedback(`Minecraft-Protocol Version @${MinecraftProtocolVersion}`, false)
|
||||
context.source.sendFeedback(`Discord.js @${discordJSVersion}`, false)
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
/*component.push({ text: 'Hostname: ', color: 'gold' })
|
||||
component.push({ text: os.hostname(), color: 'aqua' })
|
||||
component.push('\n')
|
||||
component.push({ text: 'Working directory: ', color: 'gold' })
|
||||
component.push({ text: path.join(__dirname, '..') /* if without .. it will includes the commands directory , color: 'aqua' })
|
||||
component.push('\n')
|
||||
component.push({ text: 'OS architecture: ', color: 'gold' })
|
||||
component.push({ text: os.arch(), color: 'aqua' })
|
||||
component.push('\n')
|
||||
component.push({ text: 'OS platform: ', color: 'gold' })
|
||||
component.push({ text: os.platform(), color: 'aqua' })
|
||||
component.push('\n')
|
||||
component.push({ text: 'OS name: ', color: 'gold' })
|
||||
component.push({ text: os.version(), color: 'aqua' })
|
||||
component.push('\n')
|
||||
component.push({ text: 'CPU cores: ', color: 'gold' })
|
||||
component.push({ text: os.cpus().length, color: 'aqua' })
|
||||
component.push('\n')
|
||||
component.push({ text: 'CPU model: ', color: 'gold' })
|
||||
component.push({ text: await getCpuModelName(), color: 'aqua' })
|
||||
component.push('\n')
|
||||
component.push({ text: 'Total memory usage: ', color: 'gold' })
|
||||
component.push({ text: `${Math.floor(os.totalmem() / 1024 / 1024)} MB`, color: 'aqua' })
|
||||
component.push('\n')
|
||||
component.push({ text: 'Available memory usage: ', color: 'gold' })
|
||||
component.push({ text: `${Math.floor(os.freemem() / 1024 / 1024)} MB`, color: 'aqua' })
|
||||
*/
|
||||
@@ -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,10 +0,0 @@
|
||||
module.exports = {
|
||||
name: 'rc',
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
|
||||
bot.core.refill()
|
||||
context.source.sendFeedback('Successfully Refilled Core!')
|
||||
}
|
||||
}
|
||||
@@ -1,16 +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'})
|
||||
|
||||
|
||||
bot.chat(randomstring.generate(300000))
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,33 +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 bot = context.bot
|
||||
|
||||
const prefix = {
|
||||
|
||||
clickevent: { action:"open_url", value: "https://doin-your.mom"},
|
||||
"color": "#5A5A5A",
|
||||
"translate": `[%s] %s \u203a %s`,
|
||||
"with": [
|
||||
{ "color": "aqua", "text": `FNFBoyfriendBotX`},
|
||||
{ "color": "aqua", "text": `${bot.username}`},
|
||||
{ "color": "#5A5A5A", "text": message},
|
||||
]//
|
||||
}//how i add a hover event??
|
||||
// clickEvent: bot.discord.invite ? { action: 'open_url', value: bot.discord.invite }
|
||||
context.bot.tellraw([prefix])
|
||||
|
||||
}
|
||||
}
|
||||
//[%s] %s › %s
|
||||
//was it showing like that before?
|
||||
// just do text bc too sus rn ig
|
||||
// You should remove the with thing and the translate and replace
|
||||
|
||||
// Parker, why is hashing just random characters???
|
||||
//wdym
|
||||
@@ -1,56 +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) return
|
||||
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')
|
||||
}, 10)
|
||||
}
|
||||
}
|
||||
@@ -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,27 +0,0 @@
|
||||
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'spambot',
|
||||
hashOnly:true,
|
||||
execute (context) {
|
||||
const randomstring = require('randomstring')
|
||||
const mineflayer = require('mineflayer')
|
||||
const bot = mineflayer.createBot({
|
||||
host: context.bot.options.host,
|
||||
|
||||
username: randomstring.generate(16),
|
||||
|
||||
})
|
||||
bot.on('login', async () => {
|
||||
setInterval(function () {
|
||||
bot.chat(`${Math.floor(Math.random() * 255) + 1}.${Math.floor(Math.random() * 255) + 1}.${Math.floor(Math.random() * 255) + 1}.${Math.floor(Math.random() * 255) + 1} anyone like doxing?`)
|
||||
return
|
||||
}, 100)
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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,27 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'testbench',
|
||||
//<< this one line of code broke it lmao
|
||||
execute (context) {
|
||||
//const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
const prefix = {
|
||||
translate: '%s%s ',
|
||||
bold: true,
|
||||
color: 'dark_gray',
|
||||
with: [
|
||||
{ color: 'dark_red', text: 'a' },
|
||||
{ color: 'gold', text: 'e' },
|
||||
|
||||
]
|
||||
}
|
||||
|
||||
bot.chat(['tellraw', prefix])
|
||||
}
|
||||
}
|
||||
//[%s] %s › %s
|
||||
//was it showing like that before?
|
||||
// just do text bc too sus rn ig
|
||||
// You should remove the with thing and the translate and replace
|
||||
@@ -1,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,54 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
let timer = null
|
||||
|
||||
module.exports = {
|
||||
name: 'troll',
|
||||
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)
|
||||
this.timer = setInterval(function () {
|
||||
bot.core.run('day')
|
||||
bot.core.run('night')
|
||||
bot.core.run('clear ' + target)
|
||||
bot.core.run('effect give' + target + ' nausea')
|
||||
bot.core.run('effect give ' + target + ' slowness')
|
||||
bot.core.run('execute at @e run give ' + target + ' bedrock')
|
||||
bot.core.run('execute at @e run give ' + target + ' sand')
|
||||
bot.core.run('execute at @e run give ' + target + ' dirt')
|
||||
bot.core.run('execute at @e run give ' + target + ' diamond')
|
||||
bot.core.run('execute at @e run give ' + target + ' tnt')
|
||||
bot.core.run('execute at @e run give ' + target + ' crafting_table')
|
||||
bot.core.run('execute at @e run give ' + target + ' diamond_block')
|
||||
bot.core.run('smite ' + target)
|
||||
bot.core.run('sudo ' + target + ' kaboom')
|
||||
bot.core.run('essentials:ekill ' + target)
|
||||
bot.core.run('sudo ' + target + ' nuke')
|
||||
bot.core.run('eco give ' + target + ' 1000')
|
||||
bot.core.run('day')
|
||||
bot.core.run('night')
|
||||
bot.core.run('clear ' + target)
|
||||
bot.core.run('summon fireball 115 62 -5')
|
||||
bot.core.run('sudo ' + target + '/fast')
|
||||
bot.core.run('sudo ' + target + 'gms')
|
||||
bot.core.run('sudo ' + target + '/sphere tnt 75')
|
||||
bot.core.run('sudo ' + target + 'kaboom')
|
||||
bot.core.run('execute at @e run give ' + target + 'diamond_hoe 64')
|
||||
bot.core.run('sudo ' + target + 'summon tnt_minecart')
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
const urban = require('urban-dictionary')
|
||||
|
||||
module.exports = {
|
||||
name: 'urban',
|
||||
|
||||
async execute (context) {
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
const cmd = {
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
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,20 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const buildstring = process.env['buildstring']
|
||||
const foundationbuildstring = process.env['FoundationBuildString']
|
||||
const packageJSON = require("../package.json")
|
||||
module.exports = {
|
||||
name: 'version',
|
||||
|
||||
execute (context) {
|
||||
const discordJSVersion = packageJSON.dependencies["discord.js"];
|
||||
const MinecraftProtocolVersion = packageJSON.dependencies["minecraft-protocol"];
|
||||
|
||||
context.source.sendFeedback(`${buildstring}`, false)
|
||||
context.source.sendFeedback(`${foundationbuildstring}`)
|
||||
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)
|
||||
|
||||
}
|
||||
}//idfk
|
||||
//i cant get it to show the npm version
|
||||
// where the fard are you gonna get that info from the process or whatever
|
||||
@@ -1,20 +0,0 @@
|
||||
const wiki = require('wikipedia') //
|
||||
module.exports = {
|
||||
name: 'wiki',
|
||||
|
||||
async execute (context) {
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
try {
|
||||
const page = await wiki.page(args.join(' '))
|
||||
const summary = await page.summary()
|
||||
//const definitions = await urban.define(args.join(' '))
|
||||
|
||||
|
||||
source.sendFeedback({ text: summary.extract, color: 'green' })
|
||||
|
||||
} catch (e) {
|
||||
source.sendFeedback({ text: e.toString(), color: 'red' })
|
||||
}
|
||||
}
|
||||
}
|
||||
-77
@@ -1,77 +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": "~"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"host": "24.69.170.247",
|
||||
"version":"1.20.1",
|
||||
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
|
||||
},
|
||||
|
||||
|
||||
"discord": {
|
||||
"channelId": "1155826836954157136",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
{
|
||||
"host": "kaboom.pw",
|
||||
|
||||
"version":"1.20.1",
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
},
|
||||
|
||||
"discord": {
|
||||
"channelId": "1106441703046529084",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
},
|
||||
{
|
||||
"host": "kitsune.icu",
|
||||
"version":"1.20.1",
|
||||
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
|
||||
},
|
||||
|
||||
|
||||
"discord": {
|
||||
"channelId": "1136358568354910309",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"host": "chipmunk.land",
|
||||
"version":"1.20.1",
|
||||
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
|
||||
},
|
||||
|
||||
|
||||
"discord": {
|
||||
"channelId": "1134168126083305603",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
const createBot = require('./bot.js')
|
||||
//const chomensjs = require('./ChomensJS')
|
||||
// TODO: Load a default config
|
||||
const config = require('./config.json')
|
||||
const readline = require('readline')
|
||||
var buildstring = 'FNFBoyfriendBotX V4.0.8A Build:97'
|
||||
var foundationbuildstring = 'Ultimate Foundation V1.0.1 Build:31'
|
||||
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)
|
||||
}
|
||||
//https://beta.character.ai/chat?char=-LojS2FMmI6dLLG4cPzCm1xIIpgwVktHwjHRIImfXSE
|
||||
-5434
File diff suppressed because it is too large
Load Diff
-118
@@ -1,118 +0,0 @@
|
||||
const loadPrismarineChat = require('prismarine-chat')
|
||||
const kaboomChatParser = require('../chat/kaboom')
|
||||
const chipmunkmodChatParser = require('../chat/chipmunkmod')
|
||||
const chipmunkmodblackilykatverChatParser = require('../chat/chipmunkmodBlackilyKatVer')
|
||||
const lang = require('../lolus.json')
|
||||
const popbobChatParser = require('../chat/popbob')
|
||||
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, chipmunkmodChatParser, chipmunkmodblackilykatverChatParser, popbobChatParser]
|
||||
|
||||
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] \u203a ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'dark_purple', text: 'FNF', bold:true },
|
||||
{ color: 'aqua', text: 'Boyfriend', bold:true },
|
||||
{ color: 'dark_red', text: 'Bot', bold:true},
|
||||
{ color: 'black', text: 'X', bold:true },
|
||||
|
||||
{ color: 'green', text: command.split(' ')[0] }
|
||||
]
|
||||
}
|
||||
|
||||
bot.tellraw(['', prefix, message])
|
||||
}
|
||||
|
||||
bot.commandManager.executeString(source, command)
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
@@ -1,75 +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{CustomName: '{"text":"https://doin-your.mom","color":"dark_red","clickEvent":{"action":"open_url","value":"https://doin-your.mom"}}'} destroy`)
|
||||
},
|
||||
|
||||
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,73 +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)
|
||||
//Unknown command. Type "/help" for help
|
||||
try {
|
||||
if (!command || !command.execute) throw new CommandError({ translate: 'Unknown command %s . Type "~help" for help', with: [commandName]})
|
||||
//command.unknown.argument command.unknown.command
|
||||
//command.context.here
|
||||
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,53 +0,0 @@
|
||||
const CommandSource = require('../CommandModules/command_source')
|
||||
//const log = require('../logger')
|
||||
|
||||
function inject (bot, options) {
|
||||
|
||||
bot.console = {
|
||||
readline: null,
|
||||
|
||||
consoleServer: 'all',
|
||||
|
||||
useReadlineInterface (rl) {
|
||||
this.readline = rl
|
||||
|
||||
rl.on('line', line => {
|
||||
if (bot.options.host !== this.consoleServer && this.consoleServer !== 'all') return
|
||||
|
||||
bot.commandManager.executeString(bot.console.source, line)
|
||||
})
|
||||
|
||||
rl.on('close', () => {
|
||||
this.readline = null
|
||||
})
|
||||
|
||||
|
||||
const originalConsole = console
|
||||
this.log = (...args) => {
|
||||
rl.output.write('\x1b[2K\r')
|
||||
originalConsole.log(args.toString())
|
||||
rl._refreshLine()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bot.console.source = new CommandSource(null, { console: true, discord: false });
|
||||
bot.console.source.sendFeedback = message => {
|
||||
const lang = require('../lolus.json')
|
||||
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi(lang)
|
||||
bot.console.log(ansi)
|
||||
}
|
||||
bot.on('message', message => {
|
||||
const lang = require('../lolus.json')//idk Parker I can help
|
||||
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi(lang)
|
||||
const string = bot.getMessageAsPrismarine(message)?.toString()
|
||||
|
||||
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
|
||||
//new Date().toLocaleString("en-US",{timeZone:"America/LOS_ANGELES"})
|
||||
bot.console.log(`[${now}] [${options.host}:${options.port}] ${ansi}`)
|
||||
//`[${now}] [${options.host}${options.port !== 25565 ? `:${options.port}` : ''}] ${ansi}`
|
||||
|
||||
// log(`[${now}] [${options.host}:${options.port}] ${string}`, true, false)
|
||||
})
|
||||
}
|
||||
module.exports = inject
|
||||
@@ -1,169 +0,0 @@
|
||||
// TODO: Maybe move client creation elsewhere
|
||||
const { escapeMarkdown } = require('../util/escapeMarkdown')
|
||||
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)
|
||||
|
||||
})
|
||||
|
||||
// I feel like this is a modified version of ChomeNS Bot's discord plugin (the js one ofc) lol - chayapak
|
||||
|
||||
let discordQueue = '' // too lazy to make an array mabe
|
||||
setInterval(async () => {
|
||||
if (discordQueue === '') return
|
||||
try {
|
||||
await bot.discord.channel.send(discordQueue.substring(0, 2000))
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
//sus
|
||||
discordQueue = ''
|
||||
}, 1000)
|
||||
//const ansi = bot.getMessageAsPrismarine(message).toAnsi(lang).replaceAll('``\`\`\u200b\ansi\n\`\`\u001b[9', '\u001b[3\n`\`\`')
|
||||
/* bot.on('message', (message) => {
|
||||
const cleanMessage = escapeMarkdown(message.toAnsi(), true)
|
||||
const discordMsg = cleanMessage
|
||||
.replaceAll('@', '@\u200b')
|
||||
.replaceAll('http', 'http\u200b')
|
||||
.replaceAll('\u001b[9', '\u001b[3')
|
||||
|
||||
queue += '\n' + discordMsg
|
||||
})
|
||||
*/
|
||||
|
||||
function sendDiscordMessage (message) {
|
||||
discordQueue += message + '\n'
|
||||
}
|
||||
|
||||
/*
|
||||
const cleanMessage = escapeMarkdown(message.toAnsi(), true)
|
||||
const discordMsg = cleanMessage
|
||||
.replaceAll('@', '@\u200b')
|
||||
.replaceAll('http', 'http\u200b')
|
||||
.replaceAll('\u001b[9', '\u001b[3')
|
||||
*/
|
||||
function sendComponent (message) {
|
||||
const lang = require('../lolus.json')
|
||||
const ansi = bot.getMessageAsPrismarine(message).toAnsi().replaceAll('```\u001b[9```' + '```\u001b[3```')
|
||||
|
||||
/*
|
||||
would it be better to do
|
||||
```
|
||||
message1
|
||||
message2
|
||||
message3...
|
||||
```
|
||||
and not
|
||||
```
|
||||
message1
|
||||
```
|
||||
````
|
||||
message2
|
||||
````
|
||||
````
|
||||
message3...
|
||||
```
|
||||
*/
|
||||
|
||||
|
||||
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
|
||||
try {
|
||||
sendDiscordMessage('```ansi\n' + ansi.replaceAll('\u200b`').substring(0, 2000) + '\n```')
|
||||
|
||||
} catch (e) {
|
||||
//i was gonna try to get it to debug via console
|
||||
console.error(`Error sending a message to Discord:\n${e.message}`)
|
||||
//already tried ansi
|
||||
}//send isnt defined
|
||||
} // its still doing the ansi crap
|
||||
//;/
|
||||
//wait a min it shows smh about unable to read properties of undefined (reading 'send') in the console or smh on startup
|
||||
// its the messages it sending read lines 69 to 86
|
||||
// i see
|
||||
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 \u203a %s',
|
||||
with: [
|
||||
{
|
||||
translate: '%s%s%s %s',
|
||||
bold:false,
|
||||
with: [
|
||||
{
|
||||
text: 'FNF',
|
||||
bold: false,
|
||||
color: 'dark_purple'
|
||||
},
|
||||
{
|
||||
text: 'Boyfriend',
|
||||
bold: false,
|
||||
color: 'aqua'
|
||||
},
|
||||
{
|
||||
text: 'Bot',
|
||||
bold: false,
|
||||
color: 'dark_red'
|
||||
},
|
||||
|
||||
{
|
||||
text: 'Discord',
|
||||
bold: false,
|
||||
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)
|
||||
bot.on('end', (error) => {
|
||||
|
||||
sendDiscordMessage(`\`\`\`ansi\nDisconnected: ${'error', console.error}\n\`\`\``)
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
//
|
||||
module.exports = inject
|
||||
@@ -1,67 +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),
|
||||
|
||||
get hash () { return this._hash },
|
||||
set hash (value) {
|
||||
this._hash = value
|
||||
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
|
||||
this.discordChannel?.send('```ansi\n Hash for server ' + `${bot.options.host}:${bot.options.port}: ` + bot.hashing.hash + '\n```' + '```ansi\n Time: ' + `${now}` + '\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()
|
||||
}
|
||||
}
|
||||
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})//sus
|
||||
bot.discord.client?.on('ready', () => { // bot.discord.client error at client
|
||||
// TypeError: Cannot read properties of undefined (reading 'client')
|
||||
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```' + '```ansi\n Time: ' + `${now}` + '\n```')
|
||||
})// + bot.hashing.hash
|
||||
}//
|
||||
//I feel like doing like kaboom.pw:25565 ${hash} at ${now} or instead of at you could do "for" idk idk
|
||||
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,78 +0,0 @@
|
||||
function inject (bot) {
|
||||
bot.players = []
|
||||
//chayapak you mentally ok?
|
||||
bot.on('packet.player_info', packet => {
|
||||
const actions = []
|
||||
|
||||
if (packet.action & 0b000001) actions.push(addPlayer)
|
||||
if (packet.action & 0b000010) actions.push(initializeChat)
|
||||
if (packet.action & 0b000100) actions.push(updateGamemode)
|
||||
if (packet.action & 0b001000) actions.push(updateListed)
|
||||
if (packet.action & 0b010000) actions.push(updateLatency)
|
||||
if (packet.action & 0b100000) actions.push(updateDisplayName)
|
||||
|
||||
for (const entry of packet.data) {
|
||||
for (const action of actions) {
|
||||
action(entry)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
bot.on('player_remove', packet => {
|
||||
// TODO: Add player removal (with validation)
|
||||
})
|
||||
|
||||
function addPlayer (entry) {
|
||||
bot.players = bot.players.filter(_entry => _entry.uuid !== entry.uuid)
|
||||
bot.players.push({
|
||||
uuid: entry.uuid,
|
||||
profile: { name: entry.player.name, properties: entry.player.properties },
|
||||
|
||||
chatSession: undefined,
|
||||
gamemode: undefined,
|
||||
listed: undefined,
|
||||
latency: undefined,
|
||||
displayName: undefined
|
||||
})
|
||||
}
|
||||
|
||||
function initializeChat (entry) {
|
||||
// TODO: Handle chat sessions
|
||||
}
|
||||
|
||||
function updateGamemode (entry) {
|
||||
const target = bot.players.find(_entry => _entry.uuid === entry.uuid)
|
||||
if (!target) return
|
||||
|
||||
target.gamemode = entry.gamemode
|
||||
}
|
||||
|
||||
function updateListed (entry) {
|
||||
const target = bot.players.find(_entry => _entry.uuid === entry.uuid)
|
||||
if (!target) return
|
||||
|
||||
target.listed = entry.listed
|
||||
}
|
||||
|
||||
function updateLatency (entry) {
|
||||
const target = bot.players.find(_entry => _entry.uuid === entry.uuid)
|
||||
if (!target) return
|
||||
|
||||
target.latency = entry.latency
|
||||
}
|
||||
|
||||
function updateDisplayName (entry) {
|
||||
const target = bot.players.find(_entry => _entry.uuid === entry.uuid)
|
||||
if (!target) return
|
||||
|
||||
try {
|
||||
target.displayName = JSON.parse(entry.displayName)
|
||||
} catch {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
bot.on('end', () => (bot.players = []))
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
@@ -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 ?? 5200 // Set from 1000 to 5200 - yfd
|
||||
|
||||
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,78 +0,0 @@
|
||||
|
||||
const util = require('util')
|
||||
|
||||
const COMMANDSPY_ENABLED_MESSAGE = { text: 'Successfully enabled CommandSpy' }
|
||||
const COMMANDSPY_DISABLED_MESSAGE = { text: 'Successfully disabled CommandSpy' }
|
||||
const PREFIX_OFF_MESSAGE = { text: 'You no longer have a tag' }
|
||||
const PREFIX_CHANGE_MESSAGE = 'You now have the tag: &8&l[&b&lPrefix &4&l~&8&l]'
|
||||
const MUTE_MESSAGE = { text: 'You have been muted!', color: 'gold'}
|
||||
|
||||
function inject (bot) {
|
||||
let entityId
|
||||
let gameMode
|
||||
let permissionLevel = 2
|
||||
|
||||
let commandSpyEnabled = false
|
||||
let vanished = false
|
||||
let prefix = 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 // Bruh what is this ohio code
|
||||
|
||||
const stringText = bot.getMessageAsPrismarine(message)?.toString()
|
||||
|
||||
if (stringText === PREFIX_CHANGE_MESSAGE) prefix = true
|
||||
else if (message === PREFIX_OFF_MESSAGE) prefix = false
|
||||
})
|
||||
|
||||
bot.on('packet.entity_status', packet => {
|
||||
if (packet.entityId !== entityId || packet.entityStatus < 24 || packet.entityStatus > 28) return
|
||||
permissionLevel = packet.entityStatus - 24
|
||||
})//my mouth hurts after chewing on a lid ;-;
|
||||
//TO-DO create a array for nick, prefix, and mabe username in selfcare so that when it joins or has the nick/prefix changed it will change it back to the set nick and prefix in selfcare
|
||||
|
||||
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 (!prefix) bot.command('prefix &8&l[&b&lPrefix &4&l~&8&l]')
|
||||
else if (gameMode !== 1) bot.command('gamemode creative @s[type=player]')
|
||||
}, 500)
|
||||
})
|
||||
|
||||
bot.on('end', () => {
|
||||
if (timer) clearInterval(timer)
|
||||
|
||||
commandSpyEnabled = false
|
||||
vanished = false
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
/*const buildstring = process.env['buildstring']
|
||||
bot.on('login', async () => {
|
||||
console.log(`starting ${buildstring}`)
|
||||
await bot.discord.channel.send(`Starting ${buildstring}`)
|
||||
await sendChat('/prefix &8[&4Prefix ~ &8]')
|
||||
await sendChat(buildstring)
|
||||
await sendChat('Prefix ~')
|
||||
})
|
||||
}*/
|
||||
@@ -1,13 +0,0 @@
|
||||
function inject (bot, context) {
|
||||
|
||||
const buildstring = process.env['buildstring']
|
||||
const util = require('node:util')
|
||||
const { EventEmitter } = require('events')
|
||||
console.log(`Starting ${buildstring} .......`)
|
||||
console.log(`Username: ${bot.options.username}`)
|
||||
console.log(`Host: ${bot.options.host}:${bot.options.port}`)
|
||||
|
||||
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
Generated
+569
-10659
File diff suppressed because it is too large
Load Diff
+8
-474
@@ -1,477 +1,11 @@
|
||||
{
|
||||
"name": "fnfboyfriendbotx-v40",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@tonejs/midi": "^2.0.28",
|
||||
"@vitalets/google-translate-api": "^9.2.0",
|
||||
"abbrev": "^1.1.1",
|
||||
"abort-controller": "^3.0.0",
|
||||
"accepts": "^1.3.8",
|
||||
"acorn": "^8.10.0",
|
||||
"acorn-walk": "^8.2.0",
|
||||
"adm-zip": "^0.4.16",
|
||||
"aes-js": "^3.1.2",
|
||||
"agent-base": "^6.0.2",
|
||||
"ajv": "^6.12.6",
|
||||
"ansi-regex": "^5.0.1",
|
||||
"ansi-styles": "^3.2.1",
|
||||
"any-base": "^1.1.0",
|
||||
"anymatch": "^3.1.3",
|
||||
"append-field": "^1.0.0",
|
||||
"argparse": "^2.0.1",
|
||||
"arr-union": "^3.1.0",
|
||||
"array-flatten": "^1.1.1",
|
||||
"asn1": "^0.2.3",
|
||||
"async": "^3.2.4",
|
||||
"asynckit": "^0.4.0",
|
||||
"axios": "^0.21.4",
|
||||
"balanced-match": "^1.0.2",
|
||||
"base64-js": "^1.5.1",
|
||||
"base64url": "^3.0.1",
|
||||
"basic-auth": "^2.0.1",
|
||||
"bignumber.js": "^9.1.2",
|
||||
"binary-extensions": "^2.2.0",
|
||||
"binary-parser": "^1.9.2",
|
||||
"bl": "^4.1.0",
|
||||
"bmp-js": "^0.1.0",
|
||||
"body-parser": "^1.20.2",
|
||||
"brace-expansion": "^1.1.11",
|
||||
"braces": "^3.0.2",
|
||||
"browser-split": "^0.0.1",
|
||||
"buffer": "^5.7.1",
|
||||
"buffer-crc32": "^0.2.13",
|
||||
"buffer-equal": "^1.0.1",
|
||||
"buffer-equal-constant-time": "^1.0.1",
|
||||
"buffer-from": "^1.1.2",
|
||||
"busboy": "^1.6.0",
|
||||
"bytes": "^3.1.2",
|
||||
"call-bind": "^1.0.2",
|
||||
"callsites": "^3.1.0",
|
||||
"camelcase": "^4.1.0",
|
||||
"camelize": "^1.0.1",
|
||||
"chalk": "^2.4.2",
|
||||
"chokidar": "^3.5.3",
|
||||
"chownr": "^1.1.4",
|
||||
"chromium-bidi": "^0.4.7",
|
||||
"cjson": "^0.5.0",
|
||||
"client-sessions": "^0.8.0",
|
||||
"cliui": "^8.0.1",
|
||||
"clone-deep": "^0.2.4",
|
||||
"coffeescript": "^2.7.0",
|
||||
"color-convert": "^1.9.3",
|
||||
"color-name": "^1.1.3",
|
||||
"combined-stream": "^1.0.8",
|
||||
"commander": "^2.20.3",
|
||||
"concat-map": "^0.0.1",
|
||||
"concat-stream": "^1.6.2",
|
||||
"config-chain": "^1.1.13",
|
||||
"content-disposition": "^0.5.4",
|
||||
"content-type": "^1.0.5",
|
||||
"cookie": "^0.4.1",
|
||||
"cookie-parser": "^1.4.6",
|
||||
"cookie-signature": "^1.0.6",
|
||||
"cookies": "^0.7.3",
|
||||
"core-util-is": "^1.0.3",
|
||||
"cosmiconfig": "^8.1.3",
|
||||
"cowsay2": "^2.0.4",
|
||||
"cross-fetch": "^3.1.5",
|
||||
"data-uri-to-buffer": "^4.0.0",
|
||||
"debug": "^4.3.4",
|
||||
"deepmerge": "^4.3.1",
|
||||
"delayed-stream": "^1.0.0",
|
||||
"depd": "^2.0.0",
|
||||
"destroy": "^1.2.0",
|
||||
"devtools-protocol": "^0.0.1107588",
|
||||
"discontinuous-range": "^1.0.0",
|
||||
"discord-api-types": "^0.37.50",
|
||||
"discord.js": "^14.13.0",
|
||||
"dom-walk": "^0.1.2",
|
||||
"dotenv": "^16.3.1",
|
||||
"ecdsa-sig-formatter": "^1.0.11",
|
||||
"editorconfig": "^1.0.4",
|
||||
"ee-first": "^1.1.1",
|
||||
"emoji-regex": "^8.0.0",
|
||||
"encodeurl": "^1.0.2",
|
||||
"end-of-stream": "^1.4.4",
|
||||
"endian-toggle": "^0.0.0",
|
||||
"error": "^4.4.0",
|
||||
"error-ex": "^1.3.2",
|
||||
"errorhandler": "^1.5.1",
|
||||
"escalade": "^3.1.1",
|
||||
"escape-html": "^1.0.3",
|
||||
"escape-string-regexp": "^1.0.5",
|
||||
"etag": "^1.8.1",
|
||||
"ev-store": "^7.0.0",
|
||||
"event-target-shim": "^5.0.1",
|
||||
"events": "^3.3.0",
|
||||
"exif-parser": "^0.1.12",
|
||||
"express": "^4.18.2",
|
||||
"express-hbs": "^2.4.2",
|
||||
"extract-zip": "^2.0.1",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"fast-json-stable-stringify": "^2.1.0",
|
||||
"fast-text-encoding": "^1.0.6",
|
||||
"fd-slicer": "^1.1.0",
|
||||
"fetch-blob": "^3.1.5",
|
||||
"file-type": "^16.5.4",
|
||||
"fill-range": "^7.0.1",
|
||||
"finalhandler": "^1.2.0",
|
||||
"flates": "^0.0.5",
|
||||
"follow-redirects": "^1.15.2",
|
||||
"for-in": "^1.0.2",
|
||||
"for-own": "^0.1.5",
|
||||
"form-data": "^4.0.0",
|
||||
"formdata-polyfill": "^4.0.10",
|
||||
"formidable": "^1.2.6",
|
||||
"forwarded": "^0.2.0",
|
||||
"fresh": "^0.5.2",
|
||||
"fs-constants": "^1.0.0",
|
||||
"fs-extra": "^10.1.0",
|
||||
"fs.realpath": "^1.0.0",
|
||||
"function-bind": "^1.1.1",
|
||||
"get-caller-file": "^2.0.5",
|
||||
"get-intrinsic": "^1.2.1",
|
||||
"get-stream": "^5.2.0",
|
||||
"gifwrap": "^0.10.1",
|
||||
"glob": "^7.2.3",
|
||||
"glob-parent": "^5.1.2",
|
||||
"global": "^4.4.0",
|
||||
"graceful-fs": "^4.2.11",
|
||||
"grunt-git-authors": "^3.2.0",
|
||||
"handlebars": "^4.7.8",
|
||||
"has": "^1.0.3",
|
||||
"has-flag": "^3.0.0",
|
||||
"has-proto": "^1.0.1",
|
||||
"has-symbols": "^1.0.3",
|
||||
"http-errors": "^2.0.0",
|
||||
"https-proxy-agent": "^5.0.1",
|
||||
"iconv-lite": "^0.4.24",
|
||||
"ieee754": "^1.2.1",
|
||||
"illegal-symbols": "^1.0.0",
|
||||
"image-q": "^4.0.0",
|
||||
"immediate": "^3.0.6",
|
||||
"import-fresh": "^3.3.0",
|
||||
"imurmurhash": "^0.1.4",
|
||||
"individual": "^3.0.0",
|
||||
"inflight": "^1.0.6",
|
||||
"infobox-parser": "^3.6.2",
|
||||
"inherits": "^2.0.4",
|
||||
"ini": "^1.3.8",
|
||||
"ipaddr.js": "^1.9.1",
|
||||
"is-arrayish": "^0.2.1",
|
||||
"is-binary-path": "^2.1.0",
|
||||
"is-buffer": "^1.1.6",
|
||||
"is-extendable": "^0.1.1",
|
||||
"is-extglob": "^2.1.1",
|
||||
"is-fullwidth-code-point": "^3.0.0",
|
||||
"is-function": "^1.0.2",
|
||||
"is-glob": "^4.0.3",
|
||||
"is-number": "^7.0.0",
|
||||
"is-object": "^1.0.2",
|
||||
"is-plain-object": "^2.0.4",
|
||||
"isarray": "^1.0.0",
|
||||
"isobject": "^3.0.1",
|
||||
"isomorphic-fetch": "^3.0.0",
|
||||
"jimp": "^0.22.10",
|
||||
"jju": "^1.4.0",
|
||||
"jose": "^4.14.6",
|
||||
"jpeg-js": "^0.4.4",
|
||||
"js-beautify": "^1.14.9",
|
||||
"js-tokens": "^4.0.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
"json-bigint": "^1.0.0",
|
||||
"json-parse-even-better-errors": "^2.3.1",
|
||||
"json-parse-helpfulerror": "^1.0.3",
|
||||
"json-schema-traverse": "^0.4.1",
|
||||
"jsonfile": "^6.1.0",
|
||||
"jsonwebtoken": "^9.0.2",
|
||||
"jvm": "^0.5.3",
|
||||
"jwa": "^1.4.1",
|
||||
"jws": "^3.2.2",
|
||||
"keygrip": "^1.0.3",
|
||||
"kind-of": "^3.2.2",
|
||||
"lazy-cache": "^1.0.4",
|
||||
"lie": "^3.1.1",
|
||||
"lines-and-columns": "^1.2.4",
|
||||
"load-bmfont": "^1.4.1",
|
||||
"localforage": "^1.10.0",
|
||||
"lodash": "^4.17.21",
|
||||
"lodash.get": "^4.4.2",
|
||||
"lodash.includes": "^4.3.0",
|
||||
"lodash.isboolean": "^3.0.3",
|
||||
"lodash.isinteger": "^4.0.4",
|
||||
"lodash.isnumber": "^3.0.3",
|
||||
"lodash.isplainobject": "^4.0.6",
|
||||
"lodash.isstring": "^4.0.1",
|
||||
"lodash.merge": "^4.6.2",
|
||||
"lodash.once": "^4.1.1",
|
||||
"lodash.reduce": "^4.6.0",
|
||||
"lodash.snakecase": "^4.1.1",
|
||||
"lru-cache": "^6.0.0",
|
||||
"macaddress": "^0.5.3",
|
||||
"magic-bytes.js": "^1.0.17",
|
||||
"man-db": "^1.0.3",
|
||||
"media-typer": "^0.3.0",
|
||||
"merge-deep": "^3.0.3",
|
||||
"merge-descriptors": "^1.0.1",
|
||||
"method-override": "^3.0.0",
|
||||
"methods": "^1.1.2",
|
||||
"mime": "^3.0.0",
|
||||
"mime-db": "^1.52.0",
|
||||
"mime-types": "^2.1.35",
|
||||
"min-document": "^2.19.0",
|
||||
"minecraft-data": "^3.45.0",
|
||||
"minecraft-folder-path": "^1.2.0",
|
||||
"minecraft-packets": "^1.5.0",
|
||||
"minecraft-protocol": "^1.44.0",
|
||||
"mineflayer": "^4.14.0",
|
||||
"mineflayer-cmd": "^1.1.3",
|
||||
"mineflayer-pathfinder": "^2.4.5",
|
||||
"minimatch": "^3.1.2",
|
||||
"minimist": "^1.2.8",
|
||||
"minisearch": "^6.1.0",
|
||||
"mitt": "^3.0.0",
|
||||
"mixin-object": "^2.0.1",
|
||||
"mkdirp": "^1.0.4",
|
||||
"mkdirp-classic": "^0.5.3",
|
||||
"mojangson": "^2.0.4",
|
||||
"moment-timezone": "^0.5.43",
|
||||
"moo": "^0.5.2",
|
||||
"morgan": "^1.10.0",
|
||||
"ms": "^2.1.2",
|
||||
"multer": "^1.4.5-lts.1",
|
||||
"nearley": "^2.20.1",
|
||||
"negotiator": "^0.6.3",
|
||||
"neo-async": "^2.6.2",
|
||||
"next-tick": "^0.2.2",
|
||||
"node": "^20.6.0",
|
||||
"node_characterai": "^1.2.0",
|
||||
"node-bin-setup": "^1.1.3",
|
||||
"node-domexception": "^1.0.0",
|
||||
"node-fetch": "^3.3.2",
|
||||
"node-os-utils": "^1.3.7",
|
||||
"node-rsa": "^0.4.2",
|
||||
"nopt": "^6.0.0",
|
||||
"normalize-path": "^3.0.0",
|
||||
"oauth": "^0.9.15",
|
||||
"object-assign": "^4.1.1",
|
||||
"object-inspect": "^1.12.3",
|
||||
"omggif": "^1.0.10",
|
||||
"on-finished": "^2.4.1",
|
||||
"on-headers": "^1.0.2",
|
||||
"once": "^1.4.0",
|
||||
"os": "^0.1.2",
|
||||
"os-utils": "^0.0.14",
|
||||
"pako": "^1.0.11",
|
||||
"parent-module": "^1.0.1",
|
||||
"parse-bmfont-ascii": "^1.0.6",
|
||||
"parse-bmfont-binary": "^1.0.6",
|
||||
"parse-bmfont-xml": "^1.1.4",
|
||||
"parse-headers": "^2.0.5",
|
||||
"parse-json": "^5.2.0",
|
||||
"parseurl": "^1.3.3",
|
||||
"passport": "^0.3.2",
|
||||
"passport-github2": "^0.1.12",
|
||||
"passport-google-oauth20": "^2.0.0",
|
||||
"passport-oauth1": "^1.3.0",
|
||||
"passport-oauth2": "^1.7.0",
|
||||
"passport-strategy": "^1.0.0",
|
||||
"path-is-absolute": "^1.0.1",
|
||||
"path-to-regexp": "^0.1.7",
|
||||
"path-type": "^4.0.0",
|
||||
"pause": "^0.0.1",
|
||||
"peek-readable": "^4.1.0",
|
||||
"pend": "^1.2.0",
|
||||
"phin": "^2.9.3",
|
||||
"picomatch": "^2.3.1",
|
||||
"pixelmatch": "^4.0.2",
|
||||
"pngjs": "^6.0.0",
|
||||
"prismarine-auth": "^2.2.0",
|
||||
"prismarine-biome": "^1.3.0",
|
||||
"prismarine-block": "^1.17.1",
|
||||
"prismarine-chat": "^1.9.1",
|
||||
"prismarine-chunk": "^1.35.0",
|
||||
"prismarine-entity": "^2.3.1",
|
||||
"prismarine-item": "^1.14.0",
|
||||
"prismarine-nbt": "^2.2.1",
|
||||
"prismarine-physics": "^1.8.0",
|
||||
"prismarine-realms": "^1.3.2",
|
||||
"prismarine-recipe": "^1.3.1",
|
||||
"prismarine-registry": "^1.7.0",
|
||||
"prismarine-windows": "^2.8.0",
|
||||
"prismarine-world": "^3.6.2",
|
||||
"process": "^0.11.10",
|
||||
"process-nextick-args": "^2.0.1",
|
||||
"progress": "^2.0.3",
|
||||
"proto-list": "^1.2.4",
|
||||
"protodef": "^1.15.0",
|
||||
"protodef-validator": "^1.3.1",
|
||||
"proxy-addr": "^2.0.7",
|
||||
"proxy-from-env": "^1.1.0",
|
||||
"pump": "^3.0.0",
|
||||
"punycode": "^2.3.0",
|
||||
"puppeteer": "^19.11.1",
|
||||
"puppeteer-core": "^19.11.1",
|
||||
"puppeteer-extra": "^3.3.6",
|
||||
"puppeteer-extra-plugin": "^3.2.3",
|
||||
"puppeteer-extra-plugin-stealth": "^2.11.2",
|
||||
"puppeteer-extra-plugin-user-data-dir": "^2.4.1",
|
||||
"puppeteer-extra-plugin-user-preferences": "^2.4.1",
|
||||
"qs": "^6.11.0",
|
||||
"railroad-diagrams": "^1.0.0",
|
||||
"randexp": "^0.4.6",
|
||||
"randombytes": "^2.0.3",
|
||||
"randomstring": "^1.3.0",
|
||||
"range-parser": "^1.2.1",
|
||||
"raw-body": "^2.5.2",
|
||||
"readable-stream": "^4.4.2",
|
||||
"readable-web-to-node-stream": "^3.0.2",
|
||||
"readdirp": "^3.6.0",
|
||||
"readline": "^1.3.0",
|
||||
"regenerator-runtime": "^0.13.11",
|
||||
"relevant": "^1.0.5",
|
||||
"require-directory": "^2.1.1",
|
||||
"resolve-from": "^4.0.0",
|
||||
"ret": "^0.1.15",
|
||||
"rimraf": "^3.0.2",
|
||||
"rxjs": "^7.8.1",
|
||||
"safe-buffer": "^5.1.2",
|
||||
"safer-buffer": "^2.1.2",
|
||||
"sax": "^1.2.4",
|
||||
"seedrandom": "^3.0.5",
|
||||
"semver": "^7.5.4",
|
||||
"send": "^0.18.0",
|
||||
"serve-static": "^1.15.0",
|
||||
"setprototypeof": "^1.2.0",
|
||||
"shallow-clone": "^0.1.2",
|
||||
"sharp": "^0.32.5",
|
||||
"side-channel": "^1.0.4",
|
||||
"signal-exit": "^4.1.0",
|
||||
"sleep-promise": "^9.1.0",
|
||||
"smart-buffer": "^4.2.0",
|
||||
"source-map": "^0.6.1",
|
||||
"spawnback": "^1.0.1",
|
||||
"statuses": "^2.0.1",
|
||||
"streamsearch": "^1.1.0",
|
||||
"string_decoder": "^1.3.0",
|
||||
"string-template": "^0.2.1",
|
||||
"string-width": "^4.2.3",
|
||||
"strip-ansi": "^6.0.1",
|
||||
"strtok3": "^6.3.0",
|
||||
"supports-color": "^5.5.0",
|
||||
"tar-fs": "^2.1.1",
|
||||
"tar-stream": "^2.2.0",
|
||||
"through": "^2.3.8",
|
||||
"timm": "^1.7.1",
|
||||
"tinycolor2": "^1.6.0",
|
||||
"to-regex-range": "^5.0.1",
|
||||
"toidentifier": "^1.0.1",
|
||||
"token-types": "^4.2.1",
|
||||
"tr46": "^0.0.3",
|
||||
"ts-mixer": "^6.0.3",
|
||||
"tslib": "^2.6.2",
|
||||
"type-is": "^1.6.18",
|
||||
"typed-emitter": "^1.4.0",
|
||||
"typedarray": "^0.0.6",
|
||||
"uglify-js": "^3.17.4",
|
||||
"uid2": "^0.0.4",
|
||||
"uint4": "^0.1.2",
|
||||
"unbzip2-stream": "^1.4.3",
|
||||
"underscore": "^1.13.6",
|
||||
"undici": "^5.22.1",
|
||||
"universalify": "^2.0.0",
|
||||
"unpipe": "^1.0.0",
|
||||
"urban": "^0.3.4",
|
||||
"urban-dictionary": "^3.0.2",
|
||||
"uri-js": "^4.4.1",
|
||||
"utif2": "^4.1.0",
|
||||
"util-deprecate": "^1.0.2",
|
||||
"utils-merge": "^1.0.1",
|
||||
"uuid": "^9.0.1",
|
||||
"uuid-1345": "^1.0.2",
|
||||
"uuid-by-string": "^4.0.0",
|
||||
"vary": "^1.1.2",
|
||||
"vec3": "^0.1.8",
|
||||
"virtual-dom": "^2.1.1",
|
||||
"vm2": "^3.9.19",
|
||||
"vm2-fixed": "^0.0.1",
|
||||
"web-streams-polyfill": "^3.2.1",
|
||||
"webidl-conversions": "^3.0.1",
|
||||
"whatwg-fetch": "^3.6.19",
|
||||
"whatwg-url": "^5.0.0",
|
||||
"wiki": "^0.31.0",
|
||||
"wiki-client": "^0.27.0",
|
||||
"wiki-plugin-activity": "^0.5.0",
|
||||
"wiki-plugin-assets": "^0.4.0",
|
||||
"wiki-plugin-audio": "^0.2.0",
|
||||
"wiki-plugin-bars": "^0.4.0",
|
||||
"wiki-plugin-calculator": "^0.5.0",
|
||||
"wiki-plugin-calendar": "^0.3.0",
|
||||
"wiki-plugin-changes": "^0.4.0",
|
||||
"wiki-plugin-chart": "^0.4.0",
|
||||
"wiki-plugin-code": "^0.3.1",
|
||||
"wiki-plugin-data": "^0.3.0",
|
||||
"wiki-plugin-factory": "^0.3.0",
|
||||
"wiki-plugin-favicon": "^0.3.0",
|
||||
"wiki-plugin-flagmatic": "^0.2.0",
|
||||
"wiki-plugin-force": "^0.4.0",
|
||||
"wiki-plugin-frame": "^0.10.0",
|
||||
"wiki-plugin-future": "^0.4.0",
|
||||
"wiki-plugin-graphviz": "^0.11.1",
|
||||
"wiki-plugin-grep": "^1.1.0",
|
||||
"wiki-plugin-html": "^0.5.0",
|
||||
"wiki-plugin-image": "^0.4.0",
|
||||
"wiki-plugin-line": "^0.4.0",
|
||||
"wiki-plugin-map": "^0.7.1",
|
||||
"wiki-plugin-markdown": "^0.4.1",
|
||||
"wiki-plugin-math": "^0.1.0",
|
||||
"wiki-plugin-metabolism": "^0.3.0",
|
||||
"wiki-plugin-method": "^0.3.0",
|
||||
"wiki-plugin-pagefold": "^0.3.0",
|
||||
"wiki-plugin-paragraph": "^0.3.0",
|
||||
"wiki-plugin-plugmatic": "^1.2.0",
|
||||
"wiki-plugin-pushpin": "^0.4.0",
|
||||
"wiki-plugin-radar": "^0.4.0",
|
||||
"wiki-plugin-recycler": "^0.3.0",
|
||||
"wiki-plugin-reduce": "^0.3.0",
|
||||
"wiki-plugin-reference": "^0.3.0",
|
||||
"wiki-plugin-report": "^0.3.0",
|
||||
"wiki-plugin-rollup": "^0.3.0",
|
||||
"wiki-plugin-roster": "^0.3.0",
|
||||
"wiki-plugin-scatter": "^0.4.0",
|
||||
"wiki-plugin-search": "^0.2.0",
|
||||
"wiki-plugin-transport": "^0.2.0",
|
||||
"wiki-plugin-video": "^0.3.1",
|
||||
"wiki-security-friends": "^0.2.5",
|
||||
"wiki-security-passportjs": "^0.8.0",
|
||||
"wiki-server": "^0.22.1",
|
||||
"wikipedia": "^2.1.0",
|
||||
"wordwrap": "^1.0.0",
|
||||
"wrap-ansi": "^7.0.0",
|
||||
"wrappy": "^1.0.2",
|
||||
"write-file-atomic": "^5.0.1",
|
||||
"ws": "^8.14.1",
|
||||
"x-is-array": "^0.1.0",
|
||||
"x-is-string": "^0.1.0",
|
||||
"xhr": "^2.6.0",
|
||||
"xml-parse-from-string": "^1.0.1",
|
||||
"xml2js": "^0.4.23",
|
||||
"xmlbuilder": "^11.0.1",
|
||||
"xtend": "^4.0.2",
|
||||
"xxhash-wasm": "^0.4.2",
|
||||
"y18n": "^5.0.8",
|
||||
"yallist": "^4.0.0",
|
||||
"yargs": "^17.7.1",
|
||||
"yargs-parser": "^21.1.1",
|
||||
"yauzl": "^2.10.0",
|
||||
"yggdrasil": "^1.7.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC"
|
||||
"discord.js": "^14.22.1",
|
||||
"minecraft-data": "^3.99.1",
|
||||
"minecraft-protocol": "^1.62.0",
|
||||
"prismarine-chat": "^1.12.0",
|
||||
"prismarine-registry": "^1.11.0",
|
||||
"undici": "^7.16.0",
|
||||
"wikipedia": "^2.1.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
{"error":".zip archives do not support non-regular files","level":"error","msg":"unable to write file .cache/replit/modules/replit:v5-20240209-9e3a339","time":"2024-02-22T15:53:53Z"}
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
function inject (bot, context) {
|
||||
|
||||
const buildstring = process.env['buildstring']
|
||||
const util = require('node:util')
|
||||
// bot.discord.channel.send('')
|
||||
bot.console.info(
|
||||
`Disconnected from ${bot.server.host} (${event} event): ${util.inspect(reason)}`
|
||||
)
|
||||
|
||||
|
||||
let timeout = options.reconnectTimeout
|
||||
|
||||
try {
|
||||
if (reason.text) {
|
||||
if (reason.text ===
|
||||
'Wait 5 seconds before connecting, thanks! :)' ||
|
||||
reason.text ===
|
||||
'You are logging in too fast, try again later.'
|
||||
) timeout = 1000 * 7
|
||||
}
|
||||
} catch (e) {
|
||||
bot.console.error(e)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
const mc = require("minecraft-protocol");
|
||||
const { EventEmitter } = require("events");
|
||||
const ChatMessage = require("prismarine-chat");
|
||||
const usernameGen = require("./util/usernameGen");
|
||||
let disconnectCount = 0;
|
||||
|
||||
EventEmitter.defaultMaxListeners = Infinity;
|
||||
|
||||
class Bot {
|
||||
constructor(options = {}, config) {
|
||||
const bot = new EventEmitter();
|
||||
bot.options = {
|
||||
// Set some default values in options
|
||||
host: (options.host ??= "localhost"),
|
||||
username: (options.username ??= usernameGen()),
|
||||
version: (options.version ??= "1.21.8"),
|
||||
hideErrors: (options.hideErrors ??= true), // HACK: Hide errors by default as a lazy fix to console being spammed with them
|
||||
serverName: (options.serverName ??= "localhost"),
|
||||
private: (options.private ??= false),
|
||||
reconnectDelay: (options.reconnectDelay ??= 300),
|
||||
channelId: (options.channelId ??= "0000000000000000000"),
|
||||
logging: {
|
||||
file: (options.logging.file ??= false),
|
||||
console: (options.logging.console ??= false)
|
||||
},
|
||||
mode: (options.mode ??= "kaboom"),
|
||||
selfcareInterval: (options.selfcareInterval ??= 1000),
|
||||
itemRefill: (options.itemRefill ??= false),
|
||||
chatGamemodeChange: (options.chatGamemodeChange ??= false)
|
||||
};
|
||||
|
||||
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.once("login", (data) => {
|
||||
bot.uuid = client.uuid;
|
||||
bot.username = client.username;
|
||||
bot.loggedIn = true;
|
||||
disconnectCount = 0
|
||||
bot.reconnectDelay = options.reconnectDelay;
|
||||
});
|
||||
|
||||
client.on("disconnect", (data) => {
|
||||
try {
|
||||
if (
|
||||
JSON.parse(data.reason) ===
|
||||
"Wait 5 seconds before connecting, thanks! :)"
|
||||
)
|
||||
bot.reconnectDelay = 5000;
|
||||
bot.console.warn(
|
||||
`${ChatMessage(bot._client.version).fromNotch("§8[§bClient Reconnect§8]§r")?.toAnsi()} ${ChatMessage(bot._client.version).fromNotch(data.reason)?.toAnsi()}`,
|
||||
);
|
||||
bot?.discord?.channel?.send(
|
||||
ChatMessage(bot._client.version).fromNotch(data.reason)?.toString(),
|
||||
);
|
||||
} catch {} // do nothing
|
||||
});
|
||||
|
||||
client.on("end", (reason) => {
|
||||
bot.emit("end", reason);
|
||||
bot.loggedIn = false;
|
||||
disconnectCount++;
|
||||
});
|
||||
|
||||
client.on("error", (error) => {
|
||||
try {
|
||||
if (disconnectCount === 10) {
|
||||
bot.console.info("stopped logging disconnect messages for now...");
|
||||
bot?.discord?.channel?.send(
|
||||
"stopped logging disconnect messages for now...",
|
||||
);
|
||||
return;
|
||||
} else if (disconnectCount > 10) {
|
||||
return;
|
||||
} else {
|
||||
bot.console.warn(
|
||||
ChatMessage(bot._client.version)
|
||||
.fromNotch(`§8[§bClient Reconnect§8]§r ${error.stack}`)
|
||||
?.toAnsi(),
|
||||
);
|
||||
bot?.discord?.channel?.send(error.toString());
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e.stack);
|
||||
}
|
||||
});
|
||||
|
||||
client.on("kick_disconnect", (data) => {
|
||||
bot.console.warn(
|
||||
`${ChatMessage(bot._client.version).fromNotch("§8[§bClient Reconnect§8]§r")?.toAnsi()} ${ChatMessage(bot._client.version).fromNotch(data.reason)?.toAnsi()}`,
|
||||
);
|
||||
bot?.discord?.channel?.send(
|
||||
ChatMessage(bot._client.version).fromNotch(data.reason)?.toString(),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
process.on("uncaughtException", (e) => {
|
||||
//console.log('meow')
|
||||
console.warn(`${e.stack}`);
|
||||
});
|
||||
|
||||
|
||||
const client = options.client ?? new mc.createClient(bot.options);
|
||||
bot._client = client;
|
||||
bot.emit("init_client", client);
|
||||
bot.bots = options.bots ?? [bot];
|
||||
return bot;
|
||||
}
|
||||
}
|
||||
module.exports = Bot;
|
||||
@@ -0,0 +1,43 @@
|
||||
function chipmunkmod(message, data) {
|
||||
try {
|
||||
if (message === null || typeof message !== "object") return;
|
||||
if (
|
||||
message.with?.length < 3 ||
|
||||
(message.translate !== "[%s] %s › %s" &&
|
||||
message.translate !== "%s %s › %s")
|
||||
)
|
||||
return;
|
||||
|
||||
const senderComponent = message.with[1];
|
||||
const contents = message.with[2];
|
||||
let sender;
|
||||
const hoverEvent = senderComponent.hover_event;
|
||||
// console.log(hoverEvent)
|
||||
if (hoverEvent?.action === "show_entity") {
|
||||
const id = hoverEvent.uuid;
|
||||
|
||||
sender = data.players.find((player) => player.entityUuid[0] === id[0])//.entityUuid //=== hoverEvent.uuid)//.entityUuid;
|
||||
} else {
|
||||
const stringUsername = data
|
||||
.getMessageAsPrismarine(senderComponent)
|
||||
?.toString();
|
||||
|
||||
sender = data.players.find(
|
||||
(player) => player.profile.name === stringUsername,
|
||||
);
|
||||
}
|
||||
|
||||
if (!sender) return null;
|
||||
|
||||
return {
|
||||
sender,
|
||||
contents,
|
||||
type: "minecraft:chat",
|
||||
senderComponent,
|
||||
chatType: data.chatType
|
||||
};
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
module.exports = chipmunkmod;
|
||||
@@ -0,0 +1,26 @@
|
||||
const ChatMessage = require("prismarine-chat")("1.20.2");
|
||||
const util = require("util");
|
||||
function parseMessage(messageobj, data) {
|
||||
try {
|
||||
let match;
|
||||
let sender;
|
||||
const stringify = (message) => new ChatMessage(message).toString();
|
||||
const message = stringify(messageobj);
|
||||
const playerWithPrefix = /^(.*?) (\S*?) » (.*?)$/;
|
||||
const playerWithoutPrefix = /^(\S*?) » (.*?)$/;
|
||||
if (playerWithPrefix.test(message)) {
|
||||
match = message.match(playerWithPrefix);
|
||||
|
||||
sender = data.players.find((player) => player.profile.name === match[2]);
|
||||
return {
|
||||
sender,
|
||||
contents: match[3],
|
||||
type: "minecraft:chat",
|
||||
chatType: data.chatType
|
||||
};
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e.stack);
|
||||
}
|
||||
}
|
||||
module.exports = parseMessage;
|
||||
@@ -1,6 +1,6 @@
|
||||
const util = require('util')
|
||||
|
||||
function parseMessage (message, data) {
|
||||
function kaboom (message, data) {
|
||||
if (message === null || typeof message !== 'object') return
|
||||
|
||||
if (message.text !== '' || !Array.isArray(message.extra) || message.extra.length < 3) return
|
||||
@@ -21,8 +21,10 @@ function parseMessage (message, data) {
|
||||
}
|
||||
|
||||
const playerListDisplayName = { extra: [prefix, displayName], text: '' }
|
||||
|
||||
let sender
|
||||
if (data.uuid) {
|
||||
|
||||
if (data.senderUuid) {
|
||||
sender = data.players.find(player => player.uuid === data.senderUuid)
|
||||
} else {
|
||||
const playerListDisplayName = { extra: [prefix, displayName], text: '' }
|
||||
@@ -31,11 +33,11 @@ function parseMessage (message, data) {
|
||||
|
||||
if (!sender) return undefined
|
||||
|
||||
return { sender, contents, type: 'minecraft:chat', displayName }
|
||||
return { sender, contents, type: "minecraft:chat", displayName, chatType: data.chatType }
|
||||
}
|
||||
|
||||
function isSeparatorAt (children, start) {
|
||||
return (children[start]?.text === ':' || children[start]?.text === '\xa7f:') && children[start + 1]?.text === ' '
|
||||
}
|
||||
|
||||
module.exports = parseMessage
|
||||
module.exports = kaboom
|
||||
@@ -0,0 +1,31 @@
|
||||
function me (message, data) {
|
||||
try {
|
||||
if (message === null || typeof message !== "object") return;
|
||||
|
||||
if (message.with?.length > 2 || message.translate !== "chat.type.announcement") return;
|
||||
|
||||
const component = message.with[0];
|
||||
const contents = message.with[1];
|
||||
let sender;
|
||||
const hoverEvent = component.hover_event
|
||||
|
||||
if (hoverEvent?.action === "show_entity") {
|
||||
const name = hoverEvent.name;
|
||||
sender = data.players.find((player) => player.profile.name === name)
|
||||
}
|
||||
|
||||
if (!sender) return;
|
||||
|
||||
return {
|
||||
sender,
|
||||
contents,
|
||||
type: "minecraft:chat",
|
||||
component,
|
||||
chatType: data.chatType
|
||||
};
|
||||
} catch (e) {
|
||||
console.log(e.stack)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = me;
|
||||
@@ -0,0 +1,5 @@
|
||||
function say (message, data) {
|
||||
|
||||
}
|
||||
|
||||
module.exports = say;
|
||||
@@ -0,0 +1,37 @@
|
||||
function vanilla(message, data) {
|
||||
try {
|
||||
if (message === null || typeof message !== "object") return;
|
||||
|
||||
if (
|
||||
message.with?.length < 2 ||
|
||||
(message.translate !== "chat.type.text" && message.translate !== "%s %s")
|
||||
)
|
||||
return;
|
||||
const senderComponent = message.with[0];
|
||||
const contents = message.with[1];
|
||||
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;
|
||||
return {
|
||||
sender,
|
||||
contents,
|
||||
type: "minecraft:chat",
|
||||
senderComponent,
|
||||
chatType: data.chatType
|
||||
};
|
||||
} catch (e) {
|
||||
console.error(`${e.stack}`);
|
||||
}
|
||||
}
|
||||
module.exports = vanilla;
|
||||
@@ -0,0 +1,38 @@
|
||||
const CommandError = require('./CommandError');
|
||||
const translations = require('../data/translations.json');
|
||||
|
||||
class CommandArguments {
|
||||
static getInteger (integer) {
|
||||
if (isNaN(integer)) throw new CommandError({
|
||||
translate: "fnfboyfriendbot.arguments.invalid_integer",
|
||||
fallback: translations["fnfboyfriendbot.arguments.invalid_integer"],
|
||||
color: "red",
|
||||
with: [
|
||||
{ text: `${integer}` }
|
||||
]
|
||||
})
|
||||
else return String(Number(integer))
|
||||
}
|
||||
|
||||
static getJson (json) {
|
||||
|
||||
}
|
||||
|
||||
static getArguments () {
|
||||
|
||||
}
|
||||
|
||||
static getMaxArguments (commandArgs, args) {
|
||||
if (commandArgs < args) throw new CommandError({
|
||||
translate: "fnfboyfriendbot.arguments.max_exceeded",
|
||||
fallback: translations["fnfboyfriendbot.arguments.max_exceeded"],
|
||||
color: "red",
|
||||
with: [
|
||||
{ text: `${commandArgs}` },
|
||||
{ text: `${args}` }
|
||||
]
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = CommandArguments;
|
||||
@@ -0,0 +1,12 @@
|
||||
class CommandContext {
|
||||
constructor(name, aliases, description, trustLevel, usages, playerChatOnly) {
|
||||
this.data = {};
|
||||
this.data.name = name;
|
||||
this.data.aliases = aliases;
|
||||
this.data.description = description;
|
||||
this.data.trustLevel = trustLevel;
|
||||
this.data.usages = usages;
|
||||
this.data.playerChatOnly = playerChatOnly
|
||||
}
|
||||
}
|
||||
module.exports = CommandContext;
|
||||
@@ -0,0 +1,15 @@
|
||||
const ChatMessage = require("prismarine-chat")("1.21.8");
|
||||
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;
|
||||
@@ -0,0 +1,9 @@
|
||||
class CommandSource {
|
||||
constructor(player, sources, ChatType) {
|
||||
this.player = player;
|
||||
this.sources = sources;
|
||||
this.ChatType = ChatType;
|
||||
this.player.trustLevel = 0;
|
||||
}
|
||||
}
|
||||
module.exports = CommandSource;
|
||||
@@ -0,0 +1,10 @@
|
||||
class CommandTrustLevel {
|
||||
static public = 0;
|
||||
static trusted = 1;
|
||||
static admin = 2;
|
||||
static owner = 3;
|
||||
static console = 4;
|
||||
static disabled = 5;
|
||||
}
|
||||
|
||||
module.exports = CommandTrustLevel;
|
||||
@@ -0,0 +1,155 @@
|
||||
const CommandError = require("../../command_util/command_error");
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
|
||||
class CoresettingsCommand extends CommandContext {
|
||||
constructor() {
|
||||
super("coresettings", ["cbsettings"], "change the bots core settings", 2, [
|
||||
"useplacedcommandblock <on/off/true/false/enable/disable>",
|
||||
"area start <positions>",
|
||||
"area end <positions>",
|
||||
"refillmethod/rcmethod <item/chat>",
|
||||
]);
|
||||
}
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const config = context.config;
|
||||
const source = context.source;
|
||||
let component = [];
|
||||
|
||||
if (
|
||||
!args &&
|
||||
!args[0] &&
|
||||
!args[1] &&
|
||||
!args[2] &&
|
||||
!args[3] &&
|
||||
!args[4] &&
|
||||
!args[5]
|
||||
)
|
||||
return;
|
||||
switch (args[1]?.toLowerCase()) {
|
||||
case "useplacedcommandblock":
|
||||
switch (args[2]?.toLowerCase()) {
|
||||
case "on":
|
||||
case "true":
|
||||
case "enable":
|
||||
bot.core.usePlacedCommandBlock = true;
|
||||
component.push({
|
||||
text: "now using the placed command block",
|
||||
color: config.colors.commands.primary,
|
||||
});
|
||||
break;
|
||||
case "off":
|
||||
case "false":
|
||||
case "disable":
|
||||
bot.core.usePlacedCommandBlock = false;
|
||||
component.push({
|
||||
text: "no longer using the placed command block",
|
||||
color: config.colors.commands.primary,
|
||||
});
|
||||
break;
|
||||
default:
|
||||
if (bot.core.usePlacedCommandBlock) {
|
||||
component.push({
|
||||
text: "the bot is currently using the placed command block to run its commands",
|
||||
color: config.colors.commands.primary,
|
||||
});
|
||||
} else {
|
||||
component.push({
|
||||
text: "the bot is currently using its command block core to run its commands",
|
||||
color: config.colors.commands.primary,
|
||||
});
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "area":
|
||||
switch (args[2]?.toLowerCase()) {
|
||||
case "start":
|
||||
if (isNaN(args[3]) || isNaN(args[4]) || isNaN(args[5])) {
|
||||
bot.core.area.start = config.core.area.start;
|
||||
component.push({
|
||||
text: "arguments were NaN, defaulting to config core start coords",
|
||||
color: config.colors.commands.primary,
|
||||
});
|
||||
} else {
|
||||
bot.core.area.start = {
|
||||
x: Number(args[3]),
|
||||
y: Number(args[4]),
|
||||
z: Number(args[5]),
|
||||
};
|
||||
component.push({
|
||||
text: `setting core start pos to x: ${args[3]}, y: ${args[4]}, z: ${args[5]}`,
|
||||
color: config.colors.commands.primary,
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "end":
|
||||
if (isNaN(args[3]) || isNaN(args[4]) || isNaN(args[5])) {
|
||||
bot.core.area.end = config.core.area.end;
|
||||
throw new CommandError(
|
||||
"arguments were NaN, defaulting to config core end coords",
|
||||
);
|
||||
} else {
|
||||
bot.core.area.end = {
|
||||
x: Number(args[3]),
|
||||
y: Number(args[4]),
|
||||
z: Number(args[5]),
|
||||
};
|
||||
|
||||
component.push({
|
||||
text: `setting core end pos to x: ${args[3]}, y: ${args[4]}, z: ${args[5]}`,
|
||||
color: config.colors.commands.primary,
|
||||
});
|
||||
}
|
||||
break;
|
||||
default:
|
||||
component.push({
|
||||
text: `core start pos: x: ${bot.core.area.start.x}, y: ${bot.core.area.start.y}, z: ${bot.core.area.start.z}, and end pos: x: ${bot.core.area.end.x}, y: ${bot.core.area.end.y}, z: ${bot.core.area.end.z}`,
|
||||
color: config.colors.commands.primary,
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "refillmethod":
|
||||
case "rcmethod":
|
||||
switch (args[2]?.toLowerCase()) {
|
||||
case "item":
|
||||
config.core.itemRefill = true;
|
||||
component.push({
|
||||
text: "now refilling via item",
|
||||
color: config.colors.commands.primary,
|
||||
});
|
||||
break;
|
||||
case "chat":
|
||||
config.core.itemRefill = false;
|
||||
component.push({
|
||||
text: "now refilling via chat",
|
||||
color: config.colors.commands.primary,
|
||||
});
|
||||
break;
|
||||
default:
|
||||
if (config.core.itemRefill) {
|
||||
component.push({
|
||||
text: "currently filling core via item",
|
||||
color: config.colors.commands.primary,
|
||||
});
|
||||
} else {
|
||||
component.push({
|
||||
text: "currently filling core via chat",
|
||||
color: config.colors.commands.primary,
|
||||
});
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new CommandError("invalid argument");
|
||||
}
|
||||
|
||||
if (source.sources.console) {
|
||||
bot.console.info(bot.getMessageAsPrismarine(component)?.toAnsi());
|
||||
} else {
|
||||
bot.tellraw("@a", component);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = CoresettingsCommand;
|
||||
@@ -0,0 +1,37 @@
|
||||
const CommandError = require("../../command_util/command_error");
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
|
||||
class KickCommand extends CommandContext {
|
||||
constructor() {
|
||||
super("kick", [], "kick a player from the server", 2, [
|
||||
"invalidstring",
|
||||
"item",
|
||||
"te",
|
||||
]);
|
||||
}
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const config = context.config;
|
||||
|
||||
if (!args && !args[0] && !args[1] && !args[2]) return;
|
||||
switch (args[1]?.toLowerCase()) {
|
||||
case "invalidstring":
|
||||
bot.exploits.crashes.invalidString(args[2]);
|
||||
bot.tellraw("@a", `crashing ${args[2]}`);
|
||||
break;
|
||||
case "item":
|
||||
bot.exploits.kicks.item(args[2]);
|
||||
bot.tellraw("@a", `kicking ${args[2]}`);
|
||||
break;
|
||||
case "te":
|
||||
bot.exploits.kicks.translateEntity(args[2]);
|
||||
bot.tellraw("@a", `kicking ${args[2]}`);
|
||||
break;
|
||||
default:
|
||||
throw new CommandError("invalid argument");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = KickCommand;
|
||||
@@ -0,0 +1,13 @@
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
|
||||
class ReconnectCommand extends CommandContext {
|
||||
constructor() {
|
||||
super("reconnect", ["end"], "reconnects the bot", 2, [""]);
|
||||
}
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
bot._client.end();
|
||||
bot.chat.message("reconnecting");
|
||||
}
|
||||
}
|
||||
module.exports = ReconnectCommand;
|
||||
@@ -0,0 +1,118 @@
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
const CommandError = require("../../command_util/command_error");
|
||||
|
||||
class ConsoleCommand extends CommandContext {
|
||||
constructor() {
|
||||
super("console", ["c"], "runs commands made for the bots console", 4, [
|
||||
"server/srv <all/servername>",
|
||||
"customchat <on/true/enable/off/false/disable>",
|
||||
"say <message>",
|
||||
"validate/validation/val <owner/o/admin/a/trusted/t>",
|
||||
"logging/togglelogging/logtoconsole <on/true/enable/off/false/disable>",
|
||||
]);
|
||||
}
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const source = context.source;
|
||||
const config = context.config;
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return;
|
||||
switch (args[0]?.toLowerCase()) {
|
||||
case "server":
|
||||
case "svr":
|
||||
const servers = bot.bots.map((eachBot) => eachBot.options.serverName);
|
||||
for (const eachBot of bot.bots) {
|
||||
if (args.slice(1).join(" ").toLowerCase() === "all") {
|
||||
eachBot.console.server = "all";
|
||||
bot.console.info("Set the console server to all");
|
||||
continue;
|
||||
}
|
||||
const server = servers.find((server) =>
|
||||
server.toLowerCase().includes(args[1]),
|
||||
);
|
||||
if (!server) {
|
||||
bot.console.info("Invalid server");
|
||||
return;
|
||||
}
|
||||
bot.console.info(`Set the console server to ` + server);
|
||||
eachBot.console.server = server;
|
||||
}
|
||||
break;
|
||||
case "say":
|
||||
bot.chat.send(args.slice(1).join(" "));
|
||||
break;
|
||||
case "validate":
|
||||
case "validation":
|
||||
case "val":
|
||||
switch (args[1]?.toLowerCase()) {
|
||||
case "owner":
|
||||
case "o":
|
||||
bot.chat.message(
|
||||
`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.owner} ${args.slice(3).join(" ")}`,
|
||||
);
|
||||
break;
|
||||
case "admin":
|
||||
case "a":
|
||||
bot.chat.message(
|
||||
`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.admin} ${args.slice(3).join(" ")}`,
|
||||
);
|
||||
break;
|
||||
case "trusted":
|
||||
case "t":
|
||||
bot.chat.message(
|
||||
`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.trusted} ${args.slice(3).join(" ")}`,
|
||||
);
|
||||
break;
|
||||
default:
|
||||
throw new CommandError({
|
||||
translate: "command.unknown.argument",
|
||||
color: "dark_red",
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "logging":
|
||||
case "togglelogging":
|
||||
case "logtoconsole":
|
||||
switch (args[1]?.toLowerCase()) {
|
||||
case "on":
|
||||
case "enable":
|
||||
case "enabled":
|
||||
case "true":
|
||||
if (bot.options.logging === true) {
|
||||
bot.console.info(
|
||||
`logging for ${bot.options.serverName} is already enabled!`,
|
||||
);
|
||||
} else {
|
||||
bot.console.info(
|
||||
`logging for ${bot.options.serverName} is now enabled`,
|
||||
);
|
||||
bot.options.logging = true;
|
||||
}
|
||||
break;
|
||||
case "off":
|
||||
case "disable":
|
||||
case "disabled":
|
||||
case "false":
|
||||
if (bot.options.logging === false) {
|
||||
bot.console.info(
|
||||
`logging for ${bot.options.serverName} is already disabled!`,
|
||||
);
|
||||
} else {
|
||||
bot.console.info(
|
||||
`logging for ${bot.options.serverName} is now disabled`,
|
||||
);
|
||||
bot.options.logging = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new CommandError({
|
||||
translate: "command.unknown.argument",
|
||||
color: "dark_red",
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ConsoleCommand;
|
||||
@@ -0,0 +1,12 @@
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
|
||||
class KillCommand extends CommandContext {
|
||||
constructor() {
|
||||
super("kill", ["suicide", "quit"], "kill the bots process", 3, [""]);
|
||||
}
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
module.exports = KillCommand;
|
||||
@@ -0,0 +1,42 @@
|
||||
const CommandError = require("../../command_util/command_error");
|
||||
const { stylize } = require("../../util/stylizeEval");
|
||||
const util = require("util");
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
|
||||
class ServerevalCommand extends CommandContext {
|
||||
constructor() {
|
||||
super("servereval", ["se"], "run code unisolated", 4, ["<code>"]);
|
||||
}
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const source = context.source;
|
||||
const config = context.config;
|
||||
const discordClient = context.discordClient;
|
||||
const args = context.arguments;
|
||||
const script = args.slice(1).join(" ");
|
||||
const { MessageBuilder } = require("prismarine-chat")(bot.options.version);
|
||||
try {
|
||||
if (source.sources.console) {
|
||||
bot.console.log(
|
||||
bot
|
||||
.getMessageAsPrismarine({
|
||||
text: util.inspect(eval(args.join(" ")), { stylize }),
|
||||
})
|
||||
?.toAnsi(),
|
||||
);
|
||||
} else if (bot.options.mode === "savageFriends") {
|
||||
bot.core.run(
|
||||
`minecraft:tellraw @a ${JSON.stringify(util.inspect(eval(script), { stylize }).substring(0, 32700))}`,
|
||||
);
|
||||
} else {
|
||||
bot.tellraw(`@a[name="${source.player.profile.name}"]`, {
|
||||
text: `${util.inspect(eval(script), { stylize }).substring(0, 32700)}`,
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
throw new CommandError(e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ServerevalCommand;
|
||||
@@ -0,0 +1,36 @@
|
||||
const sleep = require("../../util/sleep");
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
|
||||
class core extends CommandContext {
|
||||
constructor() {
|
||||
super("core", ["cb", "cbrun", "corerun"], "run commands in core", 0, [
|
||||
"$username <message>",
|
||||
"$uuid <message>",
|
||||
"<message>",
|
||||
]);
|
||||
}
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const source = context.source;
|
||||
|
||||
if (args.includes("$username") || args.includes("$uuid")) {
|
||||
bot.players.forEach((eachPlayer) => {
|
||||
bot.core.runTracked(
|
||||
args
|
||||
.join(" ")
|
||||
.replaceAll("$username", eachPlayer.profile.name)
|
||||
.replaceAll("$uuid", eachPlayer.uuid),
|
||||
source,
|
||||
);
|
||||
// await sleep(1000)
|
||||
});
|
||||
} else if (bot.options.mode === "savageFriends") {
|
||||
bot.core.run(args.join(" "));
|
||||
} else {
|
||||
bot.core.runTracked(args.join(" "), source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = core;
|
||||
@@ -0,0 +1,18 @@
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
|
||||
class EchoCommand extends CommandContext {
|
||||
constructor() {
|
||||
super("echo", ["say", "botsay"], "make me say something!", 0, [
|
||||
"<message>",
|
||||
]);
|
||||
}
|
||||
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
|
||||
bot.chat.send(`${args.join(" ")}`);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = EchoCommand;
|
||||
@@ -0,0 +1,446 @@
|
||||
const fixansi = require("../../util/ansi");
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
|
||||
class HelpCommand extends CommandContext {
|
||||
constructor() {
|
||||
super(
|
||||
"help",
|
||||
["heko", "?", "cmds", "commands", "hell"],
|
||||
"see a list of commands",
|
||||
0,
|
||||
["<command>"],
|
||||
);
|
||||
}
|
||||
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const config = context.config;
|
||||
const source = context.source;
|
||||
|
||||
let component = [];
|
||||
let infoComponent = [];
|
||||
let usagesComponent = [];
|
||||
let Public = [];
|
||||
let trusted = [];
|
||||
let admin = [];
|
||||
let owner = [];
|
||||
let Console = [];
|
||||
|
||||
let cat = {
|
||||
translate: "(%s | %s | %s | %s)",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: "Public", color: config.colors.help.public },
|
||||
{ text: "Trusted", color: config.colors.help.trusted },
|
||||
{ text: "Admin", color: config.colors.help.admin },
|
||||
{ text: "Owner", color: config.colors.help.owner },
|
||||
],
|
||||
};
|
||||
|
||||
component.push({
|
||||
translate: "%s: (%s) %s \u203a\n",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: "Commands", color: config.colors.commands.secondary },
|
||||
{
|
||||
text: `${bot.commandManager.commandlist.length}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
cat,
|
||||
],
|
||||
});
|
||||
for (const commands of bot.commandManager.commandlist) {
|
||||
switch (commands.data.trustLevel) {
|
||||
case 0:
|
||||
Public.push({
|
||||
text: commands.data.name + " ",
|
||||
color: config.colors.help.public,
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
translate: "%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
text: "Command Name",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.name}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
text: "Trust Level",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.trustLevel}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{
|
||||
text: "Description",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.description}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Aliases", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.aliases}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Usages", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.usages}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "suggest_command",
|
||||
value: `${config.prefixes[0]}${commands.data.name}`,
|
||||
},
|
||||
});
|
||||
break;
|
||||
case 1:
|
||||
trusted.push({
|
||||
text: commands.data.name + " ",
|
||||
color: config.colors.help.trusted,
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
translate: "%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
text: "Command Name",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.name}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
text: "Trust Level",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.trustLevel}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{
|
||||
text: "Description",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.description}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Aliases", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.aliases}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Usages", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.usages}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "suggest_command",
|
||||
value: `${config.prefixes[0]}${commands.data.name}`,
|
||||
},
|
||||
});
|
||||
break;
|
||||
case 2:
|
||||
admin.push({
|
||||
text: commands.data.name + " ",
|
||||
color: config.colors.help.admin,
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
translate: "%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
text: "Command Name",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.name}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
text: "Trust Level",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.trustLevel}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{
|
||||
text: "Description",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.description}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Aliases", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.aliases}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Usages", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.usages}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "suggest_command",
|
||||
value: `${config.prefixes[0]}${commands.data.name}`,
|
||||
},
|
||||
});
|
||||
break;
|
||||
case 3:
|
||||
owner.push({
|
||||
text: commands.data.name + " ",
|
||||
color: config.colors.help.owner,
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
translate: "%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
text: "Command Name",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.name}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
text: "Trust Level",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.trustLevel}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{
|
||||
text: "Description",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.description}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Aliases", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.aliases}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Usages", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.usages}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "suggest_command",
|
||||
value: `${config.prefixes[0]}${commands.data.name}`,
|
||||
},
|
||||
});
|
||||
break;
|
||||
case 4:
|
||||
Console.push({
|
||||
text: commands.data.name + " ",
|
||||
color: config.colors.help.console,
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
translate: "%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
text: "Command Name",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.name}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
text: "Trust Level",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.trustLevel}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{
|
||||
text: "Description",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.description}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Aliases", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.aliases}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Usages", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.usages}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "suggest_command",
|
||||
value: `${config.prefixes[0]}${commands.data.name}`,
|
||||
},
|
||||
});
|
||||
break;
|
||||
default:
|
||||
bot.chat.message(
|
||||
`fuck you ${commands.data.name} has a invalid trust level`,
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
args[0]?.toLowerCase() === commands.data.name?.toLowerCase() ||
|
||||
commands.data.aliases.find(
|
||||
(e) => e?.toLowerCase() === args[0]?.toLowerCase(),
|
||||
)
|
||||
) {
|
||||
for (const usages of commands.data.usages) {
|
||||
usagesComponent.push({
|
||||
translate: "%s%s %s",
|
||||
with: [
|
||||
{
|
||||
text: `${config.prefixes[0]}`,
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.name}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: `${usages}`, color: config.colors.commands.secondary },
|
||||
],
|
||||
});
|
||||
|
||||
usagesComponent.push("\n");
|
||||
}
|
||||
|
||||
usagesComponent.pop();
|
||||
|
||||
infoComponent.push({
|
||||
translate: "%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s:\n",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: "Name", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.name}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Aliases", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.aliases.toString().replaceAll(",", " ")}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Description", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.description}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Trust Level", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.trustLevel}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{ text: "Usages", color: config.colors.commands.primary },
|
||||
],
|
||||
});
|
||||
|
||||
infoComponent.push(usagesComponent);
|
||||
|
||||
if (source?.sources.console) {
|
||||
bot.console.info(bot.getMessageAsPrismarine(infoComponent)?.toAnsi());
|
||||
} else if (source.sources.discord) {
|
||||
bot.discord.message.reply(
|
||||
`\`\`\`ansi\n${fixansi(bot.getMessageAsPrismarine(infoComponent)?.toAnsi())}\`\`\``,
|
||||
);
|
||||
} else {
|
||||
bot.tellraw(`@a`, infoComponent);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (Public.length > 0) {
|
||||
component.push(Public);
|
||||
if (trusted.length > 0) component.push("\n");
|
||||
}
|
||||
|
||||
if (trusted.length > 0) {
|
||||
component.push(trusted);
|
||||
if (admin.length > 0) component.push("\n");
|
||||
}
|
||||
|
||||
if (admin.length > 0) {
|
||||
component.push(admin);
|
||||
if (owner.length > 0) component.push("\n");
|
||||
}
|
||||
|
||||
if (owner.length > 0) {
|
||||
component.push(owner);
|
||||
}
|
||||
|
||||
if (source.sources.console && Console.length > 0) {
|
||||
component.push(Console);
|
||||
}
|
||||
|
||||
if (source?.sources?.console) {
|
||||
bot.console.info(bot.getMessageAsPrismarine(component)?.toAnsi());
|
||||
} else if (source.sources.discord) {
|
||||
bot.discord.message.reply(
|
||||
`\`\`\`ansi\n${fixansi(bot.getMessageAsPrismarine(component)?.toAnsi())}\`\`\``,
|
||||
);
|
||||
} else {
|
||||
bot.tellraw("@a", component);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = HelpCommand;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user