Remove some codes

This commit is contained in:
7cc5c4f330d47060 2024-10-23 22:51:35 -04:00
parent ab593cfd7d
commit e87c85c0c1
Signed by: 7cc5c4f330d47060
SSH key fingerprint: SHA256:e+4tcZut1nBpe10PqjaO+Rvie0Q7W4qIvFzcUw+7riA
14 changed files with 21 additions and 37 deletions

View file

@ -1,4 +1,4 @@
const load = (b) => {
export function load (b) {
b._client.on('login', () => {
b.interval.chatQueue = setInterval(() => {
if (b.chatqueue.length !== 0) {
@ -16,4 +16,3 @@ const load = (b) => {
})
}
}
export { load }

View file

@ -7,7 +7,7 @@ const cs = {
z: 4
}
const load = function (b) {
export function load (b) {
b.interval.commandFill = setInterval(() => { if (b.sc_tasks.cc) b.sc_tasks.cc.failed = 1 }, 150000)
b.ccq = []
b.blocknoX = 0
@ -135,6 +135,4 @@ const load = function (b) {
b.ccq.push(`/${tellrawCommand} ${finalname} ${JSON.stringify(message)}`)
}
}
}
export { load }
}

View file

@ -1,4 +1,3 @@
const load = (b) => {
export function load (b) {
console.log(`Test plugin loaded on bot ${b.id}`)
}
export { load }
}

View file

@ -1,7 +1,7 @@
import { parse2 as parse } from '../util/chatparse_plain.js'
import { parse as parseNBT } from '../util/parseNBT.js'
const load = (b) => {
export function load (b) {
b.players = {}
b._client.on('player_info', (data) => {
const buffer2 = {}
@ -72,5 +72,4 @@ const load = (b) => {
return '[[[[ No display name ]]]]'
}
}
}
export { load }
}

View file

@ -1,5 +1,5 @@
import { createBot } from "../index.js"
const load = (b) => {
export function load (b) {
b._client.on('end', () => {
b.info(`Bot ${b.id} disconnected`)
for (const i in b.interval) {
@ -10,5 +10,4 @@ const load = (b) => {
createBot(b.host, b.id)
}, 5000)
})
}
export { load }
}

View file

@ -14,7 +14,7 @@ class SCTask {
}
const load = (b) => {
export function load (b) {
b.sc_tasks = {}
b.selfcareRun = 0
b.interval.sc = setInterval(() => {
@ -130,4 +130,3 @@ const load = (b) => {
})
}
}
export { load }

View file

@ -45,7 +45,7 @@ for (const plugin of bpl) {
}
const load = (b) => {
export function load (b) {
b.messageCount = 0
b.chatDisabledUntil = 0
b.interval.antiSpam = setInterval(() => {
@ -192,6 +192,4 @@ const load = (b) => {
b.emit('plainchat', msgPlain, data.type, data.subtype)
b.displayChat(data.type, data.subtype, `${msgConsole}\x1b[0m`)
})
}
export { load }
}

View file

@ -119,7 +119,7 @@ const parse = function (_data, l = 0, resetColor = consoleColors.reset) {
out += resetColor
return out
}
const parse2 = function (_data, l, resetColor) {
export function parse2 (_data, l, resetColor) {
try {
return parse(_data)
} catch (e) {
@ -127,4 +127,3 @@ const parse2 = function (_data, l, resetColor) {
return `\x1B[0m\x1B[38;2;255;85;85mAn error occured while parsing a message. See console for more information.\nJSON that caused the error: ${JSON.stringify(_data)}`
}
}
export { parse2 }

View file

@ -85,7 +85,7 @@ const parse = function (_data, l = 0, resetColor = consoleColors.reset) {
out += resetColor
return out
}
const parse2 = function (_data, l, resetColor) {
export function parse2 (_data, l, resetColor) {
try {
return parse(_data)
} catch (e) {
@ -93,4 +93,3 @@ const parse2 = function (_data, l, resetColor) {
return `\x1B[0m\x1B[38;2;255;85;85mAn error occured while parsing a message. See console for more information.\nJSON that caused the error: ${JSON.stringify(_data)}`
}
}
export { parse2 }

View file

@ -87,7 +87,7 @@ const parse = function (_data, l = 0, resetColor = consoleColors.reset) {
out += resetColor
return out
}
const parse2 = function (_data, l, resetColor) {
export function parse2 (_data, l, resetColor) {
try {
return parse(_data)
} catch (e) {
@ -95,4 +95,3 @@ const parse2 = function (_data, l, resetColor) {
return `\x1B[0m\x1B[38;2;255;85;85mAn error occured while parsing a message. See console for more information.\nJSON that caused the error: ${JSON.stringify(_data)}`
}
}
export { parse2 }

View file

@ -46,7 +46,7 @@ const parse = function (_data, l = 0) {
}
return out
}
const parse2 = function (_data, l) {
export function parse2 (_data, l) {
try {
return parse(_data)
} catch (e) {
@ -54,4 +54,3 @@ const parse2 = function (_data, l) {
return `An error occured while parsing a message. See console for more information. JSON that caused the error: ${JSON.stringify(_data)}`
}
}
export { parse2 }

View file

@ -1,5 +1,5 @@
import { processNbtMessage } from 'prismarine-chat'
const parse = function (data) {
export function parse (data) {
if (typeof data.type === 'string') {
return JSON.parse(processNbtMessage(data))
} else if (typeof data === 'string') {
@ -8,4 +8,3 @@ const parse = function (data) {
return data
}
}
export { parse }

View file

@ -1,5 +1,4 @@
import { randomBytes } from "crypto";
const generateUser = function (legal) {
export function generateUser (legal) {
return `${parseInt(randomBytes(4).toString("hex"),16).toString(36)}${parseInt(randomBytes(4).toString("hex"),16).toString(36)}`
}
export { generateUser }
}

View file

@ -1,6 +1,5 @@
const uuidToInt = function (uuid) {
export function uuidToInt (uuid) {
const splitUUID = uuid.replace(/[^0-9a-f]/g, '').replace(/.{1,8}/g, a => { return `0x${a}` }).match(/.{1,10}/g)
const numUUID = [+splitUUID[0] << 0, +splitUUID[1] << 0, +splitUUID[2] << 0, +splitUUID[3] << 0]
return numUUID
}
export { uuidToInt }
}