Compare commits

...

14 commits

Author SHA1 Message Date
ac9ce2d957 Update README.md 2024-09-20 00:06:33 -04:00
8ddee3cf3a
Backport README update to 10.0 branch 2024-09-20 00:04:32 -04:00
5a7a6548d7
Bump version 2024-09-13 03:50:03 -04:00
7ce5949d86
Bugfix 2024-09-13 03:49:00 -04:00
171b6a2f9a
Bump version 2024-09-12 00:19:03 -04:00
a85269ecce
Lint 2024-09-12 00:18:41 -04:00
28ebfc7b62
How did I not see this 2024-09-08 22:39:08 -04:00
f1994b7f7f
Improvements to about command 2024-09-08 22:24:36 -04:00
0b0fad42ef
Fix "info serveR 2024-09-08 22:24:02 -04:00
bf111d2648
Case sensitivity fixes 2024-09-08 22:23:22 -04:00
32852ff120
Update branding
If it causes problems, botvX
2024-09-08 22:06:35 -04:00
83d2cf4a65
Add m_c_player format 2024-09-08 22:06:29 -04:00
4cf86f31c1
Add chipmunk mod format 2024-09-08 22:06:25 -04:00
9658c63dcd
Change author 2024-08-30 21:46:25 -04:00
9 changed files with 95 additions and 33 deletions

View file

@ -1,16 +1,20 @@
# botvX
# owobot
botvX is a Minecraft bot originally designed for [Kaboom](https://kaboom.pw/) and its clones. It has many of the features that you would expect in a modern Kaboom bot:
owobot is a Minecraft bot originally designed for [Kaboom](https://kaboom.pw/) and its clones. It has many of the features that you would expect in a modern Kaboom bot:
- commands (obviously)
- a self care system
- a command core, to run commands quickly
- a hashing system, to enable trusted users to securely run certain commands in chat
If you are not sure if this code is safe to run, you can read through every line of code. You can also see the commit history by clicking on the (n) commits button, to make sure nobody added any exploits to the code.
If you find any exploits, security issues, etc in the code, please send me an issue or pull request and I will try to respond to it whenever I see it.
## How to install?
1. Install [Node.js](https://nodejs.org/) for your operating system.
2. Download the latest release, or alternatively, download the latest development version using `git clone https://code.chipmunk.land/7cc5c4f330d47060/botvX`.
2. Download the latest release, or alternatively, download the latest development version using `git clone https://code.chipmunk.land/7cc5c4f330d47060/owobot`.
3. Extract the files if necessary.
4. Run `npm install` in the bot's directory. If it doesn't work, try using the Node.js command prompt, or adding Node.js to your PATH.
5. Copy `settings_example.json` to `settings.json` and `secret_example.json` to `secret.json`, and adjust the settings to fit your needs. Change the example keys in secret.json as well.

View file

@ -239,10 +239,11 @@ const displayServerList = function (c) {
module.exports = {
execute: function (c) {
let subcmd = c.args[0]
let subcmd
if (c.args.length >= 1) subcmd = c.args[0].toLowerCase()
if (subcmd === 'servers') subcmd = 'serverlist'
if (c.cmdName === 'serverinfo') subcmd = 'server'
if (c.cmdName === 'serverlist' || c.cmdName === 'servers') subcmd = 'serverlist'
if (c.cmdName.toLowerCase() === 'serverinfo' || c.cmdName.toLowerCase() === 'specs') subcmd = 'server'
if (c.cmdName.toLowerCase() === 'serverlist' || c.cmdName.toLowerCase() === 'servers') subcmd = 'serverlist'
if (subcmd === 'server') {
aboutServer(c)
} else if (subcmd === 'serverlist') {
@ -251,5 +252,5 @@ module.exports = {
aboutBot(c)
}
},
aliases: ['info', 'serverlist', 'servers', 'serverinfo']
aliases: ['info', 'serverlist', 'servers', 'serverinfo', 'specs']
}

View file

@ -1,7 +1,8 @@
const { getMessage } = require('../util/lang.js')
module.exports = {
execute: (c) => {
const subcmd = c.args.splice(0, 1)[0]
let subcmd
if (c.args.length >= 1) subcmd = c.args.splice(0, 1)[0].toLowerCase()
switch (subcmd) {
case 'add': {
const rate = +(c.args.splice(0, 1)[0])

View file

@ -65,7 +65,8 @@ const printHelp = (c) => {
}
const printCmdHelp = (c) => {
const cmd = c.args[0]
let cmd
if (c.args.length >= 1) cmd = c.args[0].toLowerCase()
if (!cmds[cmd] || (cmds[cmd].hidden && c.type !== 'console')) {
c.reply({ text: getMessage(c.lang, 'command.help.noCommand') })
return

View file

@ -17,7 +17,8 @@ module.exports = {
})
return
}
const subcmd = c.args.splice(0, 1)[0]
let subcmd
if (c.args.length >= 1) subcmd = c.args.splice(0, 1)[0].toLowerCase()
switch (subcmd) {
case 'set':{
const allowedKeys = ['colorPrimary', 'colorSecondary', 'lang']

View file

@ -32,16 +32,18 @@
"command.say.desc": "Sends a message to chat",
"command.settings.usage": " get|| set <key> <value>",
"command.settings.desc": "Set your user preferences",
"command.restart.usage": "",
"command.restart.desc": "Restart bot",
"command.stop.usage": "",
"command.stop.desc": "Restart bot",
"command.stop.desc": "Stop bot",
"command.template.usage": " <required> [optional]",
"command.template.desc": "Does nothing",
"command.test.usage": " [args...]",
"command.test.desc": "Chat parsing debugger command",
"command.tpr.usage": "",
"command.tpr.desc": "Teleport to a random location",
"command.verify.usage": " [args...]",
"command.verify.desc": "Check the hashing system",
"command.validate.usage": " [args...]",
"command.validate.desc": "Check the hashing system",
"command.about.author": "%s - a Minecraft bot made by %s for Kaboom and clones",
"command.about.version": "Version %s",
"command.about.preRelease": "This is a development version - there may be errors, and features may be changed or removed at any time. Please report any errors to the bot's developer.",

View file

@ -117,21 +117,60 @@ module.exports = {
b._client.on('system_chat', (data) => {
const json = parse1204(data.content)
const parsed = parsePlain(json)
const split = parsed.split(': ')
const chatName = split.splice(0, 1)[0]
const chatNameSplit = chatName.split(' ')
const nickname = chatNameSplit[chatNameSplit.length - 1]
const username = b.findRealName(chatName)
const uuid = b.findUUID(username)
b.emit('chat', {
json,
type: 'system',
uuid,
message: split.join(': '),
nickname,
username
})
if (json.translate === '%s %s %s') { // ChipmunkMod format
if (json.with && json.with[1] && json.with[2]) {
const username = parsePlain(json.with[1])
const uuid = b.findUUID(username)
const nickname = b.findDisplayName(uuid)
const message = parsePlain(json.with[2].extra)
b.emit('chat', {
json,
type: 'system',
uuid,
message,
nickname,
username
})
} else {
b.emit('chat', {
json,
type: 'system',
uuid: '00000000-0000-0000-0000-000000000000',
message: '',
nickname: '',
username: ''
})
}
} else if (json.extra && json.extra[4] && json.extra[3] && json.extra[5] && json.extra[4].text === ' » ') { // ChipmunkMod format - m_c_player
const username = parsePlain(json.extra[3])
const uuid = b.findUUID(username)
const nickname = b.findDisplayName(uuid)
const message = parsePlain(json.extra[5])
b.emit('chat', {
json,
type: 'system',
uuid,
message,
nickname,
username
})
} else { // Generic system chat format
const parsed = parsePlain(json)
const split = parsed.split(': ')
const chatName = split.splice(0, 1)[0]
const chatNameSplit = chatName.split(' ')
const nickname = chatNameSplit[chatNameSplit.length - 1]
const username = b.findRealName(chatName)
const uuid = b.findUUID(username)
b.emit('chat', {
json,
type: 'system',
uuid,
message: split.join(': '),
nickname,
username
})
}
})
b._client.on('chat', (data) => { // Legacy chat for versions <1.19
@ -142,7 +181,19 @@ module.exports = {
let username
let message
let uuid
if (b.host.options.isVanilla && json.translate === 'chat.type.text') { // Servers without Extras chat
if (json.translate === '%s %s %s') { // ChipmunkMod format
if (json.with && json.with[1] && json.with[2]) {
username = parsePlain(json.with[1])
uuid = b.findUUID(username)
nickname = b.findDisplayName(uuid)
message = parsePlain(json.with[2].extra)
}
} else if (json.extra && json.extra[4] && json.extra[3] && json.extra[5] && json.extra[4].text === ' » ') { // ChipmunkMod format - m_c_player
username = parsePlain(json.extra[3])
uuid = b.findUUID(username)
nickname = b.findDisplayName(uuid)
message = parsePlain(json.extra[5])
} else if (b.host.options.isVanilla && json.translate === 'chat.type.text') { // Servers without Extras chat
if (json.with && json.with.length >= 2) {
message = parsePlain(json.with[1])
username = parsePlain(json.with[0])

View file

@ -1,6 +1,7 @@
const index = require('../index.js')
const parse = require('../util/chatparse_console.js')
const settings = require('../settings.json')
const version = require('../version.json')
class ConsoleCommand {
constructor (cmd, index2) {
this.send = () => {}
@ -20,7 +21,7 @@ class ConsoleCommand {
this.verify = 3
this.host = ''
this.port = '3'
this.serverName = 'botvX Console'
this.serverName = `${version.botName} Console`
this.lang = settings.defaultLang
this.colors = settings.colors
}

View file

@ -1,7 +1,7 @@
{
"botName": "owobot",
"botVersion": "10.0.0",
"botAuthor": "a5a06d596f15c7db",
"botVersion": "10.0.3",
"botAuthor": "SundanceNanshan",
"isPreRelease": false,
"sourceURL": "https://code.chipmunk.land/7cc5c4f330d47060/botvX"
"sourceURL": "https://code.chipmunk.land/7cc5c4f330d47060/owobot"
}