mirror of
https://code.chipmunk.land/Parker2991/NitoriBot/
synced 2026-11-29 21:55:38 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9abee1f075 |
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"files": {
|
||||
"bot.js": [
|
||||
{
|
||||
"id": "49d4dcaa-8dea-44a6-8ca6-dd002ada6649",
|
||||
"line": 71,
|
||||
"version": 1016,
|
||||
"index": 2141
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ function inject (bot, dcclient, config) {
|
||||
if (!command) throw new Error(`Unknown command: "${commandName}"`)
|
||||
|
||||
if (command.trusted > 0) {
|
||||
const discordRoles = message.member?.roles?.cache // do i need the "?"s ?
|
||||
const discordRoles = message.member?.roles?.cache // do i need the "?"s ?
|
||||
|
||||
// TODO: Don't hardcode the roles
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ async function inject (bot, dcclient, config) {
|
||||
allowedMentions: {
|
||||
parse: []
|
||||
}
|
||||
})
|
||||
})//sed -i '/start/s/"/"choom -n 1000 -- /' .replit
|
||||
queue = ''
|
||||
}, 1000)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// TODO: Improve how messages are stringified
|
||||
const ChatMessage = require('prismarine-chat')('1.20.1')
|
||||
const ChatMessage = require('prismarine-chat')('1.20.2')
|
||||
const stringify = message => new ChatMessage(message).toString()
|
||||
|
||||
class CommandError extends Error {
|
||||
|
||||
@@ -2,7 +2,7 @@ const mc = require('minecraft-protocol')
|
||||
const { EventEmitter } = require('events')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const forge = require('minecraft-protocol-forge')
|
||||
|
||||
// "buildstring":"FNFBoyfriendBotX V4.0.8a Build:97",
|
||||
//"FoundationBuildString":"Ultimate Foundation V1.0.1 Build:31",
|
||||
function createBot(options = {}) {
|
||||
@@ -13,7 +13,7 @@ const rs = require('randomstring')
|
||||
options.host ??= 'localhost'
|
||||
options.username ??= username()
|
||||
options.hideErrors ??= false // HACK: Hide errors by default as a lazy fix to console being spammed with them
|
||||
options.forge ??= true
|
||||
|
||||
bot.options = options
|
||||
|
||||
// Create our client object, put it on the bot, and register some events
|
||||
@@ -29,16 +29,17 @@ options.forge ??= true
|
||||
})
|
||||
|
||||
client.on('end', reason => bot.emit('end', reason))
|
||||
|
||||
|
||||
client.on('error', error => bot.emit('error', error))
|
||||
|
||||
})
|
||||
|
||||
const buildstring = process.env['buildstring']
|
||||
|
||||
const client = options.client ?? mc.createClient(options)
|
||||
bot._client = client
|
||||
bot.emit('init_client', client)
|
||||
|
||||
|
||||
bot.bots = options.bots ?? [bot]
|
||||
|
||||
// Modules
|
||||
@@ -50,6 +51,7 @@ const buildstring = process.env['buildstring']
|
||||
bot.loadModule(module)
|
||||
} catch (error) {
|
||||
console.error('Failed to load module', filename, ':', error)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,4 +69,4 @@ function username() {
|
||||
return username;
|
||||
}
|
||||
|
||||
module.exports = createBot
|
||||
module.exports = createBot
|
||||
|
||||
+3
-1
@@ -1,10 +1,12 @@
|
||||
function parseMessage (message, data) {
|
||||
function parseMessage (message, data, context) {
|
||||
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
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
const crypto = require('crypto')
|
||||
|
||||
module.exports = {
|
||||
name: 'abotval',
|
||||
description:['console only'],
|
||||
consoleOnly: true,
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
|
||||
const prefix = '<' // mabe not hardcode the prefix
|
||||
|
||||
const args = context.arguments
|
||||
let hashlol
|
||||
const key = process.env['abot_key']
|
||||
const date = new Date();
|
||||
const min = date.getMinutes();
|
||||
|
||||
const md5 = crypto.createHash('md5').update(`${min}--_${key}`).digest('hex');
|
||||
const basehash = crypto.createHash('sha256').update(md5).digest('hex');
|
||||
const hashe = btoa(basehash)
|
||||
const fullhash = crypto.createHash('sha256').update(hashe).digest('hex');
|
||||
hashlol = fullhash.substring(0, 16);
|
||||
//already have to token ready
|
||||
|
||||
|
||||
const hash = hashlol
|
||||
|
||||
const command = `${prefix}${args.shift()} ${hash} ${args.join(' ')}`
|
||||
|
||||
const peefix = {
|
||||
|
||||
clickEvent: { action:"open_url", value: "https://doin-your.mom"},
|
||||
"color": "#5A5A5A",
|
||||
"translate": '[%s] %s \u203a %s',
|
||||
"with": [
|
||||
{ "color": "aqua", "text": "FNFBoyfriendBotX"},
|
||||
{ "color": "aqua", "text": `${bot.username}`},
|
||||
{ "color": "white", "text": command},
|
||||
]// why name it that?? xD
|
||||
}
|
||||
|
||||
|
||||
context.bot.tellraw([peefix])
|
||||
}//this isnt how..
|
||||
}//./commands/tellraw.js
|
||||
// Done!
|
||||
//are ya able to help with the validation/hashing in mine?
|
||||
// Make a copy of this
|
||||
//ahh ok
|
||||
//whos not
|
||||
|
||||
// Can cars fly?
|
||||
//fr
|
||||
// look at the console
|
||||
// watch console rq
|
||||
// Rip our ram lmao
|
||||
+16
-2
@@ -7,6 +7,13 @@ const bots = [
|
||||
foundation: 'java/mcprotocollib',
|
||||
prefixes: ['#']
|
||||
},
|
||||
{
|
||||
name: { text: '64Bot', color: 'gold', bold:false },
|
||||
authors: ['64Will64'],
|
||||
exclaimer:'NINTENDO 64?!?!??!?! 69Bot when??????',
|
||||
foundation: 'NodeJS/Mineflayer',
|
||||
prefixes: ['w=']
|
||||
},
|
||||
{
|
||||
name: [{ text: 'Evil', color: 'dark_red', bold:false }, {text:'Bot', color:'dark_purple'}],
|
||||
authors: ['FusseligerDev'],
|
||||
@@ -34,9 +41,16 @@ const bots = [
|
||||
prefixes: ['Z]']
|
||||
},
|
||||
{
|
||||
name: { text: 'ABot', color: 'gold', bold:false }, // TODO: Gradient
|
||||
name: { text: 'ABot', color: 'gold', bold:true }, // TODO: Gradient
|
||||
exclaimer: 'not used anymore (replaced by V2)',
|
||||
authors: [{text: '_yfd', color: 'light_purple'}],
|
||||
foundation: 'NodeJS/Node-Minecraft-Protocol',
|
||||
prefixes: ['<']
|
||||
},
|
||||
{
|
||||
name: { text: 'ABot-V2', color: 'gold', bold:true }, // TODO: Gradient
|
||||
exclaimer: '',
|
||||
authors: ['yfd'],
|
||||
authors: [{text: '_yfd', color: 'light_purple'}],
|
||||
foundation: 'NodeJS/Node-Minecraft-Protocol',
|
||||
prefixes: ['<']
|
||||
},
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
|
||||
module.exports = {
|
||||
|
||||
name: 'cai',
|
||||
description:['a broken asf command thats supposed to connect to beta.character.ai'],
|
||||
execute (context) {
|
||||
throw new CommandError('locked cuz of Error: Failed to fetch a lazy token')
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
const args = context.arguments;
|
||||
const CharacterAI = require("node_characterai_edited");
|
||||
const characterAI = new CharacterAI();
|
||||
|
||||
(async () => {
|
||||
// Authenticating as a guest (use `.authenticateWithToken()` to use an account)
|
||||
await characterAI.authenticateAsGuest();
|
||||
|
||||
// Place your character's id here
|
||||
const characterId = "-LojS2FMmI6dLLG4cPzCm1xIIpgwVktHwjHRIImfXSE";
|
||||
|
||||
const chat = await characterAI.createOrContinueChat(characterId);
|
||||
const response = await chat.sendAndAwaitResponse(message, true);
|
||||
try {
|
||||
source.sendFeedback(response)
|
||||
|
||||
} catch (e) {
|
||||
source.sendFeedback({ text: e.stack, color: 'red' })
|
||||
}
|
||||
|
||||
})();
|
||||
}
|
||||
}
|
||||
|
||||
/* try {
|
||||
const page = await wiki.page(args.join(' '))
|
||||
const summary = await page.summary()
|
||||
//const definitions = await urban.define(args.join(' '))
|
||||
|
||||
|
||||
source.sendFeedback({ text: summary.extract, color: 'green' })
|
||||
|
||||
} catch (e) {
|
||||
source.sendFeedback({ text: e.stack, color: 'red' })
|
||||
*/
|
||||
//https://beta.character.ai/chat?char=-LojS2FMmI6dLLG4cPzCm1xIIpgwVktHwjHRIImfXSE
|
||||
|
||||
/*const CharacterAI = require("node_characterai");
|
||||
const characterAI = new CharacterAI();
|
||||
|
||||
(async () => {
|
||||
// Authenticating as a guest (use `.authenticateWithToken()` to use an account)
|
||||
await characterAI.authenticateAsGuest();
|
||||
|
||||
// Place your character's id here
|
||||
const characterId = "8_1NyR8w1dOXmI1uWaieQcd147hecbdIK7CeEAIrdJw";
|
||||
|
||||
const chat = await characterAI.createOrContinueChat(characterId);
|
||||
|
||||
// Send a message
|
||||
const response = await chat.sendAndAwaitResponse("Hello discord mod!", true);
|
||||
|
||||
console.log(response);
|
||||
// Use `response.text` to use it as a string
|
||||
})();
|
||||
*/
|
||||
@@ -274,6 +274,27 @@ const bots = [
|
||||
foundation: '10/25/23',
|
||||
exclaimer:'merged serverinfo, memused, discord, logininfo, creators, version, uptime together',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v4.2.3', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '10/30/23',
|
||||
exclaimer:'added a antiskid measure (thanks _yfd)',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v4.2.4', color: 'green', bold:false },
|
||||
authors: ['Spooky update (note: might as well give it a codename since its halloween)'],
|
||||
|
||||
foundation: '10/31/23',
|
||||
exclaimer:'merged fard and reconnect together making recend, added more crash methods to the crash command, and remove 12 commands',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v4.2.5', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '11/8/23',
|
||||
exclaimer:'patched the exploit in the discordmsg command and made it to were with the netmsg command players cannot send empty messages',
|
||||
},
|
||||
]
|
||||
//back
|
||||
|
||||
|
||||
@@ -1,252 +0,0 @@
|
||||
/*/*
|
||||
* This example demonstrates how easy it is to create a bot
|
||||
* that sends chat messages whenever something interesting happens
|
||||
* on the server you are connected to.
|
||||
*
|
||||
* Below you can find a wide range of different events you can watch
|
||||
* but remember to check out the API documentation to find even more!
|
||||
*
|
||||
* Some events may be commented out because they are very frequent and
|
||||
* may flood the chat, feel free to check them out for other purposes though.
|
||||
*
|
||||
* This bot also replies to some specific chat messages so you can ask him
|
||||
* a few informations while you are in game.
|
||||
*/
|
||||
|
||||
const crypto = require('crypto')
|
||||
|
||||
module.exports = {
|
||||
name: 'chatterboxbot',
|
||||
|
||||
hashOnly:true,
|
||||
description:['please dont omfg'],
|
||||
execute (context) {
|
||||
const mineflayer = require('mineflayer')
|
||||
const { Vec3 } = require('vec3')
|
||||
|
||||
const randomstring = require('randomstring')
|
||||
const bot = mineflayer.createBot({
|
||||
host: context.bot.options.host,
|
||||
|
||||
username:randomstring.generate(16),
|
||||
|
||||
})
|
||||
|
||||
bot.on('chat', (username, message) => {
|
||||
if (username === bot.username) return
|
||||
const result = /canSee (-?[0-9]+),(-?[0-9]+),(-?[0-9]+)/.exec(message)
|
||||
if (result) {
|
||||
canSee(new Vec3(result[1], result[2], result[3]))
|
||||
return
|
||||
}
|
||||
switch (message) {
|
||||
case 'pos':
|
||||
sayPosition(username)
|
||||
break
|
||||
case 'wearing':
|
||||
sayEquipment()
|
||||
break
|
||||
case 'nick':
|
||||
sayNick()
|
||||
break
|
||||
case 'spawn':
|
||||
saySpawnPoint()
|
||||
break
|
||||
case 'block':
|
||||
sayBlockUnder(username)
|
||||
break
|
||||
case 'quit':
|
||||
quit(username)
|
||||
break
|
||||
default:
|
||||
bot.chat("That's nice")
|
||||
}
|
||||
|
||||
function canSee (pos) {
|
||||
const block = bot.blockAt(pos)
|
||||
const r = bot.canSeeBlock(block)
|
||||
if (r) {
|
||||
bot.chat(`I can see the block of ${block.displayName} at ${pos}`)
|
||||
} else {
|
||||
bot.chat(`I cannot see the block of ${block.displayName} at ${pos}`)
|
||||
}
|
||||
}
|
||||
|
||||
function sayPosition (username) {
|
||||
bot.chat(`I am at ${bot.entity.position}`)
|
||||
bot.chat(`You are at ${bot.players[username].entity.position}`)
|
||||
}
|
||||
|
||||
function sayEquipment () {
|
||||
const eq = bot.players[username].entity.equipment
|
||||
const eqText = []
|
||||
if (eq[0]) eqText.push(`holding a ${eq[0].displayName}`)
|
||||
if (eq[1]) eqText.push(`wearing a ${eq[1].displayName} on your feet`)
|
||||
if (eq[2]) eqText.push(`wearing a ${eq[2].displayName} on your legs`)
|
||||
if (eq[3]) eqText.push(`wearing a ${eq[3].displayName} on your torso`)
|
||||
if (eq[4]) eqText.push(`wearing a ${eq[4].displayName} on your head`)
|
||||
if (eqText.length) {
|
||||
bot.chat(`You are ${eqText.join(', ')}.`)
|
||||
} else {
|
||||
bot.chat('You are naked!')
|
||||
}
|
||||
}
|
||||
|
||||
function saySpawnPoint () {
|
||||
bot.chat(`Spawn is at ${bot.spawnPoint}`)
|
||||
}
|
||||
|
||||
function sayBlockUnder () {
|
||||
const block = bot.blockAt(bot.players[username].entity.position.offset(0, -1, 0))
|
||||
bot.chat(`Block under you is ${block.displayName} in the ${block.biome.name} biome`)
|
||||
console.log(block)
|
||||
}
|
||||
|
||||
function quit (username) {
|
||||
bot.quit(`${username} told me to`)
|
||||
}
|
||||
|
||||
function sayNick () {
|
||||
bot.chat(`My name is ${bot.player.displayName}`)
|
||||
}
|
||||
})
|
||||
|
||||
bot.on('whisper', (username, message, rawMessage) => {
|
||||
console.log(`I received a message from ${username}: ${message}`)
|
||||
bot.whisper(username, 'I can tell secrets too.')
|
||||
})
|
||||
bot.on('nonSpokenChat', (message) => {
|
||||
console.log(`Non spoken chat: ${message}`)
|
||||
})
|
||||
|
||||
bot.on('login', () => {
|
||||
bot.chat('Hi everyone!')
|
||||
})
|
||||
bot.on('spawn', () => {
|
||||
bot.chat('I spawned, watch out!')
|
||||
})
|
||||
bot.on('spawnReset', (message) => {
|
||||
bot.chat('Oh noez! My bed is broken.')
|
||||
})
|
||||
bot.on('forcedMove', () => {
|
||||
bot.chat(`I have been forced to move to ${bot.entity.position}`)
|
||||
})
|
||||
bot.on('health', () => {
|
||||
bot.chat(`I have ${bot.health} health and ${bot.food} food`)
|
||||
})
|
||||
bot.on('death', () => {
|
||||
bot.chat('I died x.x')
|
||||
})
|
||||
bot.on('kicked', (reason) => {
|
||||
console.log(`I got kicked for ${reason}`)
|
||||
})
|
||||
|
||||
bot.on('time', () => {
|
||||
bot.chat('Current time: ' + bot.time.timeOfDay)
|
||||
})
|
||||
bot.on('rain', () => {
|
||||
if (bot.isRaining) {
|
||||
bot.chat('It started raining.')
|
||||
} else {
|
||||
bot.chat('It stopped raining.')
|
||||
}
|
||||
})
|
||||
bot.on('noteHeard', (block, instrument, pitch) => {
|
||||
bot.chat(`Music for my ears! I just heard a ${instrument.name}`)
|
||||
})
|
||||
bot.on('chestLidMove', (block, isOpen) => {
|
||||
const action = isOpen ? 'open' : 'close'
|
||||
bot.chat(`Hey, did someone just ${action} a chest?`)
|
||||
})
|
||||
bot.on('pistonMove', (block, isPulling, direction) => {
|
||||
const action = isPulling ? 'pulling' : 'pushing'
|
||||
bot.chat(`A piston is ${action} near me, i can hear it.`)
|
||||
})
|
||||
|
||||
bot.on('playerJoined', (player) => {
|
||||
if (player.username !== bot.username) {
|
||||
bot.chat(`Hello, ${player.username}! Welcome to the server.`)
|
||||
}
|
||||
})
|
||||
bot.on('playerLeft', (player) => {
|
||||
if (player.username === bot.username) return
|
||||
bot.chat(`Bye ${player.username}`)
|
||||
})
|
||||
bot.on('playerCollect', (collector, collected) => {
|
||||
if (collector.type === 'player') {
|
||||
const item = collected.getDroppedItem()
|
||||
bot.chat(`${collector.username !== bot.username ? ("I'm so jealous. " + collector.username) : 'I '} collected ${item.count} ${item.displayName}`)
|
||||
}
|
||||
})
|
||||
|
||||
bot.on('entitySpawn', (entity) => {
|
||||
if (entity.type === 'mob') {
|
||||
console.log(`Look out! A ${entity.displayName} spawned at ${entity.position}`)
|
||||
} else if (entity.type === 'player') {
|
||||
bot.chat(`Look who decided to show up: ${entity.username}`)
|
||||
} else if (entity.type === 'object') {
|
||||
console.log(`There's a ${entity.displayName} at ${entity.position}`)
|
||||
} else if (entity.type === 'global') {
|
||||
bot.chat('Ooh lightning!')
|
||||
} else if (entity.type === 'orb') {
|
||||
bot.chat('Gimme dat exp orb!')
|
||||
}
|
||||
})
|
||||
bot.on('entityHurt', (entity) => {
|
||||
if (entity.type === 'mob') {
|
||||
bot.chat(`Haha! The ${entity.displayName} got hurt!`)
|
||||
} else if (entity.type === 'player') {
|
||||
bot.chat(`Aww, poor ${entity.username} got hurt. Maybe you shouldn't have a ping of ${bot.players[entity.username].ping}`)
|
||||
}
|
||||
})
|
||||
bot.on('entitySwingArm', (entity) => {
|
||||
bot.chat(`${entity.username}, I see that your arm is working fine.`)
|
||||
})
|
||||
bot.on('entityCrouch', (entity) => {
|
||||
bot.chat(`${entity.username}: you so sneaky.`)
|
||||
})
|
||||
bot.on('entityUncrouch', (entity) => {
|
||||
bot.chat(`${entity.username}: welcome back from the land of hunchbacks.`)
|
||||
})
|
||||
bot.on('entitySleep', (entity) => {
|
||||
bot.chat(`Good night, ${entity.username}`)
|
||||
})
|
||||
bot.on('entityWake', (entity) => {
|
||||
bot.chat(`Top of the morning, ${entity.username}`)
|
||||
})
|
||||
bot.on('entityEat', (entity) => {
|
||||
bot.chat(`${entity.username}: OM NOM NOM NOMONOM. That's what you sound like.`)
|
||||
})
|
||||
bot.on('entityAttach', (entity, vehicle) => {
|
||||
if (entity.type === 'player' && vehicle.type === 'object') {
|
||||
bot.chat(`Sweet, ${entity.username} is riding that ${vehicle.displayName}`)
|
||||
}
|
||||
})
|
||||
bot.on('entityDetach', (entity, vehicle) => {
|
||||
if (entity.type === 'player' && vehicle.type === 'object') {
|
||||
bot.chat(`Lame, ${entity.username} stopped riding the ${vehicle.displayName}`)
|
||||
}
|
||||
})
|
||||
bot.on('entityEquipmentChange', (entity) => {
|
||||
console.log('entityEquipmentChange', entity)
|
||||
})
|
||||
bot.on('entityEffect', (entity, effect) => {
|
||||
console.log('entityEffect', entity, effect)
|
||||
})
|
||||
bot.on('entityEffectEnd', (entity, effect) => {
|
||||
console.log('entityEffectEnd', entity, effect)
|
||||
})
|
||||
|
||||
}//this isnt how..
|
||||
}//./commands/tellraw.js
|
||||
// Done!
|
||||
//are ya able to help with the validation/hashing in mine?
|
||||
// Make a copy of this
|
||||
//ahh ok
|
||||
//whos not
|
||||
|
||||
// Can cars fly?
|
||||
//fr
|
||||
// look at the console
|
||||
// watch console rq
|
||||
// Rip our ram lmao
|
||||
@@ -1,42 +0,0 @@
|
||||
const crypto = require('crypto')
|
||||
|
||||
module.exports = {
|
||||
name: 'chomeval',
|
||||
|
||||
consoleOnly: true,
|
||||
description:['console only'],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
|
||||
const prefix = '*' // mabe not hardcode the prefix
|
||||
|
||||
const args = context.arguments
|
||||
|
||||
const key = process.env['chomens_bot_key']
|
||||
|
||||
const time = Math.floor(Date.now() / 5_000)
|
||||
|
||||
const value = bot.uuid + args[0] + time + key
|
||||
|
||||
const hash = crypto.createHash('sha256').update(value).digest('hex').substring(0, 16)
|
||||
|
||||
const command = `${prefix}${args.shift()} ${hash} ${args.join(' ')}`
|
||||
const message = context.arguments.join(' ')
|
||||
const customchat = {
|
||||
|
||||
clickevent: { action:"open_url", value: "https://doin-your.mom"},
|
||||
"color": "#5A5A5A",
|
||||
"translate": `[%s] %s \u203a %s`,
|
||||
"with": [
|
||||
{ "color": "aqua", "text": "FNFBoyfriendBotX"},
|
||||
{ "color": "aqua", "text": `${bot.username}`},
|
||||
{ "color": "#5A5A5A", "text": `${command}`},
|
||||
]//
|
||||
}//how i add a hover event??
|
||||
// clickEvent: bot.discord.invite ? { action: 'open_url', value: bot.discord.invite }
|
||||
context.bot.tellraw([customchat])
|
||||
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
let timer = null
|
||||
|
||||
module.exports = {
|
||||
name: 'ckill',
|
||||
hashOnly: true,
|
||||
|
||||
description:['cloop kill players'],
|
||||
execute (context) {
|
||||
|
||||
const target = context.arguments.join(' ')
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
|
||||
if (args[0] === 'clear' || args[0] === 'stop') {
|
||||
clearInterval(timer)
|
||||
timer = null
|
||||
return
|
||||
}
|
||||
|
||||
if (timer !== null) return
|
||||
|
||||
setInterval(function () {
|
||||
bot.core.run('sudo ' + target + ' suicide')
|
||||
}, 1)
|
||||
}
|
||||
}
|
||||
+12
-12
@@ -1,18 +1,18 @@
|
||||
module.exports = {
|
||||
name: 'cloop',
|
||||
hashOnly: true,
|
||||
description:['command loop commands'],
|
||||
execute (context) {
|
||||
description:['command loop commands, the args are add, remove, clear, and list'],
|
||||
execute (context, selector) {
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
|
||||
switch (args[0]) {
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
switch (selector, args[1]) {
|
||||
case 'add':
|
||||
if (parseInt(args[1]) === NaN) source.sendFeedback({ text: 'Invalid interval', color: 'red' })
|
||||
if (parseInt(args[2]) === NaN) source.sendFeedback({ text: 'Invalid interval', color: 'red' }, false)
|
||||
|
||||
const interval = parseInt(args[1])
|
||||
const command = args.slice(2).join(' ')
|
||||
const interval = parseInt(args[2])
|
||||
const command = args.slice(3).join(' ')
|
||||
|
||||
bot.cloop.add(command, interval)
|
||||
|
||||
@@ -23,9 +23,9 @@ hashOnly: true,
|
||||
|
||||
break
|
||||
case 'remove':
|
||||
if (parseInt(args[1]) === NaN) source.sendFeedback({ text: 'Invalid index', color: 'red' })
|
||||
if (parseInt(args[2]) === NaN) source.sendFeedback({ text: 'Invalid index', color: 'red' }, false)
|
||||
|
||||
const index = parseInt(args[1])
|
||||
const index = parseInt(args[2])
|
||||
|
||||
bot.cloop.remove(index)
|
||||
|
||||
@@ -38,7 +38,7 @@ hashOnly: true,
|
||||
case 'clear':
|
||||
bot.cloop.clear()
|
||||
|
||||
source.sendFeedback({ text: 'Cleared all cloops' })
|
||||
source.sendFeedback({ text: 'Cleared all cloops' }, false)
|
||||
|
||||
break
|
||||
case 'list':
|
||||
@@ -69,8 +69,8 @@ hashOnly: true,
|
||||
component.push('\n')
|
||||
component.push(listComponent)
|
||||
|
||||
source.sendFeedback(component)
|
||||
|
||||
source.sendFeedback([component], false)
|
||||
bot.tellraw([component])
|
||||
break
|
||||
default:
|
||||
source.sendFeedback({ text: 'Invalid action', color: 'red' })
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'cloopcrash',
|
||||
hashOnly: true,
|
||||
description:['cloop crashes a server '],
|
||||
execute (context) {
|
||||
|
||||
const bot = context.bot
|
||||
timer = setInterval(function () {
|
||||
bot.core.run(``)
|
||||
}, 1)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//what is wi
|
||||
// IDK
|
||||
@@ -0,0 +1,35 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const buildstring = process.env['buildstring']
|
||||
const foundation = process.env['FoundationBuildString']
|
||||
module.exports = {
|
||||
name: 'console',
|
||||
consoleOnly:true,
|
||||
// description:['make me say something in custom chat'],
|
||||
execute (context) {
|
||||
|
||||
const message = context.arguments.join(' ')
|
||||
const bot = context.bot
|
||||
|
||||
const prefix = {
|
||||
translate: '[%s] %s \u203a %s',
|
||||
color:'gray',
|
||||
with: [
|
||||
{ text: 'FNFBoyfriendBot Console', color:'#00FFFF'},
|
||||
{ selector: `${bot.username}`, color:'#00FFFF'},
|
||||
{ text: '', extra: [`${message}`], color:'white'},
|
||||
|
||||
],
|
||||
hoverEvent: { action:"show_text", value: 'FNF Sky is a fangirl but a simp for boyfriend confirmed??'},
|
||||
clickevent: { action:"open_url", value: "https://doin-your.mom"}
|
||||
}
|
||||
|
||||
bot.tellraw([prefix])
|
||||
}
|
||||
}
|
||||
//[%s] %s › %s
|
||||
//was it showing like that before?
|
||||
// just do text bc too sus rn ig
|
||||
// You should remove the with thing and the translate and replace
|
||||
|
||||
// Parker, why is hashing just random characters???
|
||||
//wdym
|
||||
@@ -0,0 +1,72 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'cowsay',
|
||||
description:['mooooo'],
|
||||
execute (context, selector) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments.join(' ')
|
||||
const component = ['']
|
||||
// const args = context.arguments
|
||||
const source = context.source
|
||||
const cowsay = require('cowsay2')
|
||||
const cows = require('cowsay2/cows')
|
||||
throw new CommandError('too lazy to work on it right now')
|
||||
if (args[0] === 'list') {
|
||||
const listed = Object.keys(cows)
|
||||
|
||||
let primary = true
|
||||
const message = []
|
||||
|
||||
for (const value of listed) {
|
||||
message.push({
|
||||
text: value + ' ',
|
||||
color: (!((primary = !primary)) ? 'gold' : 'yellow'),
|
||||
clickEvent: {
|
||||
action: 'suggest_command',
|
||||
value: `${context.bot.options.commands.prefix}cowsay ${value} `
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
source.sendFeedback(`${source} ${message}`)
|
||||
} else {
|
||||
source.sendFeedback(`\n ${cowsay.say(args)} ${cows[args[0]] }`)
|
||||
}
|
||||
}
|
||||
}
|
||||
// bot.tellraw({ text: cowsay.say(context.arguments.join(' ').slice(1), { cow: cows[args[0]] })
|
||||
|
||||
//const listed = JSON.parse(cows)
|
||||
//source.sendFeedback(`${listed}`, false)
|
||||
/* if (args[0] === 'list') {
|
||||
const listed = Object.keys(cows)
|
||||
|
||||
let primary = true
|
||||
const message = []
|
||||
|
||||
for (const value of listed) {
|
||||
message.push({
|
||||
text: value + ' ',
|
||||
color: (!((primary = !primary)) ? 'gold' : 'yellow'),
|
||||
clickEvent: {
|
||||
action: 'suggest_command',
|
||||
value: `${prefix}cowsay ${value} `
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
bot.tellraw(selector, message)
|
||||
} else {
|
||||
bot.tellraw(selector, { text: cowsay.say(args.slice(1).join(' '), { cow: cows[args[0]] }) })
|
||||
}
|
||||
},
|
||||
*/
|
||||
/*if (query.length === 0) {
|
||||
const list = []
|
||||
|
||||
for (const info of bots) {
|
||||
if (list.length !== 0) list.push({ text: ', ', color: 'gray' })
|
||||
list.push(info.name)
|
||||
}
|
||||
*/
|
||||
+28
-3
@@ -5,13 +5,38 @@ module.exports = {
|
||||
description:['crashes a server'],
|
||||
hashOnly: true,
|
||||
execute (context) {
|
||||
|
||||
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
if (!args && !args[0] && !args[1] && !args[2]) return
|
||||
switch (args[1]) {
|
||||
case `exe`:
|
||||
const amogus = process.env['amogus']
|
||||
bot.core.run(`${amogus}`)
|
||||
break
|
||||
case `give`:
|
||||
const amogus2 = process.env['amogus2']
|
||||
bot.core.run(`${amogus2}`)
|
||||
break
|
||||
|
||||
bot.core.run(``) // yfd: make it dotenv or whatever it is. I have a sus crash exploit that can be used I guess ☆*: .。. o(≧▽≦)o .。.:*☆
|
||||
|
||||
|
||||
|
||||
|
||||
default:
|
||||
const cmd = {//test.js
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'gold', text: 'crash'},
|
||||
]
|
||||
}
|
||||
context.source.sendError([cmd, { text: 'Invalid action', color: 'dark_red', bold:false }])
|
||||
context.source.sendError([cmd, { text: 'the args are give, and exe', color: 'green', bold:false }])
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
//how do i stop following? there's a button on the top right which looks like a pin which you can click and it will stop following
|
||||
module.exports = {
|
||||
name: 'creator',//thx
|
||||
description:['see who worked on the bot!'],
|
||||
execute (context, prefix) {
|
||||
const message = context.arguments.join(' ')
|
||||
const Creators = {
|
||||
translate: '%s%s%s%s%s%s%s%s',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'dark_red', text: 'Parker' },
|
||||
{ color: 'black', text: '2991' },
|
||||
{ color: 'white', text: ',' },
|
||||
{ color: 'dark_green', text: ' _ChipMC_' },
|
||||
{ color: 'white', text: ',' },
|
||||
{ color: 'yellow', text: ' chayapak' },
|
||||
{ color: 'white', text: ',' },
|
||||
{ color: 'light_purple', text: ' _yfd' },
|
||||
]
|
||||
}
|
||||
context.source.sendFeedback(['Thank you to all that helped! ', Creators])
|
||||
context.source.sendFeedback(['ChomeNS Discord Server: https://discord.gg/xdgCkUyaA4'])
|
||||
context.source.sendFeedback(['FNFBoyfriendBot Discord Server: https://discord.gg/GCKtG4erux'])
|
||||
context.source.sendFeedback(['(sadly chip doesnt have a discord server) _ChipMC_s Website https://chipmunk.land'])
|
||||
context.source.sendFeedback(['_yfds discord server: https://discord.gg/BKYKBxfDrs'])
|
||||
context.source.sendFeedback(['Parker2991 discord username: parker2991'])
|
||||
context.source.sendFeedback(['chayapaks discord username: chayapak'])
|
||||
context.source.sendFeedback(['_ChipMC_s discord username: chipmunkmc'])
|
||||
}
|
||||
}//https://discord.gg/GCKtG4erux
|
||||
+29
-5
@@ -1,11 +1,35 @@
|
||||
const CommandError = require("../CommandModules/command_error")
|
||||
|
||||
module.exports = {
|
||||
name: 'discordmsg',
|
||||
description:['make me say something in discord'],
|
||||
execute (context) {
|
||||
const args = context.arguments
|
||||
//const args = context.args
|
||||
const bot = context.bot
|
||||
const player = context.player
|
||||
|
||||
bot.discord.channel.send(args.join(' '))
|
||||
}
|
||||
const args = context.arguments
|
||||
|
||||
// if (args.translate !== '\u202e')
|
||||
// throw new CommandError('u202e detected')
|
||||
if (!args[0]) {
|
||||
context.source.sendFeedback({text:'Message is empty', color:'red'}, false)
|
||||
} else {
|
||||
bot.discord.channel.send(args[0])
|
||||
console.log(args[0])
|
||||
context.source.sendFeedback({ text: `Recieved: ${args[0]}`, color:'green'})
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//bot.discord.channel.send(args.join(' '))
|
||||
/*
|
||||
if(!args[0])
|
||||
context.source.sendFeedback('message is empty')
|
||||
|
||||
else if (args[0])
|
||||
bot.discord.channel.send(args[0])
|
||||
console.log(args[0])
|
||||
context.source.sendFeedback(`Recieved: ${args[0]}`)
|
||||
return;
|
||||
*/
|
||||
@@ -9,4 +9,4 @@ module.exports = {
|
||||
throw new Error(message)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -29,8 +29,8 @@ hashOnly:true, // vm owners please dont get mad at me ;-;
|
||||
bot.tellraw(selector, { text: util.inspect(err).replaceAll('runner', 'Parker2991'), color: 'red' })
|
||||
*/
|
||||
//let hash = bot.hash
|
||||
|
||||
switch (args[0]) {
|
||||
if (!args && !args[0] && !args[1] && !args[2]) return
|
||||
switch (args[1]) {
|
||||
case `run`:
|
||||
try {//context.eval()
|
||||
/*
|
||||
@@ -51,7 +51,7 @@ hashOnly:true, // vm owners please dont get mad at me ;-;
|
||||
//fr
|
||||
try {
|
||||
let nerd = "";
|
||||
const script = args.slice(1).join(' '); // Ensure script is a string
|
||||
const script = args.slice(2).join(' '); // Ensure script is a string
|
||||
const cOmtext = isolate.createContext();
|
||||
|
||||
(async () => {
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'fard',
|
||||
description:['fart'],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
throw new CommandError('disabled until owner hash is added')
|
||||
context.source.sendFeedback('farding right now....')
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const os = require('os')
|
||||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
const packageJSON = require("../package.json")
|
||||
async function getCpuModelName () {
|
||||
const cpuInfo = await fs.readFile('/proc/cpuinfo')
|
||||
const lines = cpuInfo.toString().split('\n')
|
||||
// among us way of doing it
|
||||
const modelName = lines.find((line) => line.startsWith('model name')).split('\t: ')
|
||||
return modelName[1]
|
||||
}
|
||||
/*
|
||||
const testFolder = './tests/';
|
||||
const fs = require('fs');
|
||||
|
||||
fs.readdir(testFolder, (err, files) => {
|
||||
files.forEach(file => {
|
||||
console.log(file);
|
||||
});
|
||||
});
|
||||
*/
|
||||
module.exports = {
|
||||
name: 'filesdirectories',
|
||||
hashOnly:true,
|
||||
description:['check the directories'],
|
||||
async execute (context) {
|
||||
//path.join(__dirname, 'config.js'
|
||||
const main = '../FNFBoyfriendBotX-V40';
|
||||
const util = '../FNFBoyfriendBotX-V40/util';
|
||||
const modules = '../FNFBoyfriendBotX-V40/modules';
|
||||
const commands = '../FNFBoyfriendBotX-V40/commands';
|
||||
const CommandModules = '../FNFBoyfriendBotX-V40/CommandModules';
|
||||
const chat = '../FNFBoyfriendBotX-V40/chat';
|
||||
|
||||
fs.readdir(main, (err, files) => {
|
||||
files.forEach(file => {
|
||||
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/' + file);
|
||||
});
|
||||
});
|
||||
fs.readdir(util, (err, files) => {
|
||||
files.forEach(file => {
|
||||
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/util/' + file);
|
||||
});
|
||||
});
|
||||
fs.readdir(modules, (err, files) => {
|
||||
files.forEach(file => {
|
||||
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/modules/' + file);
|
||||
});
|
||||
});
|
||||
fs.readdir(commands, (err, files) => {
|
||||
files.forEach(file => {
|
||||
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/commands/' + file);
|
||||
});
|
||||
});
|
||||
fs.readdir(CommandModules, (err, files) => {
|
||||
files.forEach(file => {
|
||||
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/CommandModules/' + file);
|
||||
});
|
||||
});
|
||||
fs.readdir(chat, (err, files) => {
|
||||
files.forEach(file => {
|
||||
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/chat/' + file);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/*const fs = require('fs');
|
||||
const path = require('path');
|
||||
const directory = './';
|
||||
|
||||
// use readdir method to read the files of the direcoty
|
||||
fs.readdir(directory, (err, files) => {
|
||||
files.forEach(file => {
|
||||
// get the details of the file
|
||||
let fileDetails = fs.lstatSync(path.resolve(directory, file));
|
||||
// check if the file is directory
|
||||
if (fileDetails.isDirectory()) {
|
||||
console.log('Directory: ' + file);
|
||||
} else {
|
||||
console.log('File: ' + file);
|
||||
}
|
||||
});
|
||||
});
|
||||
*/
|
||||
@@ -1,31 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
let timer = null
|
||||
|
||||
module.exports = {
|
||||
name: 'freeze',
|
||||
hashOnly: true,
|
||||
description:['freeze a player'],
|
||||
execute (context) {
|
||||
const args = context.arguments
|
||||
|
||||
if (args[0] === 'clear' || args[0] === 'stop') {
|
||||
clearInterval(this.timer)
|
||||
this.timer = null
|
||||
|
||||
context.source.sendFeedback('Cloop Stopped', false)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
if (this.timer !== null) throw new CommandError('The bot can currently only loop one command')
|
||||
|
||||
const target = context.arguments.join(' ')
|
||||
const bot = context.bot
|
||||
|
||||
this.timer = setInterval(function () {
|
||||
bot.core.run('tp ' + target)
|
||||
|
||||
}, 1)
|
||||
}
|
||||
}
|
||||
+15
-6
@@ -35,6 +35,7 @@ module.exports = {
|
||||
let valid
|
||||
for (const fard in bot.commandManager.amogus) { // i broke a key woops
|
||||
const command = bot.commandManager.amogus[fard]
|
||||
|
||||
if (args[0].toLowerCase() === command.name) {
|
||||
valid = true
|
||||
source.sendFeedback([cmd, `Description: ${command.description}`])
|
||||
@@ -45,7 +46,8 @@ module.exports = {
|
||||
if (valid) {
|
||||
|
||||
} else {
|
||||
source.sendFeedback([cmd, {text: 'Unknown command.', color: 'dark_red'}])
|
||||
const message = context.arguments
|
||||
source.sendFeedback([cmd, {translate: 'Unknown command %s. Type "~help" for help', with: [message], color: 'dark_red'}])
|
||||
}//i will add the descriptions reading as tests and action add the descriptions for the commands after
|
||||
const length = context.bot.commandManager.amogus.length // ok
|
||||
//i guess i did delete smh woops
|
||||
@@ -55,6 +57,7 @@ module.exports = {
|
||||
let pub_lick = []
|
||||
let t_rust = []
|
||||
let own_her = []
|
||||
let cons_ole
|
||||
for (const fard in bot.commandManager.amogus) {
|
||||
const command = bot.commandManager.amogus[fard]
|
||||
if (command.hashOnly) {
|
||||
@@ -68,16 +71,22 @@ module.exports = {
|
||||
pub_lick.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
color: 'green'
|
||||
}
|
||||
color: 'green'
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// for (const command of context.bot.commandManager.getCommands()) {
|
||||
// if (command.consoleOnly && !context.console) continue
|
||||
}
|
||||
const length = context.bot.commandManager.amogus.length
|
||||
context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust], false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
if (args[0]) {
|
||||
for (const command of bot.command_handler.commands) {
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
let timer = null
|
||||
|
||||
module.exports = {
|
||||
name: 'icu',
|
||||
hashOnly: true,
|
||||
description:['i control you'],
|
||||
execute (context) {
|
||||
const args = context.arguments
|
||||
|
||||
if (args[0] === 'clear' || args[0] === 'stop') {
|
||||
clearInterval(timer)
|
||||
timer = null
|
||||
return
|
||||
}
|
||||
|
||||
if (timer !== null) return
|
||||
|
||||
|
||||
const target = context.arguments.join(' ')
|
||||
const bot = context.bot
|
||||
|
||||
setInterval(function () {
|
||||
bot.core.run('tp ' + target + ' '+ target + ' ')
|
||||
|
||||
}, 1)
|
||||
}
|
||||
}
|
||||
+26
-21
@@ -1,6 +1,5 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
const os = require('os')
|
||||
const path = require('path')
|
||||
const fs = require('fs/promises')
|
||||
const packageJSON = require("../package.json")
|
||||
@@ -14,10 +13,11 @@ async function getCpuModelName () {
|
||||
module.exports = {
|
||||
name: 'info',
|
||||
description:['check the bots info. the args are version, discord, serverinfo, logininfo, uptime, memused, creators'],
|
||||
async execute (context) {
|
||||
async execute (context, client) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const cmd = {//test.js
|
||||
// const client = context.client
|
||||
const cmd = {//test.js
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
@@ -38,13 +38,18 @@ module.exports = {
|
||||
|
||||
switch (args[0]) {
|
||||
case 'version':
|
||||
const discordJSVersion = packageJSON.dependencies["discord.js"];
|
||||
const MinecraftProtocolVersion = packageJSON.dependencies["minecraft-protocol"];
|
||||
|
||||
context.source.sendFeedback({
|
||||
translate: '\n %s \n %s \n %s ',
|
||||
translate: '\n %s \n %s \n %s \n %s \n %s',
|
||||
with: [
|
||||
{ color: "green", text: `${buildstring}`},
|
||||
{ color: "green", text: `${foundationbuildstring}`},
|
||||
{ color: "green", text: 'BotEngine:Node-Minecraft-Protocol'},
|
||||
]
|
||||
{ color: "green", text: `BotEngine:Node-Minecraft-Protocol @${MinecraftProtocolVersion}`},
|
||||
{ color: "green", text: `Discord.js @${discordJSVersion}`},
|
||||
{ color: "green", text: `Node js Version @${process.version}`},
|
||||
]
|
||||
});
|
||||
|
||||
break
|
||||
@@ -59,11 +64,10 @@ module.exports = {
|
||||
|
||||
break
|
||||
case 'serverinfo':
|
||||
const discordJSVersion = packageJSON.dependencies["discord.js"];
|
||||
const MinecraftProtocolVersion = packageJSON.dependencies["minecraft-protocol"];
|
||||
|
||||
|
||||
const os = require('os')
|
||||
context.source.sendFeedback({
|
||||
translate: '\n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s',
|
||||
translate: '\n %s \n %s \n %s \n %s \n %s \n %s \n %s',
|
||||
with: [
|
||||
{ color: "green", text: `Hostname: ${os.hostname()}`},
|
||||
{ color: "green", text: `Working Directory: ${path.join(__dirname, '..')}`},
|
||||
@@ -72,26 +76,27 @@ module.exports = {
|
||||
{ color: "green", text: `OS name: ${os.version()}`},
|
||||
{ color: "green", text: `CPU cores: ${os.cpus().length}`},
|
||||
{ color: "green", text: `CPU model: ${await getCpuModelName()}`},
|
||||
{ color: "green", text: `Node js Version @${process.version}`},
|
||||
{ color: "green", text: `Minecraft-Protocol Version @${MinecraftProtocolVersion}`},
|
||||
{ color: "green", text: `Discord.js @${discordJSVersion}`},
|
||||
|
||||
|
||||
|
||||
]
|
||||
});
|
||||
break
|
||||
case 'logininfo':
|
||||
context.source.sendFeedback({
|
||||
translate: '\n %s \n %s \n %s \n %s',
|
||||
translate: '\n %s \n %s \n %s \n %s \n %s',
|
||||
with: [
|
||||
{ color: "green", text: `Bot Username: ${bot.username}`},
|
||||
{ color: "green", text: `Bot uuid: ${context.bot.uuid}`, clickEvent: {action:"copy_to_clipboard", value: `${context.bot.uuid}`}},
|
||||
{ color: "green", text: `Minecraft Java Version: ${context.bot.options.version}`},
|
||||
{ color: "green", text: `Server: ${context.bot.options.host}`},
|
||||
{ color: "green", text: `Port: ${context.bot.options.port}`},
|
||||
|
||||
]
|
||||
});
|
||||
});// clickevent: { action:"open_url", value: `${context.bot.discord.invite}`},
|
||||
|
||||
break
|
||||
break
|
||||
|
||||
case 'uptime':
|
||||
function format(seconds){
|
||||
function pad(s){
|
||||
@@ -115,24 +120,24 @@ module.exports = {
|
||||
});
|
||||
|
||||
|
||||
|
||||
break
|
||||
case 'memused':
|
||||
const os = require('os')
|
||||
const os2 = require('os')
|
||||
context.source.sendFeedback({
|
||||
translate: '\n %s',
|
||||
with: [
|
||||
{ color: "green", text: `§aMem §aused §a${Math.floor(os.freemem() / 1048576)} §aMiB §a/ §a${Math.floor(os.totalmem() / 1048576)} MiB`},
|
||||
{ color: "green", text: `§aMem §aused §a${Math.floor(os2.freemem() / 1048576)} §aMiB §a/ §a${Math.floor(os2.totalmem() / 1048576)} MiB`},
|
||||
|
||||
]
|
||||
});
|
||||
|
||||
break
|
||||
break
|
||||
|
||||
|
||||
case 'creators':
|
||||
|
||||
context.source.sendFeedback({
|
||||
translate: '\n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s',
|
||||
translate: '\n %s \n %s%s \n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s',
|
||||
with: [
|
||||
{ color: 'green', text: 'Thank you to all that helped!' },
|
||||
{ color: 'dark_red', text: 'Parker' },
|
||||
|
||||
+8
-6
File diff suppressed because one or more lines are too long
@@ -1,90 +0,0 @@
|
||||
module.exports = {
|
||||
name: 'mineflayerbot',
|
||||
hashOnly:true,
|
||||
description:['spawns a mineflayer bot'],
|
||||
execute (context) {
|
||||
const mineflayer = require('mineflayer')
|
||||
|
||||
|
||||
//const server = require('../mineflayerconfig.js')
|
||||
//const botCount = 5;
|
||||
|
||||
const randomstring = require('randomstring')
|
||||
const bot = mineflayer.createBot({
|
||||
host: context.bot.options.host,
|
||||
port: context.bot.options.port,
|
||||
username:'FNFBFBotMinion' + randomstring.generate(2),
|
||||
version: '1.19.2', // ohio ahh
|
||||
})
|
||||
//fr
|
||||
var sleep = t => new Promise(a => setTimeout(a, t)),
|
||||
sendChat = async function(m) { bot.chat(m.slice(0, 256)); await sleep(300); }
|
||||
|
||||
function between(min, max) {
|
||||
return Math.floor(
|
||||
Math.random() * (max - min) + min
|
||||
)
|
||||
}
|
||||
function runInCore(cmd) {
|
||||
bot._client.write('update_command_block', { location: { x: between(Math.floor(bot.entity.position.x) + 1, Math.floor(bot.entity.position.x) - 15), y: between(0, 3), z: between(Math.floor(bot.entity.position.z) + 1, Math.floor(bot.entity.position.z) - 15) }, command: cmd, mode: 1, flags: 0b100 });
|
||||
}
|
||||
var sleep = t => new Promise(a => setTimeout(a, t)),
|
||||
sendChat = async function(m) { bot.chat(m.slice(0, 256)); await sleep(300); }
|
||||
|
||||
function between(min, max) {
|
||||
return Math.floor(
|
||||
Math.random() * (max - min) + min
|
||||
)
|
||||
}
|
||||
bot.on('login', async () => {
|
||||
})
|
||||
|
||||
const cmd = require('mineflayer-cmd').plugin
|
||||
cmd.allowConsoleInput = false // Optional config argument
|
||||
bot.loadPlugin(cmd)
|
||||
//logs message
|
||||
function sayCommand(sender, flags, args) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let message = ''
|
||||
|
||||
if (flags.showsender) message += sender + ': '
|
||||
if (flags.color) message += '&' + flags.color[0]
|
||||
|
||||
message += args.join(' ')
|
||||
|
||||
bot.chat(message)
|
||||
resolve()
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
bot.once('cmd_ready', () => {
|
||||
bot.cmd.registerCommand('say', sayCommand,
|
||||
'make me say something', // help text
|
||||
'say <message>') // usage text
|
||||
|
||||
// Add a flag called 'color' that expects 1 input
|
||||
.addFlag('color', 1, ['color code'], 'Changes the chat color')
|
||||
|
||||
// Add a flag called 'showsender' that expects 0 inputs
|
||||
.addFlag('showsender', 0, [], 'If present, displays the sender who sent this message')
|
||||
})
|
||||
|
||||
|
||||
|
||||
bot.on('chat', (username, message) => {
|
||||
if (message.startsWith('!')) {
|
||||
const command = message.substring(1)
|
||||
bot.cmd.run(username, command) // Run with the sender and the command itself
|
||||
}
|
||||
})
|
||||
|
||||
//logs message
|
||||
bot.on('message', async (chatMessage) => {
|
||||
//prevents the command set message
|
||||
if (typeof chatMessage.translate === 'string' && chatMessage.translate.startsWith('advMode.')) return
|
||||
//console.log(chatMessage.toAnsi())
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
+13
-1
@@ -6,6 +6,7 @@ module.exports = {
|
||||
|
||||
const message = context.arguments.join(' ')
|
||||
const bot = context.bot
|
||||
|
||||
//throw new CommandError('ohio')
|
||||
const component = {
|
||||
translate: '[%s%s%s] [%s] %s \u203a %s',
|
||||
@@ -18,7 +19,18 @@ module.exports = {
|
||||
message
|
||||
]
|
||||
}
|
||||
|
||||
if (!message[0]) {
|
||||
context.source.sendFeedback({text:'Message is empty', color:'red'}, false)
|
||||
} else {
|
||||
for (const eachBot of bot.bots) eachBot.tellraw(component)
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
if (!args[0]) {
|
||||
context.source.sendFeedback({text:'Message is empty', color:'red'}, false)
|
||||
} else {
|
||||
bot.discord.channel.send(args[0])
|
||||
console.log(args[0])
|
||||
context.source.sendFeedback({ text: `Recieved: ${args[0]}`, color:'green'})
|
||||
*/
|
||||
@@ -1,19 +0,0 @@
|
||||
module.exports = {
|
||||
name: 'ping',
|
||||
description:['Pong!'],
|
||||
execute (context) {
|
||||
if (context.arguments.length !== 0) {
|
||||
const argumentList = []
|
||||
|
||||
for (const argument of context.arguments) {
|
||||
if (argumentList.length !== 0) argumentList.push(' ')
|
||||
argumentList.push(argument)
|
||||
}
|
||||
|
||||
context.source.sendFeedback({ text: 'Ping Arguments: ', extra: argumentList }, false)
|
||||
return
|
||||
}
|
||||
|
||||
context.source.sendFeedback('Pong!', false)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'recend',
|
||||
description:['reconnect or end the bot the usages are end, and reconnect'],
|
||||
hashOnly:true,
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
const args = context.arguments
|
||||
//throw new CommandError('disabled until owner hash is added')
|
||||
if (!args && !args[0] && !args[1] && !args[2]) return
|
||||
switch (args[1]) {
|
||||
case `end`:
|
||||
context.source.sendFeedback('farding right now....')
|
||||
process.exit(1)
|
||||
break
|
||||
case `reconnect`:
|
||||
const randomstring = require('randomstring')
|
||||
context.source.sendFeedback({ text: `Reconnecting to ${bot.options.host}:${bot.options.port}`, color: 'dark_green'})
|
||||
|
||||
|
||||
bot.chat(randomstring.generate(300))
|
||||
break
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
default:
|
||||
const cmd = {//test.js
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'gold', text: 'recend Cmd'},
|
||||
]
|
||||
}
|
||||
context.source.sendError([cmd, { text: 'Invalid action', color: 'dark_red', bold:false }])
|
||||
context.source.sendError([cmd, { text: 'the args for the info command is reconnect, and end', color: 'green', bold:false }])
|
||||
}
|
||||
}
|
||||
}
|
||||
/*context.source.sendFeedback('farding right now....')
|
||||
process.exit(1)
|
||||
*/
|
||||
@@ -1,19 +0,0 @@
|
||||
const randomstring = require('randomstring')
|
||||
|
||||
module.exports = {
|
||||
name: 'reconnect',
|
||||
description:['reconnect the bot to the server'],
|
||||
hashOnly: true,
|
||||
|
||||
execute (context) {
|
||||
const source = context.source
|
||||
const bot = context.bot
|
||||
|
||||
const randomstring = require('randomstring')
|
||||
context.source.sendFeedback({ text: `Reconnecting to ${bot.options.host}:${bot.options.port}`, color: 'dark_green'})
|
||||
|
||||
|
||||
bot.chat(randomstring.generate(300))
|
||||
}
|
||||
}
|
||||
//red sus
|
||||
+12
-11
@@ -11,19 +11,20 @@ module.exports = {
|
||||
const bot = context.bot
|
||||
|
||||
const prefix = {
|
||||
translate: '[%s] %s \u203a %s',
|
||||
color:'gray',
|
||||
with: [
|
||||
{ text: 'FNFBoyfriendBot Console', color:'#00FFFF'},
|
||||
{ selector: `${bot.username}`, color:'#00FFFF'},
|
||||
{ text: '', extra: [`${message}`], color:'white'},
|
||||
translate: '[%s%s%s] \u203a %s',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'dark_purple', text: 'FNF', bold:true },
|
||||
{ color: 'aqua', text: 'Boyfriend', bold:true },
|
||||
{ color: 'dark_red', text: 'Bot', bold:true},
|
||||
|
||||
],
|
||||
hoverEvent: { action:"show_text", value: 'FNF Sky is a fangirl but a simp for boyfriend confirmed??'},
|
||||
clickevent: { action:"open_url", value: "https://doin-your.mom"}
|
||||
}
|
||||
{ color: 'green', text: `${message}` }
|
||||
]
|
||||
}
|
||||
|
||||
bot.tellraw([prefix])
|
||||
|
||||
bot.tellraw([prefix])
|
||||
}
|
||||
}
|
||||
//[%s] %s › %s
|
||||
|
||||
@@ -52,6 +52,6 @@ hashOnly: true,
|
||||
bot.core.run('sudo * gms')
|
||||
bot.core.run('sudo * /sphere tnt 75')
|
||||
bot.core.run('sudo * kaboom')
|
||||
}, 10)
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'skin',
|
||||
description:['make everyone wear the same skin'],
|
||||
|
||||
execute (context) {
|
||||
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
bot.core.run('sudo * skin ' + message)
|
||||
bot.core.run('sudo fnfboyfriendbotx c:oh look we got little ' + message + '"s running around now great', false)
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'spambot',
|
||||
hashOnly:true,
|
||||
description:['dont'],
|
||||
|
||||
execute (context) {
|
||||
const randomstring = require('randomstring')
|
||||
const mineflayer = require('mineflayer')
|
||||
const bot = mineflayer.createBot({
|
||||
host: context.bot.options.host,
|
||||
|
||||
username: randomstring.generate(16),
|
||||
|
||||
})
|
||||
bot.on('login', async () => {
|
||||
setInterval(function () {
|
||||
bot.chat(`${Math.floor(Math.random() * 255) + 1}.${Math.floor(Math.random() * 255) + 1}.${Math.floor(Math.random() * 255) + 1}.${Math.floor(Math.random() * 255) + 1} anyone like doxing?`)
|
||||
return
|
||||
}, 100)
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'sudo',
|
||||
description:['make a player say or run something'],
|
||||
|
||||
execute (context) {
|
||||
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
bot.core.run('sudo ' + message)
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -5,14 +5,14 @@ module.exports = {
|
||||
description:['very 1st command in the bot to test to see if things are working'],
|
||||
|
||||
execute (context) {
|
||||
|
||||
|
||||
const bot = context.bot
|
||||
|
||||
const player = context.source.player.profile.name
|
||||
const uuid = context.source.player.uuid
|
||||
const message = context.arguments.join(' ') // WHY SECTION SIGNS!!
|
||||
context.source.sendFeedback(`§aHello, §aWorld!, §aPlayer: §a${player}, §auuid:§a ${uuid}, §aArgument: §a${message}`, false)
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
//context.source.player.displayName ?? context.source.player.profile.name,
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
let timer = null
|
||||
|
||||
module.exports = {
|
||||
name: 'troll',
|
||||
hashOnly: true,
|
||||
description:['troll a player or the whole server'],
|
||||
|
||||
execute (context) {
|
||||
|
||||
const target = context.arguments.join(' ')
|
||||
const bot = context.bot
|
||||
|
||||
const args = context.arguments
|
||||
|
||||
if (args[0] === 'clear' || args[0] === 'stop') {
|
||||
clearInterval(this.timer)
|
||||
this.timer = null
|
||||
|
||||
context.source.sendFeedback('Cloop Stopped', false)
|
||||
return
|
||||
}
|
||||
|
||||
if (this.timer !== null)
|
||||
this.timer = setInterval(function () {
|
||||
bot.core.run('day')
|
||||
bot.core.run('night')
|
||||
bot.core.run('clear ' + target)
|
||||
bot.core.run('effect give' + target + ' nausea')
|
||||
bot.core.run('effect give ' + target + ' slowness')
|
||||
bot.core.run('execute at @e run give ' + target + ' bedrock')
|
||||
bot.core.run('execute at @e run give ' + target + ' sand')
|
||||
bot.core.run('execute at @e run give ' + target + ' dirt')
|
||||
bot.core.run('execute at @e run give ' + target + ' diamond')
|
||||
bot.core.run('execute at @e run give ' + target + ' tnt')
|
||||
bot.core.run('execute at @e run give ' + target + ' crafting_table')
|
||||
bot.core.run('execute at @e run give ' + target + ' diamond_block')
|
||||
bot.core.run('smite ' + target)
|
||||
bot.core.run('sudo ' + target + ' kaboom')
|
||||
bot.core.run('essentials:ekill ' + target)
|
||||
bot.core.run('sudo ' + target + ' nuke')
|
||||
bot.core.run('eco give ' + target + ' 1000')
|
||||
bot.core.run('day')
|
||||
bot.core.run('night')
|
||||
bot.core.run('clear ' + target)
|
||||
bot.core.run('summon fireball 115 62 -5')
|
||||
bot.core.run('sudo ' + target + '/fast')
|
||||
bot.core.run('sudo ' + target + 'gms')
|
||||
bot.core.run('sudo ' + target + '/sphere tnt 75')
|
||||
bot.core.run('sudo ' + target + 'kaboom')
|
||||
bot.core.run('execute at @e run give ' + target + 'diamond_hoe 64')
|
||||
bot.core.run('sudo ' + target + 'summon tnt_minecart')
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
module.exports = {
|
||||
name: 'weather',
|
||||
description:['test'],
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
const source = context.source
|
||||
|
||||
const weather = require('weather-js');
|
||||
|
||||
// Options:
|
||||
// search: location name or zipcode
|
||||
// degreeType: F or C
|
||||
|
||||
weather.find({search: 'San Francisco, CA', degreeType: 'F'}, function(err, result) {
|
||||
if(err) console.log(err);
|
||||
|
||||
source.sendFeedback(JSON.stringify(result, null, 2));
|
||||
});
|
||||
[
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -15,7 +15,7 @@ module.exports = {
|
||||
source.sendFeedback({ text: summary.extract, color: 'green' })
|
||||
|
||||
} catch (e) {
|
||||
source.sendFeedback({ text: e.stack, color: 'red' })
|
||||
source.sendFeedback({ text: `${e.stack} \n this isnt actually a error`, color: 'red' })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+60
-3
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"bots": [
|
||||
{
|
||||
"host": "kaboom.pw",
|
||||
"host": "",
|
||||
|
||||
"version":"1.20.1",
|
||||
"reconnectDelay": 6000,
|
||||
@@ -42,7 +42,7 @@
|
||||
},
|
||||
|
||||
{
|
||||
"host": "kaboom.fusselig.xyz",
|
||||
"host": "mcslot.eu",
|
||||
"version":"1.20.1",
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
@@ -59,6 +59,63 @@
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"host": "mc.opengamesllc.com",
|
||||
"version":"1.20.1",
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
|
||||
},
|
||||
"Core": {
|
||||
"customName":"https://doin-your.mom"
|
||||
},
|
||||
|
||||
"discord": {
|
||||
"channelId": "1167253115557400726",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
},
|
||||
{
|
||||
"host": "168.100.232.7",
|
||||
"version":"1.20.1",
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
|
||||
},
|
||||
"Core": {
|
||||
"customName":"https://doin-your.mom"
|
||||
},
|
||||
|
||||
"discord": {
|
||||
"channelId": "1170167933687836732",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
},
|
||||
{
|
||||
"host": "xd.tplinkdns.com",
|
||||
"version":"1.20.1",
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
|
||||
},
|
||||
"Core": {
|
||||
"customName":"https://doin-your.mom"
|
||||
},
|
||||
|
||||
"discord": {
|
||||
"channelId": "1170401078811037757",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+28
-12
@@ -17,7 +17,7 @@ function inject (bot) {
|
||||
bot.on('registry_ready', registry => {
|
||||
ChatMessage = loadPrismarineChat(registry)
|
||||
})
|
||||
|
||||
|
||||
bot.chatParsers = [kaboomChatParser, chipmunkmodChatParser, chipmunkmodblackilykatverChatParser]
|
||||
|
||||
bot.on('packet.profileless_chat', packet => {
|
||||
@@ -34,22 +34,35 @@ function inject (bot) {
|
||||
|
||||
tryParsingMessage(message, { senderName: sender, players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine })
|
||||
})
|
||||
|
||||
// Ignores command set messages
|
||||
//chat.type.text
|
||||
//chat.type.announcement
|
||||
//chat.type.emote
|
||||
//packet.chatType_
|
||||
bot.on('packet.player_chat', packet => {
|
||||
const unsigned = tryParse(packet.unsignedChatContent)
|
||||
|
||||
bot.emit('player_chat', { plain: packet.plainMessage, unsigned, senderUuid: packet.senderUuid })
|
||||
|
||||
|
||||
bot.emit('player_chat', { plain: packet.plainMessage, unsigned, senderUuid: packet.senderUuid})
|
||||
|
||||
bot.emit('message', unsigned)
|
||||
|
||||
tryParsingMessage(unsigned, { senderUuid: packet.senderUuid, players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine})
|
||||
// const message = tryParse(packet.content)
|
||||
|
||||
tryParsingMessage(unsigned, { senderUuid: packet.senderUuid, players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine })
|
||||
})
|
||||
// const msg = {
|
||||
// translate: 'chat.type.announcement',
|
||||
// "with": [
|
||||
//`${JSON.stringify(' ')}`
|
||||
//]
|
||||
// };
|
||||
//bot.on('message', message => { bot.command(`tellraw @a ${JSON.stringify(msg)}`)})
|
||||
})
|
||||
|
||||
bot.on('packet.system_chat', packet => {
|
||||
const message = tryParse(packet.content)
|
||||
|
||||
if (message.translate === 'advMode.setCommand.success') return // Ignores command set message
|
||||
|
||||
if (message.translate === 'advMode.setCommand.success') return // Ignores command set messages
|
||||
|
||||
bot.emit('system_chat', { message, actionbar: packet.isActionBar })
|
||||
|
||||
if (packet.isActionBar) {
|
||||
@@ -85,7 +98,7 @@ function inject (bot) {
|
||||
bot.chat = message => {
|
||||
const acc = 0
|
||||
const bitset = Buffer.allocUnsafe(3)
|
||||
|
||||
|
||||
bitset[0] = acc & 0xFF
|
||||
bitset[1] = (acc >> 8) & 0xFF
|
||||
bitset[2] = (acc >> 16) & 0xFF
|
||||
@@ -96,9 +109,12 @@ function inject (bot) {
|
||||
salt: 0n,
|
||||
offset: 0,
|
||||
acknowledged: bitset
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
bot.command = command => {
|
||||
bot._client.write('chat_command', {
|
||||
command,
|
||||
@@ -114,5 +130,5 @@ function inject (bot) {
|
||||
|
||||
bot.tellraw = (message, selector = '@a') => bot.core.run('minecraft:tellraw @a ' + JSON.stringify(message)) // ? Should this be here?
|
||||
}
|
||||
|
||||
|
||||
module.exports = inject
|
||||
|
||||
@@ -5,7 +5,7 @@ function inject (bot, options) {
|
||||
start: options.core?.area.start ?? { x: 0, y: 0, z: 0 },
|
||||
end: options.core?.area.end ?? { x: 15, y: 0, z: 15 }
|
||||
},
|
||||
position: null,
|
||||
position: -1,
|
||||
currentBlockRelative: { x: 0, y: 0, z: 0 },
|
||||
|
||||
refill () {
|
||||
@@ -29,7 +29,7 @@ function inject (bot, options) {
|
||||
currentBlock () {
|
||||
const relativePosition = bot.core.currentBlockRelative
|
||||
const corePosition = bot.core.position
|
||||
if (!corePosition) return null
|
||||
if (!corePosition) return -1
|
||||
return { x: relativePosition.x + corePosition.x, y: relativePosition.y + corePosition.y, z: relativePosition.z + corePosition.z }
|
||||
},
|
||||
|
||||
@@ -68,7 +68,7 @@ function inject (bot, options) {
|
||||
|
||||
bot.on('move', () => {
|
||||
bot.core.move(bot.position)
|
||||
// setTimeout(() => bot.core.run('say Hello, world!'), 1000)
|
||||
//setTimeout(() => bot.core.run('say hi'), 100)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
function inject (bot, options) {
|
||||
bot.cloop = {
|
||||
list: [],
|
||||
list: [""],
|
||||
|
||||
add (command, interval) {
|
||||
this.list.push({ timer: setInterval(() => bot.core.run(command), interval), command, interval })
|
||||
@@ -13,7 +13,7 @@ function inject (bot, options) {
|
||||
clear () {
|
||||
for (const cloop of this.list) clearInterval(cloop.timer)
|
||||
|
||||
this.list = []
|
||||
this.list = [""]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,13 +32,13 @@ function inject (bot, options) {
|
||||
bot.updatehash
|
||||
} else if (command.hashOnly && source.sources.discord) {
|
||||
const event = source.discordMessageEvent
|
||||
|
||||
//message?.member?.displayName
|
||||
const roles = event.member?.roles?.cache
|
||||
//1106399617635061810
|
||||
const hasRole = roles.some(role => role.name === '1106399617635061810')
|
||||
|
||||
bot.tellraw(`${roles}`)
|
||||
const hasRole = roles.some(role => role.name === 'trusted')
|
||||
console.debug(hasRole)
|
||||
if (!hasRole) throw new CommandError({ translate: 'You are not trusted!' })
|
||||
}
|
||||
}//source.discordMessageEvent.event.member.roles?.cache
|
||||
/*
|
||||
for (const filename of fs.readdirSync(path.join(__dirname, '../commands'))) {
|
||||
try {
|
||||
@@ -55,7 +55,7 @@ function inject (bot, options) {
|
||||
|
||||
if (error instanceof CommandError) source.sendError(error._message)
|
||||
|
||||
else source.sendError({ translate: 'command.failed', hoverEvent: { action: 'show_text', contents: String(error.stack) } })
|
||||
else source.sendError({ text:String(error.stack), color:'red' })
|
||||
}
|
||||
},
|
||||
//
|
||||
@@ -86,7 +86,11 @@ for (const filename of fs.readdirSync(path.join(__dirname, '../commands'))) {
|
||||
} catch (error) {
|
||||
console.error('Failed to load command', filename, ':', error)
|
||||
}
|
||||
|
||||
if (process.env['anti-skid'] !== 'amogus is sus') {
|
||||
console.log('just no')
|
||||
process.exit(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
|
||||
+2
-2
@@ -34,12 +34,12 @@ function inject (bot, options) {
|
||||
bot.console.source = new CommandSource(null, { console: true, discord: false });
|
||||
bot.console.source.sendFeedback = message => {
|
||||
const lang = require('../lolus.json')
|
||||
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi(lang)
|
||||
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi()
|
||||
bot.console.log(ansi)
|
||||
}
|
||||
bot.on('message', message => {
|
||||
const lang = require('../lolus.json')//idk Parker I can help
|
||||
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi(lang)
|
||||
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi()
|
||||
const string = bot.getMessageAsPrismarine(message)?.toString()
|
||||
|
||||
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
|
||||
|
||||
+13
-8
@@ -6,7 +6,7 @@ const { MessageContent, GuildMessages, Guilds } = GatewayIntentBits
|
||||
const CommandSource = require('../CommandModules/command_source')
|
||||
|
||||
const client = new Client({ intents: [Guilds, GuildMessages, MessageContent] })
|
||||
|
||||
const util = require('util')
|
||||
client.login(process.env.discordtoken)
|
||||
|
||||
function inject (bot, options) {
|
||||
@@ -55,7 +55,7 @@ function inject (bot, options) {
|
||||
function sendDiscordMessage (message) {
|
||||
discordQueue += message + '\n'
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
const cleanMessage = escapeMarkdown(message.toAnsi(), true)
|
||||
const discordMsg = cleanMessage
|
||||
@@ -111,7 +111,7 @@ function inject (bot, options) {
|
||||
if (message.channel.id !== bot.discord.channel.id) return
|
||||
|
||||
if (message.content.startsWith(bot.discord.commandPrefix)) { // TODO: Don't hardcode this
|
||||
const source = new CommandSource({ profile: { name: message.member.displayName } }, { discord: true, console: false }, false, message)
|
||||
const source = new CommandSource({ profile: { name: message?.member?.displayName } }, { discord: true, console: false }, false, message)
|
||||
source.sendFeedback = message => {
|
||||
sendComponent(message)
|
||||
}
|
||||
@@ -152,20 +152,25 @@ function inject (bot, options) {
|
||||
clickEvent: bot.discord.invite ? { action: 'open_url', value: bot.discord.invite } : undefined,
|
||||
hoverEvent: { action: 'show_text', contents: 'Click to join the discord' }
|
||||
},
|
||||
{ text: message.member.displayName },
|
||||
{ text: message?.member?.displayName },
|
||||
message.content
|
||||
]
|
||||
})
|
||||
}
|
||||
client.on('messageCreate', messageCreate)
|
||||
bot.on('end', (reason) => {
|
||||
|
||||
sendDiscordMessage(`\`\`\`ansi\nDisconnected: ${reason}\n\`\`\``)
|
||||
bot.on('error', (error) => {
|
||||
console.log(error.stack)
|
||||
sendDiscordMessage(`\`\`\`ansi\nDisconnected: ${util.inspect(error.stack)}\n\`\`\``)
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
/* bot.console.info(
|
||||
`Disconnected from ${bot.server.host} (${event} event): ${util.inspect(reason)}`
|
||||
)
|
||||
channel.send(`Disconnected: \`${util.inspect(reason)}\``)
|
||||
*/
|
||||
function fixansi(message) {
|
||||
const ansilist = {
|
||||
"\x1B\[93m": "\x1B[33m", // Yellow
|
||||
|
||||
+11
-2
@@ -24,7 +24,16 @@ function inject (bot) {
|
||||
|
||||
// ok
|
||||
bot.on('end', () => {
|
||||
clearInterval(interval)
|
||||
// clearInterval(interval)
|
||||
})
|
||||
}
|
||||
module.exports = inject
|
||||
module.exports = inject
|
||||
/* const interval = setInterval(() => {
|
||||
const normalKey = process.env['chomensjs_key']
|
||||
const ownerHashKey = process.env['chomensjs_owner_key']
|
||||
bot.hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + normalKey).digest('hex').substring(0, 16)
|
||||
bot.ownerHash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + ownerHashKey).digest('hex').substring(0, 16)
|
||||
}, 2000)
|
||||
bot.on('end', () => {
|
||||
clearInterval(interval)
|
||||
*/
|
||||
+13
-2
@@ -18,9 +18,13 @@ function inject (bot) {
|
||||
}
|
||||
})
|
||||
|
||||
bot.on('player_remove', packet => {
|
||||
|
||||
/*bot.on('packet.player_remove', ({ players }) => {
|
||||
for (const player of players) {
|
||||
bot.players = bot.players.filter(entry => entry.uuid !== player)
|
||||
|
||||
}
|
||||
})
|
||||
*/
|
||||
|
||||
function addPlayer (entry) {
|
||||
bot.players = bot.players.filter(_entry => _entry.uuid !== entry.uuid)
|
||||
@@ -76,3 +80,10 @@ function inject (bot) {
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
/*function addPlayer (player, packet) {
|
||||
if (bot.players.getPlayer(player)) bot.emit('player_unvanished', player, packet)
|
||||
else bot.emit('player_added', player, packet)
|
||||
|
||||
bot.players.addPlayer(player)
|
||||
}
|
||||
*/
|
||||
+3
-3
@@ -1,19 +1,19 @@
|
||||
function inject (bot) {
|
||||
bot.position = null
|
||||
bot.position = -1
|
||||
|
||||
bot.on('packet.position', packet => {
|
||||
bot.position = {
|
||||
x: packet.flags & 1 ? (this.x + packet.x) : packet.x,
|
||||
y: packet.flags & 2 ? (this.y + packet.y) : packet.y,
|
||||
z: packet.flags & 4 ? (this.z + packet.z) : packet.z
|
||||
}
|
||||
}//this looks right?
|
||||
|
||||
bot._client.write('teleport_confirm', { teleportId: packet.teleportId })
|
||||
|
||||
bot.emit('move')
|
||||
})
|
||||
|
||||
bot.on('end', () => { bot.position = null })
|
||||
bot.on('end', () => { bot.position = -1 })
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
|
||||
@@ -10,6 +10,7 @@ function reconnect (bot, options) {
|
||||
bot._client = mc.createClient(options)
|
||||
bot.emit('init_client', bot._client)
|
||||
}, bot.reconnectDelay)
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ let muted = false
|
||||
if (permissionLevel < 2) bot.command('op @s[type=player]')
|
||||
else if (!commandSpyEnabled) bot.command('commandspy:commandspy on')
|
||||
else if (!vanished) bot.command('essentials:vanish enable')
|
||||
else if (muted) bot.command(`essentials:mute ${bot.uuid}`)
|
||||
else if (muted) bot.core.run(`essentials:mute ${bot.uuid}`)
|
||||
else if (!prefix) bot.command(`prefix &8[&bPrefix &4${bot.options.commands.prefix}&8]`)
|
||||
else if (gameMode !== 1) bot.command('gamemode creative @s[type=player]')
|
||||
else if (!skin) bot.command('skin Parker2991')
|
||||
|
||||
@@ -6,6 +6,7 @@ function inject (bot, context) {
|
||||
console.log(`Starting ${buildstring} .......`)
|
||||
console.log(`Username: ${bot.options.username}`)
|
||||
console.log(`Host: ${bot.options.host}:${bot.options.port}`)
|
||||
console.log(`Minecraft java version: ${bot.options.version}`)
|
||||
|
||||
|
||||
}
|
||||
|
||||
Generated
+1589
-1517
File diff suppressed because it is too large
Load Diff
+8
-3
@@ -8,15 +8,17 @@
|
||||
"chromium": "^3.0.3",
|
||||
"color-convert": "^2.0.1",
|
||||
"cowsay2": "^2.0.4",
|
||||
"discord.js": "^14.12.1",
|
||||
"discord.js": "^14.11.0",
|
||||
"dotenv": "^16.3.1",
|
||||
"https": "^1.0.0",
|
||||
"isolated-vm": "^4.6.0",
|
||||
"minecraft-data": "^3.46.2",
|
||||
"minecraft-data": "^3.48.0",
|
||||
"minecraft-protocol": "^1.44.0",
|
||||
"minecraft-protocol-forge": "^1.0.0",
|
||||
"mineflayer": "^4.14.0",
|
||||
"mineflayer-cmd": "^1.1.3",
|
||||
"moment-timezone": "^0.5.43",
|
||||
"net": "^1.0.2",
|
||||
"node_characterai": "^1.1.3",
|
||||
"node_characterai_edited": "^1.1.5",
|
||||
"node-weatherunderground": "^1.2.0",
|
||||
@@ -28,12 +30,15 @@
|
||||
"readline": "^1.3.0",
|
||||
"sharp": "^0.32.6",
|
||||
"urban-dictionary": "^3.0.2",
|
||||
"uuid-1345": "^1.0.2",
|
||||
"uuid-by-string": "^4.0.0",
|
||||
"vec3": "^0.1.8",
|
||||
"vm2": "^3.9.19",
|
||||
"vm2-fixed": "^0.0.1",
|
||||
"weather-js": "^2.0.0",
|
||||
"wikipedia": "^2.1.1",
|
||||
"wunderground-api": "^1.1.4"
|
||||
"wunderground-api": "^1.1.4",
|
||||
"yo-mamma": "^1.3.0",
|
||||
"zlib": "^1.0.5"
|
||||
}
|
||||
}
|
||||
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
function inject (bot, context) {
|
||||
|
||||
const buildstring = process.env['buildstring']
|
||||
const util = require('node:util')
|
||||
// bot.discord.channel.send('')
|
||||
bot.console.info(
|
||||
`Disconnected from ${bot.server.host} (${event} event): ${util.inspect(reason)}`
|
||||
)
|
||||
|
||||
|
||||
let timeout = options.reconnectTimeout
|
||||
|
||||
try {
|
||||
if (reason.text) {
|
||||
if (reason.text ===
|
||||
'Wait 5 seconds before connecting, thanks! :)' ||
|
||||
reason.text ===
|
||||
'You are logging in too fast, try again later.'
|
||||
) timeout = 1000 * 7
|
||||
}
|
||||
} catch (e) {
|
||||
bot.console.error(e)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
|
||||
Reference in New Issue
Block a user