rename the functions I created 2 minutes ago.

This commit is contained in:
Olivier Gagnon 2021-12-08 18:41:49 -05:00
parent d64ce5271e
commit 6eba92b36c
20 changed files with 151 additions and 48 deletions

37
dist/bitburner.d.ts vendored

@ -972,13 +972,21 @@ export declare interface EquipmentStats {
}
/**
* Formulas API
* @remarks
* You need Formulas.exe on your home computer to use this API.
* @public
*/
export declare interface Formulas {
/** Skills formulas */
skills: SkillsFormulas;
/** Hacking formulas */
hacking: HackingFormulas;
/** Hacknet Nodes formulas */
hacknetNodes: HacknetNodesFormulas;
/** Hacknet Servers formulas */
hacknetServers: HacknetServersFormulas;
/** Gang formulas */
gang: GangFormulas;
}
@ -1253,12 +1261,39 @@ export declare interface Gang {
}
/**
* Gang formulas
* @public
*/
export declare interface GangFormulas {
/**
* Calculate the wanted penalty.
* @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}
* @returns The calculated wanted penalty.
*/
calculateWantedPenalty(gang: GangGenInfo): number;
/**
* Calculate respect gain per tick.
* @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}
* @param member - Gang info from {@link Gang.getMemberInformation | getMemberInformation}
* @param task - Gang info from {@link Gang.getTaskStats | getTaskStats}
* @returns The calculated respect gain.
*/
calculateRespectGain(gang: GangGenInfo, member: GangMemberInfo, task: GangTaskStats): number;
/**
* Calculate wanted gain per tick.
* @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}
* @param member - Member info from {@link Gang.getMemberInformation | getMemberInformation}
* @param task - Task info from {@link Gang.getTaskStats | getTaskStats}
* @returns The calculated wanted gain.
*/
calculateWantedLevelGain(gang: GangGenInfo, member: GangMemberInfo, task: GangTaskStats): number;
/**
* Calculate money gain per tick.
* @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}
* @param member - Member info from {@link Gang.getMemberInformation | getMemberInformation}
* @param task - Task info from {@link Gang.getTaskStats | getTaskStats}
* @returns The calculated money gain.
*/
calculateMoneyGain(gang: GangGenInfo, member: GangMemberInfo, task: GangTaskStats): number;
}
@ -1931,7 +1966,7 @@ export declare interface NS extends Singularity {
* It is also possible to get the number of arguments that was passed into a script using: 'args.length'
* WARNING: Do not try to modify the args array. This will break the game.
*/
readonly args: (string | number)[];
readonly args: (string | number | boolean)[];
/**
* Steal a servers money.

@ -7409,7 +7409,7 @@
{
"kind": "Interface",
"canonicalReference": "bitburner!Formulas:interface",
"docComment": "/**\n * @public\n */\n",
"docComment": "/**\n * Formulas API\n *\n * @remarks\n *\n * You need Formulas.exe on your home computer to use this API.\n *\n * @public\n */\n",
"excerptTokens": [
{
"kind": "Content",
@ -7422,7 +7422,7 @@
{
"kind": "PropertySignature",
"canonicalReference": "bitburner!Formulas#gang:member",
"docComment": "",
"docComment": "/**\n * Gang formulas\n */\n",
"excerptTokens": [
{
"kind": "Content",
@ -7449,7 +7449,7 @@
{
"kind": "PropertySignature",
"canonicalReference": "bitburner!Formulas#hacking:member",
"docComment": "",
"docComment": "/**\n * Hacking formulas\n */\n",
"excerptTokens": [
{
"kind": "Content",
@ -7476,7 +7476,7 @@
{
"kind": "PropertySignature",
"canonicalReference": "bitburner!Formulas#hacknetNodes:member",
"docComment": "",
"docComment": "/**\n * Hacknet Nodes formulas\n */\n",
"excerptTokens": [
{
"kind": "Content",
@ -7503,7 +7503,7 @@
{
"kind": "PropertySignature",
"canonicalReference": "bitburner!Formulas#hacknetServers:member",
"docComment": "",
"docComment": "/**\n * Hacknet Servers formulas\n */\n",
"excerptTokens": [
{
"kind": "Content",
@ -7530,7 +7530,7 @@
{
"kind": "PropertySignature",
"canonicalReference": "bitburner!Formulas#skills:member",
"docComment": "",
"docComment": "/**\n * Skills formulas\n */\n",
"excerptTokens": [
{
"kind": "Content",
@ -8563,7 +8563,7 @@
{
"kind": "Interface",
"canonicalReference": "bitburner!GangFormulas:interface",
"docComment": "/**\n * @public\n */\n",
"docComment": "/**\n * Gang formulas\n *\n * @public\n */\n",
"excerptTokens": [
{
"kind": "Content",
@ -8576,7 +8576,7 @@
{
"kind": "MethodSignature",
"canonicalReference": "bitburner!GangFormulas#calculateMoneyGain:member(1)",
"docComment": "",
"docComment": "/**\n * Calculate money gain per tick.\n *\n * @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}\n *\n * @param member - Member info from {@link Gang.getMemberInformation | getMemberInformation}\n *\n * @param task - Task info from {@link Gang.getTaskStats | getTaskStats}\n *\n * @returns The calculated money gain.\n */\n",
"excerptTokens": [
{
"kind": "Content",
@ -8653,7 +8653,7 @@
{
"kind": "MethodSignature",
"canonicalReference": "bitburner!GangFormulas#calculateRespectGain:member(1)",
"docComment": "",
"docComment": "/**\n * Calculate respect gain per tick.\n *\n * @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}\n *\n * @param member - Gang info from {@link Gang.getMemberInformation | getMemberInformation}\n *\n * @param task - Gang info from {@link Gang.getTaskStats | getTaskStats}\n *\n * @returns The calculated respect gain.\n */\n",
"excerptTokens": [
{
"kind": "Content",
@ -8730,7 +8730,7 @@
{
"kind": "MethodSignature",
"canonicalReference": "bitburner!GangFormulas#calculateWantedLevelGain:member(1)",
"docComment": "",
"docComment": "/**\n * Calculate wanted gain per tick.\n *\n * @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}\n *\n * @param member - Member info from {@link Gang.getMemberInformation | getMemberInformation}\n *\n * @param task - Task info from {@link Gang.getTaskStats | getTaskStats}\n *\n * @returns The calculated wanted gain.\n */\n",
"excerptTokens": [
{
"kind": "Content",
@ -8807,7 +8807,7 @@
{
"kind": "MethodSignature",
"canonicalReference": "bitburner!GangFormulas#calculateWantedPenalty:member(1)",
"docComment": "",
"docComment": "/**\n * Calculate the wanted penalty.\n *\n * @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}\n *\n * @returns The calculated wanted penalty.\n */\n",
"excerptTokens": [
{
"kind": "Content",
@ -14193,7 +14193,7 @@
},
{
"kind": "Content",
"text": "(string | number)[]"
"text": "(string | number | boolean)[]"
},
{
"kind": "Content",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -4,6 +4,8 @@
## Formulas.gang property
Gang formulas
<b>Signature:</b>
```typescript

@ -4,6 +4,8 @@
## Formulas.hacking property
Hacking formulas
<b>Signature:</b>
```typescript

@ -4,6 +4,8 @@
## Formulas.hacknetNodes property
Hacknet Nodes formulas
<b>Signature:</b>
```typescript

@ -4,6 +4,8 @@
## Formulas.hacknetServers property
Hacknet Servers formulas
<b>Signature:</b>
```typescript

@ -4,6 +4,7 @@
## Formulas interface
Formulas API
<b>Signature:</b>
@ -11,13 +12,17 @@
export interface Formulas
```
## Remarks
You need Formulas.exe on your home computer to use this API.
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [gang](./bitburner.formulas.gang.md) | [GangFormulas](./bitburner.gangformulas.md) | |
| [hacking](./bitburner.formulas.hacking.md) | [HackingFormulas](./bitburner.hackingformulas.md) | |
| [hacknetNodes](./bitburner.formulas.hacknetnodes.md) | [HacknetNodesFormulas](./bitburner.hacknetnodesformulas.md) | |
| [hacknetServers](./bitburner.formulas.hacknetservers.md) | [HacknetServersFormulas](./bitburner.hacknetserversformulas.md) | |
| [skills](./bitburner.formulas.skills.md) | [SkillsFormulas](./bitburner.skillsformulas.md) | |
| [gang](./bitburner.formulas.gang.md) | [GangFormulas](./bitburner.gangformulas.md) | Gang formulas |
| [hacking](./bitburner.formulas.hacking.md) | [HackingFormulas](./bitburner.hackingformulas.md) | Hacking formulas |
| [hacknetNodes](./bitburner.formulas.hacknetnodes.md) | [HacknetNodesFormulas](./bitburner.hacknetnodesformulas.md) | Hacknet Nodes formulas |
| [hacknetServers](./bitburner.formulas.hacknetservers.md) | [HacknetServersFormulas](./bitburner.hacknetserversformulas.md) | Hacknet Servers formulas |
| [skills](./bitburner.formulas.skills.md) | [SkillsFormulas](./bitburner.skillsformulas.md) | Skills formulas |

@ -4,6 +4,8 @@
## Formulas.skills property
Skills formulas
<b>Signature:</b>
```typescript

@ -4,6 +4,8 @@
## GangFormulas.calculateMoneyGain() method
Calculate money gain per tick.
<b>Signature:</b>
```typescript
@ -14,11 +16,13 @@ calculateMoneyGain(gang: GangGenInfo, member: GangMemberInfo, task: GangTaskStat
| Parameter | Type | Description |
| --- | --- | --- |
| gang | [GangGenInfo](./bitburner.ganggeninfo.md) | |
| member | [GangMemberInfo](./bitburner.gangmemberinfo.md) | |
| task | [GangTaskStats](./bitburner.gangtaskstats.md) | |
| gang | [GangGenInfo](./bitburner.ganggeninfo.md) | Gang info from [getGangInformation](./bitburner.gang.getganginformation.md) |
| member | [GangMemberInfo](./bitburner.gangmemberinfo.md) | Member info from [getMemberInformation](./bitburner.gang.getmemberinformation.md) |
| task | [GangTaskStats](./bitburner.gangtaskstats.md) | Task info from [getTaskStats](./bitburner.gang.gettaskstats.md) |
<b>Returns:</b>
number
The calculated money gain.

@ -4,6 +4,8 @@
## GangFormulas.calculateRespectGain() method
Calculate respect gain per tick.
<b>Signature:</b>
```typescript
@ -14,11 +16,13 @@ calculateRespectGain(gang: GangGenInfo, member: GangMemberInfo, task: GangTaskSt
| Parameter | Type | Description |
| --- | --- | --- |
| gang | [GangGenInfo](./bitburner.ganggeninfo.md) | |
| member | [GangMemberInfo](./bitburner.gangmemberinfo.md) | |
| task | [GangTaskStats](./bitburner.gangtaskstats.md) | |
| gang | [GangGenInfo](./bitburner.ganggeninfo.md) | Gang info from [getGangInformation](./bitburner.gang.getganginformation.md) |
| member | [GangMemberInfo](./bitburner.gangmemberinfo.md) | Gang info from [getMemberInformation](./bitburner.gang.getmemberinformation.md) |
| task | [GangTaskStats](./bitburner.gangtaskstats.md) | Gang info from [getTaskStats](./bitburner.gang.gettaskstats.md) |
<b>Returns:</b>
number
The calculated respect gain.

@ -4,6 +4,8 @@
## GangFormulas.calculateWantedLevelGain() method
Calculate wanted gain per tick.
<b>Signature:</b>
```typescript
@ -14,11 +16,13 @@ calculateWantedLevelGain(gang: GangGenInfo, member: GangMemberInfo, task: GangTa
| Parameter | Type | Description |
| --- | --- | --- |
| gang | [GangGenInfo](./bitburner.ganggeninfo.md) | |
| member | [GangMemberInfo](./bitburner.gangmemberinfo.md) | |
| task | [GangTaskStats](./bitburner.gangtaskstats.md) | |
| gang | [GangGenInfo](./bitburner.ganggeninfo.md) | Gang info from [getGangInformation](./bitburner.gang.getganginformation.md) |
| member | [GangMemberInfo](./bitburner.gangmemberinfo.md) | Member info from [getMemberInformation](./bitburner.gang.getmemberinformation.md) |
| task | [GangTaskStats](./bitburner.gangtaskstats.md) | Task info from [getTaskStats](./bitburner.gang.gettaskstats.md) |
<b>Returns:</b>
number
The calculated wanted gain.

@ -4,6 +4,8 @@
## GangFormulas.calculateWantedPenalty() method
Calculate the wanted penalty.
<b>Signature:</b>
```typescript
@ -14,9 +16,11 @@ calculateWantedPenalty(gang: GangGenInfo): number;
| Parameter | Type | Description |
| --- | --- | --- |
| gang | [GangGenInfo](./bitburner.ganggeninfo.md) | |
| gang | [GangGenInfo](./bitburner.ganggeninfo.md) | Gang info from [getGangInformation](./bitburner.gang.getganginformation.md) |
<b>Returns:</b>
number
The calculated wanted penalty.

@ -4,6 +4,7 @@
## GangFormulas interface
Gang formulas
<b>Signature:</b>
@ -15,8 +16,8 @@ interface GangFormulas
| Method | Description |
| --- | --- |
| [calculateMoneyGain(gang, member, task)](./bitburner.gangformulas.calculatemoneygain.md) | |
| [calculateRespectGain(gang, member, task)](./bitburner.gangformulas.calculaterespectgain.md) | |
| [calculateWantedLevelGain(gang, member, task)](./bitburner.gangformulas.calculatewantedlevelgain.md) | |
| [calculateWantedPenalty(gang)](./bitburner.gangformulas.calculatewantedpenalty.md) | |
| [calculateMoneyGain(gang, member, task)](./bitburner.gangformulas.calculatemoneygain.md) | Calculate money gain per tick. |
| [calculateRespectGain(gang, member, task)](./bitburner.gangformulas.calculaterespectgain.md) | Calculate respect gain per tick. |
| [calculateWantedLevelGain(gang, member, task)](./bitburner.gangformulas.calculatewantedlevelgain.md) | Calculate wanted gain per tick. |
| [calculateWantedPenalty(gang)](./bitburner.gangformulas.calculatewantedpenalty.md) | Calculate the wanted penalty. |

@ -26,10 +26,10 @@
| [Employee](./bitburner.employee.md) | |
| [EmployeeJobs](./bitburner.employeejobs.md) | |
| [EquipmentStats](./bitburner.equipmentstats.md) | Object representing data representing a gang member equipment. |
| [Formulas](./bitburner.formulas.md) | |
| [Formulas](./bitburner.formulas.md) | Formulas API |
| [Fragment](./bitburner.fragment.md) | |
| [Gang](./bitburner.gang.md) | Gang API |
| [GangFormulas](./bitburner.gangformulas.md) | |
| [GangFormulas](./bitburner.gangformulas.md) | Gang formulas |
| [GangGenInfo](./bitburner.ganggeninfo.md) | Gang general info. |
| [GangMemberAscension](./bitburner.gangmemberascension.md) | |
| [GangMemberInfo](./bitburner.gangmemberinfo.md) | |

@ -9,7 +9,7 @@ Arguments passed into the script.
<b>Signature:</b>
```typescript
readonly args: (string | number)[];
readonly args: (string | number | boolean)[];
```
## Remarks

@ -17,7 +17,7 @@ export interface NS extends Singularity
| Property | Type | Description |
| --- | --- | --- |
| [args](./bitburner.ns.args.md) | (string \| number)\[\] | Arguments passed into the script. |
| [args](./bitburner.ns.args.md) | (string \| number \| boolean)\[\] | Arguments passed into the script. |
| [bladeburner](./bitburner.ns.bladeburner.md) | [Bladeburner](./bitburner.bladeburner.md) | Namespace for bladeburner functions. |
| [codingcontract](./bitburner.ns.codingcontract.md) | [CodingContract](./bitburner.codingcontract.md) | Namespace for codingcontract functions. |
| [corporation](./bitburner.ns.corporation.md) | [Corporation](./bitburner.corporation.md) | Namespace for corporation functions. RAM cost: 0 GB |

@ -185,16 +185,16 @@ export function NetscriptFormulas(player: IPlayer, workerScript: WorkerScript, h
},
},
gang: {
calculateWantedPenalty(gang: any): number {
wantedPenalty(gang: any): number {
return calculateWantedPenalty(gang);
},
calculateRespectGain: function (gang: any, member: any, task: any): number {
respectGain: function (gang: any, member: any, task: any): number {
return calculateRespectGain(gang, member, task);
},
calculateWantedLevelGain: function (gang: any, member: any, task: any): number {
wantedLevelGain: function (gang: any, member: any, task: any): number {
return calculateWantedLevelGain(gang, member, task);
},
calculateMoneyGain: function (gang: any, member: any, task: any): number {
moneyGain: function (gang: any, member: any, task: any): number {
return calculateMoneyGain(gang, member, task);
},
},

@ -3341,6 +3341,7 @@ interface HacknetNodesFormulas {
}
/**
* Hacknet Server formulas
* @public
*/
interface HacknetServersFormulas {
@ -3355,23 +3356,58 @@ interface HacknetServersFormulas {
}
/**
* Gang formulas
* @public
*/
interface GangFormulas {
calculateWantedPenalty(gang: GangGenInfo): number;
calculateRespectGain(gang: GangGenInfo, member: GangMemberInfo, task: GangTaskStats): number;
calculateWantedLevelGain(gang: GangGenInfo, member: GangMemberInfo, task: GangTaskStats): number;
calculateMoneyGain(gang: GangGenInfo, member: GangMemberInfo, task: GangTaskStats): number;
/**
* Calculate the wanted penalty.
* @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}
* @returns The calculated wanted penalty.
*/
wantedPenalty(gang: GangGenInfo): number;
/**
* Calculate respect gain per tick.
* @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}
* @param member - Gang info from {@link Gang.getMemberInformation | getMemberInformation}
* @param task - Gang info from {@link Gang.getTaskStats | getTaskStats}
* @returns The calculated respect gain.
*/
respectGain(gang: GangGenInfo, member: GangMemberInfo, task: GangTaskStats): number;
/**
* Calculate wanted gain per tick.
* @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}
* @param member - Member info from {@link Gang.getMemberInformation | getMemberInformation}
* @param task - Task info from {@link Gang.getTaskStats | getTaskStats}
* @returns The calculated wanted gain.
*/
wantedLevelGain(gang: GangGenInfo, member: GangMemberInfo, task: GangTaskStats): number;
/**
* Calculate money gain per tick.
* @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}
* @param member - Member info from {@link Gang.getMemberInformation | getMemberInformation}
* @param task - Task info from {@link Gang.getTaskStats | getTaskStats}
* @returns The calculated money gain.
*/
moneyGain(gang: GangGenInfo, member: GangMemberInfo, task: GangTaskStats): number;
}
/**
* Formulas API
* @remarks
* You need Formulas.exe on your home computer to use this API.
* @public
*/
export interface Formulas {
/** Skills formulas */
skills: SkillsFormulas;
/** Hacking formulas */
hacking: HackingFormulas;
/** Hacknet Nodes formulas */
hacknetNodes: HacknetNodesFormulas;
/** Hacknet Servers formulas */
hacknetServers: HacknetServersFormulas;
/** Gang formulas */
gang: GangFormulas;
}
@ -3571,7 +3607,7 @@ export interface NS extends Singularity {
* It is also possible to get the number of arguments that was passed into a script using: 'args.length'
* WARNING: Do not try to modify the args array. This will break the game.
*/
readonly args: (string | number)[];
readonly args: (string | number | boolean)[];
/**
* Steal a servers money.