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

53 lines
1.4 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. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NS](./bitburner.ns.md) &gt; [hackAnalyze](./bitburner.ns.hackanalyze.md)
2021-10-30 18:34:14 +02:00
## NS.hackAnalyze() method
2021-10-30 18:34:14 +02:00
Get the part of money stolen with a single thread.
2021-10-30 18:34:14 +02:00
<b>Signature:</b>
```typescript
hackAnalyze(host: string): number;
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 target server. |
2021-10-30 18:34:14 +02:00
<b>Returns:</b>
number
The part of money you will steal from the target server with a single thread hack.
2021-10-30 18:34:14 +02:00
## Remarks
2021-10-30 21:46:34 +02:00
RAM cost: 1 GB
2021-10-30 18:34:14 +02:00
Returns the part of the specified servers money you will steal with a single thread hack.
2022-01-08 19:25:06 +01:00
## Example 1
2021-10-30 18:34:14 +02:00
2021-10-30 21:46:34 +02:00
```ts
2022-01-08 19:25:06 +01:00
// NS1:
2021-12-15 18:10:32 +01:00
//For example, assume the following returns 0.01:
2022-01-08 19:25:06 +01:00
var hackAmount = hackAnalyze("foodnstuff");
//This means that if hack the foodnstuff server using a single thread, then you will steal 1%, or 0.01 of its total money. If you hack using N threads, then you will steal N*0.01 times its total money.
```
## Example 2
```ts
// NS2:
//For example, assume the following returns 0.01:
const hackAmount = ns.hackAnalyze("foodnstuff");
//This means that if hack the foodnstuff server using a single thread, then you will steal 1%, or 0.01 of its total money. If you hack using N threads, then you will steal N*0.01 times its total money.
2021-10-30 18:34:14 +02:00
```