mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-23 09:42:53 +02:00
work on doc
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [HackNet](./bitburner.hacknet.md) > [hashCost](./bitburner.hacknet.hashcost.md)
|
||||
|
||||
## HackNet.hashCost() method
|
||||
|
||||
This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).
|
||||
|
||||
Returns the number of hashes required for the specified upgrade. The name of the upgrade must be an exact match.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
hashCost(upgName: HashUpgrades): number;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| upgName | [HashUpgrades](./bitburner.hashupgrades.md) | Name of the upgrade of Hacknet Node. |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
number
|
||||
|
||||
Number of hashes required for the specified upgrade.
|
||||
|
||||
## Remarks
|
||||
|
||||
0 GB
|
||||
|
||||
## Example
|
||||
|
||||
|
||||
```js
|
||||
var upgradeName = "Sell for Corporation Funds";
|
||||
if (hacknet.numHashes() > hacknet.hashCost(upgradeName)) {
|
||||
hacknet.spendHashes(upgName);
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user