mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-18 13:43:49 +01:00
34 lines
5.2 KiB
Markdown
34 lines
5.2 KiB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||
|
||
[Home](./index.md) > [bitburner](./bitburner.md) > [HackNet](./bitburner.hacknet.md)
|
||
|
||
## HackNet interface
|
||
|
||
|
||
<b>Signature:</b>
|
||
|
||
```typescript
|
||
interface HackNet
|
||
```
|
||
|
||
## Methods
|
||
|
||
| Method | Description |
|
||
| --- | --- |
|
||
| [getCacheUpgradeCost(index, n)](./bitburner.hacknet.getcacheupgradecost.md) | This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).<!-- -->Returns the cost of upgrading the cache level of the specified Hacknet Server by n.<!-- -->If an invalid value for n is provided, then this function returns 0. If the specified Hacknet Node is already at max level, then Infinity is returned. |
|
||
| [getCoreUpgradeCost(index, n)](./bitburner.hacknet.getcoreupgradecost.md) | Returns the cost of upgrading the number of cores of the specified Hacknet Node by n.<!-- -->If an invalid value for n is provided, then this function returns 0. If the specified Hacknet Node is already at max level, then Infinity is returned. |
|
||
| [getLevelUpgradeCost(index, n)](./bitburner.hacknet.getlevelupgradecost.md) | Returns the cost of upgrading the specified Hacknet Node by n levels.<!-- -->If an invalid value for n is provided, then this function returns 0. If the specified Hacknet Node is already at max level, then Infinity is returned. |
|
||
| [getNodeStats(index)](./bitburner.hacknet.getnodestats.md) | Returns an object containing a variety of stats about the specified Hacknet Node.<!-- -->Note that for Hacknet Nodes, production refers to the amount of money the node generates. For Hacknet Servers (the upgraded version of Hacknet Nodes), production refers to the amount of hashes the node generates. |
|
||
| [getPurchaseNodeCost()](./bitburner.hacknet.getpurchasenodecost.md) | Returns the cost of purchasing a new Hacknet Node. |
|
||
| [getRamUpgradeCost(index, n)](./bitburner.hacknet.getramupgradecost.md) | Returns the cost of upgrading the RAM of the specified Hacknet Node n times.<!-- -->If an invalid value for n is provided, then this function returns 0. If the specified Hacknet Node is already at max level, then Infinity is returned. |
|
||
| [hashCost(upgName)](./bitburner.hacknet.hashcost.md) | 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. |
|
||
| [numHashes()](./bitburner.hacknet.numhashes.md) | This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).<!-- -->Returns the number of hashes you have. |
|
||
| [numNodes()](./bitburner.hacknet.numnodes.md) | Returns the number of Hacknet Nodes you own. |
|
||
| [purchaseNode()](./bitburner.hacknet.purchasenode.md) | Purchases a new Hacknet Node. Returns a number with the index of the Hacknet Node. This index is equivalent to the number at the end of the Hacknet Node’s name (e.g The Hacknet Node named \`<!-- -->hacknet-node-4<!-- -->\` will have an index of 4).<!-- -->If the player cannot afford to purchase a new Hacknet Node then the function will return -1. |
|
||
| [spendHashes(upgName, upgTarget)](./bitburner.hacknet.spendhashes.md) | This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).<!-- -->Spend the hashes generated by your Hacknet Servers on an upgrade. Returns a boolean value - true if the upgrade is successfully purchased, and false otherwise.<!-- -->The name of the upgrade must be an exact match. The \`<!-- -->upgTarget<!-- -->\` argument is used for upgrades such as \`<!-- -->Reduce Minimum Security<!-- -->\`<!-- -->, which applies to a specific server. In this case, the \`<!-- -->upgTarget<!-- -->\` argument must be the hostname of the server. |
|
||
| [upgradeCache(index, n)](./bitburner.hacknet.upgradecache.md) | This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).<!-- -->Tries to upgrade the specified Hacknet Server’s cache n times.<!-- -->Returns true if it successfully upgrades the Server’s cache n times, or if it purchases some positive amount and the Server reaches its max cache level.<!-- -->Returns false otherwise. |
|
||
| [upgradeCore(index, n)](./bitburner.hacknet.upgradecore.md) | Tries to purchase n cores for the specified Hacknet Node.<!-- -->Returns true if it successfully purchases n cores for the Hacknet Node or if it purchases some positive amount and the Node reaches its max number of cores.<!-- -->Returns false otherwise. |
|
||
| [upgradeLevel(index, n)](./bitburner.hacknet.upgradelevel.md) | Tries to upgrade the level of the specified Hacknet Node by n.<!-- -->Returns true if the Hacknet Node’s level is successfully upgraded by n or if it is upgraded by some positive amount and the Node reaches its max level.<!-- -->Returns false otherwise. |
|
||
| [upgradeRam(index, n)](./bitburner.hacknet.upgraderam.md) | Tries to upgrade the specified Hacknet Node’s RAM n times. Note that each upgrade doubles the Node’s RAM. So this is equivalent to multiplying the Node’s RAM by 2 n.<!-- -->Returns true if the Hacknet Node’s RAM is successfully upgraded n times or if it is upgraded some positive number of times and the Node reaches it max RAM.<!-- -->Returns false otherwise. |
|
||
|