API: Add ns.singularity.getHackingLevelRequirementOfProgram (#2271)

This commit is contained in:
catloversg
2025-07-31 04:44:06 +07:00
committed by GitHub
parent 952fc28b67
commit 8976d54532
7 changed files with 82 additions and 16 deletions

View File

@@ -2418,17 +2418,9 @@ export interface Singularity {
*
* This function returns true if you successfully start working on the specified program, and false otherwise.
*
* Note that creating a program using this function has the same hacking level requirements as it normally would.
* These level requirements are:<br/>
* - BruteSSH.exe: 50<br/>
* - FTPCrack.exe: 100<br/>
* - relaySMTP.exe: 250<br/>
* - HTTPWorm.exe: 500<br/>
* - SQLInject.exe: 750<br/>
* - DeepscanV1.exe: 75<br/>
* - DeepscanV2.exe: 400<br/>
* - ServerProfiler.exe: 75<br/>
* - AutoLink.exe: 25
* Note that creating a program using this function has the same hacking level requirements as it normally would. You
* can call {@link Singularity.getHackingLevelRequirementOfProgram | getHackingLevelRequirementOfProgram} to get that
* value.
*
* @example
* ```js
@@ -2442,6 +2434,19 @@ export interface Singularity {
*/
createProgram(program: string, focus?: boolean): boolean;
/**
* Get the hacking level requirement of a program.
* @remarks
* RAM cost: 5 GB * 16/4/1
*
* In order to create a program via UI or {@link Singularity.createProgram | createProgram}, your hacking level must
* meet the requirement of that program. This API returns that value.
*
* @param program - Name of program to create.
* @returns Hacking level requirement. Return Infinity if the specified program cannot be created.
*/
getHackingLevelRequirementOfProgram(program: string): number;
/**
* Commit a crime.
* @remarks