[index] add sc.q and sc.sleep

This commit is contained in:
方而静 2023-10-31 19:19:44 +08:00
parent 21ec06ce2d
commit 4651ebc5c8
Signed by: szTom
GPG Key ID: 072D999D60C6473C

View File

@ -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) {