mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-18 12:15:44 +01:00
44 lines
1.5 KiB
Markdown
44 lines
1.5 KiB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
|
|
[Home](./index.md) > [bitburner](./bitburner.md) > [Singularity](./bitburner.singularity.md) > [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.singularity.getDarkwebProgramCost(programName);
|
|
if (cost > 0) ns.tprint(`${programName} costs $${ns.formatNumber(cost)}`);
|
|
```
|
|
|