bitburner-src/markdown/bitburner.hacknet.md

35 lines
5.2 KiB
Markdown
Raw Normal View History

2021-10-30 18:34:14 +02:00
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2021-10-30 21:46:34 +02:00
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Hacknet](./bitburner.hacknet.md)
2021-10-30 18:34:14 +02:00
2021-10-30 21:46:34 +02:00
## Hacknet interface
2021-10-30 18:34:14 +02:00
2021-10-30 21:46:34 +02:00
Hacknet API
2021-10-30 18:34:14 +02:00
<b>Signature:</b>
```typescript
2021-10-30 21:46:34 +02:00
interface Hacknet
2021-10-30 18:34:14 +02:00
```
## 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. |
2021-10-30 21:46:34 +02:00
| [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 Nodes name (e.g The Hacknet Node named <code>hacknet-node-4</code> 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 <code>upgTarget</code> argument is used for upgrades such as <code>Reduce Minimum Security</code>, which applies to a specific server. In this case, the <code>upgTarget</code> argument must be the hostname of the server. |
2021-10-30 18:34:14 +02:00
| [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 Servers cache n times.<!-- -->Returns true if it successfully upgrades the Servers 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 Nodes 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 Nodes RAM n times. Note that each upgrade doubles the Nodes RAM. So this is equivalent to multiplying the Nodes RAM by 2 n.<!-- -->Returns true if the Hacknet Nodes 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. |