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

53 lines
947 B
Markdown
Raw Normal View History

2021-10-30 12:34:14 -04: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; [hasRootAccess](./bitburner.ns.hasrootaccess.md)
## NS.hasRootAccess() method
Check if your have root access on a server.
2021-10-30 12:34:14 -04:00
<b>Signature:</b>
```typescript
2021-10-30 15:46:34 -04:00
hasRootAccess(host: string): boolean;
2021-10-30 12:34:14 -04:00
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
2021-11-03 00:27:21 -04:00
| host | string | Host of the target server |
2021-10-30 12:34:14 -04:00
<b>Returns:</b>
boolean
True if player has root access to the specified target server, and false otherwise.
## Remarks
2021-10-30 15:46:34 -04:00
RAM cost: 0.05 GB
2021-10-30 12:34:14 -04:00
Returns a boolean indicating whether or not the player has root access to the specified target server.
2022-01-08 13:25:06 -05:00
## Example 1
2021-10-30 12:34:14 -04:00
2021-10-30 15:46:34 -04:00
```ts
2022-01-08 13:25:06 -05:00
// NS1:
2021-10-30 12:34:14 -04:00
if (hasRootAccess("foodnstuff") == false) {
nuke("foodnstuff");
}
```
2022-01-08 13:25:06 -05:00
## Example 2
```ts
// NS2:
if (ns.hasRootAccess("foodnstuff") == false) {
ns.nuke("foodnstuff");
}
```