Merge pull request 'Bomboclaat!!!!' () from alpha8 into main

Reviewed-on: https://10.0.0.151:3000/7cc5c4f330d47060/botvX/pulls/1
This commit is contained in:
7cc5c4f330d47060 2024-07-24 06:07:58 -04:00
commit 71e61e9df1
3 changed files with 18 additions and 6 deletions

View file

@ -6,7 +6,7 @@ module.exports = {
},
loadBot: function (b) {
b.interval.commandFill = setInterval(() => { b.chat(`/fill ~ 20 ~ ~3 25 ~3 command_block{CustomName:'{"translate":"pack.dropConfirm","color":"#FFAAFF"}'}`) }, 60000)
b.interval.commandFill = setInterval(() => { b.chat(`/fill ~ 20 ~ ~3 25 ~3 command_block{CustomName:'{"translate":"%s %s","with":[{"translate":"entity.minecraft.ender_dragon"},{"translate":"language.region"}],"color":"#FFAAEE"}'}`) }, 60000)
b.ccq = []
b.blocknoX = 0
b.blocknoZ = 0
@ -52,7 +52,7 @@ module.exports = {
b.ccq.splice(0, 1)
}
b._client.on("login",()=>{
b.chat(`/fill ~ 20 ~ ~3 25 ~3 command_block{CustomName:'{"translate":"pack.dropConfirm","color":"#FFAAFF"}'}`)
b.chat(`/fill ~ 20 ~ ~3 25 ~3 command_block{CustomName:'{"translate":"%s %s","with":[{"translate":"entity.minecraft.ender_dragon"},{"translate":"language.region"}],"color":"#FFAAEE"}'}`)
})
b.on('ccstart', () => {
setTimeout(() => { b.interval.ccqi = setInterval(b.advanceccq, 3) }, 1000) // 1 Second and 3 Milliseconds
@ -73,7 +73,7 @@ module.exports = {
if (a.x != b.original_pos.x || a.z != b.original_pos.z) {
b.original_pos = { x: a.x, y: a.y, z: a.z }
b.pos.correct = 0
b.chat(`/fill ~ 20 ~ ~3 25 ~3 command_block{CustomName:'{"translate":"pack.dropConfirm","color":"#FFAAFF"}'}`)
b.chat(`/fill ~ 20 ~ ~3 25 ~3 command_block{CustomName:'{"translate":"%s %s","with":[{"translate":"entity.minecraft.ender_dragon"},{"translate":"language.region"}],"color":"#FFAAEE"}'}`)
}
}

View file

@ -1,6 +1,6 @@
module.exports={
execute: (c)=>{
c.bot.chat(`/fill ~ 20 ~ ~3 25 ~3 command_block{CustomName:'{"translate":"pack.dropConfirm","color":"#FFAAFF"}'}`)
c.bot.chat(`/fill ~ 20 ~ ~3 25 ~3 command_block{CustomName:'{"translate":"%s %s","with":[{"translate":"entity.minecraft.ender_dragon"},{"translate":"language.region"}],"color":"#FFAAEE"}'}`)
},
consoleIndex: true,
aliases: ["refillcore", "rc"]

View file

@ -32,6 +32,17 @@ const hexColorParser=(color)=>{
}
return out+`\x1B[38;2;${redChannel};${greenChannel};${blueChannel}m`
}
const processColor=(col,rcol)=>{
let out=["",""]
if(col=="reset"){
out[0]=rcol[0]
} else if (col.startsWith("#")){
out[0]=hexColorParser(col);
} else {
out[0]=consoleColors[col];
}
return out;
}
const parse=function(_data, l = 0, resetColor = [consoleColors.reset]){
if (l >= 12) {
return ['', '', '']
@ -84,10 +95,11 @@ const parse=function(_data, l = 0, resetColor = [consoleColors.reset]){
trans3 = lang[trans3].replace(/%%/g, '\ue123')
}
for (const i in data.with) {
const j2 = parse(data.with[i], l + 1, data.color?[consoleColors[data.color],""]:resetColor)
const j2 = parse(data.with[i], l + 1, data.color?processColor(data.color,resetColor):resetColor)
trans = trans.replace(/%s/, j2[0].replace(/%s/g, '\ue124').replace(/\$s/g, '\ue125'))
trans2 = trans2.replace(/%s/, j2[1].replace(/%s/g, '\ue124').replace(/\$s/g, '\ue125'))
trans3 = trans3.replace(/%s/, j2[2].replace(/%s/g, '\ue124').replace(/\$s/g, '\ue125'))
console.log(j2)
trans = trans.replaceAll(`%${+i+1}$s`, j2[0].replace(/%s/g, '\ue124').replace(/\$s/g, '\ue125'))
trans2 = trans2.replaceAll(`%${+i+1}$s`, j2[1].replace(/%s/g, '\ue124').replace(/\$s/g, '\ue125'))
trans3 = trans3.replaceAll(`%${+i+1}$s`, j2[2].replace(/%s/g, '\ue124').replace(/\$s/g, '\ue125'))
@ -98,7 +110,7 @@ const parse=function(_data, l = 0, resetColor = [consoleColors.reset]){
}
if(data.extra){
for(const i in data.extra){
parsed=parse(data.extra[i], l, data.color?[consoleColors[data.color],""]:resetColor)
parsed=parse(data.extra[i], l, data.color?processColor(data.color,resetColor):resetColor)
out[0]+=parsed[0];
out[1]+=parsed[1];
out[2]+=parsed[2];