mirror of
https://code.chipmunk.land/Parker2991/NitoriBot/
synced 2026-12-03 23:55:39 -05:00
21 lines
431 B
TypeScript
21 lines
431 B
TypeScript
export default class Position {
|
|
constructor (context: any) {
|
|
const bot = context.bot;
|
|
|
|
bot.position = null;
|
|
|
|
bot.on('packet.position', (packet: any) => {
|
|
bot.position = {
|
|
x: packet.x,
|
|
y: packet.y,
|
|
z: packet.z
|
|
}
|
|
bot._client.write("teleport_confirm", { teleportId: packet.teleportId });
|
|
|
|
bot.emit("move");
|
|
});
|
|
|
|
bot.on('end', () => bot.position = null);
|
|
}
|
|
}
|