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

42 lines
1.1 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 percent 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 percentage of money you will steal from the target server with a single hack.
## Remarks
2021-10-30 21:46:34 +02:00
RAM cost: 1 GB
2021-10-30 18:34:14 +02:00
Returns the percentage of the specified servers money you will steal with a single hack. This value is returned in percentage form, not decimal (Netscript functions typically return in decimal form, but not this one).
2021-10-30 18:34:14 +02:00
## Example
2021-10-30 21:46:34 +02:00
```ts
2021-12-15 18:10:32 +01:00
//For example, assume the following returns 0.01:
hackAnalyze("foodnstuff");
2021-12-15 18:10:32 +01:00
//This means that if hack the foodnstuff server, then you will steal 1% of its total money. If you hack using N threads, then you will steal N*0.01% of its total money.
2021-10-30 18:34:14 +02:00
```