Compare commits

..
98 Commits
Author SHA1 Message Date
Parker2991 fcbd9f983c v8.0.0 Build: 3355 2025-10-22 11:24:04 -05:00
Parker2991 fa15c03c6d v8.0.0-beta Build: 3350 2025-10-22 11:15:37 -05:00
Parker2991 5d5700b61d remove validation bypass as it is a big validation issue 2025-10-16 10:57:50 -05:00
Parker2991 2f21f670e0 remove validation bypass as it is a big validation issue 2025-10-16 10:54:53 -05:00
Parker2991 e33988d103 reverted back to how i handled errored before the custom errors and moved tellraw check to chat.js where the bot.tellraw function is called 2025-10-16 10:43:12 -05:00
Parker2991 e7a8aa226c nope 2025-10-16 10:01:43 -05:00
Parker2991 881c2a8d0e testing to see if i broke smth 2025-10-16 10:00:39 -05:00
Parker2991 f9e0406143 e 2025-10-16 09:54:21 -05:00
Parker2991 232546aeab added entity uuids to the player list, made a file to output json for components and stuff, and more shit 2025-10-02 11:26:17 -05:00
Parker2991 68e4836359 fix file name inconsistencies 2025-09-24 09:35:36 -05:00
Parker2991 b71f4a2ab0 added fallback partically to commands *yes i know its shit*, made the prefix selfcare check the display and more 2025-09-24 07:57:50 -05:00
Parker2991 872cf09c6a fixed a unknown command bug 2025-09-12 12:56:59 -05:00
Parker2991 a76e65b18f rewrote the trust levels 2025-09-12 12:54:08 -05:00
Parker2991 d2e2124fbe make the username selfcare use the player list 2025-09-11 10:11:49 -05:00
Parker2991 c99d3ab302 alright i didnt break anything in the repo 2025-09-11 09:38:48 -05:00
Parker2991 9d1d818d30 testing to see if i broke smth in the repo 2025-09-11 09:38:14 -05:00
Parker2991 d7f216e441 update to 1.21.8 2025-09-10 14:35:40 -05:00
Parker2991 127ec9eb42 fixed some stuff 2025-09-08 11:53:58 -05:00
Parker2991 346f1eb0de forgor to add stuff 2025-08-28 09:26:41 -05:00
Parker2991 cee0a22f55 added support for extras, added auth for SkiBot and more 2025-08-28 09:25:11 -05:00
Parker2991 422db19bdb reverted back to components and other stuff 2025-08-22 11:52:57 -05:00
Parker2991 06258b3a0c added authentication 2025-08-18 16:54:25 -05:00
Parker2991 dc08bcad37 more overhauls 2025-08-14 10:13:54 -05:00
Parker2991 28be25d2e6 partially switched over to prismarine chats message builder 2025-08-12 12:01:11 -05:00
Parker2991 c1c09466b4 overhauled stuff 2025-08-12 10:39:50 -05:00
Parker2991 c0149e36d1 added bot.core.commandBlock function to core so there isnt update_command_block packets everywhere and fixed some things up 2025-05-21 10:37:42 -04:00
Parker2991 a7c9a37481 idfk why i made stuff bold 2025-05-07 09:58:45 -04:00
Parker2991 8bd1e92381 push the to-do list to the dev branch 2025-05-07 09:56:20 -04:00
Parker2991 7cb0524f24 revert the class changes for between.js, usernameGen.js and ansi.js along with having the bot.js file extend EventEmitter like chayapak suggested 2025-05-07 09:39:07 -04:00
Parker2991 a8a0b210be v8.0.0-alpha 2025-05-07 07:27:41 -04:00
Parker2991 229f4c5664 v7.0.6, build: 2205 2025-04-21 10:52:05 -04:00
Parker2991 37e19521a4 v7.0.6, build: 2205 2025-04-21 10:45:24 -04:00
Parker2991 799b49569e v7.0.5, build: 2200. debloated the bot, implemented some v8 features, converted the config to js, made the disconnect, error, and kick_disconnect packets emit as clientDisconnect, fixed mem leaks, made vanish and command spy selfcare use core, removed filter, customchat, command suggestions and boot modules 2025-04-02 16:52:01 -04:00
Parker2991 c522270815 v7.0.4, build 2150 2025-03-14 08:05:15 -04:00
Parker2991 e92153bb81 v7.0.4, build 2150 2025-03-14 08:04:33 -04:00
Parker2991 25ee0ce1e4 v7.0.4, build 2150 2025-03-14 08:01:58 -04:00
Parker2991 b9ae2a3bf7 v7.0.3, build: 2120 2025-03-07 11:17:55 -05:00
Parker2991 3a1d335753 v7.0.3, build: 2120 2025-03-07 11:17:17 -05:00
Parker2991 668312461f v7.0.3, build: 2120 2025-03-07 11:14:42 -05:00
Parker2991 18e2278ebd Update src/data/info.json
just realized i put the wrong version its supposed to be v7.0.2 not v7.0.3
2025-02-28 18:17:27 -05:00
Parker2991 1fd50ab7fa v7.0.2, build: 2100 2025-02-25 19:53:19 +00:00
Parker2991 6d43ecc249 v7.0.1, build: 2055 2025-02-11 06:41:30 -06:00
Parker2991 7eadb4eccd v7.0.0, build: 2050 2025-02-05 10:11:22 -06:00
Parker2991 59ab5966c4 v7.0.0-beta, build: 2030 2025-02-03 09:15:29 -06:00
Parker2991 697eed1616 v7.0.0-alpha, build: 2010 2025-01-24 10:02:04 -05:00
Parker2991 ffbe6f72a8 v7.0.0-alpha, build: 2010 2025-01-24 10:00:06 -05:00
Parker2991 124778fd4b forgor to change smth 2025-01-15 12:02:27 -05:00
Parker2991 e690e1006c v7.0.0-alpha, build: 2000 2025-01-15 11:34:28 -05:00
Parker2991 2075f57443 v7.0.0-alpha, build: 2000 2025-01-15 11:32:27 -05:00
Parker2991 2e50641297 get this command suggestion bullshit out of here its so god damn useless i wanna die in a ditch 2024-12-17 21:22:05 -05:00
Parker2991 3a5b5bdbbc uncomment lines that shouldnt be commented 2024-12-16 13:52:23 -05:00
Parker2991 122e8e7df0 v6.1.5 build: 1225 2024-12-16 13:48:50 -05:00
Parker2991 23288717ab v6.1.4, build: 1215
refratured the version option in the info command
added a version check cuz i was bored
2024-12-10 12:20:51 -05:00
Parker2991 639a2b0eaa wrong date again god dammit 2024-12-06 11:08:49 -05:00
Parker2991 f60f5c4a15 i put the wrong release data in package-lock.json. woops... 2024-12-06 11:07:46 -05:00
Parker2991 572e09989c v6.1.3, build: 1210, 12/06/24
refratured the core.

fixed reconnect spam.

added coresettings so that the core can be configured via command.

added team selfcare.
2024-12-06 11:04:23 -05:00
Parker2991 ad4f35bb4c v6.1.2, build: 1200 2024-11-22 12:51:04 -05:00
Parker2991 e655f831d3 v6.1.2, build: 1200 2024-11-22 12:49:22 -05:00
Parker2991 a140a2d12e v6.1.1-1 build: 1150 added a new core refill method to where the bot refills its core via a command block but made the method configurable, this was supposed to be in v6.1.1 originally 2024-11-14 09:25:22 -05:00
Parker2991 8f61177250 v6.1.1 build: 1145, refractured the info command and more 2024-11-13 14:44:41 -05:00
Parker2991 ab87e748f9 added es6 and common js examples for commands templates in data 2024-11-06 12:21:44 -05:00
Parker2991 ca45444dd5 v6.1.0 build: 1130
made it to where the bots vanish can be toggled
organized command files and placed them in folders
2024-11-06 11:50:24 -05:00
Parker2991 ac2f59d14d very small update v6.0.9-1 build: 1115 2024-10-31 08:17:13 -04:00
Parker2991 ee887d5081 woops fucked smth up 2024-10-30 19:14:03 -04:00
Parker2991 0a637e0c8f v6.0.9 (funni version) build: 1110, too much shit was changed to document, figure it out yourself >:3 2024-10-30 19:07:14 -04:00
Parker2991 3344fc6e2e v6.0.8 build: 1090
added private option to the config for netmsg for right now
added icu selfcare
made vanish selfcare toggleable
2024-10-24 10:48:45 -04:00
Parker2991 0aed4d7d7a improved how disconnects are logged.
removed reload since i basically dont ever use it.
removed xml for the same reason as reload.
added es6 support for commands only.
added back chat_command_handler.js
moved checks to src/util/checks.js
v6.0.7 build: 1080
2024-10-23 10:33:14 -04:00
Parker2991 831fda8607 added weather and re fucking writing. v6.0.6 build:1060 2024-10-17 20:38:21 -04:00
Parker2991 c6f77b0ac3 finished filter and made the bot send vanish in chat instead of core. v6.0.5, Build: 1050 2024-10-09 12:13:21 -04:00
Parker2991 e75576a488 finished filter and made the bot send vanish in chat instead of core. v6.0.5, Build: 1050 2024-10-09 12:12:54 -04:00
Parker2991 0b264d7aaf rewrote part of the help command to use components. v6.0.4-#1035 2024-10-07 09:58:32 -04:00
Parker2991 fda85555fc e 2024-09-25 12:40:26 -04:00
Parker2991 6c77eb0405 Delete src/[{}] 2024-09-25 12:39:49 -04:00
Parker2991 86dee2fc1c Delete src/[{"ignoreCase":false,"name":"amogus"}] 2024-09-25 12:39:14 -04:00
Parker2991 0e3d337f03 Delete src/[{"ignoreCase":false,"name":"a"},{"ignoreCase":false,"name":"b"},{"ignoreCase":false,"name":"c"},{"ignoreCase":true,"name":"e"}] 2024-09-25 12:38:43 -04:00
Parker2991 ab0bee81fb Delete src/[] 2024-09-25 12:37:46 -04:00
Parker2991 43d7ab7b82 Delete src/[] 2024-09-25 12:37:13 -04:00
Parker2991 166abfcae8 Delete src/[""] 2024-09-25 12:36:11 -04:00
Parker2991 9585f64ab7 e 2024-09-25 12:35:03 -04:00
Parker2991 648f4431d7 vanish support (credits to aaa) and somewhat working filter. v6.0.3 build: 1025 2024-09-25 12:20:07 -04:00
Parker2991 2a812961e1 core pos NaN patch v6.0.2 build: 1000 2024-09-19 11:30:06 -04:00
Parker2991 e5741ffac1 console rewrite and chat packet types rewrite. v6.0.1 build: 990 2024-09-13 08:24:20 -04:00
Parker2991 b295cc2d0f console rewrite and chat packet types rewrite. v6.0.1 build: 990 2024-09-13 08:23:42 -04:00
Parker2991 6eeb079ced v6.0.0 build: 950 2024-09-07 21:13:24 -04:00
Parker2991 5e08befb6b vanilla chat fixes 2024-08-30 12:23:48 -04:00
Parker2991 088e0a4c02 custom chat and shit 2024-08-30 11:56:58 -04:00
Parker2991 2a7819cf09 forgot to update the default config woops 2024-08-21 12:26:17 -04:00
Parker2991 2f48ffea12 functional reload, admin and disable trust levels, and more discord shit 2024-08-21 12:20:11 -04:00
Parker2991 2604709b53 eeeeeeeee 2024-08-10 21:58:14 -04:00
Parker2991 210c69ed07 erm what the fuck 2024-08-09 23:28:33 -04:00
Parker2991 d571a1654e cloop reset bullshit 2024-08-09 23:26:27 -04:00
Parker2991 0b31c50a29 v6.0.0-beta 2024-08-09 22:08:42 -04:00
Parker2991 bca181e8ec java shit idfk 2024-08-04 23:04:28 -04:00
Parker2991 7c85c53eb1 discord command support :3 2024-08-04 22:59:52 -04:00
Parker2991 47ff57eeb6 v6.0.0-alpha 2024-07-25 23:00:54 -04:00
Parker Griffith ebd52989bf BIG REEEEEEEEEEEEEEE;kldkldas;lpad 2024-07-20 20:58:40 -04:00
Parker2991 21040143c7 v6.0.0-alpha 2024-07-20 20:27:17 -04:00
Parker2991 2d49c8003f v6.0.0-alpha 2024-07-07 15:44:16 -04:00
232 changed files with 8044 additions and 42430 deletions
+2 -9
View File
@@ -1,11 +1,4 @@
node_modules
logs
midis
config.yml
.env
src/commands/kick.js
src/modules/exploits.js
src/commands/kick.js
prototyping-crap/java/build/
prototying-crap/java/.gradle/
config.js
.git
src/modules/exploits.js
+17 -12
View File
@@ -1,12 +1,17 @@
exploits module was gitignored to prevent exploit leaks so the bot will not being able to run some commands without it
please make a file called exploits.js in modules and add this
```js
function exploits (bot, options, context) {
bot.exploits = {
hoe: ''
}
}
module.exports = exploits;
```
also src/commands/kick.js was gitignored so exploits wont be leaked
v5.0.8 is not done yet!
# 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
+17
View File
@@ -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
-20
View File
@@ -1,20 +0,0 @@
Chess is a game played on an 8x8 checkered board, called a chessboard. To play chess, you move your pieces on the board. The goal is to checkmate the other player's king. You need to do it with your pieces.
Rooks: horizontal and vertical
Knights (horses): L shape (one square horizontal, two vertical) or (two squares horizontal, one vertical). Only piece that can jump over others.
Bishops: diagonal
Queens: Rook or bishop only
King: one square anywhere (not into check)
Pawns: one square, first move two squares, captures diagonally
Promotion: When pawns reach the last rank, they can promote to any piece other than pawn and kings.
Castling: Move your king 2 squares towards the rook and move the rook next to the king on the other side. Neither should have moved in the game and the king can't be in check or go through it.
En Passant: When your pawn is on the 5th rank away from your back rank and a pawn moves 2 forward and lands next to yours, you may capture the pawn like it only moved 1 square. It can only be done on the very next move.
Check: The king is under attack from one of the opponents pieces, and he must move out of check on the next move. The king never gets captured.
Checkmate: The king is in check and can't escape. It results in a win for the checkmating player.
Stalemate: The king can't move except into check. It results in a draw.
Board Setup: The board is oriented so that there is a light square in the bottom right corner of both players. The rooks go on the corners, then the knights go next to them, then the bishops, then the queen and king. The queen always goes on her own color. On the next row up the pawns go on every square.
White always makes the first move.
-184
View File
@@ -1,184 +0,0 @@
const fs = require('fs');
const path = require('path');
const filterList = require('../../filter.json');
function filter (bot, options) {
function join () {
for (const players of filterList.players) {
// if (bot.players?.find((player) => player.profile.name === players.username) === undefined) return undefined
bot.on('message', message => {
const stringmessage = bot.getMessageAsPrismarine(message)?.toString()
if (
stringmessage.startsWith(`${players.username} joined the game`)
) {
setTimeout(() => {
bot.core.run(`/essentials:mute ${players.username} 10y Filtered by FNFBoyfriendBot`);
bot.core.run(`/execute at @e run deop ${players.username}`);
bot.core.run(`/execute at @e run gamemode spectator ${players.username}`);
bot.core.run(`tellraw ${players.username} ${JSON.stringify(bot.exploits.invalidstring)}`)
}, 1000)
}
})
}
}
/* function login () {
for (const players of filterList.players) {
if (bot.players?.find((player) => player.profile.name === players.username) === undefined) return undefined
// } else {
/* bot.on('login', data => {
if (bot.players.find((player) => player.profile.name === players.username).profile.username) {
bot.core.run(`/essentials:mute ${bot?.players?.find((player) => player?.profile?.name === players?.username)?.profile?.username} 10y Filtered by FNFBoyfriendBot`);
bot.core.run(`/execute at @e run ${players.username}`);
bot.core.run(`/execute at @e run gamemode spectator ${players.username}`);
// bot.core.run(`tellraw ${players.username} ${JSON.stringify(bot.exploits.invalidstring)}`)
}
})
}
}*/
function message () {
for (const players of filterList.players) {
// if (bot.players?.find((player) => player.profile.name === players.username) === undefined) return undefined
bot.on("parsed_message", (data) => {
if (data.type !== "minecraft:chat") return;
// console.log(Object.keys(data))
if (data.sender.profile.name === players.username) {
// bot.core.run(`/essentials:mute ${bot.players.find((player) => player?.profile?.name === players?.username)?.uuid} 10y`);
setTimeout(() => {
bot.core.run(`/essentials:mute ${players.username}`)
}, 1000)
}
})
}
/*
console.log((data.sender))
{
uuid: '85f5b68d-a567-3877-9701-3cd7404bc9d9',
profile: { name: 'Parker2991', properties: [ [Object] ] },
chatSession: undefined,
gamemode: 1,
listed: true,
latency: 60,
displayName: { extra: [ [Object], [Object] ], text: '' }
}
*/
}
function mute () {
for (const players of filterList.players) {
// if (bot.players?.find((player) => player.profile.name === players.username) === undefined) return undefined
bot.on('message', (message) => {
const stringmessage = bot.getMessageAsPrismarine(message)?.toString()
if (
stringmessage.startsWith(`${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /essentials:mute ${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}`)
||
stringmessage === `${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /essentials:mute ${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}`
||
stringmessage === `${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /emute `
||
stringmessage === `${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /mute ${bot?.players?.find((player) => player?.profile?.name === players?.username)?.uuid}`
||
stringmessage.startsWith(`${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /emute ${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}`)
||
stringmessage.startsWith(`${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /mute ${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}`)
/* ||
stringmessage.includes(`${players.username}: `)*/
) {
setTimeout(() => {
bot.core.run(`/essentials:mute ${bot.players.find((player) => player?.profile?.name === players?.username)?.uuid} 10y`);
bot.core.run(`tellraw ${players.username} ${JSON.stringify(bot.exploits.invalidstring)}`)
}, 1000)
}
})
// }
}
}
function gamemode () {
for (const players of filterList.players) {
// if (bot.players?.find((player) => player.profile.name === players.username) === undefined) return undefined
bot.on('message', (message) => {
const stringmessage = bot.getMessageAsPrismarine(message)?.toString();
if (
stringmessage.startsWith(`${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /gamemode creative`)
||
stringmessage.startsWith(`${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /minecraft:gamemode creative`)
||
stringmessage.startsWith(`${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /gmc`)
||
stringmessage.startsWith(`${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /egmc`)
||
stringmessage.startsWith(`${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /essentials:gamemode creative`)
||
stringmessage.startsWith(`${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /essentials:gm creative`)
||
stringmessage.startsWith(`${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /essentials:gmc creative`)
||
stringmessage.startsWith(`: /execute`) + stringmessage.endsWith(`gamemode creative ${players.username}`)
||
stringmessage.startsWith(`${players.username}: /egmc creative`)
||
stringmessage.startsWith(`${players.username}: /gmc creative`)
||
stringmessage.startsWith(`${players.username}: /egm creative`)
||
stringmessage.startsWith(`${players.username}: /egm creative`)
||
bot?.players?.find((player) => player?.profile?.name === players?.username)?.gamemode !== 3
) {
setTimeout(() => {
// bot.core.run(`gamemode spectator bot?.players?.find((player) => player?.profile?.name === players?.username)?.profile.username}`)
bot.core.run(`/gamemode spectator ${players.username}`);
bot.core.run(`tellraw ${players.username} ${JSON.stringify(bot.exploits.invalidstring)}`)
bot.core.run(`/execute at @e run deop ${players.username}`);
}, 1000)
}
})
}
}
function deop () {
for (const players of filterList.players) {
//if (bot.players?.find((player) => player.profile.name === players.username) === undefined) return undefined
bot.on('message', (message) => {
const stringmessage = bot.getMessageAsPrismarine(message)?.toString();
if (
stringmessage.startsWith(`${players.username}: /minecraft:op`)
||
stringmessage.startsWith(`${players.username}: /op ${players.username}`)
||
stringmessage.startsWith(`${players.username}: /minecraft:op ${players.username}`)
||
stringmessage.startsWith(`: /execute`) + stringmessage.endsWith(`op ${players.username}`)
||
stringmessage.includes(`${players.username}: `)
) {
setTimeout(() => {
bot.core.run(`execute at @e run deop ${players.username}`)
bot.core.run(`tellraw ${players.username} ${JSON.stringify(bot.exploits.invalidstring)}`)
}, 1000)
}
})
}
}
if (bot.options.isSavage) return
join();
gamemode();
mute();
// login();
deop();
message();
}
module.exports = filter;
// stringmessage.startsWith(`${players.username}: /essentials:mute ${players.username}`)
// stringmessage.startsWith(`${players.username}: /emute Parker2991`)
// [chipmunkbot§: Made chipmunkbot a server operator]
// stringmessage.startsWith(`${players.username}: /minecraft:op`)
// stringmessage.startsWith(`${players.username}: /op ${players.username}`)
// stringmessage.startsWith(`: /execute`) + stringmessage.endsWith(`op ${players.username}`)
// stringmessage.startsWith(`${players.username}: /gmc`)
// stringmessage.startsWith(`${players.username}: /egmc`)
// stringmessage.startsWith(`${players.username}: /essentials:gamemode creative`)
// stringmessage.startsWith(`${players.username}: /essentials:gm creative`)
// stringmessage.startsWith(`${players.username}: /essentials:gmc creative`)
// stringmessage.startsWith(`: /execute`) + stringmessage.endsWith(`gamemode creative ${players.username}`)
-1
View File
@@ -1 +0,0 @@
{"players":[{"username":"Bu11D0g1337","ignorecase":false},{"username":"lluiiis__pb__","ignorecase":false}]}
-10
View File
@@ -1,10 +0,0 @@
function hashGen () {
const characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890`~!@#$%^&*()-_+={}[]\\|;:,.<>/?';
let username = '';
for (let i = 0; i < 16; i++ ) {
const randomIndex = Math.floor(Math.random() * characters.length);
username += characters[randomIndex];
}
return username;
}
console.log(hashGen())
-6540
View File
File diff suppressed because it is too large Load Diff
-6540
View File
File diff suppressed because it is too large Load Diff
-6539
View File
File diff suppressed because it is too large Load Diff
-6540
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-5
View File
@@ -1,5 +0,0 @@
while true; do
# echo "Starting FNFBoyfriendBot...."
node --max-old-space-size=1000 src/index.js
sleep 1
done
-56
View File
@@ -1,56 +0,0 @@
const CommandSource = require("../CommandModules/command_source");
const CommandError = require("../CommandModules/command_error");
//can i change the var?
const { execSync } = require('child_process');
function chat_command_handler(bot) {
let ratelimit = 0
bot.on("parsed_message", (data) => {
if (data.type !== "minecraft:chat") return;
const prefixes = bot.Commands.prefixes;
prefixes.map((prefix) => {
const plainMessage = bot
.getMessageAsPrismarine(data.contents)
?.toString();
if (!plainMessage.startsWith(prefix)) return;
const command = plainMessage.substring(prefix.length); // if the prefixes are the same length just make it 1 or the length
/*
lifes sus
*/
const source = new CommandSource(data.sender,{ discord: false, console: false });
bot.sendFeedback = (message) => {
if (bot.options.useChat) {
bot.tellraw([message]);
} else {
bot.tellraw(["", message]);
}
};
bot.sendError = (message) => {
bot.sendFeedback([{ text: '', color: `red` }, message], false)
}
try{
ratelimit++
setTimeout(() => {
ratelimit--
}, 1000)
if (ratelimit > bot.Commands.ratelimit) { // ,.
bot.sendFeedback({text:'You are using commands too fast!',color:'dark_red'})
// this isn't blocking running the command you know that right?
} else {
bot.commandManager.executeString(source, command);
}//oh real
//can i change the variable name so its name isnt confusing?
}catch(e){
console.log(e.stack)
};
});
})//
}
module.exports = chat_command_handler;
-7
View File
@@ -1,7 +0,0 @@
function chatDelay (bot,options, ms){
bot.chatDelay = function delay(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
}
module.exports = chatDelay;
-150
View File
@@ -1,150 +0,0 @@
const ivm = require('isolated-vm');//new ivm.Isolate(options)
const CommandError = require('../CommandModules/command_error')
// const isolate = new ivm.isolate({ memoryLimit: 128 });
const { stylize } = require('../util/eval_colors')
// 32 seems fine
module.exports = {
name: 'evaljs',
trustLevel: -1,
aliases:['evaljsisolatedvm', 'evaljsnew', 'evaljsivm', 'eval', 'evalivm', 'evalisolatedvm', 'evaljsnew'],
description:['run code in a vm note: amcforum members had a sh##fit over this command'],
usage:["re fucking doing"],
async execute (context) {
const bot = context.bot
const source = context.source
const args = context.arguments
const util = require('util')
const ChatMessage = require('prismarine-chat')(bot.options.version)
const cmd = {
translate: '[%s] ',
bold: false,
color: 'white',
with: [
{ color: 'dark_green', text: 'EvalJS'},
]
}
// throw new CommandError('temp disabled')
/* bot.tellraw(selector, { text: util.inspect(bot.vm.run(args.slice(1).join(' ')), { stylize }).substring(0, 32000) })
} catch (err) {
bot.tellraw(selector, { text: util.inspect(err).replaceAll('runner', 'Parker2991'), color: 'red' })
*/
//let hash = bot.hash
const options = {
timeout: 1000//?
}
let isolate = new ivm.Isolate({ memoryLimit: 50, options, global, cachedData: true })
//let cachedData = true
if (!args && !args[0] && !args[1] && !args[2]) return
switch (args[1]) {
case `run`:
try {//context.eval()
/*
let kitty
const output = test.compileScript(args.slice(1).join(' '))// ivm.createContext(args.slice(1).join(' '))
const realoutput = output.then(result => {
kitty = result.run({
context: amonger,
})
}).catch(reason => {
console.error(reason) //
})
*/
// old coding
// YOU KILLED THE TERMINAL LMFAO
//let context = await isolate.createContext({ inspector: true });
//let script = await isolate.compileScript('for(;;)debugger;', { filename: 'example.js' });
// await script.run(context);
try {
let nerd = "";
const script = await args.slice(2).join(' '); // Ensure script is a string
const cOmtext = await isolate.createContextSync({options});
if (script.includes('for(;;);')){
bot.sendFeedback({text:'no now fuck off with that script',color:'dark_red'})
return
}
else if (script.includes('Array') || script.includes('\u0041rray') || script.includes('\u0065val') || script.includes('.repeat') || script.includes('concat')){
bot.sendFeedback({text:'no now fuck off with that script',color:'dark_red'})
return
} else if(script.includes('eval')){
source.sendFeedback({text:'no',color:'dark_red'})
return
}else if(script.includes('.fill')){
bot.sendFeedback({text:'screw off',color:'dark_red'})
return
}
(async () => {
try {
let result = await (await cOmtext).evalSync(script, options, {
timeout: 1000
})
nerd = result;
if(!bot.options.Core.enabled){
bot.chat(ChatMessage.fromNotch([cmd, { text: util.inspect(result, { stylize }) }]).toMotd().replaceAll('§', '&'))
}else{
bot.sendFeedback([cmd, { text: util.inspect(result, { stylize }) }]);
}
} catch (reason) {
nerd = reason;
if(!bot.options.Core.enabled){
bot.chat(ChatMessage.fromNotch([cmd, { text: String(reason.stack), color: 'white' }]).toMotd().replaceAll('§', '&'))
}else{
bot.sendFeedback([cmd, { text: String(reason.stack), color: 'white' }]);
console.log(`AAA at ${reason}\n${reason.stack}`);
}
}
})();
} catch (reason) {
if(!bot.options.Core.enabled){
bot.chat(ChatMessage.fromNotch([cmd, { text: String("UwU OwO ewwor" + reason.stack), color: 'white' }]).toMotd().replaceAll('§', '&'))
}else{
source.sendFeedback([cmd, { text: String("UwU OwO ewwor" + reason.stack), color: 'white' }]);
console.log(`AAA at ${reason}\n${reason.stack}`);
}
}
// credits to chatgpt because im lazy mabe mabe? idfk again ty
//
break//
} catch (e) {
// ral
}
case 'reset':
isolate = null
isolate = new ivm.Isolate({ memoryLimit: 50 }) // 32 seems fine
if(!bot.options.Core.enabled){
bot.chat(ChatMessage.fromNotch([cmd, { text: 'Successfully reset the eval context', color: 'green' }]).toMotd().replaceAll('§', '&'))
}else{
bot.sendFeedback([cmd, { text: 'Successfully reset the eval context', color: 'green' }])
}
break
default:
if(!bot.options.Core.enabled){
bot.chat(ChatMessage.fromNotch([cmd, { text: 'Successfully reset the eval context', color: 'green' }]).toMotd().replaceAll('§', '&'))
}else{
bot.sendFeedback([cmd, { text: 'Invalid option!', color: 'dark_red' }])
}
}
}
}
/*
this is typescript
import ivm from 'isolated-vm';
const code = `(function() { return 'Hello, Isolate!'; })()`;
const isolate = new ivm.Isolate({ memoryLimit: 8 }); // mego bites
const script = isolate.compileScriptSync(code);
const context = isolate.createContextSync();
//this
// Prints "Hello, Isolate!"
console.log(script.runSync(context));
*/
-32
View File
@@ -1,32 +0,0 @@
function logger (bot,options) {
const { createGzip } = require('node:zlib');
const gzip = createGzip();
const fs = require('fs')
const path = require('path')
const currentDate = new Date();
const timestamp = `${currentDate.getFullYear()}-${(currentDate.getMonth() + 1).toString().padStart(2, '0')}-${currentDate.getDate().toString().padStart(2, '0')}`;
const logFolder = path.join(__dirname, '../../logs'); // idfk
const logFileName = `${timestamp}.txt`;//why is it not trying to find the folder tf
// i am having a stroke from this
if (!bot.Console.filelogging) return
try {
if (!fs.existsSync(logFolder)) { // existsSync might be for files and that's why it's breaking? | make the folder if it doesn't exist before writing to it
fs.mkdirSync(logFolder);//idfk
}//oh wait
} catch (e) {} // prevent it from throwing a ohio exception mabe mabe
const logFilePath = path.join(logFolder, logFileName);
const logStream = fs.createWriteStream(logFilePath, { flags: 'a' });
// const toWrite = `${message}`//wtf
if (!bot.Console.filelogging) return // instead of using bot why not just use options cause you already defined it
// if (toFile) logStream.write(toWrite + '\n');
bot.console.filelogger = function (message) {//.
logStream.write(message + '\n'); // toFile is not defined
};
//if (toConsole) console.log(toWrite);
};
module.exports = logger
+556 -1631
View File
File diff suppressed because it is too large Load Diff
+6 -15
View File
@@ -1,20 +1,11 @@
{
"dependencies": {
"@vitalets/google-translate-api": "^9.2.0",
"color-convert": "^2.0.1",
"cowsay": "^1.6.0",
"cowsay2": "^2.0.4",
"discord.js": "^14.15.2",
"dockerode": "^4.0.2",
"dotenv": "^16.4.5",
"final-stream": "^2.0.4",
"isolated-vm": "^4.7.2",
"js-yaml": "^4.1.0",
"minecraft-protocol": "^1.47.0",
"moment-timezone": "^0.5.45",
"prettier": "^3.2.5",
"prismarine-chat": "^1.10.1",
"prismarine-registry": "^1.7.0",
"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"
}
}
-34
View File
@@ -1,34 +0,0 @@
const version = '1.20.4'
const { fromNotch } = require('prismarine-chat')(version)
const nbt = require('prismarine-nbt')
//const msg = {"type":"compound","value":{"extra":{"type":"list","value":{"type":"compound","value":[{"extra":{"type":"list","value":{"type":"compound","value":[{"color":{"type":"string","value":"dark_gray"},"text":{"type":"string","value":"["}},{"color":{"type":"string","value":"aqua"},"text":{"type":"string","value":"Prefix: "}},{"color":{"type":"string","value":"dark_red"},"text":{"type":"string","value":"~"}},{"color":{"type":"string","value":"dark_gray"},"text":{"type":"string","value":"]"}},{"":{"type":"string","value":" "}}]}},"text":{"type":"string","value":""}},{"extra":{"type":"list","value":{"type":"compound","value":[{"color":{"type":"string","value":"red"},"text":{"type":"string","value":"FNFBoyfriendBot"}}]}},"text":{"type":"string","value":""}},{"":{"type":"string","value":":"}},{"":{"type":"string","value":" "}},{"extra":{"type":"list","value":{"type":"compound","value":[{"color":{"type":"string","value":"dark_purple"},"text":{"type":"string","value":"FNF"}},{"color":{"type":"string","value":"aqua"},"text":{"type":"string","value":"Boyfriend"}},{"color":{"type":"string","value":"dark_red"},"text":{"type":"string","value":"Bot "}},{"color":{"type":"string","value":"white"},"text":{"type":"string","value":"- "}},{"color":{"type":"string","value":"dark_red"},"text":{"type":"string","value":"Parker"}},{"color":{"type":"string","value":"black"},"text":{"type":"string","value":"2991"}}]}},"text":{"type":"string","value":""}}]}},"text":{"type":"string","value":""}}}
const msg = {"type":"compound","value":{"extra":{"type":"list","value":{"type":"compound","value":[{"extra":{"type":"list","value":{"type":"compound","value":[{"bold":{"type":"byte","value":1},"color":{"type":"string","value":"dark_red"},"text":{"type":"string","value":"["}},{"bold":{"type":"byte","value":1},"color":{"type":"string","value":"red"},"text":{"type":"string","value":"OP"}},{"bold":{"type":"byte","value":1},"color":{"type":"string","value":"dark_red"},"text":{"type":"string","value":"] "}},{"color":{"type":"string","value":"red"},"text":{"type":"string","value":""}}]}},"text":{"type":"string","value":""}},{"extra":{"type":"list","value":{"type":"compound","value":[{"color":{"type":"string","value":"red"},"text":{"type":"string","value":"birdevent"}}]}},"text":{"type":"string","value":""}},{"":{"type":"string","value":":"}},{"":{"type":"string","value":" "}},{"":{"type":"string","value":"?"}}]}},"text":{"type":"string","value":""}}}
function tryParse (json) {
}
function processNbtMessage (msg) {
if (!msg || msg.type === 'end') return null
const simplified = nbt.simplify(msg)
const json = JSON.stringify(simplified, (key, val) => {
if (key === 'id' && Array.isArray(val)) return uuidFromIntArray(val)
return val
})
return json
}
console.log(fromNotch(processNbtMessage(msg)).toAnsi())
console.log(fromNotch(nbt.simplify(msg).extra).toAnsi())
async function nbtChat() {
const { parsed, type } = await nbt.parse(msg)
console.log(parsed)
}
//nbtChat()
/*
async function main(file) {
const buffer = fs.readFileSync(file)
const { parsed, type } = await nbt.parse(buffer)
console.log('JSON serialized', JSON.stringify(parsed, null, 2))
fs.createWriteStream('bigtest.nbt').write(nbt.writeUncompressed(parsed, type)) // Write it back
}
main('bigtest.nbt')
*/
-7
View File
@@ -1,7 +0,0 @@
const fs = require('fs/promises');
const path = require('path');
const blacklist = require(path.join(__dirname, 'blacklist.json'));
for (const player of blacklist.players) {
console.log('whos blacklisted?',[player]);
}
-8
View File
@@ -1,8 +0,0 @@
{
"players": [
"CynicalDev",
"denisapain",
"Pan_Poppo",
"Parker2991"
]
}
-1
View File
@@ -1 +0,0 @@
[{"text":"e"},{"text":"sus"},{"text":"amongus"}]
-102
View File
@@ -1,102 +0,0 @@
# i bet theres gonna be some whiny assholes complaining about this because config is .yml and not .js since most java bots use .yml and no other
# javascript bot uses .yml, all i got to say is go cry somewhere else about it you wont change my mind, you little shit,
# it looks cleaner than config.js - Parker2991
# FNFBoyfriendBot Config
# commands
Commands:
prefixes:
- '!'
colors:
discord:
error: "#ff0000"
embed: "#00ffff"
help:
pub_lickColor: "#00FFFF"
t_rustedColor: "dark_purple"
own_herColor: "dark_red"
error: "#FF0000"
# core
Core:
JSON: ""
area:
start:
x: 0
y: 0
z: 0
end:
x: 15
y: 0
z: 15
#validation
validation:
discord:
roles:
trusted: "trusted"
owner: "owner"
channelId: "channel validation here" # for sending hashes to discord if someone is too lazy to add validation for the bot to their client
trustedKey: "trusted key here"
ownerKey: "owner key here"
#discord
Discord:
enabled: false
invite: "https://discord.gg/GCKtG4erux"
commandPrefix: "!"
presence:
name: "amongus"
type: 4
status: "online"
# console
console:
filelogging: false
prefix: "c."
# bots
bots :
# isKaboom = running the bot in kaboom
# isCreayun = running the bot in creayun
# useChat = running the bot in chat and not core
# usernameGen = regenerating the bot's username every join
# endcredits = the bot advertising
# serverName = the name of the server ofc
# Console.ratelimit = the number of messages that the bot can read in a few seconds before rejoining this is used to prevent spam, i do not recommend setting it to Infinity
# selfcare.interval = selfcare interval duh
- host: "localhost"
useChat: false
isKaboom: true
isCreayun: false
usernameGen: true
username: "FNFBoyfriendBot"
version: "1.20.2"
serverName: "localhost"
reconnectDelay: 6000
endcredits: false
Console:
enabled: true
ratelimit: 25
Core:
enabled: true
interval: 180000
discord:
channelId: ""
log: false
matrix:
roomId: ""
selfcare:
vanished: true
unmuted: true
prefix: true
cspy: true
tptoggle: true
skin: true
gmc: true
op: true
nickname: true
username: true
god: true
interval: 500
-9
View File
@@ -1,9 +0,0 @@
e
e
e
e
e
e
e
-20
View File
@@ -1,20 +0,0 @@
const fs = require("fs");
var data = fs.readFileSync("data.json");
var myObject = JSON.parse(data);
let newData = {
text: "sus"
}
myObject.push(newData);
var newData2 = JSON.stringify(myObject);
fs.rmSync("./data.json");
fs.writeFile("data2.json", newData2, (err) => {
if (err) throw err;
console.log("New data added");
});
fs.rename('data2.json', 'data.json', (err) => {
if (err) throw err;
// console.log('Rename complete!');
});
-44
View File
@@ -1,44 +0,0 @@
/*const playlists = [
{
"id" : "1",
"owner_id" : "2",
"song_ids" : [ "8", "32"]
},
{
"id" : "2",
"owner_id" : "3",
"song_ids" : ["6", "8","11" ]
}
];*/
const fs = require('fs');
var data = require("./data.json");
const e = data.splice('e', 1)
const removePlayerById = (plists, text) =>
plists.filter(player => player.text !== text);
const result = removePlayerById(data, 2);
console.log(result)
// console.log(playerId)
//}
//remove()
/*
const fs = require("fs");
var data = fs.readFileSync("data.json");
var myObject = JSON.parse(data);
let newData = {
text: "sus"
}
myObject.push(newData);
var newData2 = JSON.stringify(myObject);
fs.rmSync("./data.json");
fs.writeFile("data2.json", newData2, (err) => {
if (err) throw err;
console.log("New data added");
});
fs.rename('data2.json', 'data.json', (err) => {
if (err) throw err;
// console.log('Rename complete!');
});
*/
-2
View File
@@ -1,2 +0,0 @@
const { haxe } = require('haxe')
console.log(haxe())
-70
View File
@@ -1,70 +0,0 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This is a general purpose Gradle build.
* To learn more about Gradle by exploring our Samples at https://docs.gradle.org/8.5/samples
*/
/*
* This file was generated by the Gradle 'init' task.
*/
plugins {
id 'java'
id 'java-library'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '8.1.1'
}
group = 'land.chipmunk.parker2991'
version = 'v6.0.0-alpha(ff08479)'
description = 'FNFBoyfriendBot'
java.sourceCompatibility = JavaVersion.VERSION_17
repositories {
mavenLocal()
mavenCentral()
maven {
url = uri('https://repo.opencollab.dev/maven-snapshots/')
}
maven {
url = uri('https://repo.opencollab.dev/maven-releases/')
}
maven {
url = uri('https://repo.maven.apache.org/maven2/')
}
maven {
url = uri("https://jitpack.io")
}
maven {
url = uri('https://maven.maxhenkel.de/repository/public')
}
}
dependencies {
implementation 'com.github.steveice10:mcprotocollib:1.20.2-1-SNAPSHOT'
implementation 'net.kyori:adventure-text-serializer-ansi:4.14.0'
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'com.google.guava:guava:31.1-jre'
implementation 'org.jline:jline:3.23.0'
implementation 'org.yaml:snakeyaml:2.0'
}
jar {
manifest {
attributes 'Main-Class': 'land.chipmunk.parker2991.fnfboyfriendbot.Main'
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
tasks.withType(Javadoc).configureEach {
options.encoding = 'UTF-8'
}
-3
View File
@@ -1,3 +0,0 @@
voiding interger will return a number
public static void functionName() {} has the funcion return nothing
@@ -1,2 +0,0 @@
# This file was generated by the Gradle 'init' task.
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format
Binary file not shown.
@@ -1,7 +0,0 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-249
View File
@@ -1,249 +0,0 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
-92
View File
@@ -1,92 +0,0 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
-8
View File
@@ -1,8 +0,0 @@
/*
* This file was generated by the Gradle 'init' task.
*
* The settings file is used to specify which projects to include in your build.
* For more detailed information on multi-project builds, please refer to https://docs.gradle.org/8.5/userguide/building_swift_projects.html in the Gradle documentation.
*/
rootProject.name = 'fnfboyfriendbot'
@@ -1,47 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot;
import land.chipmunk.parker2991.fnfboyfriendbot.*;
import com.github.steveice10.mc.auth.data.GameProfile;
import com.github.steveice10.mc.protocol.MinecraftProtocol;
import com.github.steveice10.mc.protocol.data.game.entity.player.HandPreference;
import com.github.steveice10.mc.protocol.data.game.setting.ChatVisibility;
import com.github.steveice10.mc.protocol.data.game.setting.SkinPart;
import com.github.steveice10.mc.protocol.packet.common.serverbound.ServerboundClientInformationPacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundLoginPacket;
import com.github.steveice10.mc.protocol.packet.login.clientbound.ClientboundGameProfilePacket;
import com.github.steveice10.packetlib.Session;
import com.github.steveice10.packetlib.event.session.*;
import com.github.steveice10.packetlib.packet.Packet;
import com.github.steveice10.packetlib.tcp.TcpClientSession;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
public class Bot {
private final ArrayList<ClientListener> listeners = new ArrayList<>();
public final String host;
public final int port;
public final List<Bot> bots;
public final Options.bots options;
public Bot (Options.bots options, List<Bot> bots) {
this.host = options.host;
this.port = options.port;
this.options = options;
}
public static void main(String[] args) {
}
public class ClientListener {
}
}
@@ -1,36 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import org.yaml.snakeyaml.Yaml;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import java.io.*;
import java.util.List;
import java.util.Set;
import java.util.ArrayList;
public class Main {
public static void main(String[] args) {
Bot config = null;
Path configPath = Paths.get("config.yml");
try {
Yaml yaml = new Yaml();
config = yaml.load(Files.readString(configPath));
System.out.println(config);
} catch (IOException e) {
System.out.println(e.toString());
}
List<Bots> bots = new ArrayList<>();
for (Options options : config.bots) {
final Bot client = new Bot(options, bots);
bots.add(client);
}
}
private static class Options {
}
}
@@ -1,9 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot;
public class Options {
public static class bots {
public String host = "127.0.0.1";
public int port = 25565;
public long reconnectDelay;
}
}
@@ -1,6 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.commands;
public class SayCommand {
}
@@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class BruhifyModule {
}
@@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class ChatCommandHandlerModule {
}
@@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class ChatModule {
}
@@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class CommandCoreModule {
}
@@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class CommandLoopManagerModule {
}
@@ -1,7 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class CommandManagerModule {
}
@@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class ConsoleModule {
}
@@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class DiscordModule {
}
@@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class PlayerListModule {
}
@@ -1,7 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class SelfcareModule {
}
@@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class ValidationModule {
}
@@ -1,35 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot;
import java.net.InetAddress;
import java.net.UnknownHostException;
public class servershit {
public static void main(String[] args) {
try {
InetAddress inetAddress = InetAddress.getLocalHost();
System.out.println("Hostname \u203a " + inetAddress.getHostName());
} catch (UnknownHostException e) {
e.printStackTrace();
}
System.out.println("Working Directory \u203a " + System.getProperty("user.dir"));
System.out.println(System.getProperty("os.arch"));
System.out.println("OS \u203a " + System.getProperty("os.name"));
System.out.println("OS Version/distro \u203a " + System.getProperty("os.version"));
System.out.println("Kernel Version \u203a " + System.getProperty("os.kernel.version"));
System.out.println("Cores \u203a " + Runtime.getRuntime().availableProcessors());
System.out.println("CPU \u203a " + System.getProperty("sun.cpu.isalist"));
System.out.println("Server Free memory " + (Runtime.getRuntime().freeMemory() / 1048576) + " MiB " +
Runtime.getRuntime().totalMemory() / 1048576 + " MiB");
System.out.println("Device uptime \u203a " + formatUptime(System.currentTimeMillis() / 1000L));
System.out.println("Java version \u203a " + System.getProperty("java.version"));
}
private static String formatUptime(long uptime) {
long days = uptime / 86400;
long hours = (uptime % 86400) / 3600;
long minutes = ((uptime % 86400) % 3600) / 60;
long seconds = ((uptime % 86400) % 3600) % 60;
return days + "d " + hours + "h " + minutes + "m " + seconds + "s";
}
}
@@ -1,27 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
public class serverterminal {
public static void main(String[] args) {
try {
ProcessBuilder processBuilder = new ProcessBuilder(Arrays.asList("ash", "-c", "ls"));
Process process = processBuilder.start();
InputStream inputStream = process.getInputStream();
byte[] buffer = new byte[1024];
int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) {
System.out.println(new String(buffer, 0, bytesRead));
}
int exitCode = process.waitFor();
System.out.println("Child process close all stdio with code " + exitCode);
} catch (IOException | InterruptedException e) {
e.printStackTrace();
}
}
}
@@ -1,8 +0,0 @@
Commands:
prefixes:
- "~"
- "fnfbfbot "
- "&"
- "\ufffc"
- "\u202e"
- "\u2588"
-7
View File
@@ -1,7 +0,0 @@
const mc = require('minecraft-protocol');
async function ping() {
const server = await mc.ping({host:"kaboom.pw",port:"25565"})
// console.log(await mc.ping({host:"kaboom.pw",port:"25565"}))
console.log(server)
}
ping()
-10
View File
@@ -1,10 +0,0 @@
const version = require('./version.json');
const ChatMessage = require('prismarine-chat')('1.20.2');
console.log(version);
console.log(version.BotBuildstring.build);
console.log(version.BotBuildstring.codename);
console.log(version.BotBuildstring.version);
console.log(ChatMessage.fromNotch(`${version.BotBuildstring.version}-${version.BotBuildstring.codename}-${version.BotBuildstring.build}`)?.toAnsi())
console.log(ChatMessage.fromNotch(version.BotBuildstring.codename)?.toAnsi())
console.log(ChatMessage.fromNotch(version.BotBuildstring.name)?.toAnsi())
console.log(`${ChatMessage.fromNotch(version.BotBuildstring.name)?.toAnsi()}-${version.BotBuildstring.version}-${ChatMessage.fromNotch(version.BotBuildstring.codename)?.toAnsi()}`)
-35
View File
@@ -1,35 +0,0 @@
{
"BotBuildstring": {
"name": [
{
"translate":"%s%s%s",
"with": [
{
"text": "FridayNightFunkin",
"color": "dark_purple"
},
{
"text": "Boyfriend",
"color": "#00FFFF"
},
{
"text": "Bot",
"color": "#ff0000"
}
]
}
],
"build":"#500",
"codename": [
{
"text": "Censory ",
"color": "dark_red"
},
{
"text": "Overload",
"color": "red"
}
],
"version":"v5.0.8"
}
}
-6
View File
@@ -1,6 +0,0 @@
const crypto = require('crypto');
const sus = 'meow';
//const amogus = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + bot.validation.keys.trustedKey).digest('hex').substring(0, 16)
const amogus = crypto.createHash('sha256').update(sus).digest('hex')
console.log(amogus)
View File
+107 -98
View File
@@ -1,108 +1,117 @@
const mc = require("minecraft-protocol");
const { EventEmitter } = require("node:events");
const usernameGen = require('./util/usernameGen');
require("events").EventEmitter.defaultMaxListeners = Infinity;
const { execSync } = require('child_process');
function createBot(options = {}, config) {
const bot = new EventEmitter();
// Set some default values in options
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 = {
host: options.host ??= "localhost",
username: options.username ??= usernameGen(),
hideErrors: options.hideErrors ??= true, // HACK: Hide errors by default as a lazy fix to console being spammed with the console
version: options.version ??= '1.20.2',
}
bot.options = 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)
};
// 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)
});
/* const timer = setInterval(() => {
if (!config.bots.endcredits) {
return
} else {
bot.chat(`Join the FNFBoyfriendBot discord ${bot.discord.invite}`)
}
}, 280000)*/
client.on("login", async function (data) {
bot.uuid = client.uuid;
bot.username = client.username;
bot.port = bot.options.port;
bot.version = bot.options.version;
/* if (bot.options.isCreayun) {
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);
}
var day = new Date().getDay()
if (day === 5) {
bot.chat("Gettin' freaky on a Friday Night!")
} else {
bot.chat(`&5FNF&bBoyfriend&4Bot &f- &4Parker&02991`)
}
timer;
if (bot.options.useChat) {
bot?.console?.warn(`useChat is active for ${bot.options.host} the bot will not be able to run commands in core`)
} else if (bot.options.isCreayun) {
bot?.console?.info(`Creayun mode is active for ${bot.options.host} please not that the bot will not read kaboom commands and messages when Creayun
mode is active`)
}
if (bot.options.debug.enabled) {
bot.console.warn(`Debug mode is enabled for ${bot.options.host}:${bot.options.port} please note this WILL spam console is all options are enabled`)
}*/
})
client.on("end", (reason) => {
const parsed = JSON.stringify(reason);
bot.emit('end', parsed);
bot.console.warn(`Disconnected: ${parsed}`);
bot.cloop.clear()
bot.memusage.off()
bot.tps.off()
bot.bruhifyText = ''
// clearInterval(timer)
bot?.discord?.channel?.send('Disconnected: ' + '``' + parsed + '``')
});
client.on("disconnect", (data) => {
const parsed = JSON.parse(data.reason)
bot.emit(parsed, "disconnect");
if (parsed === 'Server is full!') {
bot.emit("disconnect", `what the fuck?`)
} else if (parsed === 'Wait 5 seconds before connecting, thanks! :)') {
bot.options.reconnectDelay = 1000 * 5
bot.console.info(`Setting reconnect delay to ${1000 * 5}`)
bot.discord.channel?.send(`Setting reconnecting delay to ${1000 * 5}`)
} else {
bot.console.warn(`Disconnected: ${JSON.stringify(parsed)}`);
bot?.discord?.channel?.send('Disconnected: ' + '``' + JSON.stringify(parsed) + '``')
}
});
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(),
);
});
});
client.on("kick_disconnect", (data) => {
const parsed = JSON.parse(data.reason);
bot.emit(parsed, "kick_disconnect");
bot?.discord?.channel?.send('Disconnected: ' + '``' + parsed + '``')
bot.console.warn(`Disconnected: ${JSON.stringify(data.reason)}`);
process.on("uncaughtException", (e) => {
//console.log('meow')
console.warn(`${e.stack}`);
});
client.on("keep_alive", ({ keepAliveId }) => {
bot.emit("keep_alive", { keepAliveId });
});
client.on("error", (error) => {
bot?.discord?.channel?.send('Disconnected: ' + '``' + JSON.stringify(error.toString()) + '``')
bot.console.warn(error.toString())
// bot.emit("error", error)
})
});
const client = options.client ?? mc.createClient(options);
bot._client = client;
bot.emit("init_client", client);
bot.bots = options.bots ?? [bot];
return bot;
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 = createBot;
module.exports = Bot;
-34
View File
@@ -1,34 +0,0 @@
function chatTypeEmote (message, data, context) {
try{
if (message === null || typeof message !== 'object') return
if (message.with?.length < 2 || (message.translate !== 'chat.type.emote' && message.translate !== '%s %s')) return
const senderComponent = message.with[0]
// wtf spam again - console.log(senderComponent)//wtf...
//console.log(senderComponent)
const contents = message.with[1]
// spam lol - console.log(contents)
//console.log(contents)
let sender
const hoverEvent = senderComponent.hoverEvent
if (hoverEvent?.action === 'show_entity') {
const id = hoverEvent.contents.id
//
sender = data.players.find(player => player.uuid === id)
} else {
const stringUsername = data.getMessageAsPrismarine(senderComponent).toString() // TypeError: data.getMessageAsPrismarine is not a function
sender = data.players.find(player => player.profile.name) //=== stringusername)
}
if (!sender) return undefined
return { sender, contents, type: 'minecraft:chat', senderComponent }
}catch(e){
console.log(e.stack)
}
}
module.exports = chatTypeEmote
-34
View File
@@ -1,34 +0,0 @@
function chatTypeText (message, data, context) {
try {
if (message === null || typeof message !== 'object') return
if (message.with?.length < 2 || (message.translate !== 'chat.type.text' && message.translate !== '%s %s')) return
const senderComponent = message.with[0]
// wtf spam again - console.log(senderComponent)//wtf...
//console.log(senderComponent)
const contents = message.with[1]
// spam lol - console.log(contents)
//console.log(contents)
let sender
const hoverEvent = senderComponent.hoverEvent
if (hoverEvent?.action === 'show_entity') {
const id = hoverEvent.contents.id
//
sender = data.players.find(player => player.uuid === id)
} else {
const stringUsername = data.getMessageAsPrismarine(senderComponent).toString() // TypeError: data.getMessageAsPrismarine is not a function
sender = data.players.find(player => player.profile.name) //=== stringusername)
}
if (!sender) return undefined
return { sender, contents, type: 'minecraft:chat', senderComponent }
}catch(e){
console.log(e.stack)
}
}
module.exports = chatTypeText
-35
View File
@@ -1,35 +0,0 @@
function chipmunkmod (message, data, context, bot) {
try {
if (message === null || typeof message !== 'object') return
if (message.with?.length < 3 || (message.translate !== '[%s] %s › %s' && message.translate !== '%s %s › %s')) return
const senderComponent = message.with[1]
// wtf spam again -
//console.log(senderComponent)//wtf...
const contents = message.with[2]
// spam lol - console.log(contents)
let sender
const hoverEvent = senderComponent.hoverEvent
//console.log(JSON.stringify(hoverEvent))
if (hoverEvent?.action === 'show_entity') {
const id = hoverEvent.contents.id
//
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 null
return { sender, contents, type: 'minecraft:chat', senderComponent }
} catch(e) {
console.error(e)
}
}
module.exports = chipmunkmod
-27
View File
@@ -1,27 +0,0 @@
function chipmunkmodBlackilyKat (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 = chipmunkmodBlackilyKat
-42
View File
@@ -1,42 +0,0 @@
function creayun (messageobj, data) { // this function is not getting called
const ChatMessage = require('prismarine-chat')('1.20.1')
const util = require('util')
const stringify = message => new ChatMessage(message).toString()
const message = stringify(messageobj);
const playerWithPrefix = /^(.*?) (\S*?) » (.*?)$/;
const playerWithoutPrefix = /^(\S*?) » (.*?)$/
// var pattern = /^(.*?) (\S*?) \u203a (.*?)$/;
//console.log('[debug] parsing a message');
// const match = message.match(pattern);
if (playerWithPrefix.test(message)) {
// console.log('[debug]', match);
let match = message.match(playerWithPrefix)
const sender = data.players.find((player) => player.uuid === player.uuid)
if (!sender) return undefined
return { sender, contents: match[3], type: 'minecraft:chat'};
}//i just realized that the bot uses tellraw
//ima try to fix that
}
module.exports = creayun;
// bot.players.find((player) => player.profile.name === players.username)
// let displayName = data.senderName ?? { text: '' }
/*
const playerListDisplayName = { extra: [prefix, displayName], text: '' }
let sender
if (data.uuid) {
sender = data.players.find(player => player.uuid === data.senderUuid)
} else {
const playerListDisplayName = { extra: [prefix, displayName], text: '' }
sender = data.players.find(player => util.isDeepStrictEqual(player.displayName, playerListDisplayName))
}
if (!sender) return undefined
return { sender, contents, type: 'minecraft:chat', displayName }
}
function isSeparatorAt (children, start) {
return (children[start]?.text === ':' || children[start]?.text === '\xa7r:') && children[start + 1]?.text === ' '
}
*/
-61
View File
@@ -1,61 +0,0 @@
const util = require('util')
function savage (message, data) {
if (message === null || typeof message !== 'object') return
if (message.text !== '' || !Array.isArray(message.extra) || message.extra.length < 3) return
const children = message.extra
const prefix = children[0]
let displayName = data.senderName ?? { text: '' }
let contents = { text: ' ' }
if (isSeparatorAt(children, 1)) { // Missing/blank display name
if (children.length > 3) contents = children[3]
} else if (isSeparatorAt(children, 2)) {
displayName = children[1]
if (children.length > 4) contents = children[4]
} else {
return undefined
}
/*
if (isSeparatorAt(children, 1)) { // Missing/blank display name
if (children.length > 3) contents = children[3]
} else if (isSeparatorAt(children, 2)) {
displayName = children[1]
if (children.length > 4) contents = children[4]
} else {
return undefined
}
*/
// let sus = { text: ' ' }
const playerListDisplayName = { extra: [prefix, displayName, content]}
let sender
if (data.uuid) {
sender = data.players.find(player => player.uuid === data.senderUuid)
} else {
const playerListDisplayName = { extra: [prefix, displayName, content] }
sender = data.players.find(player => util.isDeepStrictEqual(player.displayName, playerListDisplayName))
}
if (!sender) return undefined
return { sender, contents, type: 'minecraft:chat' }
}
function isSeparatorAt (children, start) {
return (children[start]?.text === '»' || children[start]?.text === '\xa79»\xa7r') && children[start + 1]?.text === ''
}
// [prefix]&r [name] [suffix] &9»&r
// {DISPLAYNAME} &9»&r {MESSAGE}
/*
{"extra":[{"text":"e e"},{"text":" "},{"color":"dark_red","text":"Parker"},{"color":"black","text":"2991"},{"text":" "},
{"color":"blue","text":"»"},{"text":" "},{"color":"white","text":"duping fucking rank"}],"text":""}
*/
/*
{"extra":[{"bold":true,"color":"dark_red","text":"["},{"bold":true,"color":"red","text":"OP"},{"bold":true,"color":"dark_red","text":"]"},
{"text":" "},{"color":"red","text":"Parker2991"},{"text":" "},{"color":"blue","text":"»"},{"text":" e"}],"text":""}
*/
module.exports = savage;
-35
View File
@@ -1,35 +0,0 @@
function say (message, data, context, bot) {
try {
if (message === null || typeof message !== 'object') return
if (message.with?.length < 2 || (message.translate !== 'chat.type.announcement' && message.translate !== '%s %s')) return
const senderComponent = message.with[0]
// wtf spam again -
//console.log(senderComponent)//wtf...
const contents = message.with[1]
// spam lol - console.log(contents)
let sender
const hoverEvent = senderComponent.hoverEvent
//console.log(JSON.stringify(hoverEvent))
if (hoverEvent?.action === 'show_entity') {
const id = hoverEvent?.contents?.id
//
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 null
return { sender, contents, type: 'minecraft:chat', senderComponent }
} catch(e) {
console.error(e)
}
}
module.exports = say
+43
View File
@@ -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;
+26
View File
@@ -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;
@@ -21,8 +21,10 @@ function kaboom (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,12 +33,11 @@ function kaboom (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 === '\xa7r:') && children[start + 1]?.text === ' '
return (children[start]?.text === ':' || children[start]?.text === '\xa7f:') && children[start + 1]?.text === ' '
}
module.exports = kaboom
+31
View File
@@ -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;
+5
View File
@@ -0,0 +1,5 @@
function say (message, data) {
}
module.exports = say;
+37
View File
@@ -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;
+38
View File
@@ -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;
+12
View File
@@ -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;
+15
View File
@@ -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;
+9
View File
@@ -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;
+10
View File
@@ -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;
+155
View File
@@ -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;
+37
View File
@@ -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;
+13
View File
@@ -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;
+118
View File
@@ -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;
+12
View File
@@ -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;
+42
View File
@@ -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;
+36
View File
@@ -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;
+18
View File
@@ -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;
+446
View File
@@ -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;
+608
View File
@@ -0,0 +1,608 @@
const os = require("os");
const CommandError = require("../../command_util/command_error");
const fs = require("fs");
const botInfo = require("../../data/info.json");
const fixansi = require("../../util/ansi.js");
const { execSync } = require("child_process");
const CommandContext = require("../../command_util/command_context");
function format(seconds) {
function pad(s) {
return (s < 10 ? "0" : "") + s;
}
var hours = Math.floor(seconds / (60 * 60));
var minutes = Math.floor((seconds % (60 * 60)) / 60);
var seconds = Math.floor(seconds % 60);
return (
pad(`${hours} Hours`) +
" " +
pad(`${minutes} Minutes`) +
" " +
pad(`${seconds} Seconds`)
);
}
class InfoCommand extends CommandContext {
constructor() {
super("info", ["information"], "check the bots info", 0, [
"about",
"config <client, discord, options, all>",
"contributors/credits",
"discord",
"loaded",
"usages <bot, server, all>",
"uptimes/uptime <bot, server, all>",
"server",
"version/ver",
]);
}
execute(context) {
const bot = context.bot;
const args = context.arguments;
const config = context.config;
const discordClient = context.discordClient;
const source = context.source;
let component = [];
switch (args[0]?.toLowerCase()) {
case "about":
component.push({
text: `FNFBoyfriendBot is a kaboom bot created by Parker2991\nThe source code and changelog can be found here ${botInfo.buildstring.url}`,
color: `${config.colors.commands.primary}`,
translate: "",
hoverEvent: {
action: "show_text",
value: [
{
text: "click here to view bots source code",
color: `${config.colors.commands.primary}`,
},
],
},
clickEvent: {
action: "open_url",
value: `${botInfo.buildstring.url}`,
},
});
break;
case "config":
if (bot.options.isKaboom) {
mode = "Kaboom";
}
if (bot.options.useChat && bot.options.isKaboom) {
mode = "Kaboom/Coreless";
}
if (bot.options.isSavage) {
mode = "Savage";
}
if (bot.options.isCreayun) {
mode = "Creayun";
}
switch (args.slice(1).join(" ")?.toLowerCase()) {
case "client":
component.push({
translate: "%s: %s:%s\n%s: %s\n%s: %s\n%s: %s",
color: config.colors.commands.tertiary,
with: [
{ text: "Server", color: config.colors.commands.primary },
{
text: `${bot.options.host}`,
color: config.colors.commands.secondary,
},
{ text: `${bot.options.port}`, color: config.colors.integer },
{ text: "Server Name", color: config.colors.commands.primary },
{
text: `${bot.options.serverName}`,
color: config.colors.commands.secondary,
},
{
text: "Minecraft Username",
color: config.colors.commands.primary,
},
{
text: `${bot.options.username}`,
color: config.colors.commands.secondary,
},
{ text: "Version", color: config.colors.commands.primary },
{
text: `${bot.options.version}`,
color: config.colors.integer,
},
],
});
break;
case "discord":
if (!config.discord.enabled || discordClient.user === null) {
throw new CommandError(
"Token is incorrect or discord isnt enabled!",
);
} else {
component.push({
translate: "%s: %s\n%s: %s",
color: config.colors.commands.tertiary,
with: [
{
text: "Discord Username",
color: config.colors.commands.primary,
},
{
text: `${discordClient.user.tag}`,
color: config.colors.commands.secondary,
},
{
text: "Discord Channel",
color: config.colors.commands.primary,
},
{
text: `${bot.discord?.channel?.name}`,
color: config.colors.commands.secondary,
},
],
});
}
break;
case "options":
component.push({
translate: "%s: %s\n%s: %s\n%s: %s",
color: config.colors.commands.tertiary,
with: [
{ text: "Server Count", color: config.colors.commands.primary },
{ text: `${bot.bots.length}`, color: config.colors.integer },
{ text: "Prefixes", color: config.colors.commands.primary },
{
text: `${config.prefixes.map((e) => e + " ").join(" ")}`,
color: config.colors.commands.secondary,
},
{ text: "Mode", color: config.colors.commands.primary },
{
text: `${bot.options.mode}`,
color: config.colors.commands.secondary,
},
],
});
break;
case "all":
component.push({
translate:
"%s: %s:%s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s",
color: config.colors.commands.tertiary,
with: [
{ text: "Server", color: config.colors.commands.primary },
{
text: `${bot.options.host}`,
color: config.colors.commands.secondary,
},
{ text: `${bot.options.port}`, color: config.colors.integer },
{ text: "Server Name", color: config.colors.commands.primary },
{
text: `${bot.options.serverName}`,
color: config.colors.commands.secondary,
},
{
text: "Minecraft Username",
color: config.colors.commands.primary,
},
{
text: `${bot.options.username}`,
color: config.colors.commands.secondary,
},
{ text: "Version", color: config.colors.commands.primary },
{
text: `${bot.options.version}`,
color: config.colors.commands.secondary,
},
{
text: "Discord Username",
color: config.colors.commands.primary,
},
{
text: `${discordClient.user?.tag}`,
color: config.colors.commands.secondary,
},
{
text: "Discord Channel",
color: config.colors.commands.primary,
},
{
text: `${bot.discord.channel?.name}`,
color: config.colors.commands.secondary,
},
{ text: "Server Count", color: config.colors.commands.primary },
{ text: `${bot.bots.length}`, color: config.colors.integer },
{ text: "Prefixes", color: config.colors.commands.primary },
{
text: `${config.prefixes.map((e) => e + " ").join(" ")}`,
color: config.colors.commands.secondary,
},
{ text: "Mode", color: config.colors.commands.primary },
{
text: `${bot.options.mode}`,
color: config.colors.commands.secondary,
},
],
});
break;
default:
throw new CommandError({
translate: "command.unknown.argument",
color: "dark_red",
});
}
break;
case "contributors":
case "credits":
component.push({
translate: "%s%s - %s\n%s:\n%s\n%s\n%s\n%s\n%s %s\n%s\n%s",
color: config.colors.commands.tertiary,
with: [
{ text: "Parker", color: "dark_red" },
{ text: "2991", color: "black" },
{ text: "Owner" },
{ text: "Contributors" },
{ text: "_ChipMC_", color: "dark_blue" },
{ text: "chayapak", color: "yellow" },
{ text: "_yfd", color: "light_purple" },
{ text: "aaa", color: "gold" },
{ text: "Morgan", color: "green" },
{ text: "Ankan", color: "dark_green" },
{ text: "TurtleKid", color: "green" },
{ text: "Ploat/ImGloriz", color: "#cd8ccb" },
],
});
break;
case "discord":
component.push({
text: `the discord server invite is ${config.discord.invite}`,
color: config.colors.commands.primary,
translate: "",
hoverEvent: {
action: "show_text",
value: [
{
text: "click here to join the discord server!",
color: config.colors.commands.secondary,
},
],
},
clickEvent: {
action: "open_url",
value: `${config.discord.invite}`,
},
});
break;
case "loaded":
component.push({
translate: "%s %s\n%s %s",
color: config.colors.commands.tertiary,
with: [
{
text: `${bot.commandManager.commandlist.length}`,
color: config.colors.integer,
},
{ text: "Commands", color: config.colors.commands.primary },
{ text: `${bot.modules.length}`, color: config.colors.integer },
{ text: "Modules", color: config.colors.commands.primary },
],
});
break;
case "usages":
case "usage":
switch (args.slice(1).join(" ")?.toLowerCase()) {
case "bot":
component.push({
translate: "%s: %s %s / %s %s",
color: config.colors.commands.tertiary,
with: [
{
text: "Bot Memory",
color: config.colors.commands.primary,
},
{
text: `${Math.floor(process.memoryUsage().heapUsed / 1048576)}`,
color: config.colors.integer,
},
{ text: "MiB", color: config.colors.commands.secondary },
{
text: `${Math.floor(process.memoryUsage().heapTotal / 1048576)}`,
color: config.colors.integer,
},
{ text: "MiB", color: config.colors.commands.secondary },
],
});
break;
case "server":
component.push({
translate: "%s: %s %s / %s %s",
color: config.colors.commands.tertiary,
with: [
{
text: "Server Memory",
color: config.colors.commands.primary,
},
{
text: `${Math.floor(os.totalmem() / 1048576) - Math.floor(os.freemem() / 1048576)}`,
color: config.colors.integer,
},
{ text: "MB", color: config.colors.commands.secondary },
{
text: `${Math.floor(os.totalmem() / 1048576)}`,
color: config.colors.integer,
},
{ text: "MB", color: config.colors.commands.secondary },
],
});
break;
case "all":
component.push({
translate: "%s: %s %s / %s %s\n%s: %s %s / %s %s",
color: config.colors.commands.tertiary,
with: [
{
text: "Server Memory",
color: config.colors.commands.primary,
},
{
text: `${Math.floor(os.totalmem() / 1048576) - Math.floor(os.freemem() / 1048576)}`,
color: config.colors.integer,
},
{ text: "MB", color: config.colors.commands.secondary },
{
text: `${Math.floor(os.totalmem() / 1048576)}`,
color: config.colors.integer,
},
{ text: "MB", color: config.colors.commands.secondary },
{
text: "Bot Memory",
color: config.colors.commands.primary,
},
{
text: `${Math.floor(process.memoryUsage().heapUsed / 1048576)}`,
color: config.colors.integer,
},
{ text: "MB", color: config.colors.commands.secondary },
{
text: `${Math.floor(process.memoryUsage().heapTotal / 1048576)}`,
color: config.colors.integer,
},
{ text: "MB", color: config.colors.commands.secondary },
],
});
break;
default:
throw new CommandError({
translate: "command.unknown.argument",
color: "dark_red",
});
}
break;
case "uptimes":
switch (args.slice(1).join(" ")?.toLowerCase()) {
case "bot":
component.push({
translate: "%s: %s",
color: config.colors.commands.tertiary,
with: [
{ text: "Bot Uptime", color: config.colors.commands.primary },
{
text: `${format(process.uptime())}`,
color: config.colors.commands.secondary,
},
],
});
break;
case "server":
component.push({
translate: "%s: %s",
color: config.colors.commands.tertiary,
with: [
{
text: "Server Uptime",
color: config.colors.commands.primary,
},
{
text: `${format(os.uptime())}`,
color: config.colors.commands.secondary,
},
],
});
break;
case "all":
component.push({
translate: "%s: %s\n%s: %s",
color: config.colors.commands.tertiary,
with: [
{ text: "Bot Uptime", color: config.colors.commands.primary },
{
text: `${format(process.uptime())}`,
color: config.colors.commands.secondary,
},
{
text: "Server Uptime",
color: config.colors.commands.primary,
},
{
text: `${format(os.uptime())}`,
color: config.colors.commands.secondary,
},
],
});
break;
throw new CommandError({
translate: "command.unknown.argument",
color: "dark_red",
});
}
break;
case "server":
component.push({
translate:
"%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s",
color: config.colors.commands.tertiary,
with: [
{ text: "Hostname", color: config.colors.commands.primary },
{
text: `${os.hostname()}`,
color: config.colors.commands.secondary,
},
{ text: "User", color: config.colors.commands.primary },
{
text: `${os.userInfo().username}`,
color: config.colors.commands.secondary,
},
{
text: "Working Directory",
color: config.colors.commands.primary,
},
{
text: `${require.main.path}`,
color: config.colors.commands.secondary,
},
{ text: "Arch", color: config.colors.commands.primary },
{ text: `${os.arch()}`, color: config.colors.commands.secondary },
{ text: "OS", color: config.colors.commands.primary },
{ text: `${os.platform}`, color: config.colors.commands.secondary },
{ text: "OS Version", color: config.colors.commands.primary },
{
text: `${os.version()}`,
color: config.colors.commands.secondary,
},
{ text: "Kernel Version", color: config.colors.commands.primary },
{
text: `${os.release()}`,
color: config.colors.commands.secondary,
},
{ text: "CPU", color: config.colors.commands.primary },
{
text: `${os.cpus()[0].model}`,
color: config.colors.commands.secondary,
},
{ text: "CPU cores", color: config.colors.commands.primary },
{ text: `${os.cpus().length}`, color: config.colors.integer },
{ text: "Processes", color: config.colors.commands.primary },
{
text: `${execSync("ps aux | wc -l").toString().replace("\n", "")}`,
color: config.colors.integer,
},
{ text: "Node Version", color: config.colors.commands.primary },
{
text: `${process.version}`,
color: config.colors.commands.secondary,
},
{ text: "NPM Version", color: config.colors.commands.primary },
{
text: `${execSync("npm -v").toString().replaceAll("\n", "")}`,
color: config.colors.commands.secondary,
},
],
});
break;
case "version":
case "ver":
if (botInfo.buildstring.codename.length > 0) {
component.push({
translate: "%s %s %s-%s-%s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s-%s",
color: config.colors.commands.tertiary,
with: [
{ text: "Friday Night Funkin", color: "dark_blue" },
{ text: "Boyfriend", color: "dark_aqua" },
{ text: "Bot", color: "blue" },
{
text: `${botInfo.buildstring.version}`,
color: config.colors.integer,
},
botInfo.buildstring.codename,
{ text: "Build", color: config.colors.commands.primary },
{
text: `${botInfo.buildstring.build}`,
color: config.colors.integer,
},
{ text: "Repo Build", color: config.colors.commands.primary },
{
text: `${execSync("git rev-list --count --all").toString().replaceAll("\n", "")}`,
color: config.colors.integer,
},
{
text: "Version Release Date",
color: config.colors.commands.primary,
},
{
text: `${new Date(execSync("git log -1 --format=%ci").toString()).toLocaleString("en-US", { timeZone: "America/CHICAGO" })}`,
color: config.colors.commands.secondary,
},
{ text: "Commit", color: config.colors.commands.primary },
{
text: `${execSync("git rev-parse HEAD").toString().substring(0, 10)}`,
color: config.colors.commands.secondary,
},
{ text: "11/22/22", color: config.colors.commands.primary },
{
text: `${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO" })}`,
color: config.colors.commands.secondary,
},
],
});
} else {
component.push({
translate: "%s %s %s-%s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s-%s",
color: config.colors.commands.tertiary,
with: [
{ text: "Friday Night Funkin", color: "dark_blue" },
{ text: "Boyfriend", color: "dark_aqua" },
{ text: "Bot", color: "blue" },
{
text: `${botInfo.buildstring.version}`,
color: config.colors.integer,
},
{ text: "Build", color: config.colors.commands.primary },
{
text: `${botInfo.buildstring.build}`,
color: config.colors.integer,
},
{ text: "Repo Build", color: config.colors.commands.primary },
{
text: `${execSync("git rev-list --count --all").toString().replaceAll("\n", "")}`,
color: config.colors.integer,
},
{
text: "Version Release Date",
color: config.colors.commands.primary,
},
{
text: `${new Date(execSync("git log -1 --format=%ci").toString()).toLocaleString("en-US", { timeZone: "America/CHICAGO" })}`,
color: config.colors.commands.secondary,
},
{ text: "Commit", color: config.colors.commands.primary },
{
text: `${execSync("git rev-parse HEAD").toString().substring(0, 10)}`,
color: config.colors.commands.secondary,
},
{ text: "11/22/22", color: config.colors.commands.primary },
{
text: `${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO" })}`,
color: config.colors.commands.secondary,
},
],
});
}
break;
default:
throw new CommandError({
translate: "command.unknown.argument",
color: "dark_red",
});
}
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 = InfoCommand;
+54
View File
@@ -0,0 +1,54 @@
const CommandError = require("../../command_util/command_error");
const CommandContext = require("../../command_util/command_context");
class ListCommand extends CommandContext {
constructor() {
super("list", ["pl", "playerlist"], "check whos online on the server", 0, [
"",
]);
}
execute(context) {
const bot = context.bot;
const args = context.arguments;
const config = context.config;
const source = context.source;
let component = [];
let infoComponent = [];
let playerCount = [];
playerCount.push({
translate: "%s: (%s)\n",
color: config.colors.commands.tertiary,
with: [
{ text: "Players", color: config.colors.commands.primary },
{ text: `${bot.players.length}`, color: config.colors.integer },
],
});
component.push(playerCount);
for (const player of bot.players) {
component.push({
translate: "%s \u203a %s [%s: %s]",
color: config.colors.commands.tertiary,
with: [
player.displayName ?? player.profile.name,
{ text: `${player.uuid}`, color: config.colors.commands.primary },
{ text: "Latency", color: config.colors.commands.primary },
{ text: `${player.latency}`, color: config.colors.integer },
],
});
component.push("\n");
}
component.pop();
if (source.sources.console) {
bot.console.info(bot.getMessageAsPrismarine(component)?.toAnsi());
} else {
bot.tellraw("@a", component);
}
}
}
module.exports = ListCommand;
+52
View File
@@ -0,0 +1,52 @@
const mc = require("minecraft-protocol");
const util = require("util");
const CommandContext = require("../../command_util/command_context");
class McserverCommand extends CommandContext {
constructor() {
super("mcserver", ["pingserver"], "pings minecraft servers", 0, ["<ip>"]);
}
async execute(context) {
const bot = context.bot;
const config = context.config;
const args = context.arguments;
const [host, port] = args[0].split(":");
const source = context.source;
const server = await mc.ping({ host, port: Number(port ?? 25565) });
let component = [];
try {
component.push({
translate: "%s: %s:%s\n%s: (%s/%s)\n%s: %s\n%s",
color: config.colors.commands.tertiary,
with: [
{ text: "ip", color: config.colors.commands.primary },
{ text: `${host}`, color: config.colors.commands.secondary },
{
text: `${Number(port ?? 25565)}`,
color: config.colors.commands.secondary,
},
{ text: "players", color: config.colors.commands.primary },
{ text: `${server.players.online}`, color: config.colors.integer },
{ text: `${server.players.max}`, color: config.colors.integer },
{ text: "server version", color: config.colors.commands.primary },
{
text: `${server.version.name}`,
color: config.colors.commands.secondary,
},
server.description,
],
});
if (source.sources.console) {
bot.console.info(bot.getMessageAsPrismarine(component)?.toAnsi());
} else {
bot.tellraw("@a", component);
}
} catch (e) {
console.log(e.stack);
bot.chat.message(`${e.toString()}`);
}
}
}
module.exports = McserverCommand;
+65
View File
@@ -0,0 +1,65 @@
const CommandContext = require("../../command_util/command_context");
class NetmsgCommand extends CommandContext {
constructor() {
super(
"netmsg",
["networkmessage", "netmessage"],
"send a message to other servers",
0,
["<message>"],
);
}
execute(context) {
const bot = context.bot;
const config = context.config;
const args = context.arguments;
const source = context.source;
let component = [];
if (bot.options.private === true) {
component.push({
translate: "[%s] %s \u203a %s",
color: config.colors.commands.tertiary,
with: [
{
text: `${bot.options.serverName}`,
color: config.colors.commands.primary,
},
source?.player?.displayName ?? source?.player?.profile?.name,
{
text: `${args.join(" ")}`,
color: config.colors.commands.secondary,
},
],
});
} else {
component.push({
translate: "[%s:%s] %s \u203a %s",
color: config.colors.commands.tertiary,
with: [
{
text: `${bot.options.host}`,
color: config.colors.commands.primary,
},
{
text: `${bot.options.port}`,
color: config.colors.commands.primary,
},
source.player.displayName ?? source.player.profile.name,
{
text: `${args.join(" ")}`,
color: config.colors.commands.secondary,
},
],
});
}
for (const eachBot of bot.bots) {
eachBot.tellraw("@a", component);
}
}
}
module.exports = NetmsgCommand;
+14
View File
@@ -0,0 +1,14 @@
const CommandContext = require("../../command_util/command_context");
class RefillcoreCommand extends CommandContext {
constructor() {
super("refillcore", ["rc", "refill"], "refill the bots core", 0, [""]);
}
execute(context) {
const bot = context.bot;
const config = context.config;
bot.core.move(bot.position);
bot.tellraw("@a", "Refilling core,...");
}
}
module.exports = RefillcoreCommand;
+121
View File
@@ -0,0 +1,121 @@
const CommandError = require("../../command_util/command_error");
const { request } = require("undici");
const CommandContext = require("../../command_util/command_context");
const fixansi = require("../../util/ansi");
const fs = require("fs");
const path = require("path");
const { AttachmentBuilder } = require("discord.js");
class UrbanCommand extends CommandContext {
constructor() {
super("urban", ["urbandictionary"], "urban dictionary", 0, [
"<definition>",
]);
}
async execute(context) {
const source = context.source;
const args = context.arguments;
const bot = context.bot;
const prefix = [
{ text: "[", color: "dark_gray" },
{ text: "Urban", color: "#B72A00" },
{ text: "] ", color: "dark_gray" },
];
let component = [];
let term = `${args.join(" ")}`;
const query = new URLSearchParams({ term });
const dictResult = await request(
`https://api.urbandictionary.com/v0/define?${query}`,
);
const { list } = await dictResult.body.json();
if (bot.options.mode === "savageFriends") {
bot.chat.message(
"this command is disabled for this server for right now sorry!",
);
return;
}
if (!list.length) {
bot.tellraw("@a", { text: "No results found", color: "dark_red" });
}
for (const definitions of list) {
component.push(prefix, [
{
text: `${definitions.definition.replaceAll("\r", "").replaceAll("[", "\xa71\xa7n\xa7o").replaceAll("]", "\xa7r\xa77")}\n`,
color: "gray",
underlined: false,
italic: false,
translate: "",
hoverEvent: {
action: "show_text",
value: [
{
text: `Example \u203a \n ${definitions.example.replaceAll("\r", "").replaceAll("[", "\xa71\xa7n\xa7o").replaceAll("]", "\xa7r\xa77")}\n`,
color: "gray",
},
{
text: `Word \u203a ${definitions.word.replaceAll("\r", "").replaceAll("[", "\xa71\xa7n\xa7o").replaceAll("]", "\xa7r\xa77")}\n`,
color: "gray",
},
{
text: `Author \u203a ${definitions.author.replaceAll("\r", "").replaceAll("[", "\xa71\xa7n\xa7o").replaceAll("]", "\xa7r\xa77")}\n`,
color: "gray",
},
{
text: `written on \u203a ${definitions.written_on.replaceAll("\r", "").replaceAll("[", "\xa71\xa7n\xa7o").replaceAll("]", "\xa7r\xa77")}\n`,
color: "gray",
},
{
text: `Rating \u203a Thumbs-Up ${definitions.thumbs_up} / Thumbs-Down ${definitions.thumbs_down}`,
color: "gray",
},
],
},
clickEvent: {
action: "open_url",
value: `${definitions.permalink}`,
},
},
]);
}
if (source.sources.console) {
bot.console.info(bot.getMessageAsPrismarine(component)?.toAnsi());
} else if (source.sources.discord) {
const discordOutput = fixansi(
bot.getMessageAsPrismarine(component)?.toAnsi(),
);
if (discordOutput.length > 2000) {
const output = fs.writeFileSync(
path.join(__dirname, "../../output.txt"),
JSON.stringify(bot.getMessageAsPrismarine(component)?.toString()),
);
const file = new AttachmentBuilder(
path.join(__dirname, "../../output.txt"),
);
bot.discord.message.reply("output", {
files: [file],
});
// bot.discord.message.reply('meow') //[{
// files: path.join(__dirname, '../../output.txt')
// }])
// fs.unlinkSync(path.join(__dirname, '../../output.txt'))
} else {
bot.discord.message.reply(`\`\`\`ansi\n${discordOutput}\`\`\``);
}
// console.log(discordOutput.length)
} else if (bot.options.mode === "savageFriends") {
bot.core.run(`minecraft:tellraw @a ${JSON.stringify(component)}`);
} else {
bot.tellraw(`@a`, component);
}
}
}
module.exports = UrbanCommand;
+122
View File
@@ -0,0 +1,122 @@
const CommandError = require("../../command_util/command_error");
const { request } = require("undici");
const CommandContext = require("../../command_util/command_context");
class WeatherCommand extends CommandContext {
constructor() {
super("weather", [], "check the weather in locations", 0, [
"<weather/zip code>",
]);
}
async execute(context) {
const bot = context.bot;
const config = context.config;
const args = context.arguments;
const source = context.source;
let component = [];
try {
const url = await request(
`https://api.weatherapi.com/v1/current.json?key=${config.weatherApiKey}&q=${args.join(" ").replaceAll(" ", "%20")}`,
);
const info = await url.body.json();
component.push({
translate: "%s\n%s: %s, %s\n%s: %s (%s)\n%s\n%s\n%s: %s\n%s: %s",
color: config.colors.commands.tertiary,
with: [
{
translate: "%s: %s, %s %s",
with: [
{ text: "Location", color: config.colors.commands.primary },
{
text: `${info.location.name}`,
color: config.colors.commands.secondary,
},
{
text: `${info.location.region}`,
color: config.colors.commands.secondary,
},
{
text: `${info.location.country}`,
color: config.colors.commands.secondary,
},
],
},
{ text: "Coords", color: config.colors.commands.primary },
{ text: `${info.location.lat}`, color: config.colors.integer },
{ text: `${info.location.lon}`, color: config.colors.integer },
{ text: "Time", color: config.colors.commands.primary },
{
text: `${new Date().toLocaleTimeString("en-US", { timeZone: info.location.tz_id })}`,
color: config.colors.commands.secondary,
},
{
text: `${info.location.tz_id}`,
color: config.colors.commands.secondary,
},
{
translate: "%s: %s (%s), %s (%s)",
with: [
{ text: "Temp", color: config.colors.commands.primary },
{
text: `${Math.floor(info.current.temp_c)}`,
color: config.colors.integer,
},
{ text: "\u00b0C", color: config.colors.commands.secondary },
{
text: `${Math.floor(info.current.temp_f)}`,
color: config.colors.integer,
},
{ text: "\u00b0F", color: config.colors.commands.secondary },
],
},
{
translate: "%s: %s (%s, %s), %s (%s, %s)",
with: [
{ text: "Wind Speed", color: config.colors.commands.primary },
{
text: `${Math.floor(info.current.wind_kph)}`,
color: config.colors.integer,
},
{ text: "kph", color: config.colors.commands.secondary },
{
text: `${info.current.wind_dir}`,
color: config.colors.commands.secondary,
},
{
text: `${Math.floor(info.current.wind_mph)}`,
color: config.colors.integer,
},
{ text: "mph", color: config.colors.commands.secondary },
{
text: `${info.current.wind_dir}`,
color: config.colors.commands.secondary,
},
],
},
{ text: "Condition", color: config.colors.commands.primary },
{
text: `${info.current.condition.text}`,
color: config.colors.commands.secondary,
},
{ text: "Humidity", color: config.colors.commands.primary },
{
text: `${Math.floor(info.current.humidity)}`,
color: config.colors.integer,
},
],
});
if (source.sources.console) {
bot.console.info(bot.getMessageAsPrismarine(component)?.toAnsi());
} else {
bot.tellraw("@a", component);
}
} catch (e) {
bot.chat.message(e.toString());
}
}
}
module.exports = WeatherCommand;
+45
View File
@@ -0,0 +1,45 @@
const wiki = require("wikipedia");
const CommandError = require("../../command_util/command_error");
const fixansi = require("../../util/ansi");
const CommandContext = require("../../command_util/command_context");
class WikiCommand extends CommandContext {
constructor() {
super("wiki", ["wikipedia"], "wikipedia", 0, ["<article>"]);
}
async execute(context) {
const source = context.source;
const args = context.arguments;
const bot = context.bot;
const config = context.config;
let component = [];
try {
const page = await wiki.page(args.join(" "));
const summary = await page.intro();
component.push({ text: summary, color: config.colors.commands.primary });
if (source.sources.console) {
bot.console.info(bot.getMessageAsPrismarine(component)?.toAnsi());
} else if (source.sources.discord) {
bot.discord.message.reply(
`\`\`\`ansi\n${new fixansi(bot.getMessageAsPrismarine(component)?.toAnsi()).ansi}\`\`\``,
);
} else {
bot.tellraw("@a", component);
}
} catch (e) {
if (
e.toString() ===
"pageError: TypeError: Cannot read properties of undefined (reading 'pages')"
) {
bot.tellraw("@a", { text: "no article found!", color: "red" });
} else {
bot.tellraw(`@a`, `${e.toString()}`);
}
}
}
}
module.exports = WikiCommand;
+108
View File
@@ -0,0 +1,108 @@
const CommandError = require("../../command_util/command_error");
const fixAnsi = require("../../util/ansi");
const CommandContext = require("../../command_util/command_context");
class CloopCommand extends CommandContext {
constructor() {
super("cloop", ["commandloop", "loop"], "loops commands", 1, [
"add <interval> <command>",
"remove <index>",
"list",
"clear",
]);
}
execute(context) {
const bot = context.bot;
const config = context.config;
const source = context.source;
let args;
let component = [];
if (!source.sources.console && !source.sources.discord) {
args = context.arguments.slice(16);
} else {
args = context.arguments;
}
if (
!args &&
!args[0] &&
!args[1] &&
!args[2] &&
!args[3] &&
!args[4] &&
!args[5]
)
return;
switch (args[0]?.toLowerCase()) {
case "add":
if (isNaN(args[1])) throw new CommandError("invalid interval");
const interval = parseInt(args[1]);
const command = args.slice(2).join(" ");
bot.cloop.add(command, interval);
component.push(
`added ${command} to the cloops with the interval ${interval}`,
);
break;
case "clear":
bot.cloop.clear();
component.push("cleared the cloops");
break;
case "remove":
if (isNaN(args[1]))
throw new CommandError("argument must be an integer!");
const index = parseInt(args[1]);
bot.cloop.remove(index);
component.push(`removed ${index} from cloops`);
break;
case "list":
let listComponent = [];
let i = 0;
for (const cloop of bot.cloop.list) {
listComponent.push({
translate: "%s \u203a %s (%s)",
color: config.colors.commands.primary,
with: [
{ text: `${i}`, color: config.colors.integer },
cloop.command,
{ text: `${cloop.interval}`, color: config.colors.integer },
],
});
listComponent.push("\n");
i++;
}
listComponent.pop();
component.push({
translate: "Cloops (%s):",
color: config.colors.commands.primary,
with: [
{ text: `${bot.cloop.list.length}`, color: config.colors.integer },
],
});
component.push("\n");
if (bot.cloop.list.length > 0) {
component.push(listComponent);
}
break;
default:
throw new CommandError("invalid argument");
}
if (source.sources.discord) {
} else if (source.sources.console) {
bot.console.info(component);
} else {
bot.tellraw("@a", component);
}
}
}
module.exports = CloopCommand;
+24
View File
@@ -0,0 +1,24 @@
const CommandContext = require("../../command_util/command_context");
class ValidateCommand extends CommandContext {
constructor() {
super("validate", ["val"], "validate through the bot", 1, [""]);
}
execute(context) {
const bot = context.bot;
const args = context.arguments;
const source = context.source;
if (args[0] === bot.validation.trusted) {
bot.chat.message("&2Valid Trusted hash");
}
if (args[0] === bot.validation.admin) {
bot.chat.message("&2Valid Admin hash");
}
if (args[0] === bot.validation.owner) {
bot.chat.message("&2Valid Owner hash");
}
}
}
module.exports = ValidateCommand;
+41
View File
@@ -0,0 +1,41 @@
const CommandError = require("../../commandUtil/CommandError");
const CommandContext = require("../../commandUtil/CommandContext");
const trustLevel = require("../../commandUtil/CommandTrustLevel");
class kick extends CommandContext {
constructor() {
super(
"kick",
[],
"kick a player from the server",
trustLevel.admin,
["invalidstring", "item", "te"],
false,
);
}
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[0]?.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 = kick;
-368
View File
@@ -1,368 +0,0 @@
// TODO: Maybe add more authors
const bots = [
{
name: { text: "HBot", color: "aqua", bold: false },
authors: ["hhhzzzsss"],
exclaimer: "HBOT HARRYBUTT LMAOOOOOOOOOOOOOOOOO",
foundation: "java/mcprotocollib",
prefixes: ["#"],
},
{
name: [{ text: "FBot", color: "gold" }],
authors: ["popbob/aaa"],
exclaimer: "",
foundation: "nodejs/node-minecraft-protocol",
prefixes: ["+"],
},
{
name: { text: "CddehhBot", color: "red", bold: false },
authors: ["CaydennO1","spyingcreeper09"],
exclaimer: "WHAT IS THIS GOOFY AAAH FUCKING BOT FUCKING PIECE OF RETARDED ASS SHIT BOT ITS SO FUCKING SHIT I WANNA IPFILTER IT WITH FUCKING CHOMENS",
foundation: "nodejs/mineflayer",
prefixes: [","],
},
{
name: { text: "TurtleBot", color: "green", bold: false },
authors: ["TurtleKid"],
exclaimer: "nmp when?",
foundation: "nodejs/mineflayer",
prefixes: ["\\"],
},
{
name: { text: "NothingBot", color: "dark_red", bold: false },
authors: ["Yaode_owo"],
exclaimer: "uwu",
foundation: "nodejs/mineflayer",
prefixes: ["?"],
},
{
name: { text: "SC09Bot", color: "dark_gray", bold: false },
authors: ["spyingcreeper09"],
exclaimer: ":3",
foundation: "nodejs/node-minecraft-protocol",
prefixes: ["@"],
},
{
name: { text: "HorizonBot", color: "gold", bold: false },
authors: ["ZenZoya","Yaode_owo","Parker2991", "and others"],
exclaimer: "originally called §5FleamBot§r",
foundation: "nodejs/node-minecraft-protocol",
prefixes: ["^"],
},
{
name: { text: "64Bot", color: "gold", bold: false },
authors: ["64Will64"],
exclaimer: "NINTENDO 64?!?!??!?! 69Bot when??????",
foundation: "NodeJS/Mineflayer",
prefixes: ["w="],
},
{
name: { text: "Nebulabot", color: "dark_purple", bold: false },
authors: ["IuCC"],
exclaimer: "the void",
foundation: "NodeJS/Node-minecraft-protocol",
prefixes: ["["],
},
{
name: [
{ text: "Prism", color: "#00FF9C", bold: true },
{ text: "Bot", color: "white",bold:true },
],
authors: ["IuCC"],
exclaimer: "prismarine :3",
foundation: "NodeJS/Node-minecraft-protocol",
prefixes: ["["],
},
{
name: { text: "SharpBot", color: "aqua", bold: false },
authors: ["64Will64"],
exclaimer:
"sharp as in the tv? idfk im out of jokes also the first c# bot on the list??",
foundation: "C#/MineSharp",
prefixes: ["s="],
},
{
name: { text: "MoonBot", color: "red", bold: false },
authors: ["64Will64"],
exclaimer: "stop mooning/mooing me ",
foundation: "NodeJS/Mineflayer",
prefixes: ["m="],
},
{
name: { text: "TableBot", color: "yellow", bold: false },
authors: ["12alex12"],
exclaimer: "TABLE CLOTH BOT?!?! ",
foundation: "NodeJS/Node-minecraft-protocol",
prefixes: ["t!"],
},
{
name: [
{ text: "Evil", color: "dark_red", bold: false },
{ text: "Bot", color: "dark_purple" },
],
authors: ["FusseligerDev"],
exclaimer: "",
foundation: "Java/Custom",
prefixes: ["!"],
},
{
name: { text: "SBot Java", color: "white", bold: false }, // TODO: Gradient
authors: ["evkc"],
foundation: "Java/MCProtocolLib",
prefixes: [":"],
},
{
name: { text: "SBot Rust", color: "white", bold: false }, // TODO: Gradient
authors: ["evkc"],
foundation: "Rust",
prefixes: ["re:"],
},
{
name: { text: "Z-Boy-Bot", color: "dark_purple", bold: false }, // TODO: Gradient
exclaimer: "Most likely skidded along with kbot that the dev used",
authors: ["Romnci"],
foundation: "NodeJS/mineflayer or Java/mcprotocollib idfk",
prefixes: ["Z]"],
},
{
name: { text: "ABot", color: "gold", bold: true }, // TODO: Gradient
exclaimer: "not used anymore (replaced by V2)",
authors: [{ text: "_yfd", color: "light_purple" }],
foundation: "NodeJS/Node-Minecraft-Protocol",
prefixes: ["<"],
},
{
name: { text: "ABot-V2", color: "gold", bold: true }, // TODO: Gradient
exclaimer: "",
authors: [{ text: "_yfd", color: "light_purple" }],
foundation: "NodeJS/Node-Minecraft-Protocol",
prefixes: ["<"],
},
{
name: { text: "FardBot", color: "light_purple", bold: false },
authors: ["_yfd"],
exclaimer: "bot is dead lol",
foundation: "NodeJS/Mineflayer",
prefixes: ["<"],
},
{
name: { text: "ChipmunkBot Java", color: "green", bold: false },
authors: ["_ChipMC_"],
exclaimer:
"chips? also shoutout to chip and chayapak for helping in the rewrite",
foundation: "Java/MCProtocolLib",
prefixes: ["'", "/'"],
},
{
name: { text: "ChipmunkBot NodeJS", color: "green", bold: false },
authors: ["_ChipMC_"],
foundation: "NodeJS/Node-Minecraft-Protocol",
},
{
name: { text: "TestBot", color: "aqua", bold: false },
authors: ["Blackilykat"],
foundation: "Java/MCProtocolLib",
prefixes: ["-"],
},
{
name: { text: "UBot", color: "grey", bold: false },
authors: ["HexWoman"],
exclaimer: "UwU OwO",
foundation: "NodeJS/node-minecraft-protocol",
prefixes: ['"'],
},
{
name: { text: "ChomeNS Bot Java", color: "yellow", bold: false },
authors: ["chayapak"],
exclaimer: "wow its my bot !! ! 4374621q43567%^&#%67868-- chayapak \n rip ChomeNS bot i wonder what chayapak is currently doing -- Parker2991",
foundation: "Java/MCProtocolLib",
prefixes: ["*", "cbot ", "/cbot "],
},
{
name: { text: "ChomeNS Bot NodeJS", color: "yellow", bold: false },
authors: ["chayapak"],
foundation: "NodeJS/Node-Minecraft-Protocol",
prefixes: ["*", "cbot", "/cbot"],
},
{
name: { text: "RecycleBot", color: "dark_green", bold: false },
foundation: ["MorganAnkan"],
exclaimer: "nice bot",
language: "NodeJS/node-minecraft-protocol",
prefixes: ["="],
},
{
name: { text: "neobot", color: "blue", bold: false },
exclaimer: "n e o b o t ;oslkdfj;salkdfj;ladsjf",
authors: ["mirkokral"],
foundation: "java/MCProtocolLib",
prefixes: ["_"],
},
{
name: { text: "ManBot", color: "dark_green", bold: false },
exclaimer:
"(more like men bot :skull:) OH HAAAAAAAAAAAAAAIIILL LOGINTIMEDOUT",
authors: ["Man/LogintimedOut"],
foundation: "NodeJS/mineflayer",
prefixes: ["(Note:I dont remember!!)"],
},
{
name: [
{ text: "Useless", color: "red", bold: false },
{ text: "Bot", color: "gray", bold: false },
],
exclaimer: "it isnt useless its a good bot................",
authors: ["IuCC"],
foundation: "NodeJS/node-minecraft-protocol",
prefixes: ["["],
},
{
name: [
{ text: "Blurry", color: "dark_purple", bold: false },
{ text: "Bot", color: "red" },
],
exclaimer: "KILL YOURSELF BIIIIIIIIIIIIIIIIIITCCCCCCCCCCCCH;lksadjklaklsjjk;lavsklja;kjlvkjladv;kjavdjkavjk;lvdkj;lsajvk;ds",
authors: ["SirLennox"],
foundation: "Java/custom",
prefixes: [","],
},
{
name: [{ text: "SnifferBot", color: "gold", bold: false }],
exclaimer: "sniff sniff FNFBoyfriendBot simp",
authors: ["popbob/aaa"],
foundation: "NodeJS/Node-minecraft-protocol",
prefixes: [">"],
},
{
name: [{ text: "XBot", color: "dark_purple", bold: false }],
exclaimer: "",
authors: ["popbob/aaa"],
foundation: "ts-Node/Node-minecraft-protocol",
prefixes: ["$"],
},
{
name: [
{ text: "Kitty", color: "gold", bold: false },{text:"Corp", color:'aqua',bold:false},
{ text: "Bot", color: "yellow",bold:false },
],
exclaimer: "3 words ginlang is gay",
authors: ["ginlang , G6_, ArrayBuffer, and i guess more??"],
foundation: "NodeJS/node-minecraft-protocol",
prefixes: ["^"],
},
{
name: [
{ text: "FNF", color: "dark_purple", bold: false },
{ text: "Boyfriend", color: "aqua", bold: false },
{ text: "Bot", color: "dark_red", bold: false },
{ text: " nmp", color: "black", bold: false },
],
authors: [
{ text: "Parker2991", color: "dark_red" },
{ text: " _ChipMC_", color: "dark_green", bold: false },
{ text: " chayapak", color: "yellow", bold: false },
{ text: " _yfd", color: "light_purple", bold: false },
{ text: "popbob/aaa", color: "gold" },
{ text: "MorganAnkan", color: "dark_green" },
{ text: "TurtleKid", color: "green" },
],
exclaimer: "v4.0x - current",
foundation: "NodeJS/node-minecraft-protocol",
prefixes: [ '~', 'fnfbfbot ', '', '‮', '█' ],
},
{
name: [
{ text: "FNF", color: "dark_purple", bold: false },
{ text: "Boyfriend", color: "aqua", bold: false },
{ text: "Bot", color: "dark_red", bold: false },
{ text: " legacy", color: "green", bold: false },
],
authors: [
{ text: "Parker2991", color: "dark_red" },
{ text: " _ChipMC_", color: "dark_green", bold: false },
],
exclaimer:
"1037 LINES OF CODE WTFARD!??! also this version is in console commands only",
foundation: "NodeJS/mineflayer",
prefixes: [],
},
];
const CommandError = require('../util/command_error')
module.exports = {
name: "bots",
description: ["shows a list of known bots"],
aliases: ["knownbots"],
trustLevel: 0,
usage:[""],
async execute(context) {
const query = context.arguments.join(" ").toLowerCase();
const bot = context.bot;
if (query.length === 0) {
const list = [];
for (const info of bots) {
if (list.length !== 0) {
list.push({ text: ", ", color: "gray" });
}
list.push(info.name);
}
if (bot.options.isCreayun) {
let sus
// for ( sus instanceOf list)
bot.chat(bot.getMessageAsPrismarine(["Known bots (", bots.length, ") - "])?.toMotd().replaceAll('§','&'));
await bot.chatDelay(2000)
// setTimeout(async function() {
// for (const sus of list) {
bot.chat(bot.getMessageAsPrismarine(list)?.toString());
await bot.chatDelay(2000)
// }, 2000)
return
} else {
bot.sendFeedback(
bot.getMessageAsPrismarine(["Known bots (", bots.length, ") - ", ...list]).toMotd().replaceAll('\xa7','\xa7'),
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
-22
View File
@@ -1,22 +0,0 @@
const CommandError = require('../util/command_error')
module.exports = {
name: 'bruhify',
description:['bruhify text'],
aliases:['bruhifytext', 'bruh'],
trustLevel: 0,
usage:["smexy text here"],
execute (context) {
const bot = context.bot
const args = context.arguments
const message = context.arguments.join(' ')
if (bot.options.isCreayun) {
throw new CommandError('isCreayun is active!')
} else {
bot.bruhifyText = args.join(' ')
bot.sendFeedback(JSON.stringify(bot.bruhifyText))
}
}
}

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