|
-[getHackingLevelRequirementOfProgram(program)](./bitburner.singularity.gethackinglevelrequirementofprogram.md)
+[getHackingLevelRequirementOfProgram(programName)](./bitburner.singularity.gethackinglevelrequirementofprogram.md)
|
diff --git a/markdown/bitburner.singularity.purchaseprogram.md b/markdown/bitburner.singularity.purchaseprogram.md
index 8c843657b..278410d7d 100644
--- a/markdown/bitburner.singularity.purchaseprogram.md
+++ b/markdown/bitburner.singularity.purchaseprogram.md
@@ -9,7 +9,7 @@ Purchase a program from the dark web.
**Signature:**
```typescript
-purchaseProgram(programName: string): boolean;
+purchaseProgram(programName: ProgramName): boolean;
```
## Parameters
@@ -37,7 +37,7 @@ programName
|
-string
+[ProgramName](./bitburner.programname.md)
|
@@ -64,7 +64,7 @@ This function allows you to automatically purchase programs. You MUST have a TOR
```js
-const programName = "BruteSSH.exe";
+const programName = ns.enums.ProgramName.bruteSsh;
const success = ns.singularity.purchaseProgram(programName);
if (!success) ns.tprint(`ERROR: Failed to purchase ${programName}`);
```
diff --git a/src/Documentation/pages.ts b/src/Documentation/pages.ts
index 885b576a8..1772241a0 100644
--- a/src/Documentation/pages.ts
+++ b/src/Documentation/pages.ts
@@ -1195,6 +1195,8 @@ import nsDoc_bitburner_product_rating_md from "../../markdown/bitburner.product.
import nsDoc_bitburner_product_size_md from "../../markdown/bitburner.product.size.md?raw";
import nsDoc_bitburner_product_stats_md from "../../markdown/bitburner.product.stats.md?raw";
import nsDoc_bitburner_product_stored_md from "../../markdown/bitburner.product.stored.md?raw";
+import nsDoc_bitburner_programname_md from "../../markdown/bitburner.programname.md?raw";
+import nsDoc_bitburner_programnameenumtype_md from "../../markdown/bitburner.programnameenumtype.md?raw";
import nsDoc_bitburner_reactelement_key_md from "../../markdown/bitburner.reactelement.key.md?raw";
import nsDoc_bitburner_reactelement_md from "../../markdown/bitburner.reactelement.md?raw";
import nsDoc_bitburner_reactelement_props_md from "../../markdown/bitburner.reactelement.props.md?raw";
@@ -2784,6 +2786,8 @@ AllPages["nsDoc/bitburner.product.rating.md"] = nsDoc_bitburner_product_rating_m
AllPages["nsDoc/bitburner.product.size.md"] = nsDoc_bitburner_product_size_md;
AllPages["nsDoc/bitburner.product.stats.md"] = nsDoc_bitburner_product_stats_md;
AllPages["nsDoc/bitburner.product.stored.md"] = nsDoc_bitburner_product_stored_md;
+AllPages["nsDoc/bitburner.programname.md"] = nsDoc_bitburner_programname_md;
+AllPages["nsDoc/bitburner.programnameenumtype.md"] = nsDoc_bitburner_programnameenumtype_md;
AllPages["nsDoc/bitburner.reactelement.key.md"] = nsDoc_bitburner_reactelement_key_md;
AllPages["nsDoc/bitburner.reactelement.md"] = nsDoc_bitburner_reactelement_md;
AllPages["nsDoc/bitburner.reactelement.props.md"] = nsDoc_bitburner_reactelement_props_md;
diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts
index 964d1c055..285c07bec 100644
--- a/src/NetscriptFunctions.ts
+++ b/src/NetscriptFunctions.ts
@@ -137,6 +137,7 @@ export const enums: NSEnums = {
SpecialBladeburnerActionTypeForSleeve,
FragmentType: FragmentTypeEnum,
DarknetResponseCode: ResponseCodeEnum,
+ ProgramName: CompletedProgramName,
};
for (const val of Object.values(enums)) Object.freeze(val);
Object.freeze(enums);
diff --git a/src/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts
index 92456d650..6d0064512 100644
--- a/src/ScriptEditor/NetscriptDefinitions.d.ts
+++ b/src/ScriptEditor/NetscriptDefinitions.d.ts
@@ -1769,7 +1769,7 @@ export interface CompanyWorkTask extends BaseTask {
*/
export interface CreateProgramWorkTask extends BaseTask {
type: "CREATE_PROGRAM";
- programName: string;
+ programName: ProgramName;
}
/**
@@ -1988,14 +1988,14 @@ export interface Singularity {
*
* @example
* ```js
- * const programName = "BruteSSH.exe";
+ * const programName = ns.enums.ProgramName.bruteSsh;
* const success = ns.singularity.purchaseProgram(programName);
* if (!success) ns.tprint(`ERROR: Failed to purchase ${programName}`);
* ```
* @param programName - Name of program to purchase.
* @returns True if the specified program is purchased or if you already own it, and false otherwise.
*/
- purchaseProgram(programName: string): boolean;
+ purchaseProgram(programName: ProgramName): boolean;
/**
* Check if the player is busy.
@@ -2456,11 +2456,11 @@ export interface Singularity {
* const success = ns.singularity.createProgram(programName);
* if (!success) ns.tprint(`ERROR: Failed to start working on ${programName}`);
* ```
- * @param program - Name of program to create.
+ * @param programName - Name of program to create.
* @param focus - Acquire player focus on this program creation. Optional. Defaults to true.
* @returns True if you successfully start working on the specified program, and false otherwise.
*/
- createProgram(program: string, focus?: boolean): boolean;
+ createProgram(programName: ProgramName, focus?: boolean): boolean;
/**
* Get the hacking level requirement of a program.
@@ -2470,10 +2470,10 @@ export interface Singularity {
* In order to create a program via UI or {@link Singularity.createProgram | createProgram}, your hacking level must
* meet the requirement of that program. This API returns that value.
*
- * @param program - Name of program to create.
+ * @param programName - Name of program to create.
* @returns Hacking level requirement. Return Infinity if the specified program cannot be created.
*/
- getHackingLevelRequirementOfProgram(program: string): number;
+ getHackingLevelRequirementOfProgram(programName: ProgramName): number;
/**
* Commit a crime.
@@ -2823,7 +2823,7 @@ export interface Singularity {
* (if not yet purchased), 0 if it has already been purchased, or -1 if Tor has not been
* purchased. Throws an error if the specified program/exploit does not exist
*/
- getDarkwebProgramCost(programName: string): number;
+ getDarkwebProgramCost(programName: ProgramName): number;
/**
* b1t_flum3 into a different BN.
@@ -9359,6 +9359,28 @@ type FactionNameEnumType = {
/** @public */
type FactionName = _ValueOf;
+/** @public */
+type ProgramNameEnumType = {
+ nuke: "NUKE.exe";
+ bruteSsh: "BruteSSH.exe";
+ ftpCrack: "FTPCrack.exe";
+ relaySmtp: "relaySMTP.exe";
+ httpWorm: "HTTPWorm.exe";
+ sqlInject: "SQLInject.exe";
+ deepScan1: "DeepscanV1.exe";
+ deepScan2: "DeepscanV2.exe";
+ serverProfiler: "ServerProfiler.exe";
+ autoLink: "AutoLink.exe";
+ formulas: "Formulas.exe";
+ bitFlume: "b1t_flum3.exe";
+ flight: "fl1ght.exe";
+ darkscape: "DarkscapeNavigator.exe";
+ stormSeed: "STORM_SEED.exe";
+};
+
+/** @public */
+type ProgramName = _ValueOf;
+
/** @public */
type CodingContractNameEnumType = {
FindLargestPrimeFactor: "Find Largest Prime Factor";
@@ -9460,6 +9482,7 @@ type NSEnums = {
SpecialBladeburnerActionTypeForSleeve: SpecialBladeburnerActionEnumTypeForSleeve;
FragmentType: FragmentEnumType;
DarknetResponseCode: DarknetResponseCodeType;
+ ProgramName: ProgramNameEnumType;
};
/**
|