node-hill-s
    Preparing search index...

    Interface VM_GLOBALS

    Contains all the global variables that are copied into the VM.

    interface VM_GLOBALS {
        AssetDownloader: typeof AssetDownloader;
        Bot: typeof Bot;
        Brick: typeof Brick;
        debounce: (callback: (...args: string[]) => void, delay: number) => void;
        debouncePlayer: (
            callback: (player: Player, ...args: string[]) => void,
            delay: number,
        ) => void;
        Game: typeof Game;
        getModule: (module: string) => NodeModule;
        Outfit: typeof Outfit;
        PacketBuilder: typeof PacketBuilder;
        Sanction: typeof Sanction;
        sleep: Promise<void>;
        SmartBuffer: typeof SmartBuffer;
        SoundEmitter: typeof SoundEmitter;
        Team: typeof Team;
        Tool: typeof Tool;
        util: Utilities;
        Vector3: typeof Vector3;
        world: World;
    }
    Index

    Properties

    AssetDownloader: typeof AssetDownloader
    Bot: typeof Bot
    Brick: typeof Brick
    debounce: (callback: (...args: string[]) => void, delay: number) => void

    Used for locking functions until a specified time has passed.

    Game.on("playerJoin", (player) => {
    player.on("mouseclick", debounce(() => {
    console.log("You clicked! But now you can't for 5 seconds.")
    }, 5000))
    })
    debouncePlayer: (
        callback: (player: Player, ...args: string[]) => void,
        delay: number,
    ) => void

    Used for locking functions for a player until a specified time has passed.

    let brick = world.bricks.find(b => b.name === "teleporter")

    brick.touching(debouncePlayer(p => {
    p.setPosition(brick.position)
    }, 5000))
    Game: typeof Game
    getModule: (module: string) => NodeModule

    Modules in start.js are built in host (outside of the vm). It is highly recommended to use this function to require them in a VM context. If you opt to use require() instead, you may have issues.

    Example:

    // Inside of start.js: modules: ["discord.js", "fs"]

    // Now inside of a sample script:

    // You can now use discord.js
    let discord = getModule("discord.js")

    // Login to a discord account, etc.
    discord.login("myToken")
    Outfit: typeof Outfit

    Used for setting a player / bot's body colors + assets.

    PacketBuilder: typeof PacketBuilder

    Used internally by the library to create and distribute Brick Hill legacy client-compatible packets.
    This is intended for advanced users, but allows you to have complete control over the client.

    Sanction: typeof Sanction
    sleep: Promise<void>

    A promisified version of setTimeout, useful for writing timeouts syncronously.

    Game.on("playerJoin", async(player) => {
    player.message("After 5 seconds, you're gone!")
    await sleep(5000)
    player.kick("Time's up!")
    SmartBuffer: typeof SmartBuffer

    The smart-buffer package on npm.

    SoundEmitter: typeof SoundEmitter
    Team: typeof Team
    Tool: typeof Tool
    util: Utilities

    Will eventually contain handy functions. But for now only contains randomHexColor().

    Vector3: typeof Vector3

    Used for setting or reading object positions / scale / etc.

    world: World

    Shortcut to Game.world