Files
bitburner-src/markdown/bitburner.ns.getserver.md
Michael Ficocelli 6073964768 DARKNET: Darkweb Expansion Project & Bitnode (#2139)
This is BN15. It is a really big change; see the PR for all the details.
2026-02-03 03:40:36 -08:00

63 lines
1002 B
Markdown

<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NS](./bitburner.ns.md) &gt; [getServer](./bitburner.ns.getserver.md)
## NS.getServer() method
Returns data of a server.
If the server is a darknet server and has recently gone offline, it will return a dummy server object with `isOnline: false`<!-- -->.
**Signature:**
```typescript
getServer(host?: string): Server | (DarknetServerData & { isOnline: boolean });
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
host
</td><td>
string
</td><td>
_(Optional)_ Optional. Hostname/IP of the server. Defaults to the hostname of the running script's server.
</td></tr>
</tbody></table>
**Returns:**
[Server](./bitburner.server.md) \| ([DarknetServerData](./bitburner.darknetserverdata.md) &amp; { isOnline: boolean })
Data of the server.
## Remarks
RAM cost: 2 GB