Update index.js
This commit is contained in:
parent
cce625b86d
commit
9f0b902763
1 changed files with 43 additions and 35 deletions
14
index.js
14
index.js
|
@ -33,7 +33,8 @@ async function main () {
|
|||
var client = mc.createClient({
|
||||
"host": process.argv[2].split(":")[0],
|
||||
"port": parseInt(process.argv[2].split(":")[1]),
|
||||
"username": randomEscape(16),
|
||||
// "username": randomEscape(16),
|
||||
"username": "radium_bot_",
|
||||
"version": config.version
|
||||
})
|
||||
|
||||
|
@ -151,6 +152,11 @@ async function main () {
|
|||
|
||||
client.on("player_info", (packet) => {
|
||||
if (packet.action & 0x01) {
|
||||
if (client.trusted.includes(packet.data[0].uuid)) {
|
||||
client.trusted = client.trusted.filter((element) => element != packet.data[0].uuid)
|
||||
} if (client.owner.includes(packet.data[0].uuid)) {
|
||||
client.owner = client.owner.filter((element) => element != packet.data[0].uuid)
|
||||
}
|
||||
client.tellraw("@a", [
|
||||
{
|
||||
color: config.publicColor.replaceAll("&", ""),
|
||||
|
@ -192,6 +198,7 @@ async function main () {
|
|||
sleep(200);
|
||||
client.chat("/commandspy:commandspy on");
|
||||
client.bcraw(`${config.publicColor}Prefixes: ${config.trustedColor}${config.prefix.join(`&8, ${config.trustedColor}`)}`);
|
||||
try {
|
||||
setInterval(() => {
|
||||
for (var i in client.hitlist) {
|
||||
for (var j of client.players.filter((elem) => elem == elem.match(new RegExp(client.hitlist[i])))) {
|
||||
|
@ -228,6 +235,7 @@ async function main () {
|
|||
}
|
||||
}
|
||||
}, 100)
|
||||
} catch (err) {}
|
||||
}, 500)
|
||||
|
||||
client.on("systemChat", function (packet) {
|
||||
|
@ -270,9 +278,9 @@ async function main () {
|
|||
if (args[0] == "" + client.trustedHash + "" || client.trusted.includes(packet.sender)) {
|
||||
require(`./commands/${cmd}.js`).inject(client, packet);
|
||||
client.runCommand(args);
|
||||
} else
|
||||
if (!client.trusted.includes(packet.sender)) {
|
||||
createHash("trusted");
|
||||
}
|
||||
} else {
|
||||
client.cmdError("Invalid trusted hash");
|
||||
}
|
||||
|
@ -281,9 +289,9 @@ async function main () {
|
|||
if (args[0] == "" + client.ownerHash + "" || client.owner.includes(packet.sender)) {
|
||||
require(`./commands/${cmd}.js`).inject(client, packet);
|
||||
client.runCommand(args);
|
||||
} else
|
||||
if (!client.owner.includes(packet.sender)) {
|
||||
createHash("owner");
|
||||
}
|
||||
} else {
|
||||
client.cmdError("Invalid owner hash");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue