bitburner-src/markdown/bitburner.singularity.getdarkwebprogramcost.md
2023-04-28 14:45:55 -04:00

44 lines
1.5 KiB
Markdown

<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Singularity](./bitburner.singularity.md) &gt; [getDarkwebProgramCost](./bitburner.singularity.getdarkwebprogramcost.md)
## Singularity.getDarkwebProgramCost() method
Check the price of an exploit on the dark web
**Signature:**
```typescript
getDarkwebProgramCost(programName: string): number;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| programName | string | Name of program to check the price of |
**Returns:**
number
Price of the specified darkweb program (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
## Remarks
RAM cost: 0.5 GB \* 16/4/1
This function allows you to check the price of a darkweb exploit/program. You MUST have a TOR router in order to use this function. The price returned by this function is the same price you would see with buy -l from the terminal. Returns the cost of the program if it has not been purchased yet, 0 if it has already been purchased, or -1 if Tor has not been purchased (and thus the program/exploit is not available for purchase).
If the program does not exist, an error is thrown.
## Example
```js
const programName = "BruteSSH.exe";
const cost = ns.getDarkwebProgramCost(programName);
if (cost > 0) ns.tprint(`${programName} costs ${ns.formatMoney(cost)}`);
```