Compare commits

...

8 commits

5 changed files with 30 additions and 19 deletions

View file

@ -1,10 +1,20 @@
import * as index from '../index.js' // Not used in the code, but may be used by users of the command
import { getMessage } from '../util/lang.js'
import { inspect } from 'node:util'
import settings from '../settings.js'
import chatlog from '../util/chatlog.js'
const execute = (c) => {
const item = eval(c.args.join(' '))
const payload = c.args.join(' ')
if (!settings.disableLogging && !settings.disableEvalLogging) chatlog(`eval`, `${c.host}:${c.port} ${c.username} (${c.uuid}) Payload: ${payload}`)
try {
const result = inspect(eval(payload))
if (!settings.disableLogging && !settings.disableEvalLogging) chatlog(`eval`, `${c.host}:${c.port} ${c.username} (${c.uuid}) Result: ${result}`)
} catch (e){
if (!settings.disableLogging && !settings.disableEvalLogging) chatlog(`eval`, `${c.host}:${c.port} ${c.username} (${c.uuid}) Error: ${inspect(e)}`)
}
if (c.type === 'console') {
console.log(item)
console.log(result)
} else {
c.reply({
translate: '%s: %s',
@ -15,11 +25,11 @@ const execute = (c) => {
color: c.colors.secondary
},
{
text: item + '',
text: result + '',
color: c.colors.primary,
clickEvent: {
action: 'copy_to_clipboard',
value: item + ''
value: result + ''
},
hoverEvent: {
action: 'show_text',

16
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "botv12",
"version": "12.0.0-alpha.1",
"version": "12.0.0-alpha.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "botv12",
"version": "12.0.0-alpha.1",
"version": "12.0.0-alpha.2",
"license": "MIT",
"dependencies": {
"minecraft-protocol": "^1.49.0"
@ -22,9 +22,9 @@
}
},
"node_modules/@azure/msal-node": {
"version": "2.16.0",
"resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.16.0.tgz",
"integrity": "sha512-oww0oJTOOvPKTVXqVyxfcFVjExQKYEkKR5KM0cTG3jnzt6u/MRMx8XaK49L/bxV35r9sCHQFjNlEShad9qGSYA==",
"version": "2.16.2",
"resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.16.2.tgz",
"integrity": "sha512-An7l1hEr0w1HMMh1LU+rtDtqL7/jw74ORlc9Wnh06v7TU/xpG39/Zdr1ZJu3QpjUfKJ+E0/OXMW8DRSWTlh7qQ==",
"license": "MIT",
"dependencies": {
"@azure/msal-common": "14.16.0",
@ -36,9 +36,9 @@
}
},
"node_modules/@types/node": {
"version": "22.9.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.0.tgz",
"integrity": "sha512-vuyHg81vvWA1Z1ELfvLko2c8f34gyA0zaic0+Rllc5lbCnbSyuvb2Oxpm6TAUAC/2xZN3QGqxBNggD1nNR2AfQ==",
"version": "22.9.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.1.tgz",
"integrity": "sha512-p8Yy/8sw1caA8CdRIQBG5tiLHmxtQKObCijiAa9Ez+d4+PRffM4054xbju0msf+cvhJpnFEeNjxmVT/0ipktrg==",
"license": "MIT",
"dependencies": {
"undici-types": "~6.19.8"

View file

@ -1,6 +1,6 @@
{
"name": "botv12",
"version": "12.0.0-alpha.1",
"version": "12.0.0-alpha.2",
"description": "Minecraft bot for the Kaboom server",
"main": "index.js",
"type": "module",

View file

@ -125,7 +125,8 @@ export default function load (b) {
}
})
b.on('plainchat', (msg) => {
if (msg === `You now have the tag: ${parseMc(b.adPrefix).replaceAll('§', '&')}`) {
if (msg === `You now have the tag: ${parseMc(b.adPrefix).replaceAll('§', '&')}` ||
msg === 'Something went wrong while saving the prefix. Please check console.') { // Fix the prefix issue
b.sc_tasks.playerlist_ads.failed = 0
}
})

View file

@ -1,7 +1,7 @@
export default {
botName: 'botv12 Dev',
botVersion: '12.0.0-alpha.1',
botAuthor: 'owo439895035',
isPreRelease: true,
sourceURL: 'https://code.chipmunk.land/7cc5c4f330d47060/botv12'
botName: 'botv12 Dev', // Name of the bot
botVersion: '12.0.0-alpha.2', // Version of the bot. This is different from the one in package.json, which has to be updated seperately.
botAuthor: 'owo439895035', // The creator of the bot
isPreRelease: true, // If this version is a pre-release version. Used by the about command to show a warning if set to true.
sourceURL: 'https://code.chipmunk.land/7cc5c4f330d47060/botv12' // Source code repository URL. This is different from the one in package.json.
}