mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-29 12:27:07 +02:00
Add buy all option to buy terminal command
This commit is contained in:
@@ -96,13 +96,15 @@ export const HelpTexts: IMap<string[]> = {
|
||||
" ",
|
||||
],
|
||||
buy: [
|
||||
"buy [-l / program]",
|
||||
"buy [-l / -a / program]",
|
||||
" ",
|
||||
"Purchase a program through the Dark Web. Requires a TOR router to use.",
|
||||
" ",
|
||||
"If this command is ran with the '-l' flag, it will display a list of all programs that can be bought through the ",
|
||||
"dark web to the Terminal, as well as their costs.",
|
||||
" ",
|
||||
"If this command is ran with the '-a' flag, it will attempt to purchase all unowned programs.",
|
||||
" ",
|
||||
"Otherwise, the name of the program must be passed in as a parameter. This name is NOT case-sensitive.",
|
||||
],
|
||||
cat: [
|
||||
|
||||
@@ -2,7 +2,7 @@ import { ITerminal } from "../ITerminal";
|
||||
import { IRouter } from "../../ui/Router";
|
||||
import { IPlayer } from "../../PersonObjects/IPlayer";
|
||||
import { BaseServer } from "../../Server/BaseServer";
|
||||
import { listAllDarkwebItems, buyDarkwebItem } from "../../DarkWeb/DarkWeb";
|
||||
import { listAllDarkwebItems, buyAllDarkwebItems, buyDarkwebItem } from "../../DarkWeb/DarkWeb";
|
||||
import { SpecialServers } from "../../Server/data/SpecialServers";
|
||||
import { GetServer } from "../../Server/AllServers";
|
||||
|
||||
@@ -22,12 +22,15 @@ export function buy(
|
||||
if (args.length != 1) {
|
||||
terminal.print("Incorrect number of arguments. Usage: ");
|
||||
terminal.print("buy -l");
|
||||
terminal.print("buy -a");
|
||||
terminal.print("buy [item name]");
|
||||
return;
|
||||
}
|
||||
const arg = args[0] + "";
|
||||
if (arg == "-l" || arg == "-1" || arg == "--list") {
|
||||
listAllDarkwebItems();
|
||||
} else if (arg == "-a" || arg == "--all") {
|
||||
buyAllDarkwebItems();
|
||||
} else {
|
||||
buyDarkwebItem(arg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user