forked from afspiegeling/NitoriBot
Compare commits
10
Commits
SkiBot-1.0
..
v1.2.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cee12661bf | ||
|
|
b57fd74b16 | ||
|
|
6f2e8b8cab | ||
|
|
faccae130d | ||
|
|
609bddf38e | ||
|
|
faadb943a3 | ||
|
|
7c30d303a7 | ||
|
|
5d13f5f12e | ||
|
|
707b314e25 | ||
|
|
d42c88ae91 |
-10
@@ -1,11 +1 @@
|
||||
# you know the usual stuff that needs to be ignored when committing
|
||||
|
||||
node_modules
|
||||
|
||||
config.yml
|
||||
|
||||
src/modules/exploits.js
|
||||
|
||||
.git
|
||||
|
||||
src/modules/custom_chat.js
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
SkiBot is a client chat bot created by Parker2991 using Custom FNFBoyfriendBot source
|
||||
|
||||
SkiBot's source can be found at https://code.chipmunk.land/Parker2991/SkiBot.git
|
||||
|
||||
FNFBoyfriendBot's source can be found at https://code.chipmunk.land/Parker2991/FridayNightFunkinBoyfriendBot.git
|
||||
|
||||
The idea of the bot is to try and make it close to a minecraft java client as much as i can
|
||||
|
||||
Setup:
|
||||
1. run git clone https://code.chipmunk.land/Parker2991/SkiBot
|
||||
|
||||
2. make sure to have node, npm, and git installed
|
||||
|
||||
if those are installed skip step 2
|
||||
|
||||
3. then run npm i to install packages
|
||||
|
||||
4. run node src to start the bot
|
||||
|
||||
note:
|
||||
files config.yml, exploits.js, and custom_chat.js are git ignored and wont be in the source because they contain private stuff such as keys and tokens and ips for private servers
|
||||
|
||||
but the bot will recreate them from src/data/
|
||||
|
||||
|
||||
after setup is done the bot can be configured and ran
|
||||
|
||||
@@ -0,0 +1,629 @@
|
||||
const mineflayer = require('mineflayer')
|
||||
let symbol = require('illegal-symbols')
|
||||
var server = 'sus.shhnowisnottheti.me'
|
||||
//NMxigAU6dR1KfgaQkKz87L
|
||||
const readline = require('readline')
|
||||
|
||||
|
||||
let rl = readline.createInterface({ input: process.stdin, output: process.stdout })
|
||||
|
||||
const randomstring = require('randomstring');
|
||||
const bot = mineflayer.createBot({
|
||||
host: server,
|
||||
port: 25565,
|
||||
username: randomstring.generate(8),
|
||||
version: 1.17,
|
||||
|
||||
})
|
||||
|
||||
var sleep = t => new Promise(a => setTimeout(a, t)),
|
||||
sendChat = async function(m) { bot.chat(m.slice(0, 256)); await sleep(300); }
|
||||
|
||||
function between(min, max) {
|
||||
return Math.floor(
|
||||
Math.random() * (max - min) + min
|
||||
)
|
||||
}
|
||||
|
||||
//variables
|
||||
var prefix = '&8&l[&b&lFNFBoyfriendBot&8&l]&8&l[&a&lConsole&8&l]&8&l[&4&lParker2991&8&l]';
|
||||
var consoleprefix = 'bcraw &8&l[&b&lFNFBoyfriendBot&8&l]&8&l[&a&lConsole&8&l]&8&l[&4&lParker2991&8&l]';
|
||||
|
||||
function randomchar() {
|
||||
const crypto = require("crypto");
|
||||
var hash = crypto.createHash("md5");
|
||||
var randomBytes = crypto.randomBytes(16);
|
||||
hash.update(randomBytes);
|
||||
var hashi = hash.digest(Math.round(Math.random()) ? "hex" : "Base64");
|
||||
|
||||
return hashi.substring(0, 16);
|
||||
}
|
||||
|
||||
function runInCore(cmd) {
|
||||
bot._client.write('update_command_block', {location: {x:between(Math.floor(bot.entity.position.x) + 1, Math.floor(bot.entity.position.x) - 15), y:between(0, 3), z:between(Math.floor(bot.entity.position.z) + 1, Math.floor(bot.entity.position.z) - 15)}, command: cmd, mode: 1, flags: 0b100});
|
||||
}
|
||||
bot.on('login', async () => { // time in ms
|
||||
console.log(`logged in as ${bot.username}`)
|
||||
//change the coords if bot has problems
|
||||
//await sendChat('/tp '+require('randomstring').generate({length:5,charset:'1234567890'})+' 5 '+require('randomstring').generate({length:6,charset:'1234567890'}))
|
||||
|
||||
|
||||
await sendChat('/tptoggle')
|
||||
await sendChat('/online')
|
||||
await sendChat('/v on')
|
||||
await sendChat('/console ')
|
||||
await sendChat('/username Parker2991')
|
||||
await sendChat('/c')
|
||||
await sendChat('/gmc')
|
||||
await sendChat('/top')
|
||||
await sendChat('/night')
|
||||
await sendChat('/gamerule doMobSpawning false')
|
||||
await sendChat('/de')
|
||||
await sendChat('/online')
|
||||
await sendChat('/cspy on')
|
||||
await sendChat('/prefix &4[BOT/CONSOLE]')
|
||||
await sendChat('/sudo parker2991 &8&l[&b&lOwner of the FNFBoyfriendbot&8&l])')
|
||||
|
||||
await sendChat(`/fill ${Math.floor(bot.entity.position.x)} 0 ${Math.floor(bot.entity.position.z)} ${Math.floor(bot.entity.position.x) - 15} 50 ${Math.floor(bot.entity.position.z - 15)} command_block replace`)
|
||||
|
||||
runInCore ('bcraw ' + prefix + '&b&lOwner &8&lis &4&lParker2991')
|
||||
runInCore ('bcraw ' + prefix + '&a &lVersion &a1.2')
|
||||
runInCore ('bcraw ' + prefix + 'full bot release &8&l1/26/23 &8&l1:47am &8&lCentral &8<ime')
|
||||
runInCore ('bcraw ' + prefix + '&a&lVersion 2.0 release date is unknown i may release the beta first ^-^ but it is being worked on as of right now but alot of good commands are coming even reworked commands planned release 2/8/23 or 2/10/23')
|
||||
runInCore ('bcraw ' + prefix + 'i will add commands to the bot that yall request for 2.0 give ideas i will be glad to accept request just dont make it screwed up requests')
|
||||
runInCore ('bcraw ' + prefix + 'also whitelists are and auto op are stil on hold until i can figure out how to but i will do a early whitelist concept for people that want access to the bot but cant be any people that troll i will ask people questions to see if they can be trusted')
|
||||
runInCore ('bcraw ' + prefix + 'current people that have access to it logintimedout, CNWPlayer,and Werewolfboy4 im also gonna ask chip on how to add a whitelist or ask ginlang i dont know')
|
||||
|
||||
|
||||
})
|
||||
const cmd = require('mineflayer-cmd').plugin
|
||||
|
||||
cmd.allowConsoleInput = false // Optional config argument
|
||||
bot.loadPlugin(cmd)
|
||||
//kill command function
|
||||
//test command
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'nuke':
|
||||
setInterval(function() { runInCore('essentials:ekill *'), 1 })
|
||||
setInterval(function() { runInCore('nuke'), 1 })
|
||||
setInterval(function() { runInCore('eco give * 1000'), 1 })
|
||||
setInterval(function() { runInCore('day'), 1 })
|
||||
setInterval(function() { runInCore('night'), 1 })
|
||||
setInterval(function() { runInCore('clear @a'), 1 })
|
||||
setInterval(function() { runInCore('summon fireball 115 62 -5'), 1 })
|
||||
setInterval(function() { runInCore('bcraw ' + prefix + 'WELCOME TO HELL'), 1 })
|
||||
break
|
||||
}
|
||||
})
|
||||
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'fakekick':
|
||||
runInCore('msg ' + args + ' @e @e @e @e @e @e @e @e @e')
|
||||
|
||||
break
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
//powertool command
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
|
||||
|
||||
|
||||
case 'Powertool':
|
||||
runInCore('sudo ' + args.join + 'pt')
|
||||
runInCore('bcraw enjoy your new powertool')
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'gmc':
|
||||
runInCore('sudo * gmc')
|
||||
runInCore('bcraw &4DOWN IN OHIO!')
|
||||
break
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'deop':
|
||||
setInterval(function() { runInCore('sudo ' + + 'deop @s[type=player]'), 1 })
|
||||
}
|
||||
})
|
||||
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
switch (command) {
|
||||
|
||||
case 'kaboom':
|
||||
setInterval(function() { runInCore('sudo * kaboom'), 8})
|
||||
runInCore('bcraw have fun =)')
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
|
||||
|
||||
switch (command) {
|
||||
|
||||
case 'BOOM':
|
||||
runInCore('sudo * /fast')
|
||||
runInCore('sudo * god')
|
||||
runInCore('sudo * gms')
|
||||
runInCore('sudo * /sphere tnt 75')
|
||||
runInCore('sudo * kaboom')
|
||||
runInCore('BOOM GOES THE DINOMITE')
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
})
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
|
||||
case 'kick':
|
||||
runInCore('/console @e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e')
|
||||
runInCore('bcraw &8&l[&b&m&lBoyfriendbot]&8 ' + args + ' has been kicked!')
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'greeting':
|
||||
|
||||
runInCore('bcraw &e Ayunami2000 Joined the game')
|
||||
|
||||
break
|
||||
}
|
||||
})
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'ban':
|
||||
runInCore('msg ' + args + ' @e @e @e @e @e @e @e @e @e')
|
||||
runInCore('bcraw &4&l&mConsole Has Perm Banned ' + args + 'For 22 Days And 14 Hours')
|
||||
|
||||
break
|
||||
}
|
||||
})
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'thor':
|
||||
setInterval(function() { runInCore('essentials:smite *' + args), 1 })
|
||||
break
|
||||
}
|
||||
})
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'console':
|
||||
runInCore('sudo * c: why not' + args.join(' '))
|
||||
break
|
||||
}
|
||||
})
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'servercrash':
|
||||
setInterval(function() { runInCore('essentials:sudo * kick @e[type=player] @e @e @e'), 1 })
|
||||
break
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'explode':
|
||||
setInterval(function() { runInCore('minecraft:execute unless entity @e[name= run ] at ' + args + ' run summon minecraft:tnt'), 1 })
|
||||
|
||||
|
||||
|
||||
break
|
||||
}
|
||||
})
|
||||
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'trol':
|
||||
setInterval(function() { runInCore('essentials:smite ' + args), 1 })
|
||||
setInterval(function() { runInCore('clear ' + args), 1 })
|
||||
setInterval(function() { runInCore('effect give ' + args + ' nausea'), 1 })
|
||||
setInterval(function() { runInCore('effect give ' + args + ' poison'), 1 })
|
||||
runInCore('gms ' + args)
|
||||
setInterval(function() { runInCore('spawnentity pig 10 ' + args), 1 })
|
||||
setInterval(function() { runInCore('spawnentity tntminecart 10 ' + args), 1 })
|
||||
setInterval(function() { runInCore('spawnentity zombie 10 ' + args), 1 })
|
||||
setInterval(function() { runInCore('kaboom ' + args), 1 })
|
||||
break
|
||||
}
|
||||
})
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'cloop':
|
||||
|
||||
setInterval(function() { runInCore(args.join(' ')), 1 })
|
||||
break
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'test':
|
||||
|
||||
|
||||
setInterval(function() { runInCore('minecraft:execute unless entity @s[name= run ] at ' + args + ' run summon minecraft:iron_golem'), 1 })
|
||||
break
|
||||
}
|
||||
})
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'soundbreaker':
|
||||
|
||||
|
||||
setInterval(function() { runInCore('sudo * execute at @a run playsound minecraft:entity.wolf.hurt master @a ~ ~ ~ 10000 1.5 1 '), 1 })
|
||||
|
||||
break
|
||||
}
|
||||
})
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'entityspam':
|
||||
setInterval(function() { runInCore('summon fireball 115 62 -5'), 1 })
|
||||
setInterval(function() { runInCore('summon ender_dragon 115 62 -6'), 1 })
|
||||
setInterval(function() { runInCore('summon zombie 115 62 -3'), 1 })
|
||||
setInterval(function() { runInCore('summon creeper 115 62 -1'), 1 })
|
||||
setInterval(function() { runInCore('summon blazed 115 62 -5'), 1 })
|
||||
setInterval(function() { runInCore('summon horse 115 62 -5'), 1 })
|
||||
setInterval(function() { runInCore('summon spider 115 62 -5'), 1 })
|
||||
setInterval(function() { runInCore('summon fireball 115 62 -5'), 1 })
|
||||
setInterval(function() { runInCore('summon ender_dragon 115 62 -6'), 1 })
|
||||
setInterval(function() { runInCore('summon zombie 115 62 -3'), 1 })
|
||||
setInterval(function() { runInCore('summon creeper 115 62 -1'), 1 })
|
||||
setInterval(function() { runInCore('summon blazed 115 62 -5'), 1 })
|
||||
setInterval(function() { runInCore('summon horse 115 62 -5'), 1 })
|
||||
setInterval(function() { runInCore('summon spider 115 62 -5'), 1 })
|
||||
break
|
||||
}
|
||||
})
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'tp':
|
||||
runInCore('essentials:sudo * tp ' + args)
|
||||
break
|
||||
}
|
||||
})
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'gms':
|
||||
setInterval(function() { runInCore('sudo * gms ' + args), 1 })
|
||||
break
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'stop':
|
||||
runInCore('bcraw ' + prefix + 'STOPPING SERVER.....')
|
||||
setInterval(function() { runInCore('execute unless entity @s[name= run ] run stop'), 1 })
|
||||
break
|
||||
}
|
||||
})
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'tntspam':
|
||||
setInterval(function() { runInCore('summon tnt 600 65 6000'), 1 })
|
||||
setInterval(function() { runInCore('summon tnt 100 65 100'), 1 })
|
||||
setInterval(function() { runInCore('summon tnt 60045 65 60000'), 1 })
|
||||
setInterval(function() { runInCore('summon tnt 60 65 55'), 1 })
|
||||
setInterval(function() { runInCore('summon tnt 800 65 60000000'), 1 })
|
||||
setInterval(function() { runInCore('summon tnt 600000 65 6000000'), 1 })
|
||||
setInterval(function() { runInCore('summon tnt 60000000 65 6500000'), 1 })
|
||||
setInterval(function() { runInCore('summon tnt 6600 65 60060'), 1 })
|
||||
setInterval(function() { runInCore('summon tnt 6500 65 56000'), 1 })
|
||||
setInterval(function() { runInCore('summon tnt 6070 65 777776000'), 1 })
|
||||
setInterval(function() { runInCore('summon tnt 888600 65 608700'), 1 })
|
||||
setInterval(function() { runInCore('summon tnt 68700 65 987000'), 1 })
|
||||
setInterval(function() { runInCore('summon tnt 98000 65 567000'), 1 })
|
||||
setInterval(function() { runInCore('summon tnt 56700 65 696700'), 1 })
|
||||
setInterval(function() { runInCore('summon tnt 688800 65 6088800'), 1 })
|
||||
setInterval(function() { runInCore('summon tnt 2 65 4'), 1 })
|
||||
setInterval(function() { runInCore('summon tnt 25 65 80'), 1 })
|
||||
setInterval(function() { runInCore('summon tnt 976769 65 56979'), 1 })
|
||||
setInterval(function() { runInCore('summon tnt 6979 65 21'), 1 })
|
||||
setInterval(function() { runInCore('summon tnt 21 65 600000'), 1 })
|
||||
setInterval(function() { runInCore('summon tnt 434 65 60434400'), 1 })
|
||||
setInterval(function() { runInCore('summon tnt 640 65 6545450'), 1 })
|
||||
setInterval(function() { runInCore('summon tnt 6045450 65 6000'), 1 })
|
||||
setInterval(function() { runInCore('summon tnt 6095850 65 6000'), 1 })
|
||||
|
||||
break
|
||||
}
|
||||
})
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'prefix':
|
||||
runInCore('sudo * prefix ' + args)
|
||||
break
|
||||
}
|
||||
})
|
||||
//cloop command
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'annoy':
|
||||
setInterval(function() { runInCore('sudo * bc WHY NO WHY NOT' + ''), 1 })
|
||||
setInterval(function() { runInCore('sudo * playsound minecraft:entity.cat.hurt master @a ~ ~ ~ 10000 1.5 1' + ''), 1 })
|
||||
|
||||
break
|
||||
}
|
||||
})
|
||||
//freeze command
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'freeze':
|
||||
setInterval(function() { runInCore('tp ' + args + ' ' + args), 1 })
|
||||
break
|
||||
}
|
||||
})
|
||||
|
||||
//troll command
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'troll':
|
||||
setInterval(function() { runInCore('day'), 1 })
|
||||
setInterval(function() { runInCore('night'), 1 })
|
||||
setInterval(function() { runInCore('clear @a'), 1 })
|
||||
setInterval(function() { runInCore('effect give @a nausea'), 1 })
|
||||
setInterval(function() { runInCore('effect give @a slowness'), 1 })
|
||||
setInterval(function() { runInCore('give @a bedrock'), 1 })
|
||||
setInterval(function() { runInCore('give @a sand'), 1 })
|
||||
setInterval(function() { runInCore('give @a dirt'), 1 })
|
||||
setInterval(function() { runInCore('give @a diamond'), 1 })
|
||||
setInterval(function() { runInCore('give @a tnt'), 1 })
|
||||
setInterval(function() { runInCore('give @a crafting_table'), 1 })
|
||||
setInterval(function() { runInCore('give @a diamond_block'), 1 })
|
||||
setInterval(function() { runInCore('smite *'), 1 })
|
||||
setInterval(function() { runInCore('essentials:smite ' + args), 1 })
|
||||
setInterval(function() { runInCore('clear ' + args), 1 })
|
||||
setInterval(function() { runInCore('effect give ' + args + ' nausea'), 1 })
|
||||
setInterval(function() { runInCore('effect give ' + args + ' poison'), 1 })
|
||||
runInCore('gms ' + args)
|
||||
setInterval(function() { runInCore('spawnentity pig 10 ' + args), 1 })
|
||||
setInterval(function() { runInCore('spawnentity tntminecart 10 ' + args), 1 })
|
||||
setInterval(function() { runInCore('spawnentity zombie 10 ' + args), 1 })
|
||||
setInterval(function() { runInCore('kaboom ' + args), 1 })
|
||||
|
||||
break
|
||||
}
|
||||
})
|
||||
|
||||
//icu command
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'icu':
|
||||
setInterval(function() { runInCore('tp ' + args + ' Parker2991'), 1 })
|
||||
break
|
||||
}
|
||||
})
|
||||
//say command
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
|
||||
switch (command) {
|
||||
case 'say':
|
||||
runInCore('bcraw ' + prefix + args.join(' '))
|
||||
|
||||
break
|
||||
}
|
||||
})
|
||||
|
||||
//deop command
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'serverdeop':
|
||||
setInterval(function() { runInCore('sudo * deop @e[type=player] ' + args), 1 })
|
||||
setInterval(function() { runInCore('op @s[type=player] ' + args), 1 })
|
||||
setInterval(function() { runInCore('op parker2991 ' + args), 1 })
|
||||
break
|
||||
}
|
||||
})
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'sudo':
|
||||
runInCore('sudo ' + args.join(' '))
|
||||
|
||||
break
|
||||
}
|
||||
})
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'tpe':
|
||||
runInCore('execute unless entity @s[name= run ] run tp @e[type=!player] ' + args)
|
||||
|
||||
break
|
||||
}
|
||||
})
|
||||
|
||||
//sudoall command
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'sudoall':
|
||||
runInCore('essentials:sudo * ' + args.join(' '))
|
||||
console.log("succesfully execute sudo command " + args)
|
||||
break
|
||||
}
|
||||
})
|
||||
|
||||
rl.on('line', (line) => {
|
||||
let args = line.split(' ')
|
||||
let command = args.shift()
|
||||
|
||||
switch (command) {
|
||||
case 'selfdestruct':
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
setInterval(function() { runInCore('day'), 1 })
|
||||
setInterval(function() { runInCore('night'), 1 })
|
||||
setInterval(function() { runInCore('clear @a'), 1 })
|
||||
setInterval(function() { runInCore('effect give @a nausea'), 1 })
|
||||
setInterval(function() { runInCore('effect give @a slowness'), 1 })
|
||||
setInterval(function() { runInCore('give @a bedrock'), 1 })
|
||||
setInterval(function() { runInCore('give @a sand'), 1 })
|
||||
setInterval(function() { runInCore('give @a dirt'), 1 })
|
||||
setInterval(function() { runInCore('give @a diamond'), 1 })
|
||||
setInterval(function() { runInCore('give @a tnt'), 1 })
|
||||
setInterval(function() { runInCore('give @a crafting_table'), 1 })
|
||||
setInterval(function() { runInCore('give @a diamond_block'), 1 })
|
||||
setInterval(function() { runInCore('smite *'), 1 })
|
||||
setInterval(function() { runInCore('kaboom'), 1 })
|
||||
setInterval(function() { runInCore('essentials:ekill *'), 1 })
|
||||
setInterval(function() { runInCore('nuke'), 1 })
|
||||
setInterval(function() { runInCore('eco give * 1000'), 1 })
|
||||
setInterval(function() { runInCore('day'), 1 })
|
||||
setInterval(function() { runInCore('night'), 1 })
|
||||
setInterval(function() { runInCore('clear @a'), 1 })
|
||||
setInterval(function() { runInCore('summon fireball 115 62 -5'), 1 })
|
||||
setInterval(function() { runInCore('sudo * /fast'), 1 })
|
||||
setInterval(function() { runInCore('sudo * gms'), 1 })
|
||||
setInterval(function() { runInCore('sudo * /sphere tnt 75'), 1 })
|
||||
setInterval(function() { runInCore('sudo * kaboom'), 1 })
|
||||
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bot.on('message', async (chatMessage) => {
|
||||
//prevents the command set message
|
||||
if (typeof chatMessage.translate === 'string' && chatMessage.translate.startsWith('advMode.')) return
|
||||
console.log(chatMessage.toAnsi())
|
||||
})
|
||||
|
||||
Generated
-1309
File diff suppressed because it is too large
Load Diff
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"discord.js": "^14.25.1",
|
||||
"js-yaml": "^4.1.1",
|
||||
"minecraft-data": "^3.102.3",
|
||||
"minecraft-protocol": "^1.62.0",
|
||||
"prismarine-chat": "^1.12.0",
|
||||
"prismarine-nbt": "^2.8.0",
|
||||
"prismarine-registry": "^1.11.0",
|
||||
"terminal-kit": "^3.1.2",
|
||||
"undici": "^7.18.1"
|
||||
}
|
||||
}
|
||||
-75
@@ -1,75 +0,0 @@
|
||||
const mc = require('minecraft-protocol');
|
||||
const { EventEmitter } = require('events');
|
||||
EventEmitter.defaultMaxListeners = 5e6;
|
||||
const util = require('util');
|
||||
const ChatMessage = require('prismarine-chat');
|
||||
function createBot(context) {
|
||||
const bot = new EventEmitter();
|
||||
const config = context.config;
|
||||
bot.server = {
|
||||
// Set some default values in options
|
||||
host: config.server.host ??= 'localhost',
|
||||
username: config.server.username ??= 'Player',
|
||||
hideErrors: config.server.hideErrors ??= true, // HACK: Hide errors by default as a lazy fix to console being spammed with them
|
||||
auth: config.server.auth
|
||||
};
|
||||
|
||||
bot.server = config.server;
|
||||
const { fromNotch } = require('prismarine-chat')(bot.server.version);
|
||||
// Create our client object, put it on the bot, and register some events
|
||||
bot.on('init_client', client => {
|
||||
client.on('packet', (data, meta) => {
|
||||
bot.emit('packet', data, meta)
|
||||
bot.emit('packet.' + meta.name, data);
|
||||
})
|
||||
|
||||
client.on('login', (data) => {
|
||||
bot.uuid = client.uuid
|
||||
bot.username = client.username
|
||||
})
|
||||
|
||||
client.on('disconnect', data => {
|
||||
bot.emit("disconnect", data);
|
||||
bot?.console?.disconnect(data.reason);
|
||||
})
|
||||
|
||||
client.on('end', reason => {
|
||||
bot.emit('end', reason);
|
||||
if (reason === "socketClosed") return
|
||||
bot?.console?.disconnect(reason);
|
||||
})
|
||||
|
||||
client.on('error', error => {
|
||||
bot.emit('error', error);
|
||||
bot?.console?.disconnect(error);
|
||||
})
|
||||
|
||||
client.on("keep_alive", ({ keepAliveId }) => {
|
||||
bot.emit("keep_alive", { keepAliveId })
|
||||
})
|
||||
|
||||
client.on('kick_disconnect', (data) => {
|
||||
bot.emit("kick_disconnect", data);
|
||||
bot?.console?.disconnect(data.reason);
|
||||
})
|
||||
|
||||
client.on('success', (data) => {
|
||||
bot?.console?.log(`Successfully logged into ${bot.server.host}:${bot.server.port}`)
|
||||
});
|
||||
|
||||
client.on('server_data', (data) => {
|
||||
bot.console.log(require('./util/nbt_parser')(null, data.motd))
|
||||
// bot?.console?.log(data.motd)
|
||||
});
|
||||
|
||||
process.on("uncaughtException", (e) => {
|
||||
console?.warn(e.stack)
|
||||
});
|
||||
})
|
||||
|
||||
const client = mc.createClient(bot.server)
|
||||
bot._client = client
|
||||
bot.emit('init_client', client)
|
||||
return bot;
|
||||
}
|
||||
module.exports = createBot;
|
||||
@@ -1,95 +0,0 @@
|
||||
module.exports = {
|
||||
data: {
|
||||
name: "cloop",
|
||||
aliases: [
|
||||
"commandloop",
|
||||
"loop"
|
||||
],
|
||||
description: "loops commands",
|
||||
enabled: true,
|
||||
usages: [
|
||||
|
||||
]
|
||||
},
|
||||
execute (context) {
|
||||
const bot = context.bot;
|
||||
const config = context.config;
|
||||
const 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]) === true) throw new CommandError("invalid interval");
|
||||
|
||||
const interval = parseInt(args[1]);
|
||||
const command = args.slice(2).join(' ');
|
||||
bot.cloop.add(command, interval);
|
||||
|
||||
bot.console.command(`added ${command} to the cloops with the interval ${interval}`);
|
||||
break;
|
||||
case "clear":
|
||||
bot.cloop.clear();
|
||||
bot.console.command('cleared the cloops');
|
||||
break;
|
||||
case "remove":
|
||||
// if (isNaN(args[1]) === true) throw new CommandError('argument must be an integer!');
|
||||
|
||||
const index = parseInt(args[1]);
|
||||
bot.cloop.remove(index);
|
||||
|
||||
bot.chat.message(`removed ${index} from cloops`);
|
||||
break;
|
||||
case "list":
|
||||
const component = []
|
||||
|
||||
const listComponent = []
|
||||
let i = 0
|
||||
for (const cloop of bot.cloop.list) {
|
||||
listComponent.push({
|
||||
translate: '%s \u203a %s (%s)',
|
||||
color: "dark_blue",
|
||||
with: [
|
||||
{ text: `${i}`, color: "gold" },
|
||||
cloop.command,
|
||||
{ text: `${cloop.interval}`, color: "gold" },
|
||||
]
|
||||
})
|
||||
listComponent.push('\n')
|
||||
i++
|
||||
}
|
||||
|
||||
listComponent.pop()
|
||||
|
||||
component.push({
|
||||
translate: 'Cloops (%s):',
|
||||
color: "dark_blue",
|
||||
with: [
|
||||
{ text: `${bot.cloop.list.length}`, color: "gold"}
|
||||
]
|
||||
})
|
||||
component.push('\n')
|
||||
|
||||
if (bot.cloop.list.length > 0) {
|
||||
component.push(listComponent)
|
||||
}
|
||||
bot.console.command(component);
|
||||
/*
|
||||
if (bot.cloop.list.length === 0) {
|
||||
bot.tellraw(`@a[name="${source?.player.profile?.name}"]`, {
|
||||
translate: 'Cloops (%s):',
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: `${bot.cloop.list.length}`, color: config.colors. }
|
||||
]
|
||||
})
|
||||
} else {
|
||||
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, component)
|
||||
}*/
|
||||
break;
|
||||
default:
|
||||
bot.console.command("invalid argument")
|
||||
//throw new CommandError('invalid argument')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
module.exports = {
|
||||
data: {
|
||||
name: "core",
|
||||
enabled: true,
|
||||
aliases: [
|
||||
"cb",
|
||||
"corerun"
|
||||
],
|
||||
description: "run commands in core",
|
||||
usages: [
|
||||
"<command>"
|
||||
]
|
||||
},
|
||||
execute (context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
bot.core.run(args.join(' '));
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
module.exports = {
|
||||
data: {
|
||||
name: "customchat",
|
||||
enabled: true,
|
||||
aliases: [
|
||||
],
|
||||
description: "toggle the custom chat",
|
||||
usages: [
|
||||
"enable/disable"
|
||||
]
|
||||
},
|
||||
execute (context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
switch (args[0]?.toLowerCase()) {
|
||||
case "enable":
|
||||
bot.customChat.enabled = true;
|
||||
bot.console.command('enabling custom chat');
|
||||
break;
|
||||
case "disable":
|
||||
bot.customChat.enabled = false;
|
||||
bot.console.command('disabling custom chat');
|
||||
break;
|
||||
default:
|
||||
bot.console.command(`Custom chat is ${bot.customChat.enabled}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
module.exports = {
|
||||
data: {
|
||||
name: "echo",
|
||||
enabled: true,
|
||||
aliases: [
|
||||
"say",
|
||||
"botsay"
|
||||
],
|
||||
description: "send things in chat",
|
||||
usages: [
|
||||
"<message>"
|
||||
]
|
||||
},
|
||||
execute (context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
bot._client.chat(args.join(' '));
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
const { stylize } = require('../util/eval_colors');
|
||||
const util = require('util');
|
||||
|
||||
module.exports = {
|
||||
data: {
|
||||
name: "eval",
|
||||
enabled: true,
|
||||
aliases: [
|
||||
],
|
||||
description: "self explanatory",
|
||||
usages: [
|
||||
"<input>"
|
||||
]
|
||||
},
|
||||
execute (context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
try {
|
||||
bot.console.command(util.inspect(eval(args.join(' ')), { stylize }));
|
||||
} catch (e) {
|
||||
bot.console.command(e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
module.exports = {
|
||||
data: {
|
||||
name: "help",
|
||||
enabled: true,
|
||||
aliases: [
|
||||
"heko",
|
||||
"?",
|
||||
"cmds",
|
||||
"commands"
|
||||
],
|
||||
description: "get a list of the commands",
|
||||
usages: [
|
||||
"<command>"
|
||||
]
|
||||
},
|
||||
execute (context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const config = context.config;
|
||||
let commandComponent = [];
|
||||
let outputComponent = [];
|
||||
let colorMix = true;
|
||||
for (const commands of bot.commandManager.commandlist) {
|
||||
let usagesComponent = [];
|
||||
let infoComponent = [];
|
||||
for (const usages of commands.data.usages) {
|
||||
usagesComponent.push({
|
||||
translate: "%s%s %s",
|
||||
with: [
|
||||
{ text: `${config.console.prefix}`, color: "dark_blue" },
|
||||
{ text: `${commands.data.name}`, color: "aqua" },
|
||||
{ text: `${usages}`, color: "blue" },
|
||||
]
|
||||
});
|
||||
|
||||
usagesComponent.push("\n");
|
||||
}
|
||||
usagesComponent.pop();
|
||||
|
||||
infoComponent.push({
|
||||
translate: "%s: %s\n%s: %s\n%s: %s\n%s:",
|
||||
color: "dark_gray",
|
||||
with: [
|
||||
{ text: "Command Name", color: "dark_blue" },
|
||||
{ text: `${commands.data.name}`, color: "blue" },
|
||||
{ text: "Aliases", color: "dark_blue" },
|
||||
{ text: `${commands.data.aliases.toString().replaceAll(',',' ')}`, color: "blue" },
|
||||
{ text: "Description", color: "dark_blue" },
|
||||
{ text: `${commands.data.description}`, color: "blue" },
|
||||
{ text: "Usages", color: "dark_blue" },
|
||||
]
|
||||
});
|
||||
|
||||
infoComponent.push("\n");
|
||||
|
||||
infoComponent.push(usagesComponent);
|
||||
|
||||
if (args[0]?.toLowerCase() === commands.data.name) {
|
||||
bot.console.command(infoComponent);
|
||||
return;
|
||||
}
|
||||
|
||||
commandComponent.push({
|
||||
text: commands.data.name + ' ',
|
||||
color: (!(colorMix = !colorMix) ? "aqua" : "dark_blue")
|
||||
});
|
||||
}
|
||||
|
||||
outputComponent.push({
|
||||
translate: "%s (%s) \u203a\n %s",
|
||||
color: "dark_gray",
|
||||
with: [
|
||||
{ text: "Commands", color: "blue" },
|
||||
{ text: `${bot.commandManager.commandlist.length}`, color: "gold" },
|
||||
commandComponent
|
||||
]
|
||||
})
|
||||
|
||||
bot.console.command(outputComponent);
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
const { request } = require('undici');
|
||||
const { execSync } = require('child_process');
|
||||
const { buildstring } = require('../data/info.json');
|
||||
|
||||
module.exports = {
|
||||
data: {
|
||||
name: "info",
|
||||
enabled: true,
|
||||
aliases: [
|
||||
"information",
|
||||
],
|
||||
description: "bot information",
|
||||
usages: [
|
||||
"version"
|
||||
]
|
||||
},
|
||||
async execute (context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const config = context.config;
|
||||
let component = [];
|
||||
|
||||
switch (args[0]?.toLowerCase()) {
|
||||
case "version":
|
||||
let fnfbfbotversionurl = await request('https://code.chipmunk.land/api/v1/repos/Parker2991/FridayNightFunkinBoyfriendBot/releases');
|
||||
let fnfbfbotcommiturl = await request('https://code.chipmunk.land/api/v1/repos/Parker2991/FridayNightFunkinBoyfriendBot/commits');
|
||||
|
||||
let urlVersionData = await fnfbfbotversionurl.body.json();
|
||||
let urlCommitData = await fnfbfbotcommiturl.body.json();
|
||||
let urlVersionOutput = urlVersionData[0];
|
||||
let urlCommitOutput = urlCommitData[0];
|
||||
|
||||
component.push({
|
||||
translate: "%s%s-%s\n%s: %s\n%s: %s\n\n%s%s%s-%s\n%s: %s",
|
||||
color: "dark_gray",
|
||||
with: [
|
||||
{ text: "Ski", color: "aqua" },
|
||||
{ text: "Bot", color: "blue" },
|
||||
{ text: `${buildstring.version}`, color: "blue" },
|
||||
{ text: "Build", color: "dark_blue" },
|
||||
{ text: `${buildstring.build}`, color: "blue" },
|
||||
{ text: "Commit", color: "dark_blue" },
|
||||
{ text: `${execSync("git rev-parse HEAD").toString().substring(0, 10).replaceAll('\n', '')}`, color: "blue" },
|
||||
{ text: "FNF", color: "dark_blue" },
|
||||
{ text: "Boyfriend", color: "dark_aqua" },
|
||||
{ text: "Bot", color: "blue" },
|
||||
{ text: `${urlVersionOutput.name}`, color: "blue" },
|
||||
{ text: "Commit", color: "dark_blue" },
|
||||
{ text: `${urlCommitOutput.sha.substring(0, 10)}`, color: "blue" }
|
||||
]
|
||||
});
|
||||
break;
|
||||
default:
|
||||
bot.console.command('SkiBot is a client chat bot created by Parker2991 using Custom FNFBoyfriendBot source\nSkiBot\'s source can be found at https://code.chipmunk.land/Parker2991/SkiBot.git\nFNFBoyfriendBot\'s source can be found at https://code.chipmunk.land/Parker2991/FridayNightFunkinBoyfriendBot.git\n\nthe idea of the bot is to try and make it close to a minecraft java client as much as i can')
|
||||
}
|
||||
bot.console.command(component);
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
module.exports = {
|
||||
data: {
|
||||
name: "kick",
|
||||
enabled: true,
|
||||
aliases: [
|
||||
],
|
||||
description: "kick players",
|
||||
usages: [
|
||||
"invalidstring <player>",
|
||||
"item <player>",
|
||||
]
|
||||
},
|
||||
execute (context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
switch (args[0]?.toLowerCase()) {
|
||||
case "invalidstring":
|
||||
bot.exploits.crashes.invalidString(args.slice(1).join(' '));
|
||||
bot.console.command(`Crashing ${args.slice(1).join(' ')}`);
|
||||
break;
|
||||
case "item":
|
||||
bot.exploits.kicks.item(args.slice(1).join(' '));
|
||||
bot.console.command(`Kicking ${args.slice(1).join(' ')}`);
|
||||
break;
|
||||
case "te":
|
||||
bot.exploits.kicks.translateEntity(args.slice(1).join(' '))
|
||||
break;
|
||||
default:
|
||||
bot.console.command("invalid argument");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
module.exports = {
|
||||
data: {
|
||||
name: "kill",
|
||||
enabled: true,
|
||||
aliases: [
|
||||
],
|
||||
description: "kills the process",
|
||||
usages: [
|
||||
]
|
||||
},
|
||||
execute (context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
process.exit();
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
module.exports = {
|
||||
data: {
|
||||
name: "rc",
|
||||
enabled: true,
|
||||
aliases: [
|
||||
"refill",
|
||||
"refillcore"
|
||||
],
|
||||
description: "refills the core",
|
||||
usages: [
|
||||
]
|
||||
},
|
||||
execute (context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const config = context.config;
|
||||
if (config.core.itemRefill === true) {
|
||||
bot.core.itemRefill();
|
||||
} else {
|
||||
bot.core.chatRefill();
|
||||
}
|
||||
bot.console.command('refilling core,...');
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
module.exports = {
|
||||
data: {
|
||||
name: "reconnect",
|
||||
enabled: true,
|
||||
aliases: [
|
||||
"end"
|
||||
],
|
||||
description: "reconnect to the server",
|
||||
usages: [
|
||||
]
|
||||
},
|
||||
execute (context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
bot._client.end('command reconnect');
|
||||
}
|
||||
}
|
||||
@@ -1,187 +0,0 @@
|
||||
module.exports = {
|
||||
data: {
|
||||
name: "selfcare",
|
||||
enabled: true,
|
||||
aliases: [
|
||||
"sc",
|
||||
"selfcaretoggle",
|
||||
"sctoggles"
|
||||
],
|
||||
description: "toggle the selfcare",
|
||||
usages: [
|
||||
"vanish enable/disable",
|
||||
"mute enable/disable",
|
||||
"cspy enable/disable",
|
||||
"gamemode enable/disable",
|
||||
"op enable/disable",
|
||||
"icu enable/disable",
|
||||
"god enable/disable",
|
||||
"nick enable/disable",
|
||||
"username enable/disable",
|
||||
"prefix enable/disable"
|
||||
]
|
||||
},
|
||||
execute (context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const config = context.config;
|
||||
/*
|
||||
vanish: true
|
||||
mute: true
|
||||
cspy: true
|
||||
gamemode: true
|
||||
op: true
|
||||
icu: true
|
||||
god: true
|
||||
nick: true
|
||||
username: true
|
||||
prefix: true
|
||||
*/
|
||||
if (!args && !args[0] && !args[1]) return;
|
||||
|
||||
switch (args[0]?.toLowerCase()) {
|
||||
case "vanish":
|
||||
switch (args[1]) {
|
||||
case "enable":
|
||||
config.selfcare.vanish = true;
|
||||
bot.console.command('enabling vanish selfcare');
|
||||
break;
|
||||
case "disable":
|
||||
config.selfcare.vanish = false;
|
||||
bot.console.command('disabling vanish selfcare');
|
||||
break;
|
||||
default:
|
||||
bot.console.command(`Vanish selfcare is currently ${config.selfcare.vanish}`);
|
||||
}
|
||||
break;
|
||||
case "prefix":
|
||||
switch (args[1]) {
|
||||
case "enable":
|
||||
config.selfcare.prefix = true;
|
||||
bot.console.command('enabling prefix selfcare');
|
||||
break;
|
||||
case "disable":
|
||||
config.selfcare.prefix = false;
|
||||
bot.console.command('disabling prefix selfcare');
|
||||
break;
|
||||
default:
|
||||
bot.console.command(`Prefix selfcare is currently ${config.selfcare.prefix}`);
|
||||
}
|
||||
break;
|
||||
case "username":
|
||||
switch (args[1]) {
|
||||
case "enable":
|
||||
config.selfcare.username = true;
|
||||
bot.console.command('enabling username selfcare');
|
||||
break;
|
||||
case "disable":
|
||||
config.selfcare.username = false;
|
||||
bot.console.command('disabling username selfcare');
|
||||
break;
|
||||
default:
|
||||
bot.console.command(`Username selfcare is currently ${config.selfcare.username}`);
|
||||
}
|
||||
break;
|
||||
case "nick":
|
||||
switch (args[1]) {
|
||||
case "enable":
|
||||
config.selfcare.nick = true;
|
||||
bot.console.command('enabling nick selfcare');
|
||||
break;
|
||||
case "disable":
|
||||
config.selfcare.nick = false;
|
||||
bot.console.command('disabling nick selfcare');
|
||||
break;
|
||||
default:
|
||||
bot.console.command(`Nick selfcare is currently ${config.selfcare.nick}`);
|
||||
}
|
||||
break;
|
||||
case "mute":
|
||||
switch (args[1]) {
|
||||
case "enable":
|
||||
config.selfcare.mute = true;
|
||||
bot.console.command('enabling mute selfcare');
|
||||
break;
|
||||
case "disable":
|
||||
config.selfcare.mute = false;
|
||||
bot.console.command('disabling mute selfcare');
|
||||
break;
|
||||
default:
|
||||
bot.console.command(`Mute selfcare is currently ${config.selfcare.mute}`);
|
||||
}
|
||||
break;
|
||||
case "cspy":
|
||||
switch (args[1]) {
|
||||
case "enable":
|
||||
config.selfcare.cspy = true;
|
||||
bot.console.command('enabling cspy selfcare');
|
||||
break;
|
||||
case "disable":
|
||||
config.selfcare.cspy = false;
|
||||
bot.console.command('disabling cspy selfcare');
|
||||
break;
|
||||
default:
|
||||
bot.console.command(`Cspy selfcare is currently ${config.selfcare.cspy}`);
|
||||
}
|
||||
break;
|
||||
case "god":
|
||||
switch (args[1]) {
|
||||
case "enable":
|
||||
config.selfcare.god = true;
|
||||
bot.console.command('enabling god selfcare');
|
||||
break;
|
||||
case "disable":
|
||||
config.selfcare.god = false;
|
||||
bot.console.command('disabling god selfcare');
|
||||
break;
|
||||
default:
|
||||
bot.console.command(`God selfcare is currently ${config.selfcare.god}`);
|
||||
}
|
||||
break;
|
||||
case "icu":
|
||||
switch (args[1]) {
|
||||
case "enable":
|
||||
config.selfcare.icu = true;
|
||||
bot.console.command('enabling icu selfcare');
|
||||
break;
|
||||
case "disable":
|
||||
config.selfcare.icu = false;
|
||||
bot.console.command('disabling icu selfcare');
|
||||
break;
|
||||
default:
|
||||
bot.console.command(`Icu selfcare is currently ${config.selfcare.icu}`);
|
||||
}
|
||||
break;
|
||||
case "gamemode":
|
||||
switch (args[1]) {
|
||||
case "enable":
|
||||
config.selfcare.gamemode = true;
|
||||
bot.console.command('enabling gamemode selfcare');
|
||||
break;
|
||||
case "disable":
|
||||
config.selfcare.gamemode = false;
|
||||
bot.console.command('disabling gamemode selfcare');
|
||||
break;
|
||||
default:
|
||||
bot.console.command(`Gamemode selfcare is currently ${config.selfcare.gamemode}`);
|
||||
}
|
||||
break;
|
||||
case "op":
|
||||
switch (args[1]) {
|
||||
case "enable":
|
||||
config.selfcare.op = true;
|
||||
bot.console.command('enabling op selfcare');
|
||||
break;
|
||||
case "disable":
|
||||
config.selfcare.op = false;
|
||||
bot.console.command('disabling op selfcare');
|
||||
break;
|
||||
default:
|
||||
bot.console.command(`Op selfcare is currently ${config.selfcare.vanish}`);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
bot.console.command('invalid argument');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
const crypto = require('crypto');
|
||||
module.exports = {
|
||||
data: {
|
||||
name: "validate",
|
||||
enabled: true,
|
||||
aliases: [
|
||||
"val"
|
||||
],
|
||||
description: "validate through bots",
|
||||
usages: [
|
||||
"chomens <arguments>",
|
||||
"fnfboyfriendbot <arguments>",
|
||||
"qbot <arguments>",
|
||||
"sbot <arguments>",
|
||||
"testbot <arguments>",
|
||||
]
|
||||
},
|
||||
execute (context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const config = context.config;
|
||||
let hash;
|
||||
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return;
|
||||
|
||||
switch (args[0]) {
|
||||
case "chomens":
|
||||
const time = Math.floor(Date.now() / 5_000)
|
||||
|
||||
const value = bot.uuid + args.slice(1).join(' ') + time + config.bots.chomens.key
|
||||
|
||||
hash = crypto.createHash('sha256').update(value).digest('hex').substring(0, 16)
|
||||
if (bot.customChat.enabled) {
|
||||
bot.customChat.chat(`${config.bots.chomens.prefix}${args.slice(1).shift()} ${hash} ${args.slice(2).join(' ')}`);
|
||||
} else {
|
||||
bot.chat(`${config.bots.chomens.prefix}${args.slice(1).shift()} ${hash} ${args.slice(2).join(' ')}`);
|
||||
}
|
||||
break;
|
||||
case "fnfboyfriendbot":
|
||||
hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 2000) + config.bots.fnfboyfriendbot.key).digest("hex").substring(0, 16);
|
||||
if (bot.customChat.enabled) {
|
||||
bot.customChat.chat(`${config.bots.fnfboyfriendbot.prefix}${args.slice(1).shift()} ${crypto.createHash('sha256').update(Math.floor(Date.now() / 2000) + config.bots.fnfboyfriendbot.key).digest('hex').substring(0, 16)} ${args.slice(2).join(' ')}`)
|
||||
} else {
|
||||
bot.chat(`${config.bots.fnfboyfriendbot.prefix}${args.slice(1).shift()} ${crypto.createHash('sha256').update(Math.floor(Date.now() / 2000) + config.bots.fnfboyfriendbot.key).digest('hex').substring(0, 16)} ${args.slice(2).join(' ')}`);
|
||||
}
|
||||
break;
|
||||
case "qbot":
|
||||
hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 1000) + config.bots.qbot.key).digest("hex").substring(0, 16);
|
||||
if (bot.customChat.enabled) {
|
||||
bot.customChat.chat(`${config.bots.qbot.prefix}${args.slice(1).shift()} ${hash} ${args.slice(2).join(' ')}`);
|
||||
} else {
|
||||
bot.chat(`${config.bots.qbot.prefix}${args.slice(1).shift()} ${hash} ${args.slice(2).join(' ')}`);
|
||||
}
|
||||
break;
|
||||
case "sbot":
|
||||
|
||||
const md = crypto.createHash("md5");
|
||||
const command = args.slice(1).join(' ');
|
||||
const time1 = Math.floor(+new Date() / 20000);
|
||||
const raw = ":"+`${command.replace(/&[0-9a-fklmnor]/g, '')};${bot.server.username};${time1};${config.bots.key}`;
|
||||
md.update(raw);
|
||||
const hash = md.digest();
|
||||
const big_int = hash.slice(0, 4).readUInt32BE();
|
||||
bot.chat(`${config.bots.sbot.prefix}${command} ${big_int.toString(36)}`);
|
||||
|
||||
break;
|
||||
case "testbot":
|
||||
context.webhook.send(`${bot.server.username}`);
|
||||
if (bot.customChat.enabled) {
|
||||
bot.customChat.chat(`${config.bots.testbot.prefix}${args.slice(1).join(' ')}`);
|
||||
} else {
|
||||
bot.chat(`${config.bots.testbot.prefix}${args.slice(1).join(' ')}`);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
console.warn('unknown argument');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
bots:
|
||||
chomens:
|
||||
prefix: "*"
|
||||
key: ""
|
||||
|
||||
fnfboyfriendbot:
|
||||
prefix: "~"
|
||||
key: ""
|
||||
|
||||
qbot:
|
||||
prefix: "]"
|
||||
key: ""
|
||||
|
||||
sbot:
|
||||
prefix: ":"
|
||||
key: ""
|
||||
|
||||
testbot:
|
||||
prefix: "-"
|
||||
token: ""
|
||||
|
||||
console:
|
||||
prefix: "."
|
||||
|
||||
core:
|
||||
itemRefill: false
|
||||
area:
|
||||
start:
|
||||
x: 0
|
||||
y: 0
|
||||
z: 0
|
||||
end:
|
||||
x: 15
|
||||
y: 0
|
||||
z: 15
|
||||
itemName: { text: "https://doin-your.mom", color: "dark_red" }
|
||||
name: { text: "https://doin-your.mom", color: "dark_red" }
|
||||
|
||||
selfcare:
|
||||
vanish: true
|
||||
mute: true
|
||||
cspy: true
|
||||
gamemode: true
|
||||
op: true
|
||||
icu: true
|
||||
god: true
|
||||
nick: true
|
||||
username: true
|
||||
prefix: true
|
||||
|
||||
server:
|
||||
host: "localhost"
|
||||
# port: ""
|
||||
username: "player"
|
||||
version: "1.20.2"
|
||||
reconnectDelay: 3000
|
||||
@@ -1,28 +0,0 @@
|
||||
module.exports = {
|
||||
data: {
|
||||
description: "pretty self explanatory",
|
||||
enabled: true,
|
||||
name: "custom chat",
|
||||
type: "extras"
|
||||
},
|
||||
inject (context) {
|
||||
const bot = context.bot;
|
||||
bot.customChat = {
|
||||
enabled: true,
|
||||
chat (args) {
|
||||
const prefix = {
|
||||
translate: "chat.type.text",
|
||||
with: [
|
||||
{ selector: `${bot.username}` },
|
||||
{
|
||||
text: '',
|
||||
extra: [ args ]
|
||||
}
|
||||
]
|
||||
}
|
||||
bot.tellraw("@a", prefix);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
module.exports = {
|
||||
data: {
|
||||
description: "server exploits :3",
|
||||
enabled: true,
|
||||
name: "exploits",
|
||||
type: "extras",
|
||||
},
|
||||
inject (context) {
|
||||
const bot = context.bot;
|
||||
bot.exploits = {
|
||||
kicks: {
|
||||
|
||||
},
|
||||
|
||||
crashes: {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"buildstring": {
|
||||
"version": "1.3.5",
|
||||
"build": "50"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,43 +0,0 @@
|
||||
const fs = require('fs');
|
||||
const { load } = require('js-yaml');
|
||||
const path = require('path');
|
||||
const { WebhookClient } = require('discord.js');
|
||||
|
||||
|
||||
if (!fs.existsSync(path.join(__dirname, "../config.yml"))) {
|
||||
console.warn("Config not found creating config from the default config");
|
||||
fs.copyFileSync(
|
||||
path.join(__dirname, "./data/default_config.yml"),
|
||||
path.join(__dirname, "../config.yml")
|
||||
)
|
||||
}
|
||||
|
||||
if (!fs.existsSync(path.join(__dirname, "./modules/custom_chat.js"))) {
|
||||
console.warn("custom chat format not found recreating from default custom chat format");
|
||||
fs.copyFileSync(
|
||||
path.join(__dirname, "./data/default_custom_chat.js"),
|
||||
path.join(__dirname, "./modules/custom_chat.js")
|
||||
)
|
||||
}
|
||||
|
||||
if (!fs.existsSync(path.join(__dirname, "./modules/exploits.js"))) {
|
||||
console.warn("exploits module not found recreating from default exploits");
|
||||
fs.copyFileSync(
|
||||
path.join(__dirname, "./data/default_exploits.js"),
|
||||
path.join(__dirname, "./modules/exploits.js")
|
||||
)
|
||||
}
|
||||
|
||||
try {
|
||||
config = load(fs.readFileSync(path.join(__dirname, '../', 'config.yml')));
|
||||
} catch (e) {
|
||||
console.error("Failed to load the config look below for the error stack");
|
||||
console.error(e.stack);
|
||||
}
|
||||
|
||||
const webhook = new WebhookClient({ id: config.bots.testbot.id, token: config.bots.testbot.token });
|
||||
//webhook.send({ content: "amogus" });
|
||||
|
||||
let bot = require('./bot.js')({ config });
|
||||
|
||||
require('./util/loadModules')(bot, config, webhook);
|
||||
@@ -1,145 +0,0 @@
|
||||
const convertNbtComponentToJson = require('../util/nbt_parser')
|
||||
/*
|
||||
please note that the code here for 1.21.8
|
||||
was ported from the FNFBoyfriendBot Reignite 1.21.8 port
|
||||
and had SkiBot's console format added to it
|
||||
*/
|
||||
|
||||
function parse (chatTypes, type, sender, target, message) {
|
||||
const chatType = chatTypes[type]
|
||||
const parsed = convertNbtComponentToJson(null, chatType.value.value.chat)
|
||||
const json = { translate: parsed.translation_key, with: [] }
|
||||
|
||||
for (const parameter of parsed.parameters) {
|
||||
|
||||
switch (parameter) {
|
||||
case "sender": json.with.push(sender)
|
||||
break;
|
||||
case "target": json.with.push(target)
|
||||
case "content": json.with.push(message)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return json
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
data: {
|
||||
description: "parses chat",
|
||||
enabled: true,
|
||||
name: "chat",
|
||||
type: "logging"
|
||||
},
|
||||
inject (context) {
|
||||
const bot = context.bot;
|
||||
const config = context.config;
|
||||
|
||||
bot.on('packet.registry_data', (packet) => {
|
||||
if (packet.id !== 'minecraft:chat_type') return // taken from FNFBoyfriendBot Reignite 1.21.8 port
|
||||
chatTypes = packet.entries
|
||||
})
|
||||
|
||||
bot.on('packet.player_chat', (packet) => {
|
||||
const unsigned = convertNbtComponentToJson(null, packet.unsignedChatContent);
|
||||
bot.emit('message', [
|
||||
{
|
||||
translate: "[%s %s %s%s %s] ",
|
||||
color: "dark_gray",
|
||||
with: [
|
||||
{ text: 'Player Chat', color: 'dark_purple' },
|
||||
{ text: '|' },
|
||||
{ text: 'Packet Type', color: "aqua" },
|
||||
{ text: ':' },
|
||||
{ text: packet.type.chatType, color: 'gold' },
|
||||
],
|
||||
},
|
||||
unsigned
|
||||
])
|
||||
});
|
||||
|
||||
bot.on('packet.profileless_chat', (packet) => {
|
||||
const sender = convertNbtComponentToJson(null, packet.name);
|
||||
const message = convertNbtComponentToJson(null, packet.message);
|
||||
const target = convertNbtComponentToJson(null, packet.target)
|
||||
const type = packet.type.chatType;
|
||||
const parsed = parse(chatTypes, type, sender, target, message)
|
||||
|
||||
bot.emit('message', [
|
||||
{
|
||||
translate: "[%s %s %s%s %s] ",
|
||||
color: "dark_gray",
|
||||
with: [
|
||||
{ text: 'Profileless Chat', color: 'dark_aqua' },
|
||||
{ text: '|' },
|
||||
{ text: 'Packet Type', color: "aqua" },
|
||||
{ text: ':' },
|
||||
{ text: packet.type.chatType, color: 'gold' },
|
||||
],
|
||||
},
|
||||
parsed
|
||||
])
|
||||
});
|
||||
|
||||
bot.on('packet.system_chat', packet => {
|
||||
try {
|
||||
const message = convertNbtComponentToJson(null, packet.content)
|
||||
|
||||
if (message.translate === 'advMode.setCommand.success') return // Ignores command set message
|
||||
|
||||
if (message.translate === 'multiplayer.message_not_delivered') return;
|
||||
|
||||
if (packet.isActionBar) {
|
||||
return
|
||||
}
|
||||
|
||||
bot.emit('message', [
|
||||
{
|
||||
translate: "[%s] ",
|
||||
color: "dark_gray",
|
||||
with: [
|
||||
{ text: 'System Chat', color: 'dark_blue' },
|
||||
],
|
||||
},
|
||||
message
|
||||
]);
|
||||
|
||||
bot.emit('system_chat_selfcare', message); // this is for selfcare
|
||||
} catch (e) {
|
||||
console.log(e.stack)
|
||||
}
|
||||
});
|
||||
|
||||
bot.chat = (args) => {
|
||||
if (args.startsWith('/')) {
|
||||
bot._client.write('chat_command', {
|
||||
command: args?.substring(1).substring(0, 256),
|
||||
timestamp: BigInt(Date.now()),
|
||||
salt: 0n,
|
||||
argumentSignatures: [],
|
||||
signedPreview: false,
|
||||
messageCount: 0,
|
||||
acknowledged: Buffer.alloc(3),
|
||||
previousMessages: []
|
||||
})
|
||||
return;
|
||||
}
|
||||
const acc = 0;
|
||||
const bitset = Buffer.allocUnsafe(3);
|
||||
bitset[0] = acc & 0xFF;
|
||||
bitset[1] = (acc >> 8) & 0xFF;
|
||||
bitset[2] = (acc >> 16) & 0xFF;
|
||||
bot._client.write('chat_message', {
|
||||
message: args?.substring(0, 256),
|
||||
timestamp: BigInt(Date.now()),
|
||||
salt: 0n,
|
||||
offset: 0,
|
||||
acknowledged: bitset
|
||||
})
|
||||
}
|
||||
|
||||
bot.tellraw = (selector, message) => {
|
||||
bot.core.run(`minecraft:tellraw ${selector} ${JSON.stringify(message)}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,173 +0,0 @@
|
||||
const mcData = require('minecraft-data')('1.20.2');
|
||||
const nbt = require('prismarine-nbt');
|
||||
|
||||
module.exports = {
|
||||
data: {
|
||||
description: "runs commands in command blocks",
|
||||
enabled: true,
|
||||
name: "command core",
|
||||
type: "commands"
|
||||
},
|
||||
inject (context) {
|
||||
const bot = context.bot;
|
||||
const config = context.config;
|
||||
const Item = require("prismarine-item")(bot.server.version);
|
||||
|
||||
bot.core = {
|
||||
area: {
|
||||
start: config.core?.area.start ?? { x: 0, y: 0, z: 0 },
|
||||
end: config.core?.area.end ?? { x: 15, y: 0, z: 15 }
|
||||
},
|
||||
|
||||
position: null,
|
||||
|
||||
itemPosition: null,
|
||||
|
||||
currentBlockRelative: { x: 0, y: 0, z: 0 },
|
||||
|
||||
usePlacedCommandBlock: false,
|
||||
|
||||
chatRefill () {
|
||||
const pos = bot.core.position
|
||||
const { start, end } = bot.core.area
|
||||
|
||||
if (!pos) return
|
||||
const command = `/minecraft:fill ${pos.x + start.x} ${pos.y + start.y} ${pos.z + start.z} ${pos.x + end.x} ${pos.y + end.y} ${pos.z + end.z} repeating_command_block{CustomName:${JSON.stringify(config.core.name)}}`
|
||||
bot.chat(`${command}`)
|
||||
},
|
||||
|
||||
itemRefill () {
|
||||
const pos = bot.core.position;
|
||||
const { start, end } = bot.core.area;
|
||||
const itemPosition = bot.core.itemPosition;
|
||||
|
||||
if (!pos) return;
|
||||
|
||||
const command = `minecraft:fill ${pos.x + start.x} ${pos.y + start.y} ${pos.z + start.z} ${pos.x + end.x} ${pos.y + end.y} ${pos.z + end.z} command_block{CustomName:${JSON.stringify(config.core.name)}}`
|
||||
|
||||
bot._client.write('set_creative_slot', {
|
||||
slot: 36,
|
||||
item: Item.toNotch(
|
||||
new Item(
|
||||
bot.registry.itemsByName.repeating_command_block.id,
|
||||
1,
|
||||
0,
|
||||
),
|
||||
),
|
||||
});
|
||||
|
||||
bot._client.write('block_dig', {
|
||||
status: 0,
|
||||
location: itemPosition,
|
||||
face: 0
|
||||
});
|
||||
|
||||
bot._client.write('block_place', {
|
||||
hand: 0,
|
||||
location: itemPosition,
|
||||
direction: 0,
|
||||
cursorX: 0.1,
|
||||
cursorY: 0,
|
||||
cursorZ: 0.1,
|
||||
insideBlock: false
|
||||
});
|
||||
|
||||
if (bot.core.usePlacedCommandBlock) {
|
||||
return
|
||||
} else {
|
||||
bot._client.write('update_command_block', {
|
||||
location: itemPosition,
|
||||
command,
|
||||
flags: 5,
|
||||
mode: 1
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
move (pos = bot.position) {
|
||||
bot.core.position = {
|
||||
x: Math.floor(pos.x / 16) * 16,
|
||||
y: 0,
|
||||
z: Math.floor(pos.z / 16) * 16
|
||||
};
|
||||
|
||||
bot.core.itemPosition = {
|
||||
x: pos.x,
|
||||
y: pos.y -1,
|
||||
z: pos.z
|
||||
}
|
||||
|
||||
if (config.core.itemRefill === true) {
|
||||
bot.core.itemRefill();
|
||||
} else {
|
||||
bot.core.chatRefill();
|
||||
}
|
||||
},
|
||||
|
||||
currentBlock () {
|
||||
const relativePosition = bot.core.currentBlockRelative
|
||||
const corePosition = bot.core.position
|
||||
if (!corePosition) return null
|
||||
return { x: relativePosition.x + corePosition.x, y: relativePosition.y + corePosition.y, z: relativePosition.z + corePosition.z }
|
||||
},
|
||||
|
||||
incrementCurrentBlock () {
|
||||
const relativePosition = bot.core.currentBlockRelative
|
||||
const { start, end } = bot.core.area
|
||||
|
||||
relativePosition.x++
|
||||
|
||||
if (relativePosition.x > end.x) {
|
||||
relativePosition.x = start.x
|
||||
relativePosition.z++
|
||||
}
|
||||
|
||||
if (relativePosition.z > end.z) {
|
||||
relativePosition.z = start.z
|
||||
relativePosition.y++
|
||||
}
|
||||
|
||||
if (relativePosition.y > end.y) {
|
||||
relativePosition.x = start.x
|
||||
relativePosition.y = start.y
|
||||
relativePosition.z = start.z
|
||||
}
|
||||
},
|
||||
|
||||
run (command) {
|
||||
const location = bot.core.currentBlock();
|
||||
const itemPosition = bot.core.itemPosition;
|
||||
|
||||
if (!location || bot.server.mode === "savageFriends") return;
|
||||
if (bot.core.usePlacedCommandBlock) {
|
||||
bot._client.write('update_command_block', {
|
||||
command: command.substring(0, 32767),
|
||||
location: itemPosition,
|
||||
mode: 1,
|
||||
flags: 5,
|
||||
});
|
||||
|
||||
bot.core.incrementCurrentBlock();
|
||||
} else {
|
||||
bot._client.write('update_command_block', {
|
||||
command: command.substring(0, 32767),
|
||||
location,
|
||||
mode: 1,
|
||||
flags: 5
|
||||
});
|
||||
|
||||
bot.core.incrementCurrentBlock();
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
bot.on('move', () => {
|
||||
if (bot.server.mode === "savageFriends") return;
|
||||
bot.core.move(bot.position)
|
||||
})
|
||||
|
||||
bot.on('packet.block_change', (data) => {
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
module.exports = {
|
||||
data: {
|
||||
description: "loops commands",
|
||||
enabled: true,
|
||||
name: "command loop",
|
||||
type: "extras"
|
||||
},
|
||||
inject (context) {
|
||||
const bot = context.bot;
|
||||
bot.cloop = {
|
||||
list: [],
|
||||
add (command, interval) {
|
||||
let timer;
|
||||
if (bot.server.mode === "savageFriends") {
|
||||
timer = ({ timer: setInterval(() => bot.chat(`${command}`), interval), command, interval })
|
||||
} else {
|
||||
timer = ({ timer: setInterval(() => bot.core.run(command), interval), command, interval })
|
||||
}
|
||||
this.list.push(timer)
|
||||
|
||||
bot.on('end', () => {
|
||||
this.clear()
|
||||
})
|
||||
|
||||
bot.on('packet.login', () => {
|
||||
if (this.list.length === 0) return
|
||||
timer = ({ timer: setInterval(() => bot.core.run(command), interval), command, interval })
|
||||
this.list.push(timer);
|
||||
})
|
||||
},
|
||||
|
||||
remove (index) {
|
||||
clearInterval(this.list[index].timer)
|
||||
bot.cloop.list.splice(index, 1)
|
||||
},
|
||||
|
||||
clear () {
|
||||
for (const cloop of this.list) clearInterval(cloop.timer)
|
||||
this.list = []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
module.exports = {
|
||||
data: {
|
||||
description: "registers commands",
|
||||
enabled: true,
|
||||
name: "command manager",
|
||||
type: "commands"
|
||||
},
|
||||
inject (context) {
|
||||
const bot = context.bot;
|
||||
const config = context.config;
|
||||
const webhook = context.webhook;
|
||||
const { MessageBuilder } = require('prismarine-chat')(bot.server.version);
|
||||
bot.commandManager = {
|
||||
commands: {},
|
||||
commandlist: [],
|
||||
execute (commandName, args) {
|
||||
const command = bot.commandManager.getCommand(commandName?.toLowerCase())
|
||||
|
||||
try {
|
||||
if (!command || !command.execute) bot.console.command('unknown command');
|
||||
return command?.execute({ bot, config, arguments: args, MessageBuilder, webhook })
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
},
|
||||
|
||||
executeString (command) {
|
||||
const [commandName, ...args] = command.split(' ')
|
||||
return this.execute(commandName, args)
|
||||
},
|
||||
|
||||
register (command) {
|
||||
this.commands[command.data.name] = command
|
||||
if (command.data.aliases) {
|
||||
command.data.aliases.map((a) => (
|
||||
this.commands[a] = command
|
||||
))
|
||||
}
|
||||
},
|
||||
|
||||
getCommand (name) {
|
||||
return this.commands[name]
|
||||
},
|
||||
|
||||
getCommands () {
|
||||
return Object.values(this.commands)
|
||||
}
|
||||
}
|
||||
|
||||
for (const filename of fs.readdirSync(path.join(__dirname, '../commands'))) {
|
||||
try {
|
||||
const command = require(path.join(__dirname, '../commands', filename))
|
||||
if (command.data.enabled === false) {
|
||||
|
||||
} else {
|
||||
bot.commandManager.register(command);
|
||||
bot.commandManager.commandlist.push(command);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to load command', filename, ':', error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
const { fromNotch } = require('prismarine-chat')('1.20.2');
|
||||
const readline = require('readline');
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
data: {
|
||||
description: "console functions",
|
||||
enabled: true,
|
||||
name: "console",
|
||||
type: "console"
|
||||
},
|
||||
inject (context) {
|
||||
const bot = context.bot;
|
||||
const config = context.config;
|
||||
rl.on('line', (args) => {
|
||||
if (args.startsWith(config.console.prefix)) {
|
||||
return bot.commandManager.executeString(args.substring(config.console.prefix.length));
|
||||
} else if (args.startsWith('')) {
|
||||
if (bot.customChat.enabled) {
|
||||
if (args.startsWith('/')) {
|
||||
bot.chat(`/${args.substring(1)}`);
|
||||
return;
|
||||
}
|
||||
bot.customChat.chat(args.substring(0));
|
||||
} else {
|
||||
bot.commandManager.executeString(`echo ${args.substring(0)}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
refreshLine = function (...args) {
|
||||
rl.output.write("\x1b[2K\r");
|
||||
console.log(args.toString());
|
||||
rl._refreshLine();
|
||||
}
|
||||
|
||||
bot.console = {
|
||||
log (message) {
|
||||
if (fromNotch(message)?.toString().includes("https://www.innersloth.com/games/among-us/ › amogus")) {
|
||||
|
||||
} else {
|
||||
refreshLine(`${fromNotch("§8[§6logs§8]§r")?.toAnsi()} ${fromNotch(message)?.toAnsi(require('../data/language.json'))}`)
|
||||
}
|
||||
},
|
||||
command (message) {
|
||||
refreshLine(`${fromNotch("§8[§ecommand§8]§r")?.toAnsi()} ${fromNotch(message)?.toAnsi(require('../data/language.json'))}`)
|
||||
},
|
||||
disconnect (reason) {
|
||||
refreshLine(`${fromNotch("§8[§bdisconnect§8]§r")?.toAnsi()} ${fromNotch(reason)?.toAnsi(require('../data/language.json'))}`)
|
||||
},
|
||||
warn (error) {
|
||||
refreshLine(`${fromNotch("§8[§cwarn§8]§r")?.toAnsi()} ${fromNotch(error)?.toAnsi(require('../data/language.json'))}`)
|
||||
},
|
||||
error (error) {
|
||||
refreshLine(`${fromNotch("§8[§4error§8]§r")?.toAnsi()} ${fromNotch(error)?.toAnsi(require('../data/language.json'))}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
module.exports = {
|
||||
data: {
|
||||
descripton: "logs chat to console",
|
||||
enabled: true,
|
||||
name: "log",
|
||||
type: "console"
|
||||
},
|
||||
inject (context) {
|
||||
const bot = context.bot;
|
||||
|
||||
bot.on('message', (message) => {
|
||||
try {
|
||||
bot.console.log(message)
|
||||
} catch {}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
module.exports = {
|
||||
data: {
|
||||
description: "where the bot is at",
|
||||
enabled: true,
|
||||
name: "position",
|
||||
type: "client"
|
||||
},
|
||||
inject (context) {
|
||||
const bot = context.bot;
|
||||
bot.position = null;
|
||||
|
||||
bot.on('packet.position', packet => {
|
||||
bot.position = {
|
||||
x: packet.x,
|
||||
y: packet.y,
|
||||
z: packet.z
|
||||
};
|
||||
|
||||
bot._client.write('teleport_confirm', { teleportId: packet.teleportId })
|
||||
|
||||
bot.emit('move')
|
||||
})
|
||||
|
||||
bot.on('end', () => { bot.position = null })
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
const mc = require('minecraft-protocol');
|
||||
|
||||
module.exports = {
|
||||
data: {
|
||||
description: "reconnects the players to the server",
|
||||
enabled: true,
|
||||
name: "reconnect",
|
||||
type: "client"
|
||||
},
|
||||
inject (context) {
|
||||
const bot = context.bot;
|
||||
const config = context.config;
|
||||
if (bot.server.reconnectDelay < 0) return
|
||||
bot.on('end', () => {
|
||||
setTimeout(() => {
|
||||
let client = new mc.createClient(bot.server)
|
||||
bot._client = client;
|
||||
bot.emit('init_client', client)
|
||||
}, bot.server.reconnectDelay);
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
const registry = require('prismarine-registry');
|
||||
|
||||
module.exports = {
|
||||
data: {
|
||||
description: "registers the client data",
|
||||
enabled: true,
|
||||
name: 'registry',
|
||||
type: 'client',
|
||||
},
|
||||
inject (context) {
|
||||
const bot = context.bot;
|
||||
bot.on('packet.login', packet => {
|
||||
bot.registry = registry(bot._client.version)
|
||||
// bot.registry.language = require('../data/language.json');
|
||||
bot.emit('registry_ready', bot.registry)
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,139 +0,0 @@
|
||||
const { fromNotch } = require('prismarine-chat')('1.20.2');
|
||||
module.exports = {
|
||||
data: {
|
||||
description: "self explanatory",
|
||||
enabled: true,
|
||||
name: "selfcare",
|
||||
type: "client"
|
||||
},
|
||||
inject (context) {
|
||||
const bot = context.bot;
|
||||
const config = context.config;
|
||||
|
||||
let entityId;
|
||||
let permission = 2;
|
||||
let gameMode;
|
||||
let positionCount = 0;
|
||||
let mute = false;
|
||||
let god = false;
|
||||
let commandSpy = false;
|
||||
let prefix = false;
|
||||
let vanish = false;
|
||||
let nick = false;
|
||||
let username = false;
|
||||
|
||||
bot.on("system_chat_selfcare", (message) => {
|
||||
try {
|
||||
const parsedMessage = fromNotch(message)?.toMotd();
|
||||
if (parsedMessage?.startsWith("§6You have been muted")) mute = true;
|
||||
else if (parsedMessage?.startsWith("§6You have been unmuted")) mute = false;
|
||||
else if (parsedMessage?.startsWith("§6Your voice has been silenced")) mute = true;
|
||||
|
||||
else if (parsedMessage === "§6God mode§c enabled§6.") god = true;
|
||||
else if (parsedMessage === "§6God mode§c disabled§6.") god = false;
|
||||
|
||||
else if (parsedMessage === "Successfully enabled CommandSpy") commandSpy = true;
|
||||
else if (parsedMessage === "Successfully disabled CommandSpy") commandSpy = false;
|
||||
else if (parsedMessage === "Successfully disabled CommandSpy.") commandSpy = false;
|
||||
else if (parsedMessage === "Successfully enabled CommandSpy.") commandSpy = true;
|
||||
|
||||
else if (parsedMessage?.startsWith("You now have the tag:")) prefix = true;
|
||||
else if (parsedMessage === "You no longer have a tag" || parsedMessage === "Something went wrong while saving the prefix. Please check console.") prefix = false;
|
||||
|
||||
else if (parsedMessage === `§6Vanish for ${bot.server.username}: enabled`) vanish = true;
|
||||
else if (parsedMessage === `§6Vanish for §c${bot.server.username}§6: disabled`) vanish = false;
|
||||
|
||||
else if (parsedMessage?.startsWith('§6Your nickname is now')) nick = true;
|
||||
else if (parsedMessage === "§6You no longer have a nickname.") nick = false;
|
||||
|
||||
else if (parsedMessage?.startsWith("Successfully set your username to ") || parsedMessage?.endsWith(`${bot.server.username}`)) username = true;
|
||||
else if (parsedMessage === `Successfully set your username to "${bot.server.username}"`) username = false;
|
||||
else if (parsedMessage === `You already have the username "${bot.server.username}"`) username = false;
|
||||
|
||||
} catch (e) {
|
||||
console.log(e.stack)
|
||||
}
|
||||
});
|
||||
|
||||
bot.on('packet.entity_status', (data) => {
|
||||
if (data.entityId !== entityId || data.entityStatus < 24 || data.entityStatus > 28) return;
|
||||
permission = data.entityStatus - 24
|
||||
});
|
||||
|
||||
bot.on('packet.game_state_change', (packet) => {
|
||||
if (packet.reason === 3 || packet.reason === "change_game_mode") {
|
||||
gameMode = packet.gameMode;
|
||||
} if (packet.reason === 4 || packet.reason === "win_game") {
|
||||
bot._client.write('client_command', { action: 0 })
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/* bot.on("packet.position", (packet, position) => {
|
||||
if (!config.selfcare.icu || bot.server.mode === "savageFriends") return;
|
||||
positionCount++
|
||||
setTimeout(() => {
|
||||
positionCount--
|
||||
if (positionCount > 4) {
|
||||
bot.core.run('sudo * icu stop');
|
||||
} if (permission < 2 || gameMode !== 1) {
|
||||
bot._client.end('anti icu :3');
|
||||
}
|
||||
}, 1000)
|
||||
})*/
|
||||
|
||||
let timer;
|
||||
bot.on('packet.login', (data) => {
|
||||
entityId = data.entityId;
|
||||
switch (data.worldState.gamemode) {
|
||||
case 'survival':
|
||||
gameMode = 0
|
||||
break
|
||||
case 'creative':
|
||||
gameMode = 1
|
||||
break
|
||||
case 'adventure':
|
||||
gameMode = 2
|
||||
break
|
||||
case 'spectator':
|
||||
gameMode = 3
|
||||
break
|
||||
default:
|
||||
gameMode = 0
|
||||
break
|
||||
}
|
||||
|
||||
// if (bot.server.mode === "savageFriends") return;
|
||||
timer = setInterval(() => {
|
||||
if (bot.server.mode === "savageFriends") {
|
||||
if (gameMode !== 1 && config.selfcare.game) bot.chat("/minecraft:gamemode creative")
|
||||
else if (permission < 2 && config.selfcare.op) bot.chat(`/minecraft:op ${bot._client.username}`)
|
||||
} else {
|
||||
if (permission < 2 && config.selfcare.op) bot.chat("/minecraft:op @s[type=player]");
|
||||
else if (gameMode !== 1 && config.selfcare.gamemode) bot.chat("/minecraft:gamemode creative");
|
||||
else if (!commandSpy && config.selfcare.cspy) bot.chat('/cspy on');
|
||||
else if (prefix && config.selfcare.prefix) bot.chat('/prefix off');
|
||||
else if (!vanish && config.selfcare.vanish) bot.chat('/vanish on');
|
||||
else if (username && config.selfcare.username) bot.chat(`/username ${bot.server.username}`);
|
||||
|
||||
else if (mute && config.selfcare.mute) bot.core.run(`essentials:mute ${bot.uuid}`);
|
||||
else if (!god && config.selfcare.god) bot.core.run(`god ${bot.server.username} on`);
|
||||
else if (nick && config.selfcare.nick) bot.core.run(`nick ${bot.server.username} off`);
|
||||
|
||||
else if (gameMode !== 4) bot._client.write("client_command", { actionId: 0 });
|
||||
}
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
bot.on('end', () => {
|
||||
if (timer) clearInterval(timer);
|
||||
commandSpy = false;
|
||||
god = false;
|
||||
mute = false;
|
||||
prefix = false;
|
||||
vanish = false;
|
||||
nick = false;
|
||||
username = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
const BOOLEAN_TYPES = ['interpret', 'bold', 'italic', 'underlined', 'strikethrough', 'obfuscated']
|
||||
function convertNbtComponentToJson (key, tag) {
|
||||
let chatTypes
|
||||
if (!tag) {
|
||||
return null
|
||||
} else if (tag.type === 'compound') {
|
||||
const object = {}
|
||||
|
||||
for (const key of Object.keys(tag.value)) {
|
||||
object[key === '' ? 'text' : key] = convertNbtComponentToJson(key, tag.value[key])
|
||||
}
|
||||
|
||||
return object
|
||||
} else if (tag.type === 'list') {
|
||||
const array = []
|
||||
|
||||
for (const item of tag.value.value) {
|
||||
array.push(convertNbtComponentToJson(null, { type: tag.value.type, value: item }))
|
||||
}
|
||||
|
||||
return array
|
||||
} else if (tag.type === 'byte') {
|
||||
if (key && BOOLEAN_TYPES.includes(key)) return tag.value !== 0
|
||||
|
||||
return tag.value
|
||||
} else if (tag.type === 'int') {
|
||||
return tag.value
|
||||
} else if (tag.type === 'string') {
|
||||
return tag.value
|
||||
} else if (tag.type === 'intArray') {
|
||||
const array = []
|
||||
|
||||
for (const value of tag.value) {
|
||||
array.push(value)
|
||||
}
|
||||
|
||||
return array
|
||||
} else {
|
||||
console.log('Failed to parse NBT component type ' + tag.type)
|
||||
|
||||
return { text: '' }
|
||||
}
|
||||
}
|
||||
module.exports = convertNbtComponentToJson
|
||||
@@ -1,22 +0,0 @@
|
||||
const styles = {
|
||||
bigint: '\xa76', // gold
|
||||
boolean: '\xa76', // gold
|
||||
date: '\xa75', // dark_purple
|
||||
module: '\xa7n', // underline
|
||||
name: undefined, //undefined
|
||||
null: '\xa73', // bold
|
||||
number: '\xa76', // gold
|
||||
regexp: '\xa74', // dark_red
|
||||
special: '\xa73', // blue
|
||||
string: '\xa72', // green
|
||||
symbol: '\xa72', // green
|
||||
undefined: '\xa78' // dark_gray
|
||||
}
|
||||
|
||||
function stylize (str, styleType) {
|
||||
const style = styles[styleType]
|
||||
if (style !== undefined) return `${style}${str}\xa7r`
|
||||
return str
|
||||
}
|
||||
|
||||
module.exports = { stylize, styles }
|
||||
@@ -1,18 +0,0 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
async function loadModules (bot, config, webhook) {
|
||||
for (const filename of fs.readdirSync(path.join(__dirname, '../', 'modules'))) {
|
||||
try {
|
||||
if (filename.endsWith(".js")) {
|
||||
const module = require(path.join(__dirname, '../modules', filename));
|
||||
if (module.data.enabled === false) return;
|
||||
module.inject({ bot, config, webhook });
|
||||
bot.emit('modules', module.data);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`Failed to load module ${filename} due to error`);
|
||||
console.error(`\x1b[31m${error.stack}\x1b[0m`);
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports = loadModules;
|
||||
@@ -1,59 +0,0 @@
|
||||
const BOOLEAN_TYPES = [
|
||||
"interpret",
|
||||
"bold",
|
||||
"italic",
|
||||
"underlined",
|
||||
"strikethrough",
|
||||
"obfuscated",
|
||||
"float"
|
||||
];
|
||||
function convertNbtComponentToJson(key, tag) {
|
||||
let chatTypes;
|
||||
if (!tag) {
|
||||
return null;
|
||||
} else if (tag.type === "compound") {
|
||||
const object = {};
|
||||
|
||||
for (const key of Object.keys(tag.value)) {
|
||||
object[key === "" ? "text" : key] = convertNbtComponentToJson(
|
||||
key,
|
||||
tag.value[key],
|
||||
);
|
||||
}
|
||||
|
||||
return object;
|
||||
} else if (tag.type === "list") {
|
||||
const array = [];
|
||||
|
||||
for (const item of tag.value.value) {
|
||||
array.push(
|
||||
convertNbtComponentToJson(null, { type: tag.value.type, value: item }),
|
||||
);
|
||||
}
|
||||
|
||||
return array;
|
||||
} else if (tag.type === "byte") {
|
||||
if (key && BOOLEAN_TYPES.includes(key)) return tag.value !== 0;
|
||||
|
||||
return tag.value;
|
||||
} else if (tag.type === "int") {
|
||||
return tag.value;
|
||||
} else if (tag.type === "string") {
|
||||
return tag.value;
|
||||
} else if (tag.type === "float") {
|
||||
return tag.value
|
||||
} else if (tag.type === "intArray") {
|
||||
const array = [];
|
||||
|
||||
for (const value of tag.value) {
|
||||
array.push(value);
|
||||
}
|
||||
|
||||
return array;
|
||||
} else {
|
||||
console.log("Failed to parse NBT component type " + tag.type);
|
||||
|
||||
return { text: "" };
|
||||
}
|
||||
}
|
||||
module.exports = convertNbtComponentToJson;
|
||||
@@ -1,6 +0,0 @@
|
||||
async function delay(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
module.exports = delay;
|
||||
// ported from FNFBoyfriendBot v3
|
||||
|
||||
Reference in New Issue
Block a user