mirror of
https://code.chipmunk.land/Parker2991/NitoriBot/
synced 2026-12-06 01:15:42 -05:00
should have pushed this a long time ago
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
const mc = require('minecraft-protocol');
|
||||
|
||||
const client = mc.createClient({
|
||||
host: "amy.lat.",
|
||||
port: "25565",
|
||||
username: "eee",
|
||||
version: "1.20.2",
|
||||
hideErrors: false,
|
||||
})
|
||||
// username, playerUUID
|
||||
//client.write('keep_alive');
|
||||
client.on('init_client', () => {
|
||||
// client.write('login_start', { username: client.username, playerUUID: client.uuid });
|
||||
});
|
||||
//console.log(client.write);
|
||||
@@ -0,0 +1,89 @@
|
||||
const mc = require('minecraft-protocol')
|
||||
const readline = require('readline')
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
terminal: false,
|
||||
prompt: 'Enter a message> '
|
||||
})
|
||||
|
||||
const [,, host, port, username] = process.argv
|
||||
//if (!host || !port) {
|
||||
// console.error('Usage: node client_chat.js <host> <port> <username>')
|
||||
// console.error('Usage (offline mode): node client_chat.js <host> <port> offline')
|
||||
// process.exit(1)
|
||||
//}
|
||||
|
||||
const client = mc.createClient({
|
||||
host:"ayunboom.shhnowisnottheti.me",
|
||||
username: "among",
|
||||
version: "1.8.8"
|
||||
// auth: username === 'offline' ? 'offline' : 'microsoft'
|
||||
})
|
||||
|
||||
// Boilerplate
|
||||
client.on('disconnect', function (packet) {
|
||||
console.log('Disconnected from server : ' + packet.reason)
|
||||
})
|
||||
|
||||
client.on('end', function () {
|
||||
console.log('Connection lost')
|
||||
process.exit()
|
||||
})
|
||||
|
||||
client.on('error', function (err) {
|
||||
console.log('Error occurred')
|
||||
console.log(err)
|
||||
process.exit(1)
|
||||
})
|
||||
|
||||
client.on('connect', () => {
|
||||
const ChatMessage = require('prismarine-chat')(client.version)
|
||||
|
||||
console.log('Connected to server')
|
||||
rl.prompt()
|
||||
|
||||
client.on('playerChat', function ({ senderName, plainMessage, unsignedContent, formattedMessage, verified }) {
|
||||
let content
|
||||
|
||||
const allowInsecureChat = true
|
||||
|
||||
if (formattedMessage) content = JSON.parse(formattedMessage)
|
||||
else if (allowInsecureChat && unsignedContent) content = JSON.parse(unsignedContent)
|
||||
else content = { text: plainMessage }
|
||||
|
||||
const chat = new ChatMessage(content)
|
||||
console.log(senderName, { trugie: 'Verified:', false: 'UNVERIFIED:' }[verified] || '', chat.toAnsi())
|
||||
})
|
||||
client.on('systemChat', (data) => {
|
||||
console.log(data)
|
||||
});
|
||||
})
|
||||
|
||||
// Send the queued messages
|
||||
const queuedChatMessages = []
|
||||
client.on('state', function (newState) {
|
||||
if (newState === mc.states.PLAY) {
|
||||
queuedChatMessages.forEach(message => client.chat(message))
|
||||
queuedChatMessages.length = 0
|
||||
}
|
||||
})
|
||||
|
||||
// Listen for messages written to the console, send them to game chat
|
||||
rl.on('line', function (line) {
|
||||
if (line === '') {
|
||||
return
|
||||
} else if (line === '/quit') {
|
||||
console.info('Disconnected from ' + host + ':' + port)
|
||||
client.end()
|
||||
return
|
||||
} else if (line === '/end') {
|
||||
console.info('Forcibly ended client')
|
||||
process.exit(0)
|
||||
}
|
||||
if (!client.chat) {
|
||||
queuedChatMessages.push(line)
|
||||
} else {
|
||||
client.chat(line)
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,9 @@
|
||||
const { request } = require('undici');
|
||||
|
||||
(async () => {
|
||||
const url = await request('https://en.wikipedia.org/api/rest_v1/page/media-list/amongus');
|
||||
const json = await url.body.json();
|
||||
for (const e of json.items) {
|
||||
console.log(e.caption)
|
||||
}
|
||||
})()
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
Generated
+217
-11
@@ -8,10 +8,12 @@
|
||||
"dependencies": {
|
||||
"discord.js": "^14.16.3",
|
||||
"js-yaml": "^4.1.0",
|
||||
"minecraft-data": "^3.84.0",
|
||||
"minecraft-protocol": "^1.51.0",
|
||||
"prismarine-chat": "^1.10.1",
|
||||
"prismarine-chat": "^1.11.0",
|
||||
"prismarine-nbt": "^2.7.0",
|
||||
"prismarine-registry": "^1.10.0",
|
||||
"prismarine-registry": "^1.11.0",
|
||||
"terminal-kit": "^3.1.1",
|
||||
"undici": "^7.2.0"
|
||||
}
|
||||
},
|
||||
@@ -38,6 +40,20 @@
|
||||
"node": ">=16"
|
||||
}
|
||||
},
|
||||
"node_modules/@cronvel/get-pixels": {
|
||||
"version": "3.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@cronvel/get-pixels/-/get-pixels-3.4.1.tgz",
|
||||
"integrity": "sha512-gB5C5nDIacLUdsMuW8YsM9SzK3vaFANe4J11CVXpovpy7bZUGrcJKmc6m/0gWG789pKr6XSZY2aEetjFvSRw5g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"jpeg-js": "^0.4.4",
|
||||
"ndarray": "^1.0.19",
|
||||
"ndarray-pack": "^1.1.1",
|
||||
"node-bitmap": "0.0.1",
|
||||
"omggif": "^1.0.10",
|
||||
"pngjs": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/builders": {
|
||||
"version": "1.9.0",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.9.0.tgz",
|
||||
@@ -411,12 +427,27 @@
|
||||
"integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==",
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/chroma-js": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/chroma-js/-/chroma-js-2.6.0.tgz",
|
||||
"integrity": "sha512-BLHvCB9s8Z1EV4ethr6xnkl/P2YRFOGqfgvuMG/MyCbZPrTA+NeiByY6XvgF0zP4/2deU2CXnWyMa3zu1LqQ3A==",
|
||||
"license": "(BSD-3-Clause AND Apache-2.0)"
|
||||
},
|
||||
"node_modules/commander": {
|
||||
"version": "2.20.3",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
||||
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/cwise-compiler": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/cwise-compiler/-/cwise-compiler-1.1.3.tgz",
|
||||
"integrity": "sha512-WXlK/m+Di8DMMcCjcWr4i+XzcQra9eCdXIJrgh4TUgh0pIS/yJduLxS9JgefsHJ/YVLdgPtXm9r62W92MvanEQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"uniq": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
|
||||
@@ -566,6 +597,18 @@
|
||||
],
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/iota-array": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/iota-array/-/iota-array-1.0.0.tgz",
|
||||
"integrity": "sha512-pZ2xT+LOHckCatGQ3DcG/a+QuEqvoxqkiL7tvE8nn3uuu+f6i1TtpB5/FtWFbxUuVr5PZCx8KskuGatbJDXOWA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/is-buffer": {
|
||||
"version": "1.1.6",
|
||||
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
|
||||
"integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/jose": {
|
||||
"version": "4.15.9",
|
||||
"resolved": "https://registry.npmjs.org/jose/-/jose-4.15.9.tgz",
|
||||
@@ -575,6 +618,12 @@
|
||||
"url": "https://github.com/sponsors/panva"
|
||||
}
|
||||
},
|
||||
"node_modules/jpeg-js": {
|
||||
"version": "0.4.4",
|
||||
"resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.4.tgz",
|
||||
"integrity": "sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==",
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/js-yaml": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
|
||||
@@ -636,6 +685,15 @@
|
||||
"safe-buffer": "^5.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/lazyness": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/lazyness/-/lazyness-1.2.0.tgz",
|
||||
"integrity": "sha512-KenL6EFbwxBwRxG93t0gcUyi0Nw0Ub31FJKN1laA4UscdkL1K1AxUd0gYZdcLU3v+x+wcFi4uQKS5hL+fk500g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/lodash": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||
@@ -721,9 +779,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/minecraft-data": {
|
||||
"version": "3.80.0",
|
||||
"resolved": "https://registry.npmjs.org/minecraft-data/-/minecraft-data-3.80.0.tgz",
|
||||
"integrity": "sha512-UYq+ADpS9K1+cqiJiz6tqkht4y4cRYF3qOYanG9eIiHY+VC+qIAC7/UcW6G3adayvj5YBOCurlqaw3E0TMAtHg==",
|
||||
"version": "3.84.0",
|
||||
"resolved": "https://registry.npmjs.org/minecraft-data/-/minecraft-data-3.84.0.tgz",
|
||||
"integrity": "sha512-UbHHsFHP3jxt3YcmTfng8sB6oaNkahowxN37iK0+l4CFHOx8ZF+0yxTDLl2N+wzmUCYccBXBFN8PNt36uzLt0g==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/minecraft-folder-path": {
|
||||
@@ -784,6 +842,26 @@
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/ndarray": {
|
||||
"version": "1.0.19",
|
||||
"resolved": "https://registry.npmjs.org/ndarray/-/ndarray-1.0.19.tgz",
|
||||
"integrity": "sha512-B4JHA4vdyZU30ELBw3g7/p9bZupyew5a7tX1Y/gGeF2hafrPaQZhgrGQfsvgfYbgdFZjYwuEcnaobeM/WMW+HQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"iota-array": "^1.0.0",
|
||||
"is-buffer": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/ndarray-pack": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ndarray-pack/-/ndarray-pack-1.2.1.tgz",
|
||||
"integrity": "sha512-51cECUJMT0rUZNQa09EoKsnFeDL4x2dHRT0VR5U2H5ZgEcm95ZDWcMA5JShroXjHOejmAD/fg8+H+OvUnVXz2g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cwise-compiler": "^1.1.2",
|
||||
"ndarray": "^1.0.13"
|
||||
}
|
||||
},
|
||||
"node_modules/nearley": {
|
||||
"version": "2.20.1",
|
||||
"resolved": "https://registry.npmjs.org/nearley/-/nearley-2.20.1.tgz",
|
||||
@@ -806,6 +884,23 @@
|
||||
"url": "https://nearley.js.org/#give-to-nearley"
|
||||
}
|
||||
},
|
||||
"node_modules/nextgen-events": {
|
||||
"version": "1.5.3",
|
||||
"resolved": "https://registry.npmjs.org/nextgen-events/-/nextgen-events-1.5.3.tgz",
|
||||
"integrity": "sha512-P6qw6kenNXP+J9XlKJNi/MNHUQ+Lx5K8FEcSfX7/w8KJdZan5+BB5MKzuNgL2RTjHG1Svg8SehfseVEp8zAqwA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/node-bitmap": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/node-bitmap/-/node-bitmap-0.0.1.tgz",
|
||||
"integrity": "sha512-Jx5lPaaLdIaOsj2mVLWMWulXF6GQVdyLvNSxmiYCvZ8Ma2hfKX0POoR2kgKOqz+oFsRreq0yYZjQ2wjE9VNzCA==",
|
||||
"engines": {
|
||||
"node": ">=v0.6.5"
|
||||
}
|
||||
},
|
||||
"node_modules/node-fetch": {
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
|
||||
@@ -835,6 +930,21 @@
|
||||
"asn1": "0.2.3"
|
||||
}
|
||||
},
|
||||
"node_modules/omggif": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmjs.org/omggif/-/omggif-1.0.10.tgz",
|
||||
"integrity": "sha512-LMJTtvgc/nugXj0Vcrrs68Mn2D1r0zf630VNtqtpI1FEO7e+O9FP4gqs9AcnBaSEeoHIPm28u6qgPR0oyEpGSw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/pngjs": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pngjs/-/pngjs-6.0.0.tgz",
|
||||
"integrity": "sha512-TRzzuFRRmEoSW/p1KVAmiOgPco2Irlah+bGFCeNfJXxxYGwSw7YwAOAcd7X28K/m5bjBWKsC29KyoMfHbypayg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/prismarine-auth": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/prismarine-auth/-/prismarine-auth-2.5.0.tgz",
|
||||
@@ -850,10 +960,34 @@
|
||||
"uuid-1345": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/prismarine-biome": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/prismarine-biome/-/prismarine-biome-1.3.0.tgz",
|
||||
"integrity": "sha512-GY6nZxq93mTErT7jD7jt8YS1aPrOakbJHh39seYsJFXvueIOdHAmW16kYQVrTVMW5MlWLQVxV/EquRwOgr4MnQ==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"minecraft-data": "^3.0.0",
|
||||
"prismarine-registry": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/prismarine-block": {
|
||||
"version": "1.21.0",
|
||||
"resolved": "https://registry.npmjs.org/prismarine-block/-/prismarine-block-1.21.0.tgz",
|
||||
"integrity": "sha512-Um7zRIMHKbtpHYq+bSibc+LgFPqhHCnJgy5DeUYGG1VPLptrHjgAwvzb9bztzpzz4auziZIX+325CCWSDjIv+Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"minecraft-data": "^3.38.0",
|
||||
"prismarine-biome": "^1.1.0",
|
||||
"prismarine-chat": "^1.5.0",
|
||||
"prismarine-item": "^1.10.1",
|
||||
"prismarine-nbt": "^2.0.0",
|
||||
"prismarine-registry": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/prismarine-chat": {
|
||||
"version": "1.10.1",
|
||||
"resolved": "https://registry.npmjs.org/prismarine-chat/-/prismarine-chat-1.10.1.tgz",
|
||||
"integrity": "sha512-XukYcuueuhDxzEXG7r8BZyt6jOObrPPB4JESCgb+/XenB9nExoSHF8eTQWWj8faKPLqm1dRQaYwFJlNBlJZJUw==",
|
||||
"version": "1.11.0",
|
||||
"resolved": "https://registry.npmjs.org/prismarine-chat/-/prismarine-chat-1.11.0.tgz",
|
||||
"integrity": "sha512-VJT/MWYB3qoiznUhrgvSQh76YFpzpCZpY85kJKxHLbd3UVoM0wsfs43Eg8dOltiZG92wc5/DTMLlT07TEeoa9w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mojangson": "^2.0.1",
|
||||
@@ -861,6 +995,16 @@
|
||||
"prismarine-registry": "^1.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/prismarine-item": {
|
||||
"version": "1.16.0",
|
||||
"resolved": "https://registry.npmjs.org/prismarine-item/-/prismarine-item-1.16.0.tgz",
|
||||
"integrity": "sha512-88Tz+/6HquYIsDuseae5G3IbqLeMews2L+ba2gX+p6K6soU9nuFhCfbwN56QuB7d/jZFcWrCYAPE5+UhwWh67w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"prismarine-nbt": "^2.0.0",
|
||||
"prismarine-registry": "^1.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/prismarine-nbt": {
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/prismarine-nbt/-/prismarine-nbt-2.7.0.tgz",
|
||||
@@ -881,12 +1025,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/prismarine-registry": {
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/prismarine-registry/-/prismarine-registry-1.10.0.tgz",
|
||||
"integrity": "sha512-6TYQiZHtsJ87HsB2E0yamCFp77ZyyLT16OmW5iXB5V30yCPflhHvR5TR2IqISmmiRc2093BkHfiIhsOZaMatmQ==",
|
||||
"version": "1.11.0",
|
||||
"resolved": "https://registry.npmjs.org/prismarine-registry/-/prismarine-registry-1.11.0.tgz",
|
||||
"integrity": "sha512-uTvWE+bILxYv4i5MrrlxPQ0KYWINv1DJ3P2570GLC8uCdByDiDLBFfVyk4BrqOZBlDBft9CnaJMeOsC1Ly1iXw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"minecraft-data": "^3.70.0",
|
||||
"prismarine-block": "^1.17.1",
|
||||
"prismarine-nbt": "^2.0.0"
|
||||
}
|
||||
},
|
||||
@@ -997,6 +1142,24 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/setimmediate": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
|
||||
"integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/seventh": {
|
||||
"version": "0.9.2",
|
||||
"resolved": "https://registry.npmjs.org/seventh/-/seventh-0.9.2.tgz",
|
||||
"integrity": "sha512-C+dnbBXIEycnrN6/CpFt/Rt8ccMzAX3wbwJU61RTfC8lYPMzSkKkAVWnUEMTZDHdvtlrTupZeCUK4G+uP4TmRQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"setimmediate": "^1.0.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/smart-buffer": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz",
|
||||
@@ -1036,12 +1199,49 @@
|
||||
],
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/string-kit": {
|
||||
"version": "0.18.3",
|
||||
"resolved": "https://registry.npmjs.org/string-kit/-/string-kit-0.18.3.tgz",
|
||||
"integrity": "sha512-G8cBS7wxxHhwQrKU0Y8SjZJRtCzZ61bMmMCO1bWm6N6y2obT0koGK8uWYloMOaVPPr8zk7Ic995uEd4Jw504AQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=14.15.0"
|
||||
}
|
||||
},
|
||||
"node_modules/terminal-kit": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/terminal-kit/-/terminal-kit-3.1.1.tgz",
|
||||
"integrity": "sha512-R+R47zBQ14Ax2NZCLeuVl2GwonDwQN4iAsjQZICW8gMzaV+VIJMvL4qhUQtzDOhENADyNPQvY1Vz5G0bHHkLEA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@cronvel/get-pixels": "^3.4.1",
|
||||
"chroma-js": "^2.4.2",
|
||||
"lazyness": "^1.2.0",
|
||||
"ndarray": "^1.0.19",
|
||||
"nextgen-events": "^1.5.3",
|
||||
"seventh": "^0.9.2",
|
||||
"string-kit": "^0.18.1",
|
||||
"tree-kit": "^0.8.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/tr46": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/tree-kit": {
|
||||
"version": "0.8.7",
|
||||
"resolved": "https://registry.npmjs.org/tree-kit/-/tree-kit-0.8.7.tgz",
|
||||
"integrity": "sha512-BA/cp8KBvbBDkunxIuoBqzz3pYHL7J8QdzbKohK09urOpHFYqEe/xWGKkECEQG+LvfREd1GNqH3643GYFX8wSQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=16.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ts-mixer": {
|
||||
"version": "6.0.4",
|
||||
"resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.4.tgz",
|
||||
@@ -1069,6 +1269,12 @@
|
||||
"integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/uniq": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz",
|
||||
"integrity": "sha512-Gw+zz50YNKPDKXs+9d+aKAjVwpjNwqzvNpLigIruT4HA9lMZNdMqs9x07kKHB/L9WRzqp4+DlTU5s4wG2esdoA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/uri-js": {
|
||||
"version": "4.4.1",
|
||||
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
|
||||
|
||||
+4
-2
@@ -2,10 +2,12 @@
|
||||
"dependencies": {
|
||||
"discord.js": "^14.16.3",
|
||||
"js-yaml": "^4.1.0",
|
||||
"minecraft-data": "^3.84.0",
|
||||
"minecraft-protocol": "^1.51.0",
|
||||
"prismarine-chat": "^1.10.1",
|
||||
"prismarine-chat": "^1.11.0",
|
||||
"prismarine-nbt": "^2.7.0",
|
||||
"prismarine-registry": "^1.10.0",
|
||||
"prismarine-registry": "^1.11.0",
|
||||
"terminal-kit": "^3.1.1",
|
||||
"undici": "^7.2.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
XAUTHORITY=/var/lib/lightdm/.Xauthority DISPLAY=:0 xrandr --output VGA-1 --mode 1368x768
|
||||
+5
-3
@@ -11,6 +11,7 @@ function createBot(context) {
|
||||
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;
|
||||
@@ -34,13 +35,13 @@ function createBot(context) {
|
||||
|
||||
client.on('end', reason => {
|
||||
bot.emit('end', reason);
|
||||
if (reason === "socketClosed") return;
|
||||
if (reason === "socketClosed") return
|
||||
bot?.console?.disconnect(reason);
|
||||
})
|
||||
|
||||
client.on('error', error => {
|
||||
bot.emit('error', error);
|
||||
bot?.console?.disconnect(error.toString());
|
||||
bot?.console?.disconnect(error);
|
||||
})
|
||||
|
||||
client.on("keep_alive", ({ keepAliveId }) => {
|
||||
@@ -57,7 +58,8 @@ function createBot(context) {
|
||||
});
|
||||
|
||||
client.on('server_data', (data) => {
|
||||
bot?.console?.log(data.motd)
|
||||
bot.console.log(require('./util/nbt_parser')(null, data.motd))
|
||||
// bot?.console?.log(data.motd)
|
||||
});
|
||||
|
||||
process.on("uncaughtException", (e) => {
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
//const CommandError = require('../util/command_error');
|
||||
|
||||
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')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,6 @@ module.exports = {
|
||||
execute (context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
bot.chat(args.join(' '));
|
||||
bot._client.chat(args.join(' '));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ module.exports = {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
try {
|
||||
bot.console.command({ text: util.inspect(eval(args.join(' ')), { stylize })});
|
||||
bot.console.command(util.inspect(eval(args.join(' ')), { stylize }));
|
||||
} catch (e) {
|
||||
bot.console.command(e.toString());
|
||||
}
|
||||
|
||||
@@ -22,6 +22,9 @@ module.exports = {
|
||||
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");
|
||||
}
|
||||
|
||||
@@ -20,11 +20,14 @@ module.exports = {
|
||||
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) + time + config.bots.chomens.key
|
||||
const value = bot.uuid + args[1] + time + config.bots.chomens.key
|
||||
|
||||
hash = crypto.createHash('sha256').update(value).digest('hex').substring(0, 16)
|
||||
if (bot.customChat.enabled) {
|
||||
@@ -34,11 +37,11 @@ module.exports = {
|
||||
}
|
||||
break;
|
||||
case "fnfboyfriendbot":
|
||||
hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 1000) + config.bots.fnfboyfriendbot.key).digest("hex").substring(0, 16);
|
||||
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()} ${hash} ${args.slice(2).join(' ')}`)
|
||||
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()} ${hash} ${args.slice(2).join(' ')}`);
|
||||
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":
|
||||
|
||||
+723
-263
File diff suppressed because it is too large
Load Diff
+97
-90
@@ -1,3 +1,4 @@
|
||||
const convertNbtComponentToJson = require('../util/nbt_parser')
|
||||
|
||||
module.exports = {
|
||||
data: {
|
||||
@@ -11,58 +12,9 @@ module.exports = {
|
||||
const config = context.config;
|
||||
|
||||
bot.on('packet.player_chat', (data) => {
|
||||
const unsigned = data.unsignedChatContent;
|
||||
const unsigned = convertNbtComponentToJson(null, data.unsignedChatContent)
|
||||
try {
|
||||
switch (data.type) {
|
||||
case 1:
|
||||
|
||||
break;
|
||||
case 3:
|
||||
bot.emit('playerChat', [
|
||||
{
|
||||
translate: "[%s %s %s%s %s] ",
|
||||
color: "dark_gray",
|
||||
with: [
|
||||
{ text: 'Player Chat', color: 'dark_purple' },
|
||||
{ text: '|' },
|
||||
{ text: 'Packet Type', color: "aqua" },
|
||||
{ text: ':' },
|
||||
{ text: data.type, color: 'gold' },
|
||||
],
|
||||
},
|
||||
{ translate: "commands.message.display.outgoing",
|
||||
with: [
|
||||
JSON.parse(data.networkName).insertion,
|
||||
data.plainMessage
|
||||
],
|
||||
color: "gray",
|
||||
italic: true
|
||||
}
|
||||
])
|
||||
break
|
||||
case 2:
|
||||
bot.emit('playerChat', [
|
||||
{
|
||||
translate: "[%s %s %s%s %s] ",
|
||||
color: "dark_gray",
|
||||
with: [
|
||||
{ text: 'Player Chat', color: 'dark_purple' },
|
||||
{ text: '|' },
|
||||
{ text: 'Packet Type', color: "aqua" },
|
||||
{ text: ':' },
|
||||
{ text: data.type, color: 'gold' },
|
||||
],
|
||||
},
|
||||
{ translate: "commands.message.display.incoming",
|
||||
with: [
|
||||
JSON.parse(data.networkName).insertion,
|
||||
data.plainMessage
|
||||
],
|
||||
color: "gray",
|
||||
italic: true
|
||||
}
|
||||
])
|
||||
break
|
||||
switch (data.type.registryIndex) {
|
||||
case 4:
|
||||
bot.emit('playerChat', [
|
||||
{
|
||||
@@ -73,12 +25,42 @@ module.exports = {
|
||||
{ text: '|' },
|
||||
{ text: 'Packet Type', color: "aqua" },
|
||||
{ text: ':' },
|
||||
{ text: data.type, color: 'gold' },
|
||||
{ text: data.type.registryIndex, color: 'gold' },
|
||||
],
|
||||
},
|
||||
JSON.parse(unsigned)
|
||||
{ translate: "commands.message.display.outgoing",
|
||||
with: [
|
||||
data.networkName.insertion,
|
||||
data.plainMessage
|
||||
],
|
||||
color: "gray",
|
||||
italic: true
|
||||
}
|
||||
])
|
||||
break;
|
||||
break
|
||||
case 3:
|
||||
bot.emit('playerChat', [
|
||||
{
|
||||
translate: "[%s %s %s%s %s] ",
|
||||
color: "dark_gray",
|
||||
with: [
|
||||
{ text: 'Player Chat', color: 'dark_purple' },
|
||||
{ text: '|' },
|
||||
{ text: 'Packet Type', color: "aqua" },
|
||||
{ text: ':' },
|
||||
{ text: data.type.registryIndex, color: 'gold' },
|
||||
],
|
||||
},
|
||||
{ translate: "commands.message.display.incoming",
|
||||
with: [
|
||||
data.networkName.insertion,
|
||||
data.plainMessage
|
||||
],
|
||||
color: "gray",
|
||||
italic: true
|
||||
}
|
||||
])
|
||||
break
|
||||
case 5:
|
||||
bot.emit('playerChat', [
|
||||
{
|
||||
@@ -89,12 +71,28 @@ module.exports = {
|
||||
{ text: '|' },
|
||||
{ text: 'Packet Type', color: "aqua" },
|
||||
{ text: ':' },
|
||||
{ text: data.type, color: 'gold' },
|
||||
{ text: data.type.registryIndex, color: 'gold' },
|
||||
],
|
||||
},
|
||||
unsigned
|
||||
])
|
||||
break;
|
||||
case 6:
|
||||
bot.emit('playerChat', [
|
||||
{
|
||||
translate: "[%s %s %s%s %s] ",
|
||||
color: "dark_gray",
|
||||
with: [
|
||||
{ text: 'Player Chat', color: 'dark_purple' },
|
||||
{ text: '|' },
|
||||
{ text: 'Packet Type', color: "aqua" },
|
||||
{ text: ':' },
|
||||
{ text: data.type.registryIndex, color: 'gold' },
|
||||
],
|
||||
},
|
||||
{ translate: "chat.type.announcement",
|
||||
with: [
|
||||
JSON.parse(data.networkName).insertion,
|
||||
data.networkName.insertion,
|
||||
data.plainMessage
|
||||
]
|
||||
}
|
||||
@@ -109,10 +107,11 @@ module.exports = {
|
||||
})
|
||||
|
||||
bot.on('packet.profileless_chat', (packet) => {
|
||||
const message = JSON.parse(packet.message)
|
||||
const sender = JSON.parse(packet.name)
|
||||
switch (packet.type) {
|
||||
case 1:
|
||||
const message = convertNbtComponentToJson(null, packet.message)
|
||||
const sender = convertNbtComponentToJson(null, packet.name)
|
||||
try {
|
||||
switch (packet.type.registryIndex) {
|
||||
case 2:
|
||||
bot?.emit('profilelessChat', [
|
||||
{
|
||||
translate: "[%s %s %s%s %s] ",
|
||||
@@ -122,7 +121,7 @@ module.exports = {
|
||||
{ text: '|' },
|
||||
{ text: 'Packet Type', color: "aqua" },
|
||||
{ text: ':' },
|
||||
{ text: packet.type, color: 'gold' },
|
||||
{ text: packet.type.registryIndex, color: 'gold' },
|
||||
],
|
||||
},
|
||||
{ translate: "chat.type.emote",
|
||||
@@ -133,29 +132,6 @@ module.exports = {
|
||||
}
|
||||
])
|
||||
break
|
||||
case 2:
|
||||
bot.emit('profilelessChat', [
|
||||
{
|
||||
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, color: 'gold' },
|
||||
],
|
||||
},
|
||||
{ translate: "commands.message.display.incoming",
|
||||
with: [
|
||||
sender,
|
||||
message
|
||||
],
|
||||
color: "gray",
|
||||
italic: true
|
||||
}
|
||||
])
|
||||
break
|
||||
case 3:
|
||||
bot.emit('profilelessChat', [
|
||||
{
|
||||
@@ -166,10 +142,10 @@ module.exports = {
|
||||
{ text: '|' },
|
||||
{ text: 'Packet Type', color: "aqua" },
|
||||
{ text: ':' },
|
||||
{ text: packet.type, color: 'gold' },
|
||||
{ text: packet.type.registryIndex, color: 'gold' },
|
||||
],
|
||||
},
|
||||
{ translate: "commands.message.display.outgoing",
|
||||
{ translate: "commands.message.display.incoming",
|
||||
with: [
|
||||
sender,
|
||||
message
|
||||
@@ -189,10 +165,17 @@ module.exports = {
|
||||
{ text: '|' },
|
||||
{ text: 'Packet Type', color: "aqua" },
|
||||
{ text: ':' },
|
||||
{ text: packet.type, color: 'gold' },
|
||||
{ text: packet.type.registryIndex, color: 'gold' },
|
||||
],
|
||||
},
|
||||
message
|
||||
{ translate: "commands.message.display.outgoing",
|
||||
with: [
|
||||
sender,
|
||||
message
|
||||
],
|
||||
color: "gray",
|
||||
italic: true
|
||||
}
|
||||
])
|
||||
break
|
||||
case 5:
|
||||
@@ -205,7 +188,23 @@ module.exports = {
|
||||
{ text: '|' },
|
||||
{ text: 'Packet Type', color: "aqua" },
|
||||
{ text: ':' },
|
||||
{ text: packet.type, color: 'gold' },
|
||||
{ text: packet.type.registryIndex, color: 'gold' },
|
||||
],
|
||||
},
|
||||
message
|
||||
])
|
||||
break
|
||||
case 6:
|
||||
bot.emit('profilelessChat', [
|
||||
{
|
||||
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.registryIndex, color: 'gold' },
|
||||
],
|
||||
},
|
||||
{ translate: 'chat.type.announcement',
|
||||
@@ -217,10 +216,15 @@ module.exports = {
|
||||
])
|
||||
break
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e.stack)
|
||||
}
|
||||
});
|
||||
|
||||
bot.on('packet.system_chat', packet => {
|
||||
const message = JSON.parse(packet.content)
|
||||
try {
|
||||
// console.log(packet)
|
||||
const message = convertNbtComponentToJson(null, packet.content)
|
||||
|
||||
if (message.translate === 'advMode.setCommand.success') return // Ignores command set message
|
||||
|
||||
@@ -244,6 +248,9 @@ module.exports = {
|
||||
]);
|
||||
|
||||
bot.emit('system_chat_selfcare', message); // this is for selfcare
|
||||
} catch (e) {
|
||||
console.log(e.stack)
|
||||
}
|
||||
});
|
||||
|
||||
bot.chat = (args) => {
|
||||
|
||||
@@ -30,7 +30,7 @@ module.exports = {
|
||||
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)}'} destroy`
|
||||
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}`)
|
||||
},
|
||||
|
||||
@@ -139,7 +139,7 @@ module.exports = {
|
||||
const location = bot.core.currentBlock();
|
||||
const itemPosition = bot.core.itemPosition;
|
||||
|
||||
if (!location) return;
|
||||
if (!location || bot.server.mode === "savageFriends") return;
|
||||
if (bot.core.usePlacedCommandBlock) {
|
||||
bot._client.write('update_command_block', {
|
||||
command: command.substring(0, 32767),
|
||||
@@ -163,6 +163,7 @@ module.exports = {
|
||||
}
|
||||
|
||||
bot.on('move', () => {
|
||||
if (bot.server.mode === "savageFriends") return;
|
||||
bot.core.move(bot.position)
|
||||
})
|
||||
|
||||
|
||||
@@ -11,7 +11,11 @@ module.exports = {
|
||||
list: [],
|
||||
add (command, interval) {
|
||||
let timer;
|
||||
timer = ({ timer: setInterval(() => bot.core.run(command), interval), command, interval })
|
||||
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', () => {
|
||||
|
||||
+13
-9
@@ -7,10 +7,10 @@ const rl = readline.createInterface({
|
||||
|
||||
module.exports = {
|
||||
data: {
|
||||
description: "logs chat to console",
|
||||
description: "console functions",
|
||||
enabled: true,
|
||||
name: "console",
|
||||
type: "logging"
|
||||
type: "console"
|
||||
},
|
||||
inject (context) {
|
||||
const bot = context.bot;
|
||||
@@ -39,23 +39,27 @@ module.exports = {
|
||||
|
||||
bot.console = {
|
||||
log (message) {
|
||||
refreshLine(`${fromNotch("§8[§6logs§8]§r")?.toAnsi()} ${fromNotch(message)?.toAnsi(bot.registry?.language)}`)
|
||||
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(bot.registry?.language)}`)
|
||||
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(bot.registry?.language)}`)
|
||||
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(bot.registry?.language)}`)
|
||||
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(bot.registry?.language)}`)
|
||||
refreshLine(`${fromNotch("§8[§4error§8]§r")?.toAnsi()} ${fromNotch(error)?.toAnsi(require('../data/language.json'))}`)
|
||||
}
|
||||
}
|
||||
|
||||
bot.on('playerChat', (message) => {
|
||||
/* bot.on('playerChat', (message) => {
|
||||
bot.console.log(message);
|
||||
});
|
||||
|
||||
@@ -65,6 +69,6 @@ module.exports = {
|
||||
|
||||
bot.on('systemChat', (message) => {
|
||||
bot.console.log(message);
|
||||
});
|
||||
});*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
module.exports = {
|
||||
data: {
|
||||
descripton: "logs chat to console",
|
||||
enabled: true,
|
||||
name: "log",
|
||||
type: "console"
|
||||
},
|
||||
inject (context) {
|
||||
const bot = context.bot;
|
||||
bot.on('playerChat', (message) => {
|
||||
bot.console.log(message);
|
||||
//console.log(message);
|
||||
});
|
||||
|
||||
bot.on('profilelessChat', (message) => {
|
||||
bot.console.log(message);
|
||||
// console.log(message);
|
||||
});
|
||||
|
||||
bot.on('systemChat', (message) => {
|
||||
bot.console.log(message);
|
||||
// console.log(JSON.stringify(message));
|
||||
});
|
||||
|
||||
bot.on('actionBar', (message) => {
|
||||
// console.log(message);
|
||||
});
|
||||
|
||||
/* bot.on('titleBar', (message) => {
|
||||
console.log(message);
|
||||
});*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,9 +11,9 @@ module.exports = {
|
||||
|
||||
bot.on('packet.position', packet => {
|
||||
bot.position = {
|
||||
x: packet.flags & 1 ? (this.x + packet.x) : packet.x,
|
||||
y: packet.flags & 2 ? (this.y + packet.y) : packet.y,
|
||||
z: packet.flags & 4 ? (this.z + packet.z) : packet.z
|
||||
x: packet.x,
|
||||
y: packet.y,
|
||||
z: packet.z
|
||||
};
|
||||
|
||||
bot._client.write('teleport_confirm', { teleportId: packet.teleportId })
|
||||
|
||||
@@ -11,7 +11,7 @@ module.exports = {
|
||||
const bot = context.bot;
|
||||
bot.on('packet.login', packet => {
|
||||
bot.registry = registry(bot._client.version)
|
||||
bot.registry.language = require('../data/language.json');
|
||||
// bot.registry.language = require('../data/language.json');
|
||||
bot.emit('registry_ready', bot.registry)
|
||||
});
|
||||
}
|
||||
|
||||
+32
-5
@@ -24,6 +24,7 @@ module.exports = {
|
||||
|
||||
|
||||
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;
|
||||
@@ -50,6 +51,9 @@ module.exports = {
|
||||
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) => {
|
||||
@@ -68,8 +72,8 @@ module.exports = {
|
||||
clientLock = data.gameMode;
|
||||
})
|
||||
|
||||
bot.on("packet.position", (packet, position) => {
|
||||
if (!config.selfcare.icu) return;
|
||||
/* bot.on("packet.position", (packet, position) => {
|
||||
if (!config.selfcare.icu || bot.server.mode === "savageFriends") return;
|
||||
positionCount++
|
||||
setTimeout(() => {
|
||||
positionCount--
|
||||
@@ -79,13 +83,35 @@ module.exports = {
|
||||
bot._client.end('anti icu :3');
|
||||
}
|
||||
}, 1000)
|
||||
})
|
||||
})*/
|
||||
|
||||
let timer;
|
||||
bot.on('packet.login', (data) => {
|
||||
entityId = data.entityId;
|
||||
gameMode = data.gameMode;
|
||||
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');
|
||||
@@ -98,7 +124,8 @@ module.exports = {
|
||||
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);
|
||||
}
|
||||
}, 300);
|
||||
});
|
||||
|
||||
bot.on('end', () => {
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
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
|
||||
@@ -0,0 +1,44 @@
|
||||
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
|
||||
@@ -0,0 +1,6 @@
|
||||
async function delay(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
module.exports = delay;
|
||||
// ported from FNFBoyfriendBot v3
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
while true; do
|
||||
XAUTHORITY=/var/lib/lightdm/.Xauthority DISPLAY=:0 x0vncserver -rfbauth $HOME/.config/tigervnc/passwd
|
||||
sleep 1
|
||||
done
|
||||
@@ -0,0 +1,4 @@
|
||||
while true; do
|
||||
websockify 0.0.0.0:6080 127.0.0.1:5900
|
||||
sleep 1
|
||||
done
|
||||
@@ -0,0 +1,6 @@
|
||||
--2025-06-02 23:31:30-- https://cdn.discordapp.com/attachments/1378936268355928076/1379274815956975726/image.png?ex=683fa545
|
||||
Resolving cdn.discordapp.com (cdn.discordapp.com)... 162.159.129.233, 162.159.130.233, 162.159.135.233, ...
|
||||
Connecting to cdn.discordapp.com (cdn.discordapp.com)|162.159.129.233|:443... connected.
|
||||
HTTP request sent, awaiting response... 404 Not Found
|
||||
2025-06-02 23:31:31 ERROR 404: Not Found.
|
||||
|
||||
Reference in New Issue
Block a user