mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-22 22:22:26 +01:00
Merge pull request #1602 from danielyxie/raw
netscript def is raw loaded
This commit is contained in:
commit
4fbcb1c4e9
1709
package-lock.json
generated
1709
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -35,6 +35,7 @@
|
||||
"monaco-editor": "^0.27.0",
|
||||
"notistack": "^2.0.2",
|
||||
"numeral": "2.0.6",
|
||||
"raw-loader": "^4.0.2",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-draggable": "^4.4.4",
|
||||
|
@ -3,17 +3,18 @@ import { IMap } from "../types";
|
||||
import { Programs } from "../Programs/Programs";
|
||||
|
||||
export const DarkWebItems: IMap<DarkWebItem> = {
|
||||
BruteSSHProgram: new DarkWebItem(Programs.BruteSSHProgram.name, 500e3, "Opens up SSH Ports"),
|
||||
FTPCrackProgram: new DarkWebItem(Programs.FTPCrackProgram.name, 1500e3, "Opens up FTP Ports"),
|
||||
RelaySMTPProgram: new DarkWebItem(Programs.RelaySMTPProgram.name, 5e6, "Opens up SMTP Ports"),
|
||||
HTTPWormProgram: new DarkWebItem(Programs.HTTPWormProgram.name, 30e6, "Opens up HTTP Ports"),
|
||||
SQLInjectProgram: new DarkWebItem(Programs.SQLInjectProgram.name, 250e6, "Opens up SQL Ports"),
|
||||
DeepscanV1: new DarkWebItem(Programs.DeepscanV1.name, 500000, "Enables 'scan-analyze' with a depth up to 5"),
|
||||
DeepscanV2: new DarkWebItem(Programs.DeepscanV2.name, 25e6, "Enables 'scan-analyze' with a depth up to 10"),
|
||||
AutolinkProgram: new DarkWebItem(Programs.AutoLink.name, 1e6, "Enables direct connect via 'scan-analyze'"),
|
||||
BruteSSHProgram: new DarkWebItem(Programs.BruteSSHProgram.name, 500e3, "Opens up SSH Ports."),
|
||||
FTPCrackProgram: new DarkWebItem(Programs.FTPCrackProgram.name, 1500e3, "Opens up FTP Ports."),
|
||||
RelaySMTPProgram: new DarkWebItem(Programs.RelaySMTPProgram.name, 5e6, "Opens up SMTP Ports."),
|
||||
HTTPWormProgram: new DarkWebItem(Programs.HTTPWormProgram.name, 30e6, "Opens up HTTP Ports."),
|
||||
SQLInjectProgram: new DarkWebItem(Programs.SQLInjectProgram.name, 250e6, "Opens up SQL Ports."),
|
||||
DeepscanV1: new DarkWebItem(Programs.DeepscanV1.name, 500000, "Enables 'scan-analyze' with a depth up to 5."),
|
||||
DeepscanV2: new DarkWebItem(Programs.DeepscanV2.name, 25e6, "Enables 'scan-analyze' with a depth up to 10."),
|
||||
AutolinkProgram: new DarkWebItem(Programs.AutoLink.name, 1e6, "Enables direct connect via 'scan-analyze.'"),
|
||||
ServerProfilerProgram: new DarkWebItem(
|
||||
Programs.ServerProfiler.name,
|
||||
1e6,
|
||||
"Displays hacking and Netscript-related information about a server",
|
||||
"Displays hacking and Netscript-related information about a server.",
|
||||
),
|
||||
FormulasProgram: new DarkWebItem(Programs.Formulas.name, 1e9, "Unlock access to the formulas API."),
|
||||
};
|
||||
|
@ -30,7 +30,7 @@ export function Augmentations(props: IProps): React.ReactElement {
|
||||
}
|
||||
|
||||
function queueAllAugs(): void {
|
||||
for (const augName of Object.keys(AugmentationNames)) {
|
||||
for (const augName of Object.values(AugmentationNames)) {
|
||||
props.player.queueAugmentation(augName);
|
||||
}
|
||||
}
|
||||
|
@ -190,7 +190,7 @@ export const programsMetadata: IProgramCreationParams[] = [
|
||||
time: CONSTANTS.MillisecondsPerQuarterHour,
|
||||
},
|
||||
run: (router: IRouter, terminal: ITerminal): void => {
|
||||
terminal.error("This executable cannot be run.");
|
||||
terminal.print("This executable cannot be run.");
|
||||
terminal.print("DeepscanV1.exe lets you run 'scan-analyze' with a depth up to 5.");
|
||||
},
|
||||
},
|
||||
@ -204,7 +204,7 @@ export const programsMetadata: IProgramCreationParams[] = [
|
||||
time: CONSTANTS.MillisecondsPer2Hours,
|
||||
},
|
||||
run: (router: IRouter, terminal: ITerminal): void => {
|
||||
terminal.error("This executable cannot be run.");
|
||||
terminal.print("This executable cannot be run.");
|
||||
terminal.print("DeepscanV2.exe lets you run 'scan-analyze' with a depth up to 10.");
|
||||
},
|
||||
},
|
||||
@ -268,11 +268,25 @@ export const programsMetadata: IProgramCreationParams[] = [
|
||||
time: CONSTANTS.MillisecondsPerQuarterHour,
|
||||
},
|
||||
run: (router: IRouter, terminal: ITerminal): void => {
|
||||
terminal.error("This executable cannot be run.");
|
||||
terminal.print("This executable cannot be run.");
|
||||
terminal.print("AutoLink.exe lets you automatically connect to other servers when using 'scan-analyze'.");
|
||||
terminal.print("When using scan-analyze, click on a server's hostname to connect to it.");
|
||||
},
|
||||
},
|
||||
{
|
||||
key: "Formulas",
|
||||
name: "Formulas.exe",
|
||||
create: {
|
||||
level: 1000,
|
||||
tooltip: "This program allows you to use the formulas API",
|
||||
req: requireHackingLevel(1000),
|
||||
time: CONSTANTS.MillisecondsPer4Hours,
|
||||
},
|
||||
run: (router: IRouter, terminal: ITerminal): void => {
|
||||
terminal.print("This executable cannot be run.");
|
||||
terminal.print("Formulas.exe lets you use the formulas API.");
|
||||
},
|
||||
},
|
||||
{
|
||||
key: "BitFlume",
|
||||
name: "b1t_flum3.exe",
|
||||
|
@ -1,5 +1,3 @@
|
||||
export const libSource = `
|
||||
|
||||
type Host = string;
|
||||
type Script = string;
|
||||
type StockSymbol =
|
||||
@ -38,10 +36,7 @@ type StockSymbol =
|
||||
| "TITN";
|
||||
type OrderType = "limitbuy" | "limitsell" | "stopbuy" | "stopsell";
|
||||
type OrderPos = "long" | "short";
|
||||
type University =
|
||||
| "Summit University"
|
||||
| "Rothman University"
|
||||
| "ZB Institute Of Technology";
|
||||
type University = "Summit University" | "Rothman University" | "ZB Institute Of Technology";
|
||||
type UniversityCourse =
|
||||
| "Study Computer Science"
|
||||
| "Data Strucures"
|
||||
@ -49,20 +44,9 @@ type UniversityCourse =
|
||||
| "Algorithms"
|
||||
| "Management"
|
||||
| "Leadership";
|
||||
type Gym =
|
||||
| "Crush Fitness Gym"
|
||||
| "Snap Fitness Gym"
|
||||
| "Iron Gym"
|
||||
| "Powerhouse Gym"
|
||||
| "Millenium Fitness Gym";
|
||||
type Gym = "Crush Fitness Gym" | "Snap Fitness Gym" | "Iron Gym" | "Powerhouse Gym" | "Millenium Fitness Gym";
|
||||
type GymStat = "str" | "def" | "dex" | "agi";
|
||||
type City =
|
||||
| "Aevum"
|
||||
| "Chongqing"
|
||||
| "Sector-12"
|
||||
| "New Tokyo"
|
||||
| "Ishima"
|
||||
| "Volhaven";
|
||||
type City = "Aevum" | "Chongqing" | "Sector-12" | "New Tokyo" | "Ishima" | "Volhaven";
|
||||
type PurchaseableProgram =
|
||||
| "brutessh.exe"
|
||||
| "ftpcrack.exe"
|
||||
@ -470,6 +454,49 @@ interface HacknetMultipliers {
|
||||
levelCost: number;
|
||||
}
|
||||
|
||||
interface Server {
|
||||
// How many CPU cores this server has. Maximum of 8.
|
||||
// Currently, this only affects hacking missions
|
||||
cpuCores: number;
|
||||
|
||||
// Flag indicating whether the FTP port is open
|
||||
ftpPortOpen: boolean;
|
||||
|
||||
// Flag indicating whether player has admin/root access to this server
|
||||
hasAdminRights: boolean;
|
||||
|
||||
// Hostname. Must be unique
|
||||
hostname: string;
|
||||
|
||||
// Flag indicating whether HTTP Port is open
|
||||
httpPortOpen: boolean;
|
||||
|
||||
// IP Address. Must be unique
|
||||
ip: string;
|
||||
|
||||
// Flag indicating whether player is curently connected to this server
|
||||
isConnectedTo: boolean;
|
||||
|
||||
// RAM (GB) available on this server
|
||||
maxRam: number;
|
||||
|
||||
// Name of company/faction/etc. that this server belongs to.
|
||||
// Optional, not applicable to all Servers
|
||||
organizationName: string;
|
||||
|
||||
// RAM (GB) used. i.e. unavailable RAM
|
||||
ramUsed: number;
|
||||
|
||||
// Flag indicating whether SMTP Port is open
|
||||
smtpPortOpen: boolean;
|
||||
|
||||
// Flag indicating whether SQL Port is open
|
||||
sqlPortOpen: boolean;
|
||||
|
||||
// Flag indicating whether the SSH Port is open
|
||||
sshPortOpen: boolean;
|
||||
}
|
||||
|
||||
interface BitNodeMultipliers {
|
||||
/** Influences how quickly the player's agility level (not exp) scales */
|
||||
AgilityLevelMultiplier: number;
|
||||
@ -707,10 +734,7 @@ interface SourceFileLvl {
|
||||
lvl: number;
|
||||
}
|
||||
|
||||
type BladeburnerContracts =
|
||||
| "Tracking"
|
||||
| "Bounty Hunter"
|
||||
| "Retirement";
|
||||
type BladeburnerContracts = "Tracking" | "Bounty Hunter" | "Retirement";
|
||||
|
||||
type BladeburnerOperations =
|
||||
| "Investigation"
|
||||
@ -766,11 +790,7 @@ type BladeburnerSkills =
|
||||
| "Hands of Midas"
|
||||
| "Hyperdrive";
|
||||
|
||||
type BladeburnerActTypes =
|
||||
| "contracts"
|
||||
| "operations"
|
||||
| "black ops"
|
||||
| "general";
|
||||
type BladeburnerActTypes = "contracts" | "operations" | "black ops" | "general";
|
||||
|
||||
interface BladeburnerCurAction {
|
||||
/** Type of Action */
|
||||
@ -854,12 +874,7 @@ type GangEquipment =
|
||||
| "Hmap Node"
|
||||
| "Jack the Ripper";
|
||||
|
||||
type GangEquipmentType =
|
||||
| "Weapon"
|
||||
| "Armor"
|
||||
| "Vehicle"
|
||||
| "Rootkit"
|
||||
| "Augmentation";
|
||||
type GangEquipmentType = "Weapon" | "Armor" | "Vehicle" | "Rootkit" | "Augmentation";
|
||||
|
||||
type GangAugmentations =
|
||||
| "Bionic Arms"
|
||||
@ -1021,19 +1036,211 @@ interface GangMemberAscension {
|
||||
|
||||
interface SleeveStats {
|
||||
/** current shock of the sleeve [0-100] */
|
||||
shock: 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20
|
||||
|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37
|
||||
|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54
|
||||
|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71
|
||||
|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88
|
||||
|89|90|91|92|93|94|95|96|97|98|99|100;
|
||||
shock:
|
||||
| 0
|
||||
| 1
|
||||
| 2
|
||||
| 3
|
||||
| 4
|
||||
| 5
|
||||
| 6
|
||||
| 7
|
||||
| 8
|
||||
| 9
|
||||
| 10
|
||||
| 11
|
||||
| 12
|
||||
| 13
|
||||
| 14
|
||||
| 15
|
||||
| 16
|
||||
| 17
|
||||
| 18
|
||||
| 19
|
||||
| 20
|
||||
| 21
|
||||
| 22
|
||||
| 23
|
||||
| 24
|
||||
| 25
|
||||
| 26
|
||||
| 27
|
||||
| 28
|
||||
| 29
|
||||
| 30
|
||||
| 31
|
||||
| 32
|
||||
| 33
|
||||
| 34
|
||||
| 35
|
||||
| 36
|
||||
| 37
|
||||
| 38
|
||||
| 39
|
||||
| 40
|
||||
| 41
|
||||
| 42
|
||||
| 43
|
||||
| 44
|
||||
| 45
|
||||
| 46
|
||||
| 47
|
||||
| 48
|
||||
| 49
|
||||
| 50
|
||||
| 51
|
||||
| 52
|
||||
| 53
|
||||
| 54
|
||||
| 55
|
||||
| 56
|
||||
| 57
|
||||
| 58
|
||||
| 59
|
||||
| 60
|
||||
| 61
|
||||
| 62
|
||||
| 63
|
||||
| 64
|
||||
| 65
|
||||
| 66
|
||||
| 67
|
||||
| 68
|
||||
| 69
|
||||
| 70
|
||||
| 71
|
||||
| 72
|
||||
| 73
|
||||
| 74
|
||||
| 75
|
||||
| 76
|
||||
| 77
|
||||
| 78
|
||||
| 79
|
||||
| 80
|
||||
| 81
|
||||
| 82
|
||||
| 83
|
||||
| 84
|
||||
| 85
|
||||
| 86
|
||||
| 87
|
||||
| 88
|
||||
| 89
|
||||
| 90
|
||||
| 91
|
||||
| 92
|
||||
| 93
|
||||
| 94
|
||||
| 95
|
||||
| 96
|
||||
| 97
|
||||
| 98
|
||||
| 99
|
||||
| 100;
|
||||
/** current sync of the sleeve [0-100] */
|
||||
sync: 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20
|
||||
|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37
|
||||
|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54
|
||||
|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71
|
||||
|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88
|
||||
|89|90|91|92|93|94|95|96|97|98|99|100;
|
||||
sync:
|
||||
| 0
|
||||
| 1
|
||||
| 2
|
||||
| 3
|
||||
| 4
|
||||
| 5
|
||||
| 6
|
||||
| 7
|
||||
| 8
|
||||
| 9
|
||||
| 10
|
||||
| 11
|
||||
| 12
|
||||
| 13
|
||||
| 14
|
||||
| 15
|
||||
| 16
|
||||
| 17
|
||||
| 18
|
||||
| 19
|
||||
| 20
|
||||
| 21
|
||||
| 22
|
||||
| 23
|
||||
| 24
|
||||
| 25
|
||||
| 26
|
||||
| 27
|
||||
| 28
|
||||
| 29
|
||||
| 30
|
||||
| 31
|
||||
| 32
|
||||
| 33
|
||||
| 34
|
||||
| 35
|
||||
| 36
|
||||
| 37
|
||||
| 38
|
||||
| 39
|
||||
| 40
|
||||
| 41
|
||||
| 42
|
||||
| 43
|
||||
| 44
|
||||
| 45
|
||||
| 46
|
||||
| 47
|
||||
| 48
|
||||
| 49
|
||||
| 50
|
||||
| 51
|
||||
| 52
|
||||
| 53
|
||||
| 54
|
||||
| 55
|
||||
| 56
|
||||
| 57
|
||||
| 58
|
||||
| 59
|
||||
| 60
|
||||
| 61
|
||||
| 62
|
||||
| 63
|
||||
| 64
|
||||
| 65
|
||||
| 66
|
||||
| 67
|
||||
| 68
|
||||
| 69
|
||||
| 70
|
||||
| 71
|
||||
| 72
|
||||
| 73
|
||||
| 74
|
||||
| 75
|
||||
| 76
|
||||
| 77
|
||||
| 78
|
||||
| 79
|
||||
| 80
|
||||
| 81
|
||||
| 82
|
||||
| 83
|
||||
| 84
|
||||
| 85
|
||||
| 86
|
||||
| 87
|
||||
| 88
|
||||
| 89
|
||||
| 90
|
||||
| 91
|
||||
| 92
|
||||
| 93
|
||||
| 94
|
||||
| 95
|
||||
| 96
|
||||
| 97
|
||||
| 98
|
||||
| 99
|
||||
| 100;
|
||||
/** current hacking skill of the sleeve */
|
||||
hacking_skill: number;
|
||||
/** current strength of the sleeve */
|
||||
@ -1089,7 +1296,6 @@ interface SleeveTask {
|
||||
}
|
||||
|
||||
interface TIX {
|
||||
|
||||
/**
|
||||
* Returns an array of the symbols of the tradable stocks
|
||||
*
|
||||
@ -1182,7 +1388,7 @@ interface TIX {
|
||||
* @param {string} posType Specifies whether the order is a “Long” or “Short” position.
|
||||
* @returns {number} Cost to buy a given number of shares of a stock.
|
||||
*/
|
||||
getPurchaseCost (sym: StockSymbol, shares: Number, posType: OrderPos): number;
|
||||
getPurchaseCost(sym: StockSymbol, shares: number, posType: OrderPos): number;
|
||||
|
||||
/**
|
||||
* Calculates and returns how much you would gain from selling a given number of shares of a stock.
|
||||
@ -1194,8 +1400,7 @@ interface TIX {
|
||||
* @param {string} posType Specifies whether the order is a “Long” or “Short” position.
|
||||
* @returns {number} Gain from selling a given number of shares of a stock.
|
||||
*/
|
||||
getSaleGain (sym: StockSymbol, shares: Number, posType: OrderPos): number;
|
||||
|
||||
getSaleGain(sym: StockSymbol, shares: number, posType: OrderPos): number;
|
||||
|
||||
/**
|
||||
* Attempts to purchase shares of a stock using a Market Order.
|
||||
@ -1292,13 +1497,7 @@ interface TIX {
|
||||
* @param {string} pos Specifies whether the order is a “Long” or “Short” position.
|
||||
* @returns {boolean} True if the order is successfully placed, and false otherwise.
|
||||
*/
|
||||
placeOrder (
|
||||
sym: StockSymbol,
|
||||
shares: number,
|
||||
price: number,
|
||||
type: OrderType,
|
||||
pos: OrderPos,
|
||||
): boolean;
|
||||
placeOrder(sym: StockSymbol, shares: number, price: number, type: OrderType, pos: OrderPos): boolean;
|
||||
|
||||
/**
|
||||
* Cancels an oustanding Limit or Stop order on the stock market.
|
||||
@ -1313,13 +1512,7 @@ interface TIX {
|
||||
* @param {string} type Type of order.
|
||||
* @param {string} pos Specifies whether the order is a “Long” or “Short” position.
|
||||
*/
|
||||
cancelOrder (
|
||||
sym: StockSymbol,
|
||||
shares: number,
|
||||
price: number,
|
||||
type: OrderType,
|
||||
pos: OrderPos,
|
||||
): void;
|
||||
cancelOrder(sym: StockSymbol, shares: number, price: number, type: OrderType, pos: OrderPos): void;
|
||||
|
||||
/**
|
||||
* Returns your order book for the stock market.
|
||||
@ -1458,10 +1651,7 @@ interface Singularity {
|
||||
* @param {string} courseName Name of course.
|
||||
* @returns {boolean} True if actions is successfully started, false otherwise.
|
||||
*/
|
||||
universityCourse (
|
||||
universityName: University,
|
||||
courseName: UniversityCourse,
|
||||
): boolean;
|
||||
universityCourse(universityName: University, courseName: UniversityCourse): boolean;
|
||||
|
||||
/**
|
||||
* If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to use this function and the RAM cost is doubled.
|
||||
@ -2288,7 +2478,7 @@ interface BladeBurner {
|
||||
*/
|
||||
startAction(
|
||||
type: BladeburnerActTypes,
|
||||
name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps
|
||||
name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps,
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
@ -2326,7 +2516,7 @@ interface BladeBurner {
|
||||
*/
|
||||
getActionTime(
|
||||
type: BladeburnerActTypes,
|
||||
name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps
|
||||
name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps,
|
||||
): number;
|
||||
|
||||
/**
|
||||
@ -2344,7 +2534,7 @@ interface BladeBurner {
|
||||
*/
|
||||
getActionEstimatedSuccessChance(
|
||||
type: BladeburnerActTypes,
|
||||
name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps
|
||||
name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps,
|
||||
): number;
|
||||
|
||||
/**
|
||||
@ -2364,7 +2554,7 @@ interface BladeBurner {
|
||||
getActionRepGain(
|
||||
type: BladeburnerActTypes,
|
||||
name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps,
|
||||
level: number
|
||||
level: number,
|
||||
): number;
|
||||
|
||||
/**
|
||||
@ -2385,7 +2575,7 @@ interface BladeBurner {
|
||||
*/
|
||||
getActionCountRemaining(
|
||||
type: BladeburnerActTypes,
|
||||
name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps
|
||||
name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps,
|
||||
): number;
|
||||
|
||||
/**
|
||||
@ -2403,7 +2593,7 @@ interface BladeBurner {
|
||||
*/
|
||||
getActionMaxLevel(
|
||||
type: BladeburnerActTypes,
|
||||
name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps
|
||||
name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps,
|
||||
): number;
|
||||
|
||||
/**
|
||||
@ -2421,7 +2611,7 @@ interface BladeBurner {
|
||||
*/
|
||||
getActionCurrentLevel(
|
||||
type: BladeburnerActTypes,
|
||||
name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps
|
||||
name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps,
|
||||
): number;
|
||||
|
||||
/**
|
||||
@ -2439,7 +2629,7 @@ interface BladeBurner {
|
||||
*/
|
||||
getActionAutolevel(
|
||||
type: BladeburnerActTypes,
|
||||
name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps
|
||||
name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps,
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
@ -2456,7 +2646,7 @@ interface BladeBurner {
|
||||
setActionAutolevel(
|
||||
type: BladeburnerActTypes,
|
||||
name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps,
|
||||
autoLevel: boolean
|
||||
autoLevel: boolean,
|
||||
): void;
|
||||
|
||||
/**
|
||||
@ -2473,7 +2663,7 @@ interface BladeBurner {
|
||||
setActionLevel(
|
||||
type: BladeburnerActTypes,
|
||||
name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps,
|
||||
level: number
|
||||
level: number,
|
||||
): void;
|
||||
|
||||
/**
|
||||
@ -2569,7 +2759,7 @@ interface BladeBurner {
|
||||
*/
|
||||
getTeamSize(
|
||||
type: BladeburnerActTypes,
|
||||
name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps
|
||||
name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps,
|
||||
): number;
|
||||
|
||||
/**
|
||||
@ -2589,7 +2779,7 @@ interface BladeBurner {
|
||||
setTeamSize(
|
||||
type: BladeburnerActTypes,
|
||||
name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps,
|
||||
size: number
|
||||
size: number,
|
||||
): number;
|
||||
|
||||
/**
|
||||
@ -2732,11 +2922,7 @@ interface CodingContract {
|
||||
* @param {string} [host] Host or IP of the server containing the contract. Optional. Defaults to current server if not provided.
|
||||
* @returns {boolean} True if the solution was correct, false otherwise.
|
||||
*/
|
||||
attempt (
|
||||
answer: string | string[] | number,
|
||||
fn: string,
|
||||
host?: Host
|
||||
): boolean;
|
||||
attempt(answer: string | string[] | number, fn: string, host?: Host): boolean;
|
||||
|
||||
/**
|
||||
* Attempts to solve the Coding Contract with the provided solution.
|
||||
@ -2748,12 +2934,7 @@ interface CodingContract {
|
||||
* @param {object} [opts] Optional parameters for configuring function behavior.
|
||||
* @returns {boolean} True if the solution was correct, false otherwise. If the returnReward option is configured, then the function will instead return a string. If the contract is successfully solved, the string will contain a description of the contract’s reward. Otherwise, it will be an empty string.
|
||||
*/
|
||||
attempt (
|
||||
answer: string | string[] | number,
|
||||
fn: string,
|
||||
host?: Host,
|
||||
opts?: CodingAttemptOptions
|
||||
): boolean | string;
|
||||
attempt(answer: string | string[] | number, fn: string, host?: Host, opts?: CodingAttemptOptions): boolean | string;
|
||||
|
||||
/**
|
||||
* Returns a name describing the type of problem posed by the Coding Contract.
|
||||
@ -2800,7 +2981,6 @@ interface CodingContract {
|
||||
}
|
||||
|
||||
interface Gang {
|
||||
|
||||
/**
|
||||
* If you are not in BitNode-2, then you must have Source-File 2 in order to use this function.
|
||||
*
|
||||
@ -2933,9 +3113,7 @@ interface Gang {
|
||||
* @param {string} equipName Name of equipment.
|
||||
* @returns {number} Type of the equipment.
|
||||
*/
|
||||
getEquipmentType (
|
||||
equipName: GangEquipment | GangAugmentations
|
||||
): GangEquipmentType;
|
||||
getEquipmentType(equipName: GangEquipment | GangAugmentations): GangEquipmentType;
|
||||
|
||||
/**
|
||||
* If you are not in BitNode-2, then you must have Source-File 2 in order to use this function.
|
||||
@ -2946,9 +3124,7 @@ interface Gang {
|
||||
* @param {string} equipName Name of equipment.
|
||||
* @returns {object} A dictionary containing the stats of the equipment.
|
||||
*/
|
||||
getEquipmentStats (
|
||||
equipName: GangEquipment | GangAugmentations
|
||||
): GangEquipmentStats;
|
||||
getEquipmentStats(equipName: GangEquipment | GangAugmentations): GangEquipmentStats;
|
||||
|
||||
/**
|
||||
* If you are not in BitNode-2, then you must have Source-File 2 in order to use this function.
|
||||
@ -3187,8 +3363,7 @@ interface Sleeve {
|
||||
purchaseSleeveAug(sleeveNumber: number, augName: AugmentName): boolean;
|
||||
}
|
||||
|
||||
interface NS extends Singularity {
|
||||
|
||||
export interface NS extends Singularity {
|
||||
/**
|
||||
* Not all functions in the Hacknet Node API are immediately available.
|
||||
*
|
||||
@ -3393,7 +3568,6 @@ interface NS extends Singularity {
|
||||
*/
|
||||
growthAnalyze(host: Host, growthAmount: number): number;
|
||||
|
||||
|
||||
/**
|
||||
* Returns the security increase that would occur if a grow with this many threads happened.
|
||||
*
|
||||
@ -3650,11 +3824,7 @@ interface NS extends Singularity {
|
||||
* @param {...string} [args] Additional arguments to pass into the new script that is being run. Note that if any arguments are being passed into the new script, then the second argument numThreads must be filled in with a value.
|
||||
* @returns {number} Returns the PID of a successfully started script, and 0 otherwise.
|
||||
*/
|
||||
run (
|
||||
script: Script,
|
||||
numThreads?: number,
|
||||
...args: string[]
|
||||
): number;
|
||||
run(script: Script, numThreads?: number, ...args: string[]): number;
|
||||
|
||||
/**
|
||||
* Run a script as a separate process on a specified server. This is similar to the run function
|
||||
@ -3691,12 +3861,7 @@ interface NS extends Singularity {
|
||||
* @param {...string} [args] Additional arguments to pass into the new script that is being run. Note that if any arguments are being passed into the new script, then the third argument numThreads must be filled in with a value.
|
||||
* @returns {number} Returns the PID of a successfully started script, and 0 otherwise.
|
||||
*/
|
||||
exec (
|
||||
script: Script,
|
||||
host: Host,
|
||||
numThreads?: number,
|
||||
...args: string[]
|
||||
): number;
|
||||
exec(script: Script, host: Host, numThreads?: number, ...args: string[]): number;
|
||||
|
||||
/**
|
||||
* Terminates the current script, and then after a delay of about 10 seconds it will execute the
|
||||
@ -3823,9 +3988,9 @@ interface NS extends Singularity {
|
||||
*/
|
||||
scp(
|
||||
files: string | ReadonlyArray<string>,
|
||||
source: | Host,
|
||||
source: Host,
|
||||
// tslint:disable-next-line:unified-signatures
|
||||
destination: Host
|
||||
destination: Host,
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
@ -3933,7 +4098,6 @@ interface NS extends Singularity {
|
||||
*/
|
||||
getServer(host?: Host): Server;
|
||||
|
||||
|
||||
/**
|
||||
* Returns the amount of money available on a server.
|
||||
* Running this function on the home computer will return the player’s money.
|
||||
@ -4537,5 +4701,3 @@ interface NS extends Singularity {
|
||||
*/
|
||||
getBitNodeMultipliers(url: string, target: string, host: string): BitNodeMultipliers;
|
||||
}
|
||||
|
||||
`;
|
||||
|
4
src/ScriptEditor/raw-loader.d.ts
vendored
Normal file
4
src/ScriptEditor/raw-loader.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
declare module "!!raw-loader!*" {
|
||||
const contents: { default: string };
|
||||
export = contents;
|
||||
}
|
@ -15,7 +15,7 @@ import { calculateRamUsage } from "../../Script/RamCalculations";
|
||||
import { RamCalculationErrorCode } from "../../Script/RamCalculationErrorCodes";
|
||||
import { numeralWrapper } from "../../ui/numeralFormat";
|
||||
import { CursorPositions } from "../CursorPositions";
|
||||
import { libSource } from "../NetscriptDefinitions";
|
||||
|
||||
import { NetscriptFunctions } from "../../NetscriptFunctions";
|
||||
import { WorkerScript } from "../../Netscript/WorkerScript";
|
||||
import { Settings } from "../../Settings/Settings";
|
||||
@ -32,6 +32,8 @@ import TextField from "@mui/material/TextField";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import SettingsIcon from "@mui/icons-material/Settings";
|
||||
|
||||
import libSource from "!!raw-loader!../NetscriptDefinitions";
|
||||
|
||||
let symbolsLoaded = false;
|
||||
let symbols: string[] = [];
|
||||
export function SetupTextEditor(): void {
|
||||
@ -327,8 +329,9 @@ export function Root(props: IProps): React.ReactElement {
|
||||
l.language.tokenizer.root.unshift(["this", { token: "this" }]);
|
||||
})();
|
||||
|
||||
monaco.languages.typescript.javascriptDefaults.addExtraLib(libSource, "netscript.d.ts");
|
||||
monaco.languages.typescript.typescriptDefaults.addExtraLib(libSource, "netscript.d.ts");
|
||||
const source = (libSource + "").replace(/export /g, "");
|
||||
monaco.languages.typescript.javascriptDefaults.addExtraLib(source, "netscript.d.ts");
|
||||
monaco.languages.typescript.typescriptDefaults.addExtraLib(source, "netscript.d.ts");
|
||||
loadThemes(monaco);
|
||||
}
|
||||
// 370px 71%, 725px 85.1%, 1085px 90%, 1300px 91.7%
|
||||
|
@ -9,7 +9,7 @@
|
||||
"target": "es6",
|
||||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"types": ["cypress", "@testing-library/cypress", "node"]
|
||||
"types": ["cypress", "@testing-library/cypress", "node", "raw-loader.d.ts"]
|
||||
},
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user