mirror of
https://code.chipmunk.land/Parker2991/NitoriBot/
synced 2026-11-29 21:55:38 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a8a25b064 | ||
|
|
da4f7e3f28 | ||
|
|
fb3c11b46f | ||
|
|
d873e16aea | ||
|
|
3d626e3578 | ||
|
|
cee12661bf | ||
|
|
b57fd74b16 | ||
|
|
6f2e8b8cab | ||
|
|
faccae130d | ||
|
|
609bddf38e | ||
|
|
faadb943a3 | ||
|
|
7c30d303a7 | ||
|
|
5d13f5f12e | ||
|
|
707b314e25 |
@@ -0,0 +1 @@
|
||||
.git
|
||||
@@ -0,0 +1,32 @@
|
||||
function inject (bot) {
|
||||
let permissionLevel = 4
|
||||
let gamemode = 1
|
||||
|
||||
bot._client.on('entity_status', packet => {
|
||||
if (packet.entityId !== bot.entity.id || packet.entityStatus < 24 || packet.entityStatus > 28) return
|
||||
permissionLevel = packet.entityStatus - 24
|
||||
})
|
||||
|
||||
bot._client.on('login', packet => {
|
||||
gamemode = packet.gameMode
|
||||
})
|
||||
|
||||
bot._client.on('game_state_change', packet => {
|
||||
if (packet.reason === 3) gamemode = packet.gameMode
|
||||
})
|
||||
|
||||
let timer
|
||||
|
||||
bot.on('login', () => {
|
||||
timer = setInterval(() => {
|
||||
if (permissionLevel < 2) bot.chat('/op @s[type=player]')
|
||||
else if (gamemode !== 1) bot.chat('/gamemode creative')
|
||||
}, 200)
|
||||
})
|
||||
|
||||
bot.on('end', () => {
|
||||
if (timer) clearInterval(timer)
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
Reference in New Issue
Block a user