API: Expose ProgramName enum (#2492)

This commit is contained in:
catloversg
2026-02-14 02:51:42 +07:00
committed by GitHub
parent be66b766a2
commit 68700ff01f
14 changed files with 115 additions and 24 deletions

View File

@@ -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
</td><td>
string
[ProgramName](./bitburner.programname.md)
</td><td>
@@ -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}`);
```