bitburner-src/markdown/bitburner.ns.scan.md

34 lines
891 B
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. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NS](./bitburner.ns.md) &gt; [scan](./bitburner.ns.scan.md)
## NS.scan() method
Get the list servers connected to a server.
2021-10-30 18:34:14 +02:00
<b>Signature:</b>
```typescript
2021-10-30 21:46:34 +02:00
scan(host: string, hostnames?: boolean): string[];
2021-10-30 18:34:14 +02:00
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
2021-10-30 21:46:34 +02:00
| host | string | Hostname of the server to scan. |
2021-10-30 18:34:14 +02:00
| hostnames | boolean | Optional boolean specifying whether the function should output hostnames (if true) or IP addresses (if false). |
<b>Returns:</b>
2021-10-30 21:46:34 +02:00
string\[\]
2021-10-30 18:34:14 +02:00
Returns an string of hostnames or IP.
## Remarks
2021-10-30 21:46:34 +02:00
RAM cost: 0.2 GB
2021-10-30 18:34:14 +02:00
Returns an array containing the hostnames or IPs of all servers that are one node way from the specified target server. The hostnames/IPs in the returned array are strings.