mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 14:59:16 +02:00
61 lines
781 B
Markdown
61 lines
781 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
|
|
[Home](./index.md) > [bitburner](./bitburner.md) > [NS](./bitburner.ns.md) > [getServer](./bitburner.ns.getserver.md)
|
|
|
|
## NS.getServer() method
|
|
|
|
Returns a server object for the given server.
|
|
|
|
**Signature:**
|
|
|
|
```typescript
|
|
getServer(host?: string): Server;
|
|
```
|
|
|
|
## 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 for the requested server object. Defaults to the server the calling script is running on.
|
|
|
|
|
|
</td></tr>
|
|
</tbody></table>
|
|
|
|
**Returns:**
|
|
|
|
[Server](./bitburner.server.md)
|
|
|
|
The requested server object.
|
|
|
|
## Remarks
|
|
|
|
RAM cost: 2 GB
|
|
|