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

15 lines
481 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
2022-09-13 18:37:24 +02:00
export function home(args: (string | number | boolean)[]): void {
2021-09-16 01:50:44 +02:00
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
}