Skip to content

Customizing

samo_lego edited this page Nov 11, 2020 · 2 revisions

I wanna do it my way

No worries, we've got you covered.

Change username and hostname

myConsole.username = "newUsername";
myConsole.hostname= "newHostname";

// Refreshing typer
myConsole.consoleTyper.innerText = myConsole.getUsername(myConsole);

Deleting all available commands

myConsole.AVAILABLE_COMMANDS_MAP.clear();

Overriding default command

myConsole.AVAILABLE_COMMANDS_MAP.set("help", "this.myHelpCommand");

Overriding myConsole functions (local methods)

myConsole.help = (self, args) => {
      console.log(args);
      self.writeLine("New help command!", "yellow");
}

Overriding default functions (global functions)

async function clear() {
      console.log(args);
      self.writeLine("New clear command!", "yellow");
}