From 4651ebc5c8e79c97295edee1a16aba7f135532e5 Mon Sep 17 00:00:00 2001 From: szdytom Date: Tue, 31 Oct 2023 19:19:44 +0800 Subject: [PATCH] [index] add `sc.q` and `sc.sleep` --- index.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.mjs b/index.mjs index 53de1ed..0b83f8c 100644 --- a/index.mjs +++ b/index.mjs @@ -1,7 +1,7 @@ import * as authlib from './auth/authlib.mjs'; import mineflayer from 'mineflayer'; import yargs from 'yargs'; -import { parseLogin, waitEvent } from 'compass-utils'; +import { asyncSleep, parseLogin, waitEvent } from 'compass-utils'; import repl from 'node:repl'; import debug from 'debug'; @@ -76,6 +76,8 @@ async function main() { context.sc.pos = () => bot.entity.position; context.sc.debug_enable = (module) => debug.enable(module); context.sc.debug_disable = (module) => debug.disable(module); + context.sc.q = () => bot.quit(); + context.sc.sleep = asyncSleep; } if (!args.noRepl) {