v6.0.8 build: 1090

added private option to the config for netmsg for right now
added icu selfcare
made vanish selfcare toggleable
This commit is contained in:
Parker2991 2024-10-24 10:48:45 -04:00
parent 0aed4d7d7a
commit 3344fc6e2e
8 changed files with 96 additions and 30 deletions

View file

@ -80,7 +80,7 @@ module.exports = {
case "trusted":
case "t":
if (bot.console.customChat.enabled) {
bot.console.customChat.chat(`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.owner} ${args.slice(3).join(' ')}`);
bot.console.customChat.chat(`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.trusted} ${args.slice(3).join(' ')}`);
} else if (!bot.console.customChat.enabled) {
bot.chat.message(`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.trusted} ${args.slice(3).join(' ')}`);
}

View file

@ -409,28 +409,28 @@ module.exports = {
bot.discord.message.reply({ embeds: [Embed] })
return
}
if (command?.trustLevel === 0) {
if (command?.trustLevel === 0 && command.discordExecute) {
public.push([
{
text: command.name + ' ',
color: "aqua",
}
])
} else if (command?.trustLevel === 1) {
} else if (command?.trustLevel === 1 && command.discordExecute) {
trusted.push([
{
text: command.name + ' ',
color: "dark_aqua"
}
])
} else if (command?.trustLevel === 2) {
} else if (command?.trustLevel === 2 && command.discordExecute) {
admin.push([
{
text: command.name + ' ',
color: 'blue'
}
])
} else if (command?.trustLevel === 3) {
} else if (command?.trustLevel === 3 && command.discordExecute) {
owner.push([
{
text: command.name + ' ',
@ -439,7 +439,7 @@ module.exports = {
])
}
}
const length = bot.commandManager.commandlist.filter(c => c.trustLevel != 3).length
const length = bot.commandManager.commandlist.filter(c => c.trustLevel !== 3 && c.discordExecute).length
const ansi1 = bot.getMessageAsPrismarine([ { text: 'Commands (', color: 'gray' }, { text: JSON.stringify(length), color: 'gold' }, { text: ') ', color: 'gray' }, category, '\n', public, trusted, owner ])?.toAnsi();
const fix1 = fixansi(ansi1.replaceAll('`', '`\u200b'))
const Embed = new EmbedBuilder()

View file

@ -1,7 +1,7 @@
const CommandError = require('../util/command_error.js')
module.exports = {
name: 'netmsg',
trustLevel: 1,
trustLevel: 0,
aliases: [
],
@ -14,23 +14,25 @@ module.exports = {
const bot = context.bot;
const source = context.source;
const config = context.config;
if (config.patches.netmsg) {
component = [
{ text: '[', color: "dark_gray" },
{ text: bot.options.serverName, color: "gray" },
{ text: "] ", color: "dark_gray" },
source.player.displayName,
{ text: " \u203a ", color: "dark_gray", bold: false },
{ text: args.join(' '), color: "gray", bold: false }
]
} else {
if (bot.options.private) {
component = {
translate: '[%s] %s \u203a %s',
color: "dark_gray",
with: [
{ text: bot.options.serverName, color: "gray" },
{ text: bot.options.serverName, color: "blue" },
source.player.displayName ?? source.player.profile.name,
{ text: args.join(' '), color: "gray" },
{ text: args.join(' '), color: "blue" },
]
}
} else if (!bot.options.private) {
component = {
translate: '[%s:%s] %s \u203a %s',
color: "dark_gray",
with: [
{ text: bot.options.host, color: "blue" },
{ text: `${bot.options.port}`, color: "gold" },
source.player.displayName ?? source.player.profile.name,
{ text: args.join(' '), color: "blue" },
]
}
}
@ -53,13 +55,27 @@ module.exports = {
const bot = context.bot;
const args = context.arguments;
const source = context.source;
const component = {
translate: '[%s] %s \u203a %s',
with: [
bot.options.serverName,
source.player.displayName ?? source.player.profile.name,
args.join(' ')
]
if (bot.options.private) {
component = {
translate: '[%s] %s \u203a %s',
color: "dark_gray",
with: [
{ text: bot.options.serverName, color: "blue" },
source.player.displayName ?? source.player.profile.name,
{ text: args.join(' '), color: "blue" },
]
}
} else if (!bot.options.private) {
component = {
translate: '[%s:%s] %s \u203a %s',
color: "dark_gray",
with: [
{ text: bot.options.host, color: "blue" },
{ text: `${bot.options.port}`, color: "gold" },
source.player.displayName ?? source.player.profile.name,
{ text: args.join(' '), color: "blue" },
]
}
}
bot.bots.filter((eachBot) => {
if (eachBot.options.serverName === "Savage Friends" && eachBot.options.isSavage && !eachBot.options.useChat && !eachBot.options.isKaboom) {

31
src/commands/vanish.js Normal file
View file

@ -0,0 +1,31 @@
module.exports = {
name: 'vanish',
trustLevel: 2,
aliases: [
"vanishtoggle"
],
description: 'toggle the bots vanish selfcare',
usages: [
],
execute (context) {
const bot = context.bot
const args = context.arguments;
if (args.slice(1).join('') === 'true') {
bot.vanished = true
bot.chat.message('enabled vanish selfcare')
}
if (args.slice(1).join('') === 'false') {
bot.vanished = false;
bot.chat.message('disabled vanish selfcare')
}
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
bot.vanished = false;
bot.chat.message('disabling vanish selfcare,...');
bot.chat.command('v off')
}
}

View file

@ -51,6 +51,7 @@ bots:
usernameGen: true
version: "1.20.2"
serverName: "localhost"
private: false
reconnectDelay: 6000
channelId: "discord channel id here"
logging: false

View file

@ -1,8 +1,8 @@
{
"bot": {
"buildstring": {
"version": "v6.0.7",
"build":"1080",
"version": "v6.0.8",
"build":"1090",
"codename":""
},
"source": "https://code.chipmunk.land/Parker2991/FridayNightFunkinBoyfriendBot/"

View file

@ -19,7 +19,7 @@ function Console (bot, options, config) {
})
})
},
source: new CommandSource(bot.options.username, { console: true, discord: false }),
source: new CommandSource(bot._client.username, { console: true, discord: false }),
refreshLine (...args) {
this.readline.output.write("\x1b[2K\r");
console.log.apply(console, arguments);

View file

@ -12,6 +12,8 @@ function selfcare (bot, options, config) {
let nickname = false;
let login = false;
let register = false;
let positionCount = 0;
bot.vanished = true
// You now have the tag: &8[&bPrefix&8: &3~&8]
// You no longer have a tag
bot.on('message', (message) => {
@ -63,18 +65,34 @@ You already have registered this username!
else if (stringMessage.startsWith('Your nickname is now ')) nickname = true;
}
})
bot.on('packet.entity_status', packet => {
if (packet.entityId !== entityId || packet.entityStatus < 24 || packet.entityStatus > 28) return
permissionLevel = packet.entityStatus - 24
})
bot.on('packet.game_state_change', packet => {
if (packet.reason !== 3) return // Reason 3 = Change Game Mode
gameMode = packet.gameMode;
});
bot.on("packet.game_state.change", packet => {
if (packet.reason !== 4) return // checks if the bot is seeing the endcredits or died
clientLock = packet.gameMode;
})
bot.on("packet.position", (packet, position) => {
positionCount++
setTimeout(() => {
positionCount--
if (positionCount > 4) {
bot.core.run('sudo * icu stop');
} if (permissionLevel < 2 || gameMode !== 1) {
bot._client.end('anti icu :3');
}
}, 1000)
})
let timer;
bot.on('packet.login', (packet) => {
entityId = packet.entityId;
@ -96,7 +114,7 @@ You already have registered this username!
else if (username) bot.chat.command(`username ${bot.options.username}`)
else if (nickname) bot.chat.command(`nick off`)
else if (!prefix) bot.chat.command(`prefix &8[&bPrefix&8: &3${config.prefixes[0]}&8]`);
else if (!vanished) bot.chat.command(`essentials:vanish on`);
else if (!vanished && bot.vanished) bot.chat.command(`essentials:vanish on`);
else if (unmuted) bot.core.run(`essentials:mute ${bot.uuid}`);
else if (!god) bot.core.run(`god ${bot.options.username} enable`);
else if (!teleportToggle) bot.core.run(`tptoggle ${bot.options.username} disable`);