bitburner-src/src/Terminal/commands/home.ts

17 lines
491 B
TypeScript
Raw Normal View History

2022-09-06 15:07:12 +02:00
import { Terminal } from "../../Terminal";
import { Player } from "../../Player";
2021-09-16 01:50:44 +02:00
export function home(
2021-12-03 20:44:32 +01:00
args: (string | number | boolean)[],
2021-09-16 01:50:44 +02:00
): void {
if (args.length !== 0) {
2022-09-06 15:07:12 +02:00
Terminal.error("Incorrect usage of home command. Usage: home");
2021-09-16 01:50:44 +02:00
return;
}
2022-09-06 15:07:12 +02:00
Player.getCurrentServer().isConnectedTo = false;
Player.currentServer = Player.getHomeComputer().hostname;
Player.getCurrentServer().isConnectedTo = true;
Terminal.print("Connected to home");
Terminal.setcwd("/");
2021-09-16 01:50:44 +02:00
}