Improved module import styling for all top-level src files

This commit is contained in:
danielyxie 2019-04-11 01:37:40 -07:00 committed by danielyxie
parent 3b6b37f8a6
commit df89cc5002
27 changed files with 751 additions and 629 deletions

@ -1,35 +1,38 @@
import {workerScripts, // TODO - Convert this to React
killWorkerScript} from "./NetscriptWorker"; import { workerScripts, killWorkerScript } from "./NetscriptWorker";
import { Player } from "./Player"; import { Player } from "./Player";
import { getServer } from "./Server/ServerHelpers"; import { getServer } from "./Server/ServerHelpers";
import {numeralWrapper} from "./ui/numeralFormat";
import {dialogBoxCreate} from "../utils/DialogBox";
import {createAccordionElement} from "../utils/uiHelpers/createAccordionElement";
import {arrayToString} from "../utils/helpers/arrayToString";
import {createElement} from "../utils/uiHelpers/createElement";
import {createProgressBarText} from "../utils/helpers/createProgressBarText";
import {exceptionAlert} from "../utils/helpers/exceptionAlert";
import {getElementById} from "../utils/uiHelpers/getElementById";
import {logBoxCreate} from "../utils/LogBox";
import {formatNumber,
convertTimeMsToTimeElapsedString } from "../utils/StringHelperFunctions";
import {removeChildrenFromElement} from "../utils/uiHelpers/removeChildrenFromElement";
import {removeElement} from "../utils/uiHelpers/removeElement";
import {roundToTwo} from "../utils/helpers/roundToTwo";
import {Page, routing} from "./ui/navigationTracking";
/* { import { Page, routing } from "./ui/navigationTracking";
* serverName: { import { numeralWrapper } from "./ui/numeralFormat";
* header: Server Header Element
* panel: Server Panel List (ul) element import { dialogBoxCreate } from "../utils/DialogBox";
* scripts: { import { logBoxCreate } from "../utils/LogBox";
* script id: Ref to Script information import { convertTimeMsToTimeElapsedString } from "../utils/StringHelperFunctions";
* } import { arrayToString } from "../utils/helpers/arrayToString";
* } import { createProgressBarText } from "../utils/helpers/createProgressBarText";
* ... import { exceptionAlert } from "../utils/helpers/exceptionAlert";
import { roundToTwo } from "../utils/helpers/roundToTwo";
import { createAccordionElement } from "../utils/uiHelpers/createAccordionElement";
import { createElement } from "../utils/uiHelpers/createElement";
import { getElementById } from "../utils/uiHelpers/getElementById";
import { removeChildrenFromElement } from "../utils/uiHelpers/removeChildrenFromElement";
import { removeElement } from "../utils/uiHelpers/removeElement";
/**
* {
* serverName: {
* header: Server Header Element
* panel: Server Panel List (ul) element
* scripts: {
* script id: Ref to Script information
* }
* }
* ...
*/ */
let ActiveScriptsUI = {}; const ActiveScriptsUI = {};
let ActiveScriptsTasks = []; //Sequentially schedule the creation/deletion of UI elements const ActiveScriptsTasks = []; //Sequentially schedule the creation/deletion of UI elements
const getHeaderHtml = (server) => { const getHeaderHtml = (server) => {
// TODO: calculate the longest hostname length rather than hard coding it // TODO: calculate the longest hostname length rather than hard coding it

@ -1,5 +1,5 @@
import { IMap } from "./types"; import { IMap } from "./types";
import { post } from "./ui/postToTerminal"; import { post } from "./ui/postToTerminal";
export let Aliases: IMap<string> = {}; export let Aliases: IMap<string> = {};
export let GlobalAliases: IMap<string> = {}; export let GlobalAliases: IMap<string> = {};

@ -1,34 +1,40 @@
import { Augmentations } from "./Augmentation/Augmentations"; import { Augmentations } from "./Augmentation/Augmentations";
import { AugmentationNames } from "./Augmentation/data/AugmentationNames"; import { AugmentationNames } from "./Augmentation/data/AugmentationNames";
import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers"; import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers";
import { CONSTANTS } from "./Constants"; import { CONSTANTS } from "./Constants";
import { Engine } from "./engine"; import { Engine } from "./engine";
import { Faction } from "./Faction/Faction"; import { Faction } from "./Faction/Faction";
import { Factions, factionExists } from "./Faction/Factions"; import { Factions, factionExists } from "./Faction/Factions";
import { joinFaction, displayFactionContent } from "./Faction/FactionHelpers"; import { joinFaction, displayFactionContent } from "./Faction/FactionHelpers";
import { Player } from "./Player"; import { Player } from "./Player";
import { hackWorldDaemon, redPillFlag } from "./RedPill"; import { hackWorldDaemon, redPillFlag } from "./RedPill";
import { numeralWrapper } from "./ui/numeralFormat";
import { setTimeoutRef } from "./utils/SetTimeoutRef";
import { KEY } from "../utils/helpers/keyCodes";
import { createProgressBarText } from "../utils/helpers/createProgressBarText"; import { Page, routing } from "./ui/navigationTracking";
import { dialogBoxCreate } from "../utils/DialogBox"; import { numeralWrapper } from "./ui/numeralFormat";
import { removeChildrenFromElement } from "../utils/uiHelpers/removeChildrenFromElement";
import { Reviver, Generic_toJSON, import { dialogBoxCreate } from "../utils/DialogBox";
Generic_fromJSON } from "../utils/JSONReviver"; import {
import { addOffset } from "../utils/helpers/addOffset"; Reviver,
import { appendLineBreaks } from "../utils/uiHelpers/appendLineBreaks"; Generic_toJSON,
import { clearObject } from "../utils/helpers/clearObject"; Generic_fromJSON
import { createElement } from "../utils/uiHelpers/createElement"; } from "../utils/JSONReviver";
import { createPopup } from "../utils/uiHelpers/createPopup"; import { setTimeoutRef } from "./utils/SetTimeoutRef";
import { Page, routing } from "./ui/navigationTracking"; import { formatNumber } from "../utils/StringHelperFunctions";
import { exceptionAlert } from "../utils/helpers/exceptionAlert";
import { formatNumber } from "../utils/StringHelperFunctions"; import { addOffset } from "../utils/helpers/addOffset";
import { getRandomInt } from "../utils/helpers/getRandomInt"; import { clearObject } from "../utils/helpers/clearObject";
import { getTimestamp } from "../utils/helpers/getTimestamp"; import { createProgressBarText } from "../utils/helpers/createProgressBarText";
import { removeElement } from "../utils/uiHelpers/removeElement"; import { exceptionAlert } from "../utils/helpers/exceptionAlert";
import { removeElementById } from "../utils/uiHelpers/removeElementById"; import { getRandomInt } from "../utils/helpers/getRandomInt";
import { getTimestamp } from "../utils/helpers/getTimestamp";
import { KEY } from "../utils/helpers/keyCodes";
import { removeChildrenFromElement } from "../utils/uiHelpers/removeChildrenFromElement";
import { appendLineBreaks } from "../utils/uiHelpers/appendLineBreaks";
import { createElement } from "../utils/uiHelpers/createElement";
import { createPopup } from "../utils/uiHelpers/createPopup";
import { removeElement } from "../utils/uiHelpers/removeElement";
import { removeElementById } from "../utils/uiHelpers/removeElementById";
const stealthIcon = `<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" viewBox="0 0 166 132" style="fill:#adff2f;"><g><path d="M132.658-0.18l-24.321,24.321c-7.915-2.71-16.342-4.392-25.087-4.392c-45.84,0-83,46-83,46 s14.1,17.44,35.635,30.844L12.32,120.158l12.021,12.021L144.68,11.841L132.658-0.18z M52.033,80.445 c-2.104-4.458-3.283-9.438-3.283-14.695c0-19.054,15.446-34.5,34.5-34.5c5.258,0,10.237,1.179,14.695,3.284L52.033,80.445z"/><path d="M134.865,37.656l-18.482,18.482c0.884,3.052,1.367,6.275,1.367,9.612c0,19.055-15.446,34.5-34.5,34.5 c-3.337,0-6.56-0.483-9.611-1.367l-10.124,10.124c6.326,1.725,12.934,2.743,19.735,2.743c45.84,0,83-46,83-46 S153.987,50.575,134.865,37.656z"/></g></svg>&nbsp;` const stealthIcon = `<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" viewBox="0 0 166 132" style="fill:#adff2f;"><g><path d="M132.658-0.18l-24.321,24.321c-7.915-2.71-16.342-4.392-25.087-4.392c-45.84,0-83,46-83,46 s14.1,17.44,35.635,30.844L12.32,120.158l12.021,12.021L144.68,11.841L132.658-0.18z M52.033,80.445 c-2.104-4.458-3.283-9.438-3.283-14.695c0-19.054,15.446-34.5,34.5-34.5c5.258,0,10.237,1.179,14.695,3.284L52.033,80.445z"/><path d="M134.865,37.656l-18.482,18.482c0.884,3.052,1.367,6.275,1.367,9.612c0,19.055-15.446,34.5-34.5,34.5 c-3.337,0-6.56-0.483-9.611-1.367l-10.124,10.124c6.326,1.725,12.934,2.743,19.735,2.743c45.84,0,83-46,83-46 S153.987,50.575,134.865,37.656z"/></g></svg>&nbsp;`
const killIcon = `<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" viewBox="-22 0 511 511.99561" style="fill:#adff2f;"><path d="m.496094 466.242188 39.902344-39.902344 45.753906 45.753906-39.898438 39.902344zm0 0"/><path d="m468.421875 89.832031-1.675781-89.832031-300.265625 300.265625 45.753906 45.753906zm0 0"/><path d="m95.210938 316.785156 16.84375 16.847656h.003906l83.65625 83.65625 22.753906-22.753906-100.503906-100.503906zm0 0"/><path d="m101.445312 365.300781-39.902343 39.902344 45.753906 45.753906 39.902344-39.902343-39.90625-39.902344zm0 0"/></svg>` const killIcon = `<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" viewBox="-22 0 511 511.99561" style="fill:#adff2f;"><path d="m.496094 466.242188 39.902344-39.902344 45.753906 45.753906-39.898438 39.902344zm0 0"/><path d="m468.421875 89.832031-1.675781-89.832031-300.265625 300.265625 45.753906 45.753906zm0 0"/><path d="m95.210938 316.785156 16.84375 16.847656h.003906l83.65625 83.65625 22.753906-22.753906-100.503906-100.503906zm0 0"/><path d="m101.445312 365.300781-39.902343 39.902344 45.753906 45.753906 39.902344-39.902343-39.90625-39.902344zm0 0"/></svg>`

@ -1,29 +1,29 @@
import {Engine} from "./engine"; import { Engine } from "./engine";
import { setTimeoutRef } from "./utils/SetTimeoutRef"; import { setTimeoutRef } from "./utils/SetTimeoutRef";
import {removeChildrenFromElement} from "../utils/uiHelpers/removeChildrenFromElement"; import { removeChildrenFromElement } from "../utils/uiHelpers/removeChildrenFromElement";
import {createElement} from "../utils/uiHelpers/createElement"; import { createElement } from "../utils/uiHelpers/createElement";
import {exceptionAlert} from "../utils/helpers/exceptionAlert"; import { exceptionAlert } from "../utils/helpers/exceptionAlert";
import {isString} from "../utils/helpers/isString"; import { isString } from "../utils/helpers/isString";
var cinematicTextFlag = false; export let cinematicTextFlag = false;
//Lines must be an array of strings // Lines must be an array of strings
function writeCinematicText(lines) { export function writeCinematicText(lines) {
cinematicTextFlag = true; cinematicTextFlag = true;
if (lines.constructor !== Array) { if (lines.constructor !== Array) {
throw new Error("Invalid non-array argument passed into writeCinematicText()"); throw new Error("Invalid non-array argument passed into writeCinematicText()");
} }
//We'll reuse the 'Red Pill' content // Reuse the 'Red Pill' content
Engine.loadCinematicTextContent(); Engine.loadCinematicTextContent();
var container = document.getElementById("cinematic-text-container"); const container = document.getElementById("cinematic-text-container");
container.style.width = "75%"; container.style.width = "75%";
if (container == null) {throw new Error("Could not find cinematic-text-container for writeCinematicText()");} if (container == null) {throw new Error("Could not find cinematic-text-container for writeCinematicText()");}
removeChildrenFromElement(container); removeChildrenFromElement(container);
for (var i = 0; i < lines.length; ++i) { for (let i = 0; i < lines.length; ++i) {
if (!isString(lines[i])) { if (!isString(lines[i])) {
throw new Error("Invalid non-string element in 'lines' argument. writeCinematicText() failed"); throw new Error("Invalid non-string element in 'lines' argument. writeCinematicText() failed");
} }
@ -45,11 +45,11 @@ function writeCinematicTextRecurse(lines, lineNumber=0) {
function writeCinematicTextLine(line) { function writeCinematicTextLine(line) {
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
var container = document.getElementById("cinematic-text-container"); const container = document.getElementById("cinematic-text-container");
var pElem = document.createElement("p"); const pElem = document.createElement("p");
container.appendChild(pElem); container.appendChild(pElem);
var promise = writeCinematicTextLetter(pElem, line, 0); const promise = writeCinematicTextLetter(pElem, line, 0);
promise.then(function(res) { promise.then(function(res) {
resolve(res); resolve(res);
}, function(e) { }, function(e) {
@ -61,14 +61,15 @@ function writeCinematicTextLine(line) {
function writeCinematicTextLetter(pElem, line, i=0) { function writeCinematicTextLetter(pElem, line, i=0) {
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
setTimeoutRef(function() { setTimeoutRef(function() {
const textToShow = line.substring(0, i);
if (i >= line.length) { if (i >= line.length) {
var textToShow = line.substring(0, i);
pElem.innerHTML = textToShow; pElem.innerHTML = textToShow;
return resolve(true); return resolve(true);
} }
var textToShow = line.substring(0, i);
pElem.innerHTML = textToShow + "<span class='typed-cursor'> &#9608; </span>"; pElem.innerHTML = textToShow + "<span class='typed-cursor'> &#9608; </span>";
var promise = writeCinematicTextLetter(pElem, line, i+1); const promise = writeCinematicTextLetter(pElem, line, i+1);
promise.then(function(res) { promise.then(function(res) {
resolve(res); resolve(res);
}, function(e) { }, function(e) {
@ -96,5 +97,3 @@ function cinematicTextEnd() {
})); }));
}); });
} }
export {cinematicTextFlag, writeCinematicText};

@ -1,12 +1,15 @@
import { CodingContract, import {
CodingContractRewardType, CodingContract,
CodingContractTypes } from "./CodingContracts"; CodingContractRewardType,
import { Factions } from "./Faction/Factions"; CodingContractTypes
import { Player } from "./Player"; } from "./CodingContracts";
import { AllServers } from "./Server/AllServers"; import { Factions } from "./Faction/Factions";
import { GetServerByHostname } from "./Server/ServerHelpers"; import { Player } from "./Player";
import { AllServers } from "./Server/AllServers";
import { GetServerByHostname } from "./Server/ServerHelpers";
import { getRandomInt } from "../utils/helpers/getRandomInt";
import { getRandomInt } from "../utils/helpers/getRandomInt";
export function generateRandomContract() { export function generateRandomContract() {
// First select a random problem type // First select a random problem type

@ -1,11 +1,17 @@
import { codingContractTypesMetadata, import {
DescriptionFunc, codingContractTypesMetadata,
GeneratorFunc, DescriptionFunc,
SolverFunc } from "./data/codingcontracttypes"; GeneratorFunc,
SolverFunc
} from "./data/codingcontracttypes";
import { IMap } from "./types"; import { IMap } from "./types";
import { Generic_fromJSON, Generic_toJSON, Reviver } from "../utils/JSONReviver"; import {
Generic_fromJSON,
Generic_toJSON,
Reviver
} from "../utils/JSONReviver";
import { KEY } from "../utils/helpers/keyCodes"; import { KEY } from "../utils/helpers/keyCodes";
import { createElement } from "../utils/uiHelpers/createElement"; import { createElement } from "../utils/uiHelpers/createElement";
import { createPopup } from "../utils/uiHelpers/createPopup"; import { createPopup } from "../utils/uiHelpers/createPopup";
@ -13,6 +19,7 @@ import { removeElementById } from "../utils/uiHelpers/removeElementById";
/* tslint:disable:no-magic-numbers completed-docs max-classes-per-file no-console */ /* tslint:disable:no-magic-numbers completed-docs max-classes-per-file no-console */
/* Represents different types of problems that a Coding Contract can have */ /* Represents different types of problems that a Coding Contract can have */

@ -3,7 +3,7 @@
* *
* Constants for specific mechanics or features will NOT be here. * Constants for specific mechanics or features will NOT be here.
*/ */
import {IMap} from "./types"; import { IMap } from "./types";
export let CONSTANTS: IMap<any> = { export let CONSTANTS: IMap<any> = {
Version: "0.46.1", Version: "0.46.1",

@ -1,33 +1,35 @@
import { AugmentationNames } from "./Augmentation/data/AugmentationNames"; import { AugmentationNames } from "./Augmentation/data/AugmentationNames";
import { CodingContractTypes } from "./CodingContracts"; import { CodingContractTypes } from "./CodingContracts";
import { generateContract, import {
generateRandomContract, generateContract,
generateRandomContractOnHome } from "./CodingContractGenerator"; generateRandomContract,
import { Companies } from "./Company/Companies"; generateRandomContractOnHome
import { Company } from "./Company/Company"; } from "./CodingContractGenerator";
import { Programs } from "./Programs/Programs"; import { Companies } from "./Company/Companies";
import { Factions } from "./Faction/Factions"; import { Company } from "./Company/Company";
import { Player } from "./Player"; import { Programs } from "./Programs/Programs";
import { PlayerOwnedSourceFile } from "./SourceFile/PlayerOwnedSourceFile"; import { Factions } from "./Faction/Factions";
import { AllServers } from "./Server/AllServers"; import { Player } from "./Player";
import { GetServerByHostname } from "./Server/ServerHelpers"; import { PlayerOwnedSourceFile } from "./SourceFile/PlayerOwnedSourceFile";
import { hackWorldDaemon } from "./RedPill"; import { AllServers } from "./Server/AllServers";
import { StockMarket, import { GetServerByHostname } from "./Server/ServerHelpers";
SymbolToStockMap } from "./StockMarket/StockMarket"; import { hackWorldDaemon } from "./RedPill";
import { Stock } from "./StockMarket/Stock"; import { StockMarket, SymbolToStockMap } from "./StockMarket/StockMarket";
import { Terminal } from "./Terminal"; import { Stock } from "./StockMarket/Stock";
import { Terminal } from "./Terminal";
import { numeralWrapper } from "./ui/numeralFormat"; import { numeralWrapper } from "./ui/numeralFormat";
import { dialogBoxCreate } from "../utils/DialogBox"; import { dialogBoxCreate } from "../utils/DialogBox";
import { exceptionAlert } from "../utils/helpers/exceptionAlert"; import { exceptionAlert } from "../utils/helpers/exceptionAlert";
import { createElement } from "../utils/uiHelpers/createElement"; import { createElement } from "../utils/uiHelpers/createElement";
import { createOptionElement } from "../utils/uiHelpers/createOptionElement"; import { createOptionElement } from "../utils/uiHelpers/createOptionElement";
import { getSelectText } from "../utils/uiHelpers/getSelectData"; import { getSelectText } from "../utils/uiHelpers/getSelectData";
import { removeElementById } from "../utils/uiHelpers/removeElementById"; import { removeElementById } from "../utils/uiHelpers/removeElementById";
import React from "react"; import React from "react";
import ReactDOM from "react-dom"; import ReactDOM from "react-dom";
const Component = React.Component; const Component = React.Component;

@ -3,29 +3,36 @@ Also add police clashes
balance point to keep them from running out of control balance point to keep them from running out of control
*/ */
import { gangMemberTasksMetadata } from "./data/gangmembertasks"; import { gangMemberTasksMetadata } from "./data/gangmembertasks";
import { gangMemberUpgradesMetadata } from "./data/gangmemberupgrades"; import { gangMemberUpgradesMetadata } from "./data/gangmemberupgrades";
import { Engine } from "./engine";
import { Faction } from "./Faction/Faction";
import { Factions } from "./Faction/Factions";
import { displayFactionContent } from "./Faction/FactionHelpers";
import { Page, routing } from "./ui/navigationTracking";
import { numeralWrapper } from "./ui/numeralFormat";
import { dialogBoxCreate } from "../utils/DialogBox";
import {
Reviver,
Generic_toJSON,
Generic_fromJSON
} from "../utils/JSONReviver";
import { formatNumber } from "../utils/StringHelperFunctions";
import { exceptionAlert } from "../utils/helpers/exceptionAlert";
import { getRandomInt } from "../utils/helpers/getRandomInt";
import { KEY } from "../utils/helpers/keyCodes";
import { createAccordionElement } from "../utils/uiHelpers/createAccordionElement";
import { createElement } from "../utils/uiHelpers/createElement";
import { createPopup } from "../utils/uiHelpers/createPopup";
import { removeChildrenFromElement } from "../utils/uiHelpers/removeChildrenFromElement";
import { removeElement } from "../utils/uiHelpers/removeElement";
import { removeElementById } from "../utils/uiHelpers/removeElementById";
import { Engine } from "./engine";
import { Faction } from "./Faction/Faction";
import { Factions } from "./Faction/Factions";
import { displayFactionContent } from "./Faction/FactionHelpers";
import { numeralWrapper } from "./ui/numeralFormat";
import { dialogBoxCreate } from "../utils/DialogBox";
import { Reviver, Generic_toJSON,
Generic_fromJSON } from "../utils/JSONReviver";
import { KEY } from "../utils/helpers/keyCodes";
import { createAccordionElement } from "../utils/uiHelpers/createAccordionElement";
import { createElement } from "../utils/uiHelpers/createElement";
import { createPopup } from "../utils/uiHelpers/createPopup";
import { Page,
routing } from "./ui/navigationTracking";
import { formatNumber } from "../utils/StringHelperFunctions";
import { exceptionAlert } from "../utils/helpers/exceptionAlert";
import { getRandomInt } from "../utils/helpers/getRandomInt";
import { removeChildrenFromElement } from "../utils/uiHelpers/removeChildrenFromElement";
import { removeElement } from "../utils/uiHelpers/removeElement";
import { removeElementById } from "../utils/uiHelpers/removeElementById";
// Constants // Constants
const GangRespectToReputationRatio = 5; // Respect is divided by this to get rep gain const GangRespectToReputationRatio = 5; // Respect is divided by this to get rep gain

@ -1,30 +1,12 @@
import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers"; import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers";
import { CONSTANTS } from "./Constants"; import { CONSTANTS } from "./Constants";
import { Engine } from "./engine"; import { Engine } from "./engine";
import { Player } from "./Player"; import { Player } from "./Player";
import { dialogBoxCreate } from "../utils/DialogBox"; import { dialogBoxCreate } from "../utils/DialogBox";
import { clearEventListeners } from "../utils/uiHelpers/clearEventListeners"; import { clearEventListeners } from "../utils/uiHelpers/clearEventListeners";
import { getRandomInt } from "../utils/helpers/getRandomInt"; import { getRandomInt } from "../utils/helpers/getRandomInt";
import { infiltrationBoxCreate } from "../utils/InfiltrationBox"; import { infiltrationBoxCreate } from "../utils/InfiltrationBox";
import { formatNumber } from "../utils/StringHelperFunctions"; import { formatNumber } from "../utils/StringHelperFunctions";
/* Infiltration.js
*
* Kill
* Knockout (nonlethal)
* Stealth Knockout (nonlethal)
* Assassinate
*
* Hack Security
* Destroy Security
* Sneak past Security
*
* Pick the locked door
*
* Bribe security
*
* Escape
*/
let InfiltrationScenarios = { let InfiltrationScenarios = {
Guards: "You see an armed security guard patrolling the area.", Guards: "You see an armed security guard patrolling the area.",

@ -1,12 +1,15 @@
import { Engine } from "./engine"; import { Engine } from "./engine";
import { Player } from "./Player"; import { Player } from "./Player";
import { Settings } from "./Settings/Settings"; import { Settings } from "./Settings/Settings";
import { initializeMainMenuLinks } from "./ui/MainMenu/Links";
import { exceptionAlert } from "../utils/helpers/exceptionAlert"; import { initializeMainMenuLinks } from "./ui/MainMenu/Links";
import { clearEventListeners } from "../utils/uiHelpers/clearEventListeners";
import { createElement } from "../utils/uiHelpers/createElement"; import { exceptionAlert } from "../utils/helpers/exceptionAlert";
import { createPopup } from "../utils/uiHelpers/createPopup"; import { clearEventListeners } from "../utils/uiHelpers/clearEventListeners";
import { removeElementById } from "../utils/uiHelpers/removeElementById"; import { createElement } from "../utils/uiHelpers/createElement";
import { createPopup } from "../utils/uiHelpers/createPopup";
import { removeElementById } from "../utils/uiHelpers/removeElementById";
//Ordered array of keys to Interactive Tutorial Steps //Ordered array of keys to Interactive Tutorial Steps
const orderedITutorialSteps = [ const orderedITutorialSteps = [

@ -1,4 +1,4 @@
import {dialogBoxCreate} from "../utils/DialogBox"; import { dialogBoxCreate } from "../utils/DialogBox";
/* Literature.js /* Literature.js
* Lore / world building literature that can be found on servers * Lore / world building literature that can be found on servers

@ -1,14 +1,19 @@
import { CONSTANTS } from "./Constants"; import { CONSTANTS } from "./Constants";
import { Engine } from "./engine"; import { Engine } from "./engine";
import { displayFactionContent } from "./Faction/FactionHelpers"; import { displayFactionContent } from "./Faction/FactionHelpers";
import { Player } from "./Player"; import { Player } from "./Player";
import { dialogBoxCreate } from "../utils/DialogBox";
import { clearEventListeners } from "../utils/uiHelpers/clearEventListeners"; import { dialogBoxCreate } from "../utils/DialogBox";
import { addOffset } from "../utils/helpers/addOffset"; import { formatNumber } from "../utils/StringHelperFunctions";
import { formatNumber } from "../utils/StringHelperFunctions";
import { getRandomInt } from "../utils/helpers/getRandomInt"; import { addOffset } from "../utils/helpers/addOffset";
import { isString } from "../utils/helpers/isString"; import { getRandomInt } from "../utils/helpers/getRandomInt";
import jsplumb from 'jsplumb' import { isString } from "../utils/helpers/isString";
import { clearEventListeners } from "../utils/uiHelpers/clearEventListeners";
import jsplumb from "jsplumb";
let inMission = false; //Flag to denote whether a mission is running let inMission = false; //Flag to denote whether a mission is running
let currMission = null; let currMission = null;

@ -1,6 +1,6 @@
import {Player} from "./Player"; import { Player } from "./Player";
import {Bladeburner} from "./Bladeburner"; import { Bladeburner } from "./Bladeburner";
import {makeRuntimeRejectMsg} from "./NetscriptEvaluator"; import { makeRuntimeRejectMsg } from "./NetscriptEvaluator";
function unknownBladeburnerActionErrorMessage(functionName, actionType, actionName) { function unknownBladeburnerActionErrorMessage(functionName, actionType, actionName) {
return `ERROR: bladeburner.${functionName}() failed due to an invalid action specified. ` + return `ERROR: bladeburner.${functionName}() failed due to an invalid action specified. ` +

@ -1,5 +1,5 @@
import {NetscriptFunctions} from "./NetscriptFunctions"; import { NetscriptFunctions } from "./NetscriptFunctions";
import {NetscriptPort} from "./NetscriptPort"; import { NetscriptPort } from "./NetscriptPort";
/* Environment /* Environment
* NetScript program environment * NetScript program environment

@ -1,21 +1,21 @@
import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers"; import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers";
import { CONSTANTS } from "./Constants"; import { CONSTANTS } from "./Constants";
import { Player } from "./Player"; import { Player } from "./Player";
import { Environment } from "./NetscriptEnvironment"; import { Environment } from "./NetscriptEnvironment";
import { WorkerScript, addWorkerScript} from "./NetscriptWorker"; import { WorkerScript, addWorkerScript } from "./NetscriptWorker";
import { Server } from "./Server/Server"; import { Server } from "./Server/Server";
import { getServer } from "./Server/ServerHelpers"; import { getServer } from "./Server/ServerHelpers";
import { Settings } from "./Settings/Settings"; import { Settings } from "./Settings/Settings";
import { RunningScript } from "./Script/RunningScript"; import { RunningScript } from "./Script/RunningScript";
import { Script } from "./Script/Script"; import { Script } from "./Script/Script";
import { findRunningScript } from "./Script/ScriptHelpers"; import { findRunningScript } from "./Script/ScriptHelpers";
import { setTimeoutRef } from "./utils/SetTimeoutRef"; import { setTimeoutRef } from "./utils/SetTimeoutRef";
import { parse, Node } from "../utils/acorn";
import {parse, Node} from "../utils/acorn"; import { arrayToString } from "../utils/helpers/arrayToString";
import {arrayToString} from "../utils/helpers/arrayToString"; import { isValidIPAddress } from "../utils/helpers/isValidIPAddress";
import {isValidIPAddress} from "../utils/helpers/isValidIPAddress"; import { isString } from "../utils/helpers/isString";
import {isString} from "../utils/helpers/isString";
export function evaluateImport(exp, workerScript, checkingRam=false) { export function evaluateImport(exp, workerScript, checkingRam=false) {
//When its checking RAM, it exports an array of nodes for each imported function //When its checking RAM, it exports an array of nodes for each imported function

@ -1,117 +1,149 @@
var sprintf = require('sprintf-js').sprintf, const sprintf = require("sprintf-js").sprintf;
vsprintf = require('sprintf-js').vsprintf const vsprintf = require("sprintf-js").vsprintf;
import {updateActiveScriptsItems} from "./ActiveScriptsUI"; import { updateActiveScriptsItems } from "./ActiveScriptsUI";
import { Augmentation } from "./Augmentation/Augmentation"; import { Augmentation } from "./Augmentation/Augmentation";
import { Augmentations } from "./Augmentation/Augmentations"; import { Augmentations } from "./Augmentation/Augmentations";
import { augmentationExists, import {
installAugmentations } from "./Augmentation/AugmentationHelpers"; augmentationExists,
import { AugmentationNames } from "./Augmentation/data/AugmentationNames"; installAugmentations
import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers"; } from "./Augmentation/AugmentationHelpers";
import { findCrime } from "./Crime/CrimeHelpers"; import { AugmentationNames } from "./Augmentation/data/AugmentationNames";
import {Bladeburner} from "./Bladeburner"; import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers";
import {Company} from "./Company/Company"; import { findCrime } from "./Crime/CrimeHelpers";
import {Companies, companyExists} from "./Company/Companies"; import { Bladeburner } from "./Bladeburner";
import {CompanyPosition} from "./Company/CompanyPosition"; import { Company } from "./Company/Company";
import {CompanyPositions} from "./Company/CompanyPositions"; import { Companies, companyExists } from "./Company/Companies";
import {CONSTANTS} from "./Constants"; import { CompanyPosition } from "./Company/CompanyPosition";
import { DarkWebItems } from "./DarkWeb/DarkWebItems"; import { CompanyPositions } from "./Company/CompanyPositions";
import {calculateHackingChance, import { CONSTANTS } from "./Constants";
calculateHackingExpGain, import { DarkWebItems } from "./DarkWeb/DarkWebItems";
calculatePercentMoneyHacked, import {
calculateHackingTime, calculateHackingChance,
calculateGrowTime, calculateHackingExpGain,
calculateWeakenTime} from "./Hacking"; calculatePercentMoneyHacked,
import {AllGangs} from "./Gang"; calculateHackingTime,
import { Faction } from "./Faction/Faction"; calculateGrowTime,
import { Factions, calculateWeakenTime
factionExists } from "./Faction/Factions"; } from "./Hacking";
import { joinFaction, import { AllGangs } from "./Gang";
purchaseAugmentation } from "./Faction/FactionHelpers"; import { Faction } from "./Faction/Faction";
import { FactionWorkType } from "./Faction/FactionWorkTypeEnum"; import { Factions, factionExists } from "./Faction/Factions";
import { netscriptCanGrow, import { joinFaction, purchaseAugmentation } from "./Faction/FactionHelpers";
netscriptCanHack, import { FactionWorkType } from "./Faction/FactionWorkTypeEnum";
netscriptCanWeaken } from "./Hacking/netscriptCanHack"; import {
netscriptCanGrow,
netscriptCanHack,
netscriptCanWeaken
} from "./Hacking/netscriptCanHack";
import { getCostOfNextHacknetNode, import {
getCostOfNextHacknetServer, getCostOfNextHacknetNode,
purchaseHacknet, getCostOfNextHacknetServer,
hasHacknetServers, purchaseHacknet,
purchaseHashUpgrade } from "./Hacknet/HacknetHelpers"; hasHacknetServers,
import { CityName } from "./Locations/data/CityNames"; purchaseHashUpgrade
import { LocationName } from "./Locations/data/LocationNames"; } from "./Hacknet/HacknetHelpers";
import { CityName } from "./Locations/data/CityNames";
import { LocationName } from "./Locations/data/LocationNames";
import { HacknetServer } from "./Hacknet/HacknetServer"; import { HacknetServer } from "./Hacknet/HacknetServer";
import { Message } from "./Message/Message"; import { Message } from "./Message/Message";
import { Messages } from "./Message/MessageHelpers"; import { Messages } from "./Message/MessageHelpers";
import {inMission} from "./Missions"; import { inMission } from "./Missions";
import {Player} from "./Player"; import { Player } from "./Player";
import { Programs } from "./Programs/Programs"; import { Programs } from "./Programs/Programs";
import { Script } from "./Script/Script"; import { Script } from "./Script/Script";
import { findRunningScript } from "./Script/ScriptHelpers"; import { findRunningScript } from "./Script/ScriptHelpers";
import { isScriptFilename } from "./Script/ScriptHelpersTS"; import { isScriptFilename } from "./Script/ScriptHelpersTS";
import { AllServers, import { AllServers, AddToAllServers } from "./Server/AllServers";
AddToAllServers } from "./Server/AllServers"; import { Server } from "./Server/Server";
import { Server } from "./Server/Server"; import {
import { GetServerByHostname, GetServerByHostname,
getServer, getServer,
getServerOnNetwork, getServerOnNetwork,
numCycleForGrowth, numCycleForGrowth,
processSingleServerGrowth } from "./Server/ServerHelpers"; processSingleServerGrowth
import { getPurchaseServerCost, } from "./Server/ServerHelpers";
getPurchaseServerLimit, import {
getPurchaseServerMaxRam } from "./Server/ServerPurchases"; getPurchaseServerCost,
import {Settings} from "./Settings/Settings"; getPurchaseServerLimit,
import {SpecialServerIps} from "./Server/SpecialServerIps"; getPurchaseServerMaxRam
import {Stock} from "./StockMarket/Stock"; } from "./Server/ServerPurchases";
import {StockMarket, StockSymbols, SymbolToStockMap, import { Settings } from "./Settings/Settings";
initStockMarket, initSymbolToStockMap, buyStock, import { SpecialServerIps } from "./Server/SpecialServerIps";
sellStock, updateStockPlayerPosition, import { Stock } from "./StockMarket/Stock";
shortStock, sellShort, OrderTypes, import {
PositionTypes, placeOrder, cancelOrder} from "./StockMarket/StockMarket"; StockMarket,
import { getStockmarket4SDataCost, StockSymbols,
getStockMarket4STixApiCost } from "./StockMarket/StockMarketCosts"; SymbolToStockMap,
import { SourceFileFlags } from "./SourceFile/SourceFileFlags" initStockMarket,
import {TextFile, getTextFile, createTextFile} from "./TextFile"; initSymbolToStockMap,
buyStock,
sellStock,
updateStockPlayerPosition,
shortStock,
sellShort,
OrderTypes,
PositionTypes,
placeOrder,
cancelOrder
} from "./StockMarket/StockMarket";
import {
getStockmarket4SDataCost,
getStockMarket4STixApiCost
} from "./StockMarket/StockMarketCosts";
import { SourceFileFlags } from "./SourceFile/SourceFileFlags";
import { TextFile, getTextFile, createTextFile } from "./TextFile";
import {unknownBladeburnerActionErrorMessage, import {
unknownBladeburnerExceptionMessage, unknownBladeburnerActionErrorMessage,
checkBladeburnerAccess} from "./NetscriptBladeburner"; unknownBladeburnerExceptionMessage,
import * as nsGang from "./NetscriptGang"; checkBladeburnerAccess
import {WorkerScript, workerScripts, } from "./NetscriptBladeburner";
killWorkerScript, NetscriptPorts} from "./NetscriptWorker"; import * as nsGang from "./NetscriptGang";
import {makeRuntimeRejectMsg, netscriptDelay, import {
runScriptFromScript} from "./NetscriptEvaluator"; WorkerScript,
import {NetscriptPort} from "./NetscriptPort"; workerScripts,
import { SleeveTaskType } from "./PersonObjects/Sleeve/SleeveTaskTypesEnum"; killWorkerScript,
import { findSleevePurchasableAugs } from "./PersonObjects/Sleeve/Sleeve"; NetscriptPorts
} from "./NetscriptWorker";
import {
makeRuntimeRejectMsg,
netscriptDelay,
runScriptFromScript
} from "./NetscriptEvaluator";
import { NetscriptPort } from "./NetscriptPort";
import { SleeveTaskType } from "./PersonObjects/Sleeve/SleeveTaskTypesEnum";
import { findSleevePurchasableAugs } from "./PersonObjects/Sleeve/Sleeve";
import {Page, routing} from "./ui/navigationTracking"; import { Page, routing } from "./ui/navigationTracking";
import {numeralWrapper} from "./ui/numeralFormat"; import { numeralWrapper } from "./ui/numeralFormat";
import {post} from "./ui/postToTerminal"; import { post } from "./ui/postToTerminal";
import { setTimeoutRef } from "./utils/SetTimeoutRef"; import { setTimeoutRef } from "./utils/SetTimeoutRef";
import { is2DArray } from "./utils/helpers/is2DArray"; import { is2DArray } from "./utils/helpers/is2DArray";
import {dialogBoxCreate} from "../utils/DialogBox"; import { dialogBoxCreate } from "../utils/DialogBox";
import {isPowerOfTwo} from "../utils/helpers/isPowerOfTwo"; import { isPowerOfTwo } from "../utils/helpers/isPowerOfTwo";
import {arrayToString} from "../utils/helpers/arrayToString"; import { arrayToString } from "../utils/helpers/arrayToString";
import {createRandomIp} from "../utils/IPAddress"; import { createRandomIp } from "../utils/IPAddress";
import {formatNumber, isHTML} from "../utils/StringHelperFunctions"; import { formatNumber, isHTML } from "../utils/StringHelperFunctions";
import {isString} from "../utils/helpers/isString"; import { isString } from "../utils/helpers/isString";
import { createElement } from "../utils/uiHelpers/createElement"; import { createElement } from "../utils/uiHelpers/createElement";
import { createPopup } from "../utils/uiHelpers/createPopup"; import { createPopup } from "../utils/uiHelpers/createPopup";
import { removeElementById } from "../utils/uiHelpers/removeElementById"; import { removeElementById } from "../utils/uiHelpers/removeElementById";
var hasCorporationSF = false, //Source-File 3 let hasCorporationSF = false; //Source-File 3
hasSingularitySF = false, //Source-File 4 let hasSingularitySF = false; //Source-File 4
hasAISF = false, //Source-File 5 let hasAISF = false; //Source-File 5
hasBladeburnerSF = false, //Source-File 6 let hasBladeburnerSF = false; //Source-File 6
hasBladeburner2079SF = false, //Source-File 7 let hasBladeburner2079SF = false; //Source-File 7
hasWallStreetSF = false, //Source-File 8 let hasWallStreetSF = false; //Source-File 8
hasBn11SF = false; //Source-File 11 let hasBn11SF = false; //Source-File 11
var singularitySFLvl=1, wallStreetSFLvl=1; let singularitySFLvl = 1;
let wallStreetSFLvl = 1;
var possibleLogs = { var possibleLogs = {
ALL: true, ALL: true,

@ -1,6 +1,6 @@
import {Player} from "./Player"; import { Player } from "./Player";
import {Gang} from "./Gang"; import { Gang } from "./Gang";
import {makeRuntimeRejectMsg} from "./NetscriptEvaluator"; import { makeRuntimeRejectMsg } from "./NetscriptEvaluator";
export function unknownGangApiExceptionMessage(functionName, err) { export function unknownGangApiExceptionMessage(functionName, err) {
return `gang.${functionName}() failed with exception: ` + err; return `gang.${functionName}() failed with exception: ` + err;

@ -1,4 +1,4 @@
import {makeRuntimeRejectMsg} from "./NetscriptEvaluator"; import { makeRuntimeRejectMsg } from "./NetscriptEvaluator";
// Makes a blob that contains the code of a given script. // Makes a blob that contains the code of a given script.
export function makeScriptBlob(code) { export function makeScriptBlob(code) {

@ -1,4 +1,4 @@
import {Settings} from "./Settings/Settings"; import { Settings } from "./Settings/Settings";
function NetscriptPort() { function NetscriptPort() {
this.data = []; this.data = [];

@ -1,28 +1,34 @@
import {addActiveScriptsItem, import {
deleteActiveScriptsItem, addActiveScriptsItem,
updateActiveScriptsItems} from "./ActiveScriptsUI"; deleteActiveScriptsItem,
import {CONSTANTS} from "./Constants"; updateActiveScriptsItems
import {Engine} from "./engine"; } from "./ActiveScriptsUI";
import {Interpreter} from "./JSInterpreter"; import { CONSTANTS } from "./Constants";
import {Environment} from "./NetscriptEnvironment"; import { Engine } from "./engine";
import {evaluate, isScriptErrorMessage, import { Interpreter } from "./JSInterpreter";
makeRuntimeRejectMsg, import { Environment } from "./NetscriptEnvironment";
killNetscriptDelay} from "./NetscriptEvaluator"; import {
import {NetscriptFunctions} from "./NetscriptFunctions"; evaluate,
import {executeJSScript} from "./NetscriptJSEvaluator"; isScriptErrorMessage,
import {NetscriptPort} from "./NetscriptPort"; makeRuntimeRejectMsg,
import { AllServers } from "./Server/AllServers"; killNetscriptDelay
import {Settings} from "./Settings/Settings"; } from "./NetscriptEvaluator";
import { setTimeoutRef } from "./utils/SetTimeoutRef"; import { NetscriptFunctions } from "./NetscriptFunctions";
import { executeJSScript } from "./NetscriptJSEvaluator";
import { NetscriptPort } from "./NetscriptPort";
import { AllServers } from "./Server/AllServers";
import { Settings } from "./Settings/Settings";
import { setTimeoutRef } from "./utils/SetTimeoutRef";
import {generate} from 'escodegen'; import { generate } from "escodegen";
import { parse, Node } from "../utils/acorn";
import { dialogBoxCreate } from "../utils/DialogBox";
import { compareArrays } from "../utils/helpers/compareArrays";
import { arrayToString } from "../utils/helpers/arrayToString";
import { roundToTwo } from "../utils/helpers/roundToTwo";
import { isString } from "../utils/StringHelperFunctions";
import {parse, Node} from "../utils/acorn";
import {dialogBoxCreate} from "../utils/DialogBox";
import {compareArrays} from "../utils/helpers/compareArrays";
import {arrayToString} from "../utils/helpers/arrayToString";
import {roundToTwo} from "../utils/helpers/roundToTwo";
import {isString} from "../utils/StringHelperFunctions";
const walk = require("acorn/dist/walk"); const walk = require("acorn/dist/walk");

@ -1,55 +1,68 @@
import {deleteActiveScriptsItem} from "./ActiveScriptsUI"; import { deleteActiveScriptsItem } from "./ActiveScriptsUI";
import { Augmentations } from "./Augmentation/Augmentations"; import { Augmentations } from "./Augmentation/Augmentations";
import { augmentationExists, import {
initAugmentations } from "./Augmentation/AugmentationHelpers"; augmentationExists,
import { AugmentationNames } from "./Augmentation/data/AugmentationNames"; initAugmentations
import { initBitNodeMultipliers } from "./BitNode/BitNode"; } from "./Augmentation/AugmentationHelpers";
import {Bladeburner} from "./Bladeburner"; import { AugmentationNames } from "./Augmentation/data/AugmentationNames";
import {writeCinematicText} from "./CinematicText"; import { initBitNodeMultipliers } from "./BitNode/BitNode";
import {Companies, initCompanies} from "./Company/Companies"; import { Bladeburner } from "./Bladeburner";
import { resetIndustryResearchTrees } from "./Corporation/IndustryData"; import { writeCinematicText } from "./CinematicText";
import { Programs } from "./Programs/Programs"; import { Companies, initCompanies } from "./Company/Companies";
import {Engine} from "./engine"; import { resetIndustryResearchTrees } from "./Corporation/IndustryData";
import { Faction } from "./Faction/Faction"; import { Programs } from "./Programs/Programs";
import { Factions, import { Engine } from "./engine";
initFactions } from "./Faction/Factions"; import { Faction } from "./Faction/Faction";
import { joinFaction } from "./Faction/FactionHelpers"; import { Factions, initFactions } from "./Faction/Factions";
import {deleteGangDisplayContent} from "./Gang"; import { joinFaction } from "./Faction/FactionHelpers";
import { Message } from "./Message/Message"; import { deleteGangDisplayContent } from "./Gang";
import { initMessages, import { Message } from "./Message/Message";
Messages } from "./Message/MessageHelpers"; import { initMessages, Messages } from "./Message/MessageHelpers";
import {initSingularitySFFlags, hasWallStreetSF}from "./NetscriptFunctions"; import { initSingularitySFFlags, hasWallStreetSF } from "./NetscriptFunctions";
import {WorkerScript, workerScripts, import {
prestigeWorkerScripts} from "./NetscriptWorker"; WorkerScript,
import {Player} from "./Player"; workerScripts,
prestigeWorkerScripts
} from "./NetscriptWorker";
import { Player } from "./Player";
import { AllServers, import {
AddToAllServers, AllServers,
initForeignServers, AddToAllServers,
prestigeAllServers } from "./Server/AllServers"; initForeignServers,
import { Server } from "./Server/Server" prestigeAllServers
import { prestigeHomeComputer } from "./Server/ServerHelpers"; } from "./Server/AllServers";
import { SourceFileFlags, import { Server } from "./Server/Server";
updateSourceFileFlags } from "./SourceFile/SourceFileFlags"; import { prestigeHomeComputer } from "./Server/ServerHelpers";
import { SpecialServerIps, import {
SpecialServerIpsMap, SourceFileFlags,
prestigeSpecialServerIps, updateSourceFileFlags
SpecialServerNames} from "./Server/SpecialServerIps"; } from "./SourceFile/SourceFileFlags";
import {initStockMarket, initSymbolToStockMap, import {
stockMarketContentCreated, SpecialServerIps,
setStockMarketContentCreated} from "./StockMarket/StockMarket"; SpecialServerIpsMap,
import {Terminal, postNetburnerText} from "./Terminal"; prestigeSpecialServerIps,
SpecialServerNames
} from "./Server/SpecialServerIps";
import {
initStockMarket,
initSymbolToStockMap,
stockMarketContentCreated,
setStockMarketContentCreated
} from "./StockMarket/StockMarket";
import { Terminal, postNetburnerText } from "./Terminal";
import {Page, routing} from "./ui/navigationTracking"; import { Page, routing } from "./ui/navigationTracking";
import Decimal from "decimal.js"; import { dialogBoxCreate } from "../utils/DialogBox";
import {dialogBoxCreate} from "../utils/DialogBox"; import { exceptionAlert } from "../utils/helpers/exceptionAlert";
import {removeElementById} from "../utils/uiHelpers/removeElementById"; import { removeElementById } from "../utils/uiHelpers/removeElementById";
import {createElement} from "../utils/uiHelpers/createElement"; import { createElement } from "../utils/uiHelpers/createElement";
import {createPopup} from "../utils/uiHelpers/createPopup"; import { createPopup } from "../utils/uiHelpers/createPopup";
import {exceptionAlert} from "../utils/helpers/exceptionAlert";
let BitNode8StartingMoney = 250e6; import Decimal from "decimal.js";
const BitNode8StartingMoney = 250e6;
//Prestige by purchasing augmentation //Prestige by purchasing augmentation
function prestigeAugmentation() { function prestigeAugmentation() {

@ -1,18 +1,22 @@
import { BitNodes } from "./BitNode/BitNode"; import { BitNodes } from "./BitNode/BitNode";
import { Engine } from "./engine"; import { Engine } from "./engine";
import { Player } from "./Player"; import { Player } from "./Player";
import { prestigeSourceFile } from "./Prestige"; import { prestigeSourceFile } from "./Prestige";
import { SourceFiles, import { SourceFiles, SourceFile } from "./SourceFile";
SourceFile } from "./SourceFile"; import { PlayerOwnedSourceFile } from "./SourceFile/PlayerOwnedSourceFile";
import { PlayerOwnedSourceFile } from "./SourceFile/PlayerOwnedSourceFile"; import { Terminal } from "./Terminal";
import { Terminal } from "./Terminal"; import { setTimeoutRef } from "./utils/SetTimeoutRef";
import { setTimeoutRef } from "./utils/SetTimeoutRef";
import { dialogBoxCreate } from "../utils/DialogBox";
import {
yesNoBoxCreate,
yesNoBoxGetYesButton,
yesNoBoxGetNoButton,
yesNoBoxClose
} from "../utils/YesNoBox";
import { clearEventListeners } from "../utils/uiHelpers/clearEventListeners";
import { removeChildrenFromElement } from "../utils/uiHelpers/removeChildrenFromElement";
import {clearEventListeners} from "../utils/uiHelpers/clearEventListeners";
import {dialogBoxCreate} from "../utils/DialogBox";
import {removeChildrenFromElement} from "../utils/uiHelpers/removeChildrenFromElement";
import {yesNoBoxCreate, yesNoBoxGetYesButton,
yesNoBoxGetNoButton, yesNoBoxClose} from "../utils/YesNoBox";
/* RedPill.js /* RedPill.js
* Implements what happens when you have Red Pill augmentation and then hack the world daemon */ * Implements what happens when you have Red Pill augmentation and then hack the world daemon */

@ -1,41 +1,52 @@
import {loadAliases, loadGlobalAliases, import {
Aliases, GlobalAliases} from "./Alias"; loadAliases,
import {Companies, loadCompanies} from "./Company/Companies"; loadGlobalAliases,
import {CompanyPosition} from "./Company/CompanyPosition"; Aliases,
import {CONSTANTS} from "./Constants"; GlobalAliases
import {Engine} from "./engine"; } from "./Alias";
import { Factions, import { Companies, loadCompanies } from "./Company/Companies";
loadFactions } from "./Faction/Factions"; import { CompanyPosition } from "./Company/CompanyPosition";
import { processPassiveFactionRepGain } from "./Faction/FactionHelpers"; import { CONSTANTS } from "./Constants";
import { loadFconf } from "./Fconf/Fconf"; import { Engine } from "./engine";
import { FconfSettings } from "./Fconf/FconfSettings"; import { Factions, loadFactions } from "./Faction/Factions";
import {loadAllGangs, AllGangs} from "./Gang"; import { processPassiveFactionRepGain } from "./Faction/FactionHelpers";
import { hasHacknetServers, import { loadFconf } from "./Fconf/Fconf";
processHacknetEarnings } from "./Hacknet/HacknetHelpers"; import { FconfSettings } from "./Fconf/FconfSettings";
import { loadAllGangs, AllGangs } from "./Gang";
import {
hasHacknetServers,
processHacknetEarnings
} from "./Hacknet/HacknetHelpers";
import { loadMessages, initMessages, Messages } from "./Message/MessageHelpers"; import { loadMessages, initMessages, Messages } from "./Message/MessageHelpers";
import {Player, loadPlayer} from "./Player"; import { Player, loadPlayer } from "./Player";
import { loadAllRunningScripts } from "./Script/ScriptHelpers"; import { loadAllRunningScripts } from "./Script/ScriptHelpers";
import { AllServers, import { AllServers, loadAllServers } from "./Server/AllServers";
loadAllServers } from "./Server/AllServers"; import { Settings } from "./Settings/Settings";
import { Settings } from "./Settings/Settings"; import {
import { loadSpecialServerIps, loadSpecialServerIps,
SpecialServerIps } from "./Server/SpecialServerIps"; SpecialServerIps
import {loadStockMarket, StockMarket} from "./StockMarket/StockMarket"; } from "./Server/SpecialServerIps";
import { setTimeoutRef } from "./utils/SetTimeoutRef"; import { loadStockMarket, StockMarket } from "./StockMarket/StockMarket";
import {dialogBoxCreate} from "../utils/DialogBox"; import { createStatusText } from "./ui/createStatusText";
import {gameOptionsBoxClose} from "../utils/GameOptions"; import { numeralWrapper } from "./ui/numeralFormat";
import {clearEventListeners} from "../utils/uiHelpers/clearEventListeners";
import {Reviver, Generic_toJSON,
Generic_fromJSON} from "../utils/JSONReviver";
import { convertTimeMsToTimeElapsedString } from "../utils/StringHelperFunctions";
import {createElement} from "../utils/uiHelpers/createElement";
import {createPopup} from "../utils/uiHelpers/createPopup";
import {createStatusText} from "./ui/createStatusText";
import {numeralWrapper} from "./ui/numeralFormat";
import {removeElementById} from "../utils/uiHelpers/removeElementById";
import Decimal from "decimal.js"; import { setTimeoutRef } from "./utils/SetTimeoutRef";
import { dialogBoxCreate } from "../utils/DialogBox";
import { gameOptionsBoxClose } from "../utils/GameOptions";
import { convertTimeMsToTimeElapsedString } from "../utils/StringHelperFunctions";
import { clearEventListeners } from "../utils/uiHelpers/clearEventListeners";
import {
Reviver,
Generic_toJSON,
Generic_fromJSON
} from "../utils/JSONReviver";
import { createElement } from "../utils/uiHelpers/createElement";
import { createPopup } from "../utils/uiHelpers/createPopup";
import { removeElementById } from "../utils/uiHelpers/removeElementById";
import Decimal from "decimal.js";
/* SaveObject.js /* SaveObject.js
* Defines the object used to save/load games * Defines the object used to save/load games

@ -8,77 +8,85 @@ import {
removeLeadingSlash, removeLeadingSlash,
removeTrailingSlash removeTrailingSlash
} from "./Terminal/DirectoryHelpers"; } from "./Terminal/DirectoryHelpers";
import { determineAllPossibilitiesForTabCompletion } from "./Terminal/determineAllPossibilitiesForTabCompletion";
import { TerminalHelpText, HelpTexts } from "./Terminal/HelpText";
import { tabCompletion } from "./Terminal/tabCompletion";
import { import {
determineAllPossibilitiesForTabCompletion Aliases,
} from "./Terminal/determineAllPossibilitiesForTabCompletion"; GlobalAliases,
parseAliasDeclaration,
printAliases,
removeAlias,
substituteAliases
} from "./Alias";
import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers";
import { import {
TerminalHelpText, CodingContract,
HelpTexts CodingContractResult,
} from "./Terminal/HelpText"; CodingContractRewardType
} from "./CodingContracts";
import { CONSTANTS } from "./Constants";
import { Programs } from "./Programs/Programs";
import { import {
tabCompletion executeDarkwebTerminalCommand,
} from "./Terminal/tabCompletion"; checkIfConnectedToDarkweb
} from "./DarkWeb/DarkWeb";
import { Aliases, import { DarkWebItems } from "./DarkWeb/DarkWebItems";
GlobalAliases, import { Engine } from "./engine";
parseAliasDeclaration, import { parseFconfSettings, createFconf } from "./Fconf/Fconf";
printAliases, import { FconfSettings } from "./Fconf/FconfSettings";
removeAlias, import {
substituteAliases } from "./Alias"; calculateHackingChance,
import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers"; calculateHackingExpGain,
import {CodingContract, CodingContractResult, calculatePercentMoneyHacked,
CodingContractRewardType} from "./CodingContracts"; calculateHackingTime,
import {CONSTANTS} from "./Constants"; calculateGrowTime,
import { Programs } from "./Programs/Programs"; calculateWeakenTime
import { executeDarkwebTerminalCommand, } from "./Hacking";
checkIfConnectedToDarkweb } from "./DarkWeb/DarkWeb"; import { HacknetServer } from "./Hacknet/HacknetServer";
import { DarkWebItems } from "./DarkWeb/DarkWebItems"; import {
import {Engine} from "./engine"; iTutorialNextStep,
import { parseFconfSettings, iTutorialSteps,
createFconf } from "./Fconf/Fconf"; ITutorial
import { FconfSettings } from "./Fconf/FconfSettings"; } from "./InteractiveTutorial";
import {calculateHackingChance, import { showLiterature } from "./Literature";
calculateHackingExpGain, import { Message } from "./Message/Message";
calculatePercentMoneyHacked, import { showMessage } from "./Message/MessageHelpers";
calculateHackingTime, import { killWorkerScript, addWorkerScript } from "./NetscriptWorker";
calculateGrowTime, import { Player } from "./Player";
calculateWeakenTime} from "./Hacking"; import { hackWorldDaemon } from "./RedPill";
import { HacknetServer } from "./Hacknet/HacknetServer"; import { RunningScript } from "./Script/RunningScript";
import {iTutorialNextStep, iTutorialSteps, import { findRunningScript } from "./Script/ScriptHelpers";
ITutorial} from "./InteractiveTutorial"; import { isScriptFilename } from "./Script/ScriptHelpersTS";
import {showLiterature} from "./Literature"; import { AllServers } from "./Server/AllServers";
import { Message } from "./Message/Message"; import { Server } from "./Server/Server";
import { showMessage } from "./Message/MessageHelpers"; import {
import {killWorkerScript, addWorkerScript} from "./NetscriptWorker"; GetServerByHostname,
import {Player} from "./Player"; getServer,
import {hackWorldDaemon} from "./RedPill"; getServerOnNetwork
import { RunningScript } from "./Script/RunningScript"; } from "./Server/ServerHelpers";
import { findRunningScript } from "./Script/ScriptHelpers"; import { Settings } from "./Settings/Settings";
import { isScriptFilename } from "./Script/ScriptHelpersTS"; import {
import { AllServers } from "./Server/AllServers"; SpecialServerIps,
import { Server } from "./Server/Server"; SpecialServerNames
import { GetServerByHostname, } from "./Server/SpecialServerIps";
getServer, import { getTextFile } from "./TextFile";
getServerOnNetwork } from "./Server/ServerHelpers"; import { setTimeoutRef } from "./utils/SetTimeoutRef";
import {Settings} from "./Settings/Settings"; import { Page, routing } from "./ui/navigationTracking";
import { SpecialServerIps, import { numeralWrapper } from "./ui/numeralFormat";
SpecialServerNames } from "./Server/SpecialServerIps"; import { KEY } from "../utils/helpers/keyCodes";
import {getTextFile} from "./TextFile"; import { addOffset } from "../utils/helpers/addOffset";
import { setTimeoutRef } from "./utils/SetTimeoutRef"; import { isString } from "../utils/helpers/isString";
import {Page, routing} from "./ui/navigationTracking"; import { arrayToString } from "../utils/helpers/arrayToString";
import {numeralWrapper} from "./ui/numeralFormat"; import { getTimestamp } from "../utils/helpers/getTimestamp";
import {KEY} from "../utils/helpers/keyCodes"; import { logBoxCreate } from "../utils/LogBox";
import {addOffset} from "../utils/helpers/addOffset"; import {
import {isString} from "../utils/helpers/isString"; yesNoBoxCreate,
import {arrayToString} from "../utils/helpers/arrayToString"; yesNoBoxGetYesButton,
import {getTimestamp} from "../utils/helpers/getTimestamp"; yesNoBoxGetNoButton,
import {logBoxCreate} from "../utils/LogBox"; yesNoBoxClose
import {yesNoBoxCreate, } from "../utils/YesNoBox";
yesNoBoxGetYesButton,
yesNoBoxGetNoButton, yesNoBoxClose} from "../utils/YesNoBox";
import { import {
post, post,
postContent, postContent,
@ -87,9 +95,10 @@ import {
hackProgressPost hackProgressPost
} from "./ui/postToTerminal"; } from "./ui/postToTerminal";
import autosize from 'autosize'; import autosize from "autosize";
import * as JSZip from 'jszip'; import * as JSZip from "jszip";
import * as FileSaver from 'file-saver'; import * as FileSaver from "file-saver";
function postNetburnerText() { function postNetburnerText() {
post("Bitburner v" + CONSTANTS.Version); post("Bitburner v" + CONSTANTS.Version);

@ -1,6 +1,11 @@
import { setTimeoutRef } from "./utils/SetTimeoutRef"; import { setTimeoutRef } from "./utils/SetTimeoutRef";
import { dialogBoxCreate } from "../utils/DialogBox"; import { dialogBoxCreate } from "../utils/DialogBox";
import { Generic_fromJSON, Generic_toJSON, Reviver } from "../utils/JSONReviver"; import {
Generic_fromJSON,
Generic_toJSON,
Reviver
} from "../utils/JSONReviver";
/** /**
* Represents a plain text file that is typically stored on a server. * Represents a plain text file that is typically stored on a server.

@ -1,104 +1,129 @@
import {formatNumber, import {
convertTimeMsToTimeElapsedString, formatNumber,
replaceAt} from "../utils/StringHelperFunctions"; convertTimeMsToTimeElapsedString,
import {loxBoxCreate, logBoxUpdateText, replaceAt
logBoxOpened} from "../utils/LogBox"; } from "../utils/StringHelperFunctions";
import {updateActiveScriptsItems} from "./ActiveScriptsUI"; import { loxBoxCreate, logBoxUpdateText, logBoxOpened } from "../utils/LogBox";
import { Augmentations } from "./Augmentation/Augmentations"; import { updateActiveScriptsItems } from "./ActiveScriptsUI";
import { installAugmentations, import { Augmentations } from "./Augmentation/Augmentations";
initAugmentations, import {
displayAugmentationsContent, installAugmentations,
PlayerOwnedAugmentation } from "./Augmentation/AugmentationHelpers"; initAugmentations,
import { AugmentationNames } from "./Augmentation/data/AugmentationNames"; displayAugmentationsContent,
PlayerOwnedAugmentation
} from "./Augmentation/AugmentationHelpers";
import { AugmentationNames } from "./Augmentation/data/AugmentationNames";
import {BitNodes, initBitNodes, import {
initBitNodeMultipliers} from "./BitNode/BitNode"; BitNodes,
import {Bladeburner} from "./Bladeburner"; initBitNodes,
import { CharacterOverviewComponent } from "./ui/React/CharacterOverview"; initBitNodeMultipliers
import {cinematicTextFlag} from "./CinematicText"; } from "./BitNode/BitNode";
import {generateRandomContract} from "./CodingContractGenerator"; import { Bladeburner } from "./Bladeburner";
import {CompanyPositions} from "./Company/CompanyPositions"; import { CharacterOverviewComponent } from "./ui/React/CharacterOverview";
import {initCompanies} from "./Company/Companies"; import { cinematicTextFlag } from "./CinematicText";
import { Corporation } from "./Corporation/Corporation"; import { generateRandomContract } from "./CodingContractGenerator";
import {CONSTANTS} from "./Constants"; import { CompanyPositions } from "./Company/CompanyPositions";
import {createDevMenu, closeDevMenu} from "./DevMenu"; import { initCompanies } from "./Company/Companies";
import { Factions, initFactions } from "./Faction/Factions"; import { Corporation } from "./Corporation/Corporation";
import { displayFactionContent, joinFaction, import { CONSTANTS } from "./Constants";
processPassiveFactionRepGain, import { createDevMenu, closeDevMenu } from "./DevMenu";
inviteToFaction } from "./Faction/FactionHelpers"; import { Factions, initFactions } from "./Faction/Factions";
import { FconfSettings } from "./Fconf/FconfSettings"; import {
import { hasHacknetServers, displayFactionContent,
renderHacknetNodesUI, joinFaction,
clearHacknetNodesUI, processPassiveFactionRepGain,
processHacknetEarnings } from "./Hacknet/HacknetHelpers"; inviteToFaction
import {iTutorialStart} from "./InteractiveTutorial"; } from "./Faction/FactionHelpers";
import {initLiterature} from "./Literature"; import { FconfSettings } from "./Fconf/FconfSettings";
import { LocationName } from "./Locations/data/LocationNames"; import {
import { LocationRoot } from "./Locations/ui/Root"; hasHacknetServers,
import { checkForMessagesToSend, initMessages } from "./Message/MessageHelpers"; renderHacknetNodesUI,
import {inMission, currMission} from "./Missions"; clearHacknetNodesUI,
import {initSingularitySFFlags, processHacknetEarnings
hasSingularitySF, hasCorporationSF} from "./NetscriptFunctions"; } from "./Hacknet/HacknetHelpers";
import {updateOnlineScriptTimes, import { iTutorialStart } from "./InteractiveTutorial";
runScriptsLoop} from "./NetscriptWorker"; import { initLiterature } from "./Literature";
import {Player} from "./Player"; import { LocationName } from "./Locations/data/LocationNames";
import {prestigeAugmentation, import { LocationRoot } from "./Locations/ui/Root";
prestigeSourceFile} from "./Prestige"; import { checkForMessagesToSend, initMessages } from "./Message/MessageHelpers";
import { Programs } from "./Programs/Programs"; import { inMission, currMission } from "./Missions";
import { displayCreateProgramContent, import {
getNumAvailableCreateProgram, initSingularitySFFlags,
initCreateProgramButtons } from "./Programs/ProgramHelpers"; hasSingularitySF,
import {redPillFlag, hackWorldDaemon} from "./RedPill"; hasCorporationSF
import {saveObject, loadGame} from "./SaveObject"; } from "./NetscriptFunctions";
import { getCurrentEditor, import { updateOnlineScriptTimes, runScriptsLoop } from "./NetscriptWorker";
loadAllRunningScripts, import { Player } from "./Player";
scriptEditorInit, import { prestigeAugmentation, prestigeSourceFile } from "./Prestige";
updateScriptEditorContent } from "./Script/ScriptHelpers"; import { Programs } from "./Programs/Programs";
import { AllServers, import {
initForeignServers } from "./Server/AllServers"; displayCreateProgramContent,
getNumAvailableCreateProgram,
initCreateProgramButtons
} from "./Programs/ProgramHelpers";
import { redPillFlag, hackWorldDaemon } from "./RedPill";
import { saveObject, loadGame } from "./SaveObject";
import {
getCurrentEditor,
loadAllRunningScripts,
scriptEditorInit,
updateScriptEditorContent
} from "./Script/ScriptHelpers";
import { AllServers, initForeignServers } from "./Server/AllServers";
import { Server } from "./Server/Server"; import { Server } from "./Server/Server";
import {Settings} from "./Settings/Settings"; import { Settings } from "./Settings/Settings";
import { initSourceFiles, SourceFiles } from "./SourceFile"; import { initSourceFiles, SourceFiles } from "./SourceFile";
import { updateSourceFileFlags } from "./SourceFile/SourceFileFlags"; import { updateSourceFileFlags } from "./SourceFile/SourceFileFlags";
import {SpecialServerIps, initSpecialServerIps} from "./Server/SpecialServerIps"; import {
import {StockMarket, StockSymbols, SpecialServerIps,
SymbolToStockMap, initStockSymbols, initSpecialServerIps
initSymbolToStockMap, stockMarketCycle, } from "./Server/SpecialServerIps";
processStockPrices, import {
displayStockMarketContent} from "./StockMarket/StockMarket"; StockMarket,
import {Terminal, postNetburnerText} from "./Terminal"; StockSymbols,
SymbolToStockMap,
initStockSymbols,
initSymbolToStockMap,
stockMarketCycle,
processStockPrices,
displayStockMarketContent
} from "./StockMarket/StockMarket";
import { Terminal, postNetburnerText } from "./Terminal";
import { Sleeve } from "./PersonObjects/Sleeve/Sleeve"; import { Sleeve } from "./PersonObjects/Sleeve/Sleeve";
import { clearSleevesPage, import {
createSleevesPage, clearSleevesPage,
updateSleevesPage } from "./PersonObjects/Sleeve/SleeveUI"; createSleevesPage,
import { clearResleevesPage, updateSleevesPage
createResleevesPage } from "./PersonObjects/Resleeving/ResleevingUI"; } from "./PersonObjects/Sleeve/SleeveUI";
import {
clearResleevesPage,
createResleevesPage
} from "./PersonObjects/Resleeving/ResleevingUI";
import { createStatusText } from "./ui/createStatusText"; import { createStatusText } from "./ui/createStatusText";
import { displayCharacterInfo } from "./ui/displayCharacterInfo"; import { displayCharacterInfo } from "./ui/displayCharacterInfo";
import {Page, routing} from "./ui/navigationTracking"; import { Page, routing } from "./ui/navigationTracking";
import {numeralWrapper} from "./ui/numeralFormat"; import { numeralWrapper } from "./ui/numeralFormat";
import {setSettingsLabels} from "./ui/setSettingsLabels"; import { setSettingsLabels } from "./ui/setSettingsLabels";
import { initializeMainMenuHeaders } from "./ui/MainMenu/Headers"; import { initializeMainMenuHeaders } from "./ui/MainMenu/Headers";
import { initializeMainMenuLinks, import { initializeMainMenuLinks, MainMenuLinks } from "./ui/MainMenu/Links";
MainMenuLinks } from "./ui/MainMenu/Links";
import { dialogBoxCreate } from "../utils/DialogBox";
import { gameOptionsBoxClose, gameOptionsBoxOpen } from "../utils/GameOptions";
import { getRandomInt } from "../utils/helpers/getRandomInt";
import { removeChildrenFromElement } from "../utils/uiHelpers/removeChildrenFromElement";
import { clearEventListeners } from "../utils/uiHelpers/clearEventListeners";
import { createElement } from "../utils/uiHelpers/createElement";
import { exceptionAlert } from "../utils/helpers/exceptionAlert";
import { removeLoadingScreen } from "../utils/uiHelpers/removeLoadingScreen";
import { KEY } from "../utils/helpers/keyCodes";
import { dialogBoxCreate} from "../utils/DialogBox"; import React from "react";
import { gameOptionsBoxClose, import ReactDOM from "react-dom";
gameOptionsBoxOpen } from "../utils/GameOptions";
import { getRandomInt } from "../utils/helpers/getRandomInt";
import { removeChildrenFromElement } from "../utils/uiHelpers/removeChildrenFromElement";
import { clearEventListeners } from "../utils/uiHelpers/clearEventListeners";
import { createElement } from "../utils/uiHelpers/createElement";
import { exceptionAlert } from "../utils/helpers/exceptionAlert";
import { removeLoadingScreen } from "../utils/uiHelpers/removeLoadingScreen";
import {KEY} from "../utils/helpers/keyCodes";
import React from "react";
import ReactDOM from "react-dom";
// These should really be imported with the module that is presenting that UI, but because they very much depend on the // These should really be imported with the module that is presenting that UI, but because they very much depend on the
// cascade order, we'll pull them all in here. // cascade order, we'll pull them all in here.