This commit is contained in:
danielyxie 2018-05-11 16:30:55 -05:00
parent f52d7d2f8b
commit 6902ece765
8 changed files with 900 additions and 770 deletions

769
dist/engine.bundle.js vendored

@ -1684,6 +1684,7 @@ PlayerObject.prototype.finishCrime = function(cancelled) {
this.workAgiExpGained *= 2;
this.workChaExpGained *= 2;
if (this.committingCrimeThruSingFn) {
if(this.singFnCrimeWorkerScript.disableLogs.ALL == null && this.singFnCrimeWorkerScript.disableLogs.commitCrime == null) {
this.singFnCrimeWorkerScript.scriptRef.log("Crime successful! Gained " +
_utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_20___default()(this.workMoneyGained).format("$0.000a") + ", " +
Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_21__["formatNumber"])(this.workHackExpGained, 3) + " hack exp, " +
@ -1692,6 +1693,7 @@ PlayerObject.prototype.finishCrime = function(cancelled) {
Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_21__["formatNumber"])(this.workDexExpGained, 3) + " dex exp, " +
Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_21__["formatNumber"])(this.workAgiExpGained, 3) + " agi exp, " +
Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_21__["formatNumber"])(this.workChaExpGained, 3) + " cha exp.");
}
} else {
Object(_utils_DialogBox_js__WEBPACK_IMPORTED_MODULE_16__["dialogBoxCreate"])("Crime successful! <br><br>" +
"You gained:<br>"+
@ -1713,13 +1715,15 @@ PlayerObject.prototype.finishCrime = function(cancelled) {
this.workAgiExpGained /= 2;
this.workChaExpGained /= 2;
if (this.committingCrimeThruSingFn) {
if(this.singFnCrimeWorkerScript.disableLogs.ALL == null && this.singFnCrimeWorkerScript.disableLogs.commitCrime == null) {
this.singFnCrimeWorkerScript.scriptRef.log("Crime failed! Gained " +
Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_21__["formatNumber"])(this.workHackExpGained, 3) + " hack exp, " +
Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_21__["formatNumber"])(this.workStrExpGained, 3) + " str exp, " +
Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_21__["formatNumber"])(this.workDefExpGained, 3) + " def exp, " +
Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_21__["formatNumber"])(this.workDexExpGained, 3) + " dex exp, " +
Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_21__["formatNumber"])(this.workAgiExpGained, 3) + " agi exp, " +
Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_21__["formatNumber"])(this.workChaExpGained, 3) + " chaexp.");
Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_21__["formatNumber"])(this.workChaExpGained, 3) + " cha exp.");
}
} else {
Object(_utils_DialogBox_js__WEBPACK_IMPORTED_MODULE_16__["dialogBoxCreate"])("Crime failed! <br><br>" +
"You gained:<br>"+
@ -2953,7 +2957,7 @@ function generateRandomString(n) {
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONSTANTS", function() { return CONSTANTS; });
let CONSTANTS = {
Version: "0.36.0",
Version: "0.36.1",
//Max level for any skill, assuming no multipliers. Determined by max numerical value in javascript for experience
//and the skill level formula in Player.js. Note that all this means it that when experience hits MAX_INT, then
@ -4101,6 +4105,7 @@ let CONSTANTS = {
"** Datamancer skill effect increased from 4% per level to 5%<br>" +
"** Slightly decreased the base stamina cost of contracts/operations<br>" +
"** Slightly increased the effects of the Tracer, Digital Observer, Short Circuit, Cloak, and Blade's Intuition skills<br>" +
"** Overclock skill capped at level 95, rather than 99<br>" +
"** Training gives significantly more exp/s<br>" +
"* Crime, Infiltration, and Hacking are now slightly more profitable in BN-6<br>" +
"* Gyms are now more expensive, but give slightly more exp<br>" +
@ -4112,8 +4117,10 @@ let CONSTANTS = {
"* Added an option to disable hotkeys/keyboard shortcuts<br>" +
"* Refactored 'Active Scripts' UI page to optimize its performance<br>" +
"* Added a new .fconf Terminal setting: ENABLE_TIMESTAMP<br>" +
"* 'Netscript Execution Time', which can be found in the Options, now has a minimum value of 15ms rather than 25ms<br>" +
"* Bug Fix: Fixed a typo in the Fulcrum Technologies company name (Technolgies -> Technologies)<br>" +
"* Bug Fix: hacknetnodes keyword should no longer incur RAM cost if its in a comment<br>"
"* Bug Fix: hacknetnodes keyword should no longer incur RAM cost if its in a comment<br>" +
"* Bug Fix: disableLog() now works for the commitCrime() Netscript function (fixed by Github user hydroflame)"
}
@ -6351,7 +6358,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/StringHelperFunctions.js */ 2);
/* harmony import */ var _utils_LogBox_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/LogBox.js */ 51);
/* harmony import */ var _ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ActiveScriptsUI.js */ 44);
/* harmony import */ var _ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ActiveScriptsUI.js */ 43);
/* harmony import */ var _Augmentations_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Augmentations.js */ 19);
/* harmony import */ var _BitNode_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./BitNode.js */ 15);
/* harmony import */ var _Bladeburner_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Bladeburner.js */ 47);
@ -6373,7 +6380,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _NetscriptWorker_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./NetscriptWorker.js */ 21);
/* harmony import */ var _Player_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./Player.js */ 0);
/* harmony import */ var _Prestige_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./Prestige.js */ 57);
/* harmony import */ var _RedPill_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./RedPill.js */ 43);
/* harmony import */ var _RedPill_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./RedPill.js */ 44);
/* harmony import */ var _SaveObject_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./SaveObject.js */ 46);
/* harmony import */ var _Script_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./Script.js */ 26);
/* harmony import */ var _Server_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./Server.js */ 10);
@ -6860,30 +6867,18 @@ let Engine = {
displayCharacterOverviewInfo: function() {
if (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].hp == null) {_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].hp = _Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].max_hp;}
var overviewText = "Hp: " + _Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].hp + " / " + _Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].max_hp + "<br>" +
"Money: " + _utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_3___default()(_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].money.toNumber()).format('($0.000a)') + "<br>" +
"Hack: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].hacking_skill).toLocaleString() + "<br>" +
"Str: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].strength).toLocaleString() + "<br>" +
"Def: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].defense).toLocaleString() + "<br>" +
"Dex: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].dexterity).toLocaleString() + "<br>" +
"Agi: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].agility).toLocaleString() + "<br>" +
"Cha: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].charisma).toLocaleString();
if (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].intelligence >= 1) {
document.getElementById("character-overview-text").innerHTML =
("Hp: " + _Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].hp + " / " + _Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].max_hp + "<br>" +
"Money: " + _utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_3___default()(_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].money.toNumber()).format('($0.000a)') + "<br>" +
"Hack: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].hacking_skill).toLocaleString() + "<br>" +
"Str: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].strength).toLocaleString() + "<br>" +
"Def: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].defense).toLocaleString() + "<br>" +
"Dex: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].dexterity).toLocaleString() + "<br>" +
"Agi: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].agility).toLocaleString() + "<br>" +
"Cha: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].charisma).toLocaleString() + "<br>" +
"Int: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].intelligence).toLocaleString()
).replace( / /g, "&nbsp;" );
} else {
document.getElementById("character-overview-text").innerHTML =
("Hp: " + _Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].hp + " / " + _Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].max_hp + "<br>" +
"Money: " + _utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_3___default()(_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].money.toNumber()).format('($0.000a)') + "<br>" +
"Hack: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].hacking_skill).toLocaleString() + "<br>" +
"Str: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].strength).toLocaleString() + "<br>" +
"Def: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].defense).toLocaleString() + "<br>" +
"Dex: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].dexterity).toLocaleString() + "<br>" +
"Agi: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].agility).toLocaleString() + "<br>" +
"Cha: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].charisma).toLocaleString()
).replace( / /g, "&nbsp;" );
overviewText += "<br>Int: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].intelligence).toLocaleString();
}
document.getElementById("character-overview-text").innerHTML = overviewText.replace( / /g, "&nbsp;");
},
/* Display character info */
@ -7264,7 +7259,7 @@ let Engine = {
updateDisplays: 3,
updateDisplaysMed: 9,
updateDisplaysLong: 15,
updateDisplaysSecond:5,
updateActiveScriptsDisplay: 5,
createProgramNotifications: 10, //Checks whether any programs can be created and notifies
checkFactionInvitations: 100, //Check whether you qualify for any faction invitations
passiveFactionGrowth: 600,
@ -7302,11 +7297,14 @@ let Engine = {
Engine.Counters.updateSkillLevelsCounter = 10;
}
if (Engine.Counters.updateDisplaysSecond <= 0) {
if (Engine.currentPage === Engine.Page.ActiveScripts) {
if (Engine.Counters.updateActiveScriptsDisplay <= 0) {
//Always update, but make the interval longer if the page isn't active
Object(_ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_6__["updateActiveScriptsItems"])();
if (Engine.currentPage === Engine.Page.ActiveScripts) {
Engine.Counters.updateActiveScriptsDisplay = 5;
} else {
Engine.Counters.updateActiveScriptsDisplay = 15;
}
Engine.Counters.updateDisplaysSecond = 5;
}
if (Engine.Counters.updateDisplays <= 0) {
@ -12523,7 +12521,9 @@ function getNextNeurofluxLevel() {
}
}
if (aug == null) {
console.log("ERROR, Could not find NeuroFlux Governor aug");
console.log("WARNING: Could not find NeuroFlux Governor aug. This is OK if " +
"it happens during the loading/initialization of the game, but probably " +
"indicates something seriously wrong at other times");
return 1;
}
}
@ -13439,7 +13439,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _NetscriptEvaluator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./NetscriptEvaluator.js */ 7);
/* harmony import */ var _NetscriptWorker_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./NetscriptWorker.js */ 21);
/* harmony import */ var _Player_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Player.js */ 0);
/* harmony import */ var _RedPill_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./RedPill.js */ 43);
/* harmony import */ var _RedPill_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./RedPill.js */ 44);
/* harmony import */ var _Script_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./Script.js */ 26);
/* harmony import */ var _Server_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./Server.js */ 10);
/* harmony import */ var _Settings_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./Settings.js */ 23);
@ -18457,7 +18457,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addWorkerScript", function() { return addWorkerScript; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateOnlineScriptTimes", function() { return updateOnlineScriptTimes; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prestigeWorkerScripts", function() { return prestigeWorkerScripts; });
/* harmony import */ var _ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ActiveScriptsUI.js */ 44);
/* harmony import */ var _ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ActiveScriptsUI.js */ 43);
/* harmony import */ var _Constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Constants.js */ 3);
/* harmony import */ var _engine_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./engine.js */ 5);
/* harmony import */ var _NetscriptEnvironment_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./NetscriptEnvironment.js */ 69);
@ -26921,7 +26921,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _CreateProgram_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CreateProgram.js */ 14);
/* harmony import */ var _Missions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Missions.js */ 33);
/* harmony import */ var _Player_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Player.js */ 0);
/* harmony import */ var _RedPill_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./RedPill.js */ 43);
/* harmony import */ var _RedPill_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./RedPill.js */ 44);
/* harmony import */ var _Server_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Server.js */ 10);
/* harmony import */ var _Settings_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Settings.js */ 23);
/* harmony import */ var _utils_DialogBox_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/DialogBox.js */ 6);
@ -27137,7 +27137,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasCorporationSF", function() { return hasCorporationSF; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasAISF", function() { return hasAISF; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasBladeburnerSF", function() { return hasBladeburnerSF; });
/* harmony import */ var _ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ActiveScriptsUI.js */ 44);
/* harmony import */ var _ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ActiveScriptsUI.js */ 43);
/* harmony import */ var _Augmentations_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Augmentations.js */ 19);
/* harmony import */ var _BitNode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BitNode.js */ 15);
/* harmony import */ var _Crimes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Crimes.js */ 20);
@ -27216,6 +27216,55 @@ var hasCorporationSF=false, //Source-File 3
hasBn11SF=false; //Source-File 11
var possibleLogs = {
ALL: true,
scan: true,
hack: true,
sleep: true,
disableLog: true,
enableLog: true,
grow: true,
weaken: true,
nuke: true,
brutessh: true,
ftpcrack: true,
relaysmtp: true,
httpworm: true,
sqlinject: true,
spawn: true,
kill: true,
killall: true,
scp: true,
getHackingLevel: true,
getServerMoneyAvailable: true,
getServerSecurityLevel: true,
getServerBaseSecurityLevel: true,
getServerMinSecurityLevel: true,
getServerRequiredHackingLevel: true,
getServerMaxMoney: true,
getServerGrowth: true,
getServerNumPortsRequired: true,
getServerRam: true,
buyStock: true,
sellStock: true,
purchaseServer: true,
deleteServer: true,
universityCourse: true,
gymWorkout: true,
travelToCity: true,
purchaseTor: true,
purchaseProgram: true,
stopAction: true,
upgradeHomeRam: true,
workForCompany: true,
applyToCompany: true,
joinFaction: true,
workForFaction: true,
createProgram: true,
commitCrime: true,
shortStock: true,
sellShort: true,
}
var singularitySFLvl=1, wallStreetSFLvl=1;
@ -27496,13 +27545,23 @@ function NetscriptFunctions(workerScript) {
},
disableLog : function(fn) {
if (workerScript.checkingRam) {return 0;}
if(possibleLogs[fn]===undefined) {
throw Object(_NetscriptEvaluator_js__WEBPACK_IMPORTED_MODULE_23__["makeRuntimeRejectMsg"])(workerScript, "Invalid argument to disableLog: "+fn);
}
workerScript.disableLogs[fn] = true;
if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.disableLog == null) {
workerScript.scriptRef.log("Disabled logging for " + fn);
}
},
enableLog : function(fn) {
if (workerScript.checkingRam) {return 0;}
if(possibleLogs[fn]===undefined) {
throw Object(_NetscriptEvaluator_js__WEBPACK_IMPORTED_MODULE_23__["makeRuntimeRejectMsg"])(workerScript, "Invalid argument to enableLog: "+fn);
}
delete workerScript.disableLogs[fn];
if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.enableLog == null) {
workerScript.scriptRef.log("Enabled logging for " + fn);
}
},
nuke : function(ip){
if (workerScript.checkingRam) {
@ -30473,41 +30532,42 @@ function NetscriptFunctions(workerScript) {
}
crime = crime.toLowerCase();
let enableCommitCrimeLog = workerScript.disableLogs.ALL == null && workerScript.disableLogs.commitCrime == null
if (crime.includes("shoplift")) {
workerScript.scriptRef.log("Attempting to shoplift...");
if(enableCommitCrimeLog) {workerScript.scriptRef.log("Attempting to shoplift...");}
return Object(_Crimes_js__WEBPACK_IMPORTED_MODULE_3__["commitShopliftCrime"])(_Constants_js__WEBPACK_IMPORTED_MODULE_5__["CONSTANTS"].CrimeSingFnDivider, {workerscript: workerScript});
} else if (crime.includes("rob") && crime.includes("store")) {
workerScript.scriptRef.log("Attempting to rob a store...");
if(enableCommitCrimeLog) {workerScript.scriptRef.log("Attempting to rob a store...");}
return Object(_Crimes_js__WEBPACK_IMPORTED_MODULE_3__["commitRobStoreCrime"])(_Constants_js__WEBPACK_IMPORTED_MODULE_5__["CONSTANTS"].CrimeSingFnDivider, {workerscript: workerScript});
} else if (crime.includes("mug")) {
workerScript.scriptRef.log("Attempting to mug someone...");
if(enableCommitCrimeLog) {workerScript.scriptRef.log("Attempting to mug someone...");}
return Object(_Crimes_js__WEBPACK_IMPORTED_MODULE_3__["commitMugCrime"])(_Constants_js__WEBPACK_IMPORTED_MODULE_5__["CONSTANTS"].CrimeSingFnDivider, {workerscript: workerScript});
} else if (crime.includes("larceny")) {
workerScript.scriptRef.log("Attempting to commit larceny...");
if(enableCommitCrimeLog) {workerScript.scriptRef.log("Attempting to commit larceny...");}
return Object(_Crimes_js__WEBPACK_IMPORTED_MODULE_3__["commitLarcenyCrime"])(_Constants_js__WEBPACK_IMPORTED_MODULE_5__["CONSTANTS"].CrimeSingFnDivider, {workerscript: workerScript});
} else if (crime.includes("drugs")) {
workerScript.scriptRef.log("Attempting to deal drugs...");
if(enableCommitCrimeLog) {workerScript.scriptRef.log("Attempting to deal drugs...");}
return Object(_Crimes_js__WEBPACK_IMPORTED_MODULE_3__["commitDealDrugsCrime"])(_Constants_js__WEBPACK_IMPORTED_MODULE_5__["CONSTANTS"].CrimeSingFnDivider, {workerscript: workerScript});
} else if (crime.includes("bond") && crime.includes("forge")) {
workerScript.scriptRef.log("Attempting to forge corporate bonds...");
if(enableCommitCrimeLog) {workerScript.scriptRef.log("Attempting to forge corporate bonds...");}
return Object(_Crimes_js__WEBPACK_IMPORTED_MODULE_3__["commitBondForgeryCrime"])(_Constants_js__WEBPACK_IMPORTED_MODULE_5__["CONSTANTS"].CrimeSingFnDivider, {workerscript: workerScript});
} else if (crime.includes("traffick") && crime.includes("arms")) {
workerScript.scriptRef.log("Attempting to traffick illegal arms...");
if(enableCommitCrimeLog) {workerScript.scriptRef.log("Attempting to traffick illegal arms...");}
return Object(_Crimes_js__WEBPACK_IMPORTED_MODULE_3__["commitTraffickArmsCrime"])(_Constants_js__WEBPACK_IMPORTED_MODULE_5__["CONSTANTS"].CrimeSingFnDivider, {workerscript: workerScript});
} else if (crime.includes("homicide")) {
workerScript.scriptRef.log("Attempting to commit homicide...");
if(enableCommitCrimeLog) {workerScript.scriptRef.log("Attempting to commit homicide...");}
return Object(_Crimes_js__WEBPACK_IMPORTED_MODULE_3__["commitHomicideCrime"])(_Constants_js__WEBPACK_IMPORTED_MODULE_5__["CONSTANTS"].CrimeSingFnDivider, {workerscript: workerScript});
} else if (crime.includes("grand") && crime.includes("auto")) {
workerScript.scriptRef.log("Attempting to commit grand theft auto...");
if(enableCommitCrimeLog) {workerScript.scriptRef.log("Attempting to commit grand theft auto...");}
return Object(_Crimes_js__WEBPACK_IMPORTED_MODULE_3__["commitGrandTheftAutoCrime"])(_Constants_js__WEBPACK_IMPORTED_MODULE_5__["CONSTANTS"].CrimeSingFnDivider, {workerscript: workerScript});
} else if (crime.includes("kidnap")) {
workerScript.scriptRef.log("Attempting to kidnap and ransom a high-profile target...");
if(enableCommitCrimeLog) {workerScript.scriptRef.log("Attempting to kidnap and ransom a high-profile target...");}
return Object(_Crimes_js__WEBPACK_IMPORTED_MODULE_3__["commitKidnapCrime"])(_Constants_js__WEBPACK_IMPORTED_MODULE_5__["CONSTANTS"].CrimeSingFnDivider, {workerscript: workerScript});
} else if (crime.includes("assassinate")) {
workerScript.scriptRef.log("Attempting to assassinate a high-profile target...");
if(enableCommitCrimeLog) {workerScript.scriptRef.log("Attempting to assassinate a high-profile target...");}
return Object(_Crimes_js__WEBPACK_IMPORTED_MODULE_3__["commitAssassinationCrime"])(_Constants_js__WEBPACK_IMPORTED_MODULE_5__["CONSTANTS"].CrimeSingFnDivider, {workerscript: workerScript})
} else if (crime.includes("heist")) {
workerScript.scriptRef.log("Attempting to pull off a heist...");
if(enableCommitCrimeLog) {workerScript.scriptRef.log("Attempting to pull off a heist...");}
return Object(_Crimes_js__WEBPACK_IMPORTED_MODULE_3__["commitHeistCrime"])(_Constants_js__WEBPACK_IMPORTED_MODULE_5__["CONSTANTS"].CrimeSingFnDivider, {workerscript: workerScript});
} else {
throw Object(_NetscriptEvaluator_js__WEBPACK_IMPORTED_MODULE_23__["makeRuntimeRejectMsg"])(workerScript, "Invalid crime passed into commitCrime(): " + crime);
@ -54849,6 +54909,312 @@ function applySourceFile(srcFile) {
/***/ }),
/* 43 */
/*!********************************!*\
!*** ./src/ActiveScriptsUI.js ***!
\********************************/
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addActiveScriptsItem", function() { return addActiveScriptsItem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deleteActiveScriptsItem", function() { return deleteActiveScriptsItem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateActiveScriptsItems", function() { return updateActiveScriptsItems; });
/* harmony import */ var _engine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./engine.js */ 5);
/* harmony import */ var _NetscriptWorker_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./NetscriptWorker.js */ 21);
/* harmony import */ var _Player_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Player.js */ 0);
/* harmony import */ var _Server_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Server.js */ 10);
/* harmony import */ var _utils_DialogBox_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/DialogBox.js */ 6);
/* harmony import */ var _utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/HelperFunctions.js */ 1);
/* harmony import */ var _utils_LogBox_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/LogBox.js */ 51);
/* harmony import */ var _utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/numeral.min.js */ 13);
/* harmony import */ var _utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/StringHelperFunctions.js */ 2);
/* {
* serverName: {
* header: Server Header Element
* panel: Server Panel List (ul) element
* scripts: {
* script id: Ref to Script information
* }
* }
* ...
*/
let ActiveScriptsUI = {};
let ActiveScriptsTasks = []; //Sequentially schedule the creation/deletion of UI elements
function createActiveScriptsServerPanel(server) {
ActiveScriptsTasks.push(function(server) {
let hostname = server.hostname;
var activeScriptsList = document.getElementById("active-scripts-list");
let res = Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["createAccordionElement"])({hdrText:hostname});
let li = res[0];
var hdr = res[1];
let panel = res[2];
if (ActiveScriptsUI[hostname] != null) {
console.log("WARNING: Tried to create already-existing Active Scripts Server panel. This is most likely fine. It probably means many scripts just got started up on a new server. Aborting");
return;
}
var panelScriptList = Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["createElement"])("ul");
panel.appendChild(panelScriptList);
activeScriptsList.appendChild(li);
ActiveScriptsUI[hostname] = {
header: hdr,
panel: panel,
panelList: panelScriptList,
scripts: {}, //Holds references to li elements for each active script
scriptHdrs: {}, //Holds references to header elements for each active script
scriptStats: {} //Holds references to the p elements containing text for each active script
};
return li;
}.bind(null, server));
}
//Deletes the info for a particular server (Dropdown header + Panel with all info)
//in the Active Scripts page if it exists
function deleteActiveScriptsServerPanel(server) {
ActiveScriptsTasks.push(function(server) {
let hostname = server.hostname;
if (ActiveScriptsUI[hostname] == null) {
console.log("WARNING: Tried to delete non-existent Active Scripts Server panel. Aborting");
return;
}
//Make sure it's empty
if (Object.keys(ActiveScriptsUI[hostname].scripts).length > 0) {
console.log("WARNING: Tried to delete Active Scripts Server panel that still has scripts. Aborting");
return;
}
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["removeElement"])(ActiveScriptsUI[hostname].panel);
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["removeElement"])(ActiveScriptsUI[hostname].header);
delete ActiveScriptsUI[hostname];
}.bind(null, server));
}
function addActiveScriptsItem(workerscript) {
var server = Object(_Server_js__WEBPACK_IMPORTED_MODULE_3__["getServer"])(workerscript.serverIp);
if (server == null) {
console.log("ERROR: Invalid server IP for workerscript in addActiveScriptsItem()");
return;
}
let hostname = server.hostname;
if (ActiveScriptsUI[hostname] == null) {
createActiveScriptsServerPanel(server);
}
ActiveScriptsTasks.push(function(workerscript, hostname) {
//Create the unique identifier (key) for this script
var itemNameArray = ["active", "scripts", hostname, workerscript.name];
for (var i = 0; i < workerscript.args.length; ++i) {
itemNameArray.push(String(workerscript.args[i]));
}
var itemName = itemNameArray.join("-");
let res = Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["createAccordionElement"])({hdrText:workerscript.name});
let li = res[0];
let hdr = res[1];
let panel = res[2];
hdr.classList.remove("accordion-header");
hdr.classList.add("active-scripts-script-header");
panel.classList.remove("accordion-panel");
panel.classList.add("active-scripts-script-panel");
//Handle the constant elements on the panel that don't change after creation
//Threads, args, kill/log button
panel.appendChild(Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["createElement"])("p", {
innerHTML: "Threads: " + workerscript.scriptRef.threads + "<br>" +
"Args: " + Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["printArray"])(workerscript.args)
}));
var panelText = Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["createElement"])("p", {
innerText:"Loading...", fontSize:"14px",
});
panel.appendChild(panelText);
panel.appendChild(Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["createElement"])("br"));
panel.appendChild(Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["createElement"])("span", {
innerText:"Log", class:"active-scripts-button", margin:"4px", padding:"4px",
clickListener:()=>{
Object(_utils_LogBox_js__WEBPACK_IMPORTED_MODULE_6__["logBoxCreate"])(workerscript.scriptRef);
return false;
}
}));
panel.appendChild(Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["createElement"])("span", {
innerText:"Kill Script", class:"active-scripts-button", margin:"4px", padding:"4px",
clickListener:()=>{
Object(_NetscriptWorker_js__WEBPACK_IMPORTED_MODULE_1__["killWorkerScript"])(workerscript.scriptRef, workerscript.scriptRef.scriptRef.server);
Object(_utils_DialogBox_js__WEBPACK_IMPORTED_MODULE_4__["dialogBoxCreate"])("Killing script, may take a few minutes to complete...");
return false;
}
}));
//Append element to list
ActiveScriptsUI[hostname]["panelList"].appendChild(li);
ActiveScriptsUI[hostname].scripts[itemName] = li;
ActiveScriptsUI[hostname].scriptHdrs[itemName] = hdr;
ActiveScriptsUI[hostname].scriptStats[itemName] = panelText;
}.bind(null, workerscript, hostname));
}
function deleteActiveScriptsItem(workerscript) {
ActiveScriptsTasks.push(function(workerscript) {
var server = Object(_Server_js__WEBPACK_IMPORTED_MODULE_3__["getServer"])(workerscript.serverIp);
if (server == null) {
throw new Error("ERROR: Invalid server IP for workerscript. This most likely occurred because " +
"you tried to delete a large number of scripts and also purchased servers at the " +
"same time. It's not a big deal, just save and refresh the game.");
return;
}
let hostname = server.hostname;
if (ActiveScriptsUI[hostname] == null) {
console.log("ERROR: Trying to delete Active Script UI Element with a hostname that cant be found in ActiveScriptsUI: " + hostname);
return;
}
var itemNameArray = ["active", "scripts", server.hostname, workerscript.name];
for (var i = 0; i < workerscript.args.length; ++i) {
itemNameArray.push(String(workerscript.args[i]));
}
var itemName = itemNameArray.join("-");
let li = ActiveScriptsUI[hostname].scripts[itemName];
if (li == null) {
console.log("ERROR: Cannot find Active Script UI element for workerscript: ");
console.log(workerscript);
return;
}
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["removeElement"])(li);
delete ActiveScriptsUI[hostname].scripts[itemName];
delete ActiveScriptsUI[hostname].scriptHdrs[itemName];
delete ActiveScriptsUI[hostname].scriptStats[itemName];
if (Object.keys(ActiveScriptsUI[hostname].scripts).length === 0) {
deleteActiveScriptsServerPanel(server);
}
}.bind(null, workerscript));
}
//Update the ActiveScriptsItems array
function updateActiveScriptsItems() {
//Run tasks that need to be done sequentially (adding items, creating/deleting server panels)
//We'll limit this to 50 at a time in case someone decides to start a bunch of scripts all at once...
let numTasks = Math.min(100, ActiveScriptsTasks.length);
for (let i = 0; i < numTasks; ++i) {
let task = ActiveScriptsTasks.shift();
try {
task();
} catch(e) {
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["exceptionAlert"])(e);
console.log(task);
}
}
if (_engine_js__WEBPACK_IMPORTED_MODULE_0__["Engine"].currentPage !== _engine_js__WEBPACK_IMPORTED_MODULE_0__["Engine"].Page.ActiveScripts) {return;}
var total = 0;
for (var i = 0; i < _NetscriptWorker_js__WEBPACK_IMPORTED_MODULE_1__["workerScripts"].length; ++i) {
try {
total += updateActiveScriptsItemContent(_NetscriptWorker_js__WEBPACK_IMPORTED_MODULE_1__["workerScripts"][i]);
} catch(e) {
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["exceptionAlert"])(e);
}
}
document.getElementById("active-scripts-total-prod").innerHTML =
"Total online production of Active Scripts: " + _utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_7___default()(total).format('$0.000a') + " / sec<br>" +
"Total online production since last Aug installation: " +
_utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_7___default()(_Player_js__WEBPACK_IMPORTED_MODULE_2__["Player"].scriptProdSinceLastAug).format('$0.000a') + " (" +
_utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_7___default()(_Player_js__WEBPACK_IMPORTED_MODULE_2__["Player"].scriptProdSinceLastAug / (_Player_js__WEBPACK_IMPORTED_MODULE_2__["Player"].playtimeSinceLastAug/1000)).format('$0.000a') + " / sec)";
return total;
}
//Updates the content of the given item in the Active Scripts list
function updateActiveScriptsItemContent(workerscript) {
var server = Object(_Server_js__WEBPACK_IMPORTED_MODULE_3__["getServer"])(workerscript.serverIp);
if (server == null) {
console.log("ERROR: Invalid server IP for workerscript.");
return;
}
let hostname = server.hostname;
if (ActiveScriptsUI[hostname] == null) {
return; //Hasn't been created yet. We'll skip it
}
var itemNameArray = ["active", "scripts", server.hostname, workerscript.name];
for (var i = 0; i < workerscript.args.length; ++i) {
itemNameArray.push(String(workerscript.args[i]));
}
var itemName = itemNameArray.join("-");
if (ActiveScriptsUI[hostname].scriptStats[itemName] == null) {
return; //Hasn't been fully added yet. We'll skip it
}
var item = ActiveScriptsUI[hostname].scriptStats[itemName];
//Update the text if necessary. This fn returns the online $/s production
return updateActiveScriptsText(workerscript, item, itemName);
}
function updateActiveScriptsText(workerscript, item, itemName) {
var server = Object(_Server_js__WEBPACK_IMPORTED_MODULE_3__["getServer"])(workerscript.serverIp);
if (server == null) {
console.log("ERROR: Invalid server IP for workerscript.");
return;
}
let hostname = server.hostname;
if (ActiveScriptsUI[hostname] == null || ActiveScriptsUI[hostname].scriptHdrs[itemName] == null) {
console.log("ERROR: Trying to update Active Script UI Element with a hostname that cant be found in ActiveScriptsUI: " + hostname);
return;
}
var onlineMps = workerscript.scriptRef.onlineMoneyMade / workerscript.scriptRef.onlineRunningTime;
//Only update if the item is visible
if (ActiveScriptsUI[hostname].header.classList.contains("active") === false) {return onlineMps;}
if (ActiveScriptsUI[hostname].scriptHdrs[itemName].classList.contains("active") === false) {return onlineMps;}
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["removeChildrenFromElement"])(item);
//Online
var onlineTotalMoneyMade = "Total online production: $" + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_8__["formatNumber"])(workerscript.scriptRef.onlineMoneyMade, 2);
var onlineTotalExpEarned = (Array(26).join(" ") + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_8__["formatNumber"])(workerscript.scriptRef.onlineExpGained, 2) + " hacking exp").replace( / /g, "&nbsp;");
var onlineMpsText = "Online production rate: $" + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_8__["formatNumber"])(onlineMps, 2) + "/second";
var onlineEps = workerscript.scriptRef.onlineExpGained / workerscript.scriptRef.onlineRunningTime;
var onlineEpsText = (Array(25).join(" ") + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_8__["formatNumber"])(onlineEps, 4) + " hacking exp/second").replace( / /g, "&nbsp;");
//Offline
var offlineTotalMoneyMade = "Total offline production: $" + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_8__["formatNumber"])(workerscript.scriptRef.offlineMoneyMade, 2);
var offlineTotalExpEarned = (Array(27).join(" ") + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_8__["formatNumber"])(workerscript.scriptRef.offlineExpGained, 2) + " hacking exp").replace( / /g, "&nbsp;");
var offlineMps = workerscript.scriptRef.offlineMoneyMade / workerscript.scriptRef.offlineRunningTime;
var offlineMpsText = "Offline production rate: $" + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_8__["formatNumber"])(offlineMps, 2) + "/second";
var offlineEps = workerscript.scriptRef.offlineExpGained / workerscript.scriptRef.offlineRunningTime;
var offlineEpsText = (Array(26).join(" ") + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_8__["formatNumber"])(offlineEps, 4) + " hacking exp/second").replace( / /g, "&nbsp;");
item.innerHTML = onlineTotalMoneyMade + "<br>" + onlineTotalExpEarned + "<br>" +
onlineMpsText + "<br>" + onlineEpsText + "<br>" + offlineTotalMoneyMade + "<br>" + offlineTotalExpEarned + "<br>" +
offlineMpsText + "<br>" + offlineEpsText + "<br>";
return onlineMps;
}
/***/ }),
/* 44 */
/*!************************!*\
!*** ./src/RedPill.js ***!
\************************/
@ -55196,307 +55562,6 @@ function createBitNodeYesNoEventListeners(newBitNode, destroyedBitNode, flume=fa
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ 38)))
/***/ }),
/* 44 */
/*!********************************!*\
!*** ./src/ActiveScriptsUI.js ***!
\********************************/
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addActiveScriptsItem", function() { return addActiveScriptsItem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deleteActiveScriptsItem", function() { return deleteActiveScriptsItem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateActiveScriptsItems", function() { return updateActiveScriptsItems; });
/* harmony import */ var _NetscriptWorker_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./NetscriptWorker.js */ 21);
/* harmony import */ var _Player_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Player.js */ 0);
/* harmony import */ var _Server_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Server.js */ 10);
/* harmony import */ var _utils_DialogBox_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/DialogBox.js */ 6);
/* harmony import */ var _utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/HelperFunctions.js */ 1);
/* harmony import */ var _utils_LogBox_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/LogBox.js */ 51);
/* harmony import */ var _utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/numeral.min.js */ 13);
/* harmony import */ var _utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/StringHelperFunctions.js */ 2);
/* {
* serverName: {
* header: Server Header Element
* panel: Server Panel List (ul) element
* scripts: {
* script id: Ref to Script information
* }
* }
* ...
*/
let ActiveScriptsUI = {};
let ActiveScriptsTasks = []; //Sequentially schedule the creation/deletion of UI elements
function createActiveScriptsServerPanel(server) {
ActiveScriptsTasks.push(function(server) {
let hostname = server.hostname;
var activeScriptsList = document.getElementById("active-scripts-list");
let res = Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["createAccordionElement"])({hdrText:hostname});
let li = res[0];
var hdr = res[1];
let panel = res[2];
if (ActiveScriptsUI[hostname] != null) {
console.log("WARNING: Tried to create already-existing Active Scripts Server panel. This is most likely fine. It probably means many scripts just got started up on a new server. Aborting");
return;
}
var panelScriptList = Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["createElement"])("ul");
panel.appendChild(panelScriptList);
activeScriptsList.appendChild(li);
ActiveScriptsUI[hostname] = {
header: hdr,
panel: panel,
panelList: panelScriptList,
scripts: {}, //Holds references to li elements for each active script
scriptHdrs: {}, //Holds references to header elements for each active script
scriptStats: {} //Holds references to the p elements containing text for each active script
};
return li;
}.bind(null, server));
}
//Deletes the info for a particular server (Dropdown header + Panel with all info)
//in the Active Scripts page if it exists
function deleteActiveScriptsServerPanel(server) {
ActiveScriptsTasks.push(function(server) {
let hostname = server.hostname;
if (ActiveScriptsUI[hostname] == null) {
console.log("WARNING: Tried to delete non-existent Active Scripts Server panel. Aborting");
return;
}
//Make sure it's empty
if (Object.keys(ActiveScriptsUI[hostname].scripts).length > 0) {
console.log("WARNING: Tried to delete Active Scripts Server panel that still has scripts. Aborting");
return;
}
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["removeElement"])(ActiveScriptsUI[hostname].panel);
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["removeElement"])(ActiveScriptsUI[hostname].header);
delete ActiveScriptsUI[hostname];
}.bind(null, server));
}
function addActiveScriptsItem(workerscript) {
var server = Object(_Server_js__WEBPACK_IMPORTED_MODULE_2__["getServer"])(workerscript.serverIp);
if (server == null) {
console.log("ERROR: Invalid server IP for workerscript in addActiveScriptsItem()");
return;
}
let hostname = server.hostname;
if (ActiveScriptsUI[hostname] == null) {
createActiveScriptsServerPanel(server);
}
ActiveScriptsTasks.push(function(workerscript, hostname) {
//Create the unique identifier (key) for this script
var itemNameArray = ["active", "scripts", hostname, workerscript.name];
for (var i = 0; i < workerscript.args.length; ++i) {
itemNameArray.push(String(workerscript.args[i]));
}
var itemName = itemNameArray.join("-");
let res = Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["createAccordionElement"])({hdrText:workerscript.name});
let li = res[0];
let hdr = res[1];
let panel = res[2];
hdr.classList.remove("accordion-header");
hdr.classList.add("active-scripts-script-header");
panel.classList.remove("accordion-panel");
panel.classList.add("active-scripts-script-panel");
//Handle the constant elements on the panel that don't change after creation
//Threads, args, kill/log button
panel.appendChild(Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["createElement"])("p", {
innerHTML: "Threads: " + workerscript.scriptRef.threads + "<br>" +
"Args: " + Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["printArray"])(workerscript.args)
}));
var panelText = Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["createElement"])("p", {
innerText:"Loading...", fontSize:"14px",
});
panel.appendChild(panelText);
panel.appendChild(Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["createElement"])("br"));
panel.appendChild(Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["createElement"])("span", {
innerText:"Log", class:"active-scripts-button", margin:"4px", padding:"4px",
clickListener:()=>{
Object(_utils_LogBox_js__WEBPACK_IMPORTED_MODULE_5__["logBoxCreate"])(workerscript.scriptRef);
return false;
}
}));
panel.appendChild(Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["createElement"])("span", {
innerText:"Kill Script", class:"active-scripts-button", margin:"4px", padding:"4px",
clickListener:()=>{
Object(_NetscriptWorker_js__WEBPACK_IMPORTED_MODULE_0__["killWorkerScript"])(workerscript.scriptRef, workerscript.scriptRef.scriptRef.server);
Object(_utils_DialogBox_js__WEBPACK_IMPORTED_MODULE_3__["dialogBoxCreate"])("Killing script, may take a few minutes to complete...");
return false;
}
}));
//Append element to list
ActiveScriptsUI[hostname]["panelList"].appendChild(li);
ActiveScriptsUI[hostname].scripts[itemName] = li;
ActiveScriptsUI[hostname].scriptHdrs[itemName] = hdr;
ActiveScriptsUI[hostname].scriptStats[itemName] = panelText;
}.bind(null, workerscript, hostname));
}
function deleteActiveScriptsItem(workerscript) {
ActiveScriptsTasks.push(function(workerscript) {
var server = Object(_Server_js__WEBPACK_IMPORTED_MODULE_2__["getServer"])(workerscript.serverIp);
if (server == null) {
console.log("ERROR: Invalid server IP for workerscript.");
return;
}
let hostname = server.hostname;
if (ActiveScriptsUI[hostname] == null) {
console.log("ERROR: Trying to delete Active Script UI Element with a hostname that cant be found in ActiveScriptsUI: " + hostname);
return;
}
var itemNameArray = ["active", "scripts", server.hostname, workerscript.name];
for (var i = 0; i < workerscript.args.length; ++i) {
itemNameArray.push(String(workerscript.args[i]));
}
var itemName = itemNameArray.join("-");
let li = ActiveScriptsUI[hostname].scripts[itemName];
if (li == null) {
console.log("ERROR: Cannot find Active Script UI element for workerscript: ");
console.log(workerscript);
return;
}
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["removeElement"])(li);
delete ActiveScriptsUI[hostname].scripts[itemName];
delete ActiveScriptsUI[hostname].scriptHdrs[itemName];
delete ActiveScriptsUI[hostname].scriptStats[itemName];
if (Object.keys(ActiveScriptsUI[hostname].scripts).length === 0) {
deleteActiveScriptsServerPanel(server);
}
}.bind(null, workerscript));
}
//Update the ActiveScriptsItems array
function updateActiveScriptsItems() {
//Run tasks that need to be done sequentially (adding items, creating/deleting server panels)
//We'll limit this to 50 at a time in case someone decides to start a bunch of scripts all at once...
let numTasks = Math.min(50, ActiveScriptsTasks.length);
for (let i = 0; i < numTasks; ++i) {
let task = ActiveScriptsTasks.shift();
try {
task();
} catch(e) {
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["exceptionAlert"])(e);
console.log(task);
}
}
var total = 0;
for (var i = 0; i < _NetscriptWorker_js__WEBPACK_IMPORTED_MODULE_0__["workerScripts"].length; ++i) {
try {
total += updateActiveScriptsItemContent(_NetscriptWorker_js__WEBPACK_IMPORTED_MODULE_0__["workerScripts"][i]);
} catch(e) {
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["exceptionAlert"])(e);
}
}
document.getElementById("active-scripts-total-prod").innerHTML =
"Total online production of Active Scripts: " + _utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_6___default()(total).format('$0.000a') + " / sec<br>" +
"Total online production since last Aug installation: " +
_utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_6___default()(_Player_js__WEBPACK_IMPORTED_MODULE_1__["Player"].scriptProdSinceLastAug).format('$0.000a') + " (" +
_utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_6___default()(_Player_js__WEBPACK_IMPORTED_MODULE_1__["Player"].scriptProdSinceLastAug / (_Player_js__WEBPACK_IMPORTED_MODULE_1__["Player"].playtimeSinceLastAug/1000)).format('$0.000a') + " / sec)";
return total;
}
//Updates the content of the given item in the Active Scripts list
function updateActiveScriptsItemContent(workerscript) {
var server = Object(_Server_js__WEBPACK_IMPORTED_MODULE_2__["getServer"])(workerscript.serverIp);
if (server == null) {
console.log("ERROR: Invalid server IP for workerscript.");
return;
}
let hostname = server.hostname;
if (ActiveScriptsUI[hostname] == null) {
return; //Hasn't been created yet. We'll skip it
}
var itemNameArray = ["active", "scripts", server.hostname, workerscript.name];
for (var i = 0; i < workerscript.args.length; ++i) {
itemNameArray.push(String(workerscript.args[i]));
}
var itemName = itemNameArray.join("-");
if (ActiveScriptsUI[hostname].scriptStats[itemName] == null) {
return; //Hasn't been fully added yet. We'll skip it
}
var item = ActiveScriptsUI[hostname].scriptStats[itemName];
//Update the text if necessary. This fn returns the online $/s production
return updateActiveScriptsText(workerscript, item, itemName);
}
function updateActiveScriptsText(workerscript, item, itemName) {
var server = Object(_Server_js__WEBPACK_IMPORTED_MODULE_2__["getServer"])(workerscript.serverIp);
if (server == null) {
console.log("ERROR: Invalid server IP for workerscript.");
return;
}
let hostname = server.hostname;
if (ActiveScriptsUI[hostname] == null || ActiveScriptsUI[hostname].scriptHdrs[itemName] == null) {
console.log("ERROR: Trying to update Active Script UI Element with a hostname that cant be found in ActiveScriptsUI: " + hostname);
return;
}
var onlineMps = workerscript.scriptRef.onlineMoneyMade / workerscript.scriptRef.onlineRunningTime;
//Only update if the item is visible
if (ActiveScriptsUI[hostname].header.classList.contains("active") === false) {return onlineMps;}
if (ActiveScriptsUI[hostname].scriptHdrs[itemName].classList.contains("active") === false) {return onlineMps;}
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["removeChildrenFromElement"])(item);
//Online
var onlineTotalMoneyMade = "Total online production: $" + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_7__["formatNumber"])(workerscript.scriptRef.onlineMoneyMade, 2);
var onlineTotalExpEarned = (Array(26).join(" ") + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_7__["formatNumber"])(workerscript.scriptRef.onlineExpGained, 2) + " hacking exp").replace( / /g, "&nbsp;");
var onlineMpsText = "Online production rate: $" + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_7__["formatNumber"])(onlineMps, 2) + "/second";
var onlineEps = workerscript.scriptRef.onlineExpGained / workerscript.scriptRef.onlineRunningTime;
var onlineEpsText = (Array(25).join(" ") + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_7__["formatNumber"])(onlineEps, 4) + " hacking exp/second").replace( / /g, "&nbsp;");
//Offline
var offlineTotalMoneyMade = "Total offline production: $" + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_7__["formatNumber"])(workerscript.scriptRef.offlineMoneyMade, 2);
var offlineTotalExpEarned = (Array(27).join(" ") + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_7__["formatNumber"])(workerscript.scriptRef.offlineExpGained, 2) + " hacking exp").replace( / /g, "&nbsp;");
var offlineMps = workerscript.scriptRef.offlineMoneyMade / workerscript.scriptRef.offlineRunningTime;
var offlineMpsText = "Offline production rate: $" + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_7__["formatNumber"])(offlineMps, 2) + "/second";
var offlineEps = workerscript.scriptRef.offlineExpGained / workerscript.scriptRef.offlineRunningTime;
var offlineEpsText = (Array(26).join(" ") + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_7__["formatNumber"])(offlineEps, 4) + " hacking exp/second").replace( / /g, "&nbsp;");
item.innerHTML = onlineTotalMoneyMade + "<br>" + onlineTotalExpEarned + "<br>" +
onlineMpsText + "<br>" + onlineEpsText + "<br>" + offlineTotalMoneyMade + "<br>" + offlineTotalExpEarned + "<br>" +
offlineMpsText + "<br>" + offlineEpsText + "<br>";
return onlineMps;
}
/***/ }),
/* 45 */
/*!******************************!*\
@ -56222,7 +56287,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _Faction_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Faction.js */ 11);
/* harmony import */ var _Location_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Location.js */ 4);
/* harmony import */ var _Player_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Player.js */ 0);
/* harmony import */ var _RedPill_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./RedPill.js */ 43);
/* harmony import */ var _RedPill_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./RedPill.js */ 44);
/* harmony import */ var _Terminal_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Terminal.js */ 18);
/* harmony import */ var _utils_DialogBox_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/DialogBox.js */ 6);
/* harmony import */ var _utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/HelperFunctions.js */ 1);
@ -59401,7 +59466,7 @@ function initBladeburner() {
name:SkillNames.Overclock,
desc:"Each level of this skill decreases the time it takes " +
"to attempt a contract or operation by 1% (Max Level: 99)",
baseCost:5, costInc:1, maxLvl:99,
baseCost:5, costInc:1, maxLvl:95,
actionTime:1
});
Skills[SkillNames.EvasiveSystem] = new Skill({
@ -61065,7 +61130,7 @@ exports.Utf8EncodeWorker = Utf8EncodeWorker;
__webpack_require__.r(__webpack_exports__);
/* WEBPACK VAR INJECTION */(function($) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prestigeAugmentation", function() { return prestigeAugmentation; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prestigeSourceFile", function() { return prestigeSourceFile; });
/* harmony import */ var _ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ActiveScriptsUI.js */ 44);
/* harmony import */ var _ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ActiveScriptsUI.js */ 43);
/* harmony import */ var _Augmentations_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Augmentations.js */ 19);
/* harmony import */ var _BitNode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BitNode.js */ 15);
/* harmony import */ var _CinematicText_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CinematicText.js */ 70);

769
dist/tests.bundle.js vendored

@ -1684,6 +1684,7 @@ PlayerObject.prototype.finishCrime = function(cancelled) {
this.workAgiExpGained *= 2;
this.workChaExpGained *= 2;
if (this.committingCrimeThruSingFn) {
if(this.singFnCrimeWorkerScript.disableLogs.ALL == null && this.singFnCrimeWorkerScript.disableLogs.commitCrime == null) {
this.singFnCrimeWorkerScript.scriptRef.log("Crime successful! Gained " +
_utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_20___default()(this.workMoneyGained).format("$0.000a") + ", " +
Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_21__["formatNumber"])(this.workHackExpGained, 3) + " hack exp, " +
@ -1692,6 +1693,7 @@ PlayerObject.prototype.finishCrime = function(cancelled) {
Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_21__["formatNumber"])(this.workDexExpGained, 3) + " dex exp, " +
Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_21__["formatNumber"])(this.workAgiExpGained, 3) + " agi exp, " +
Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_21__["formatNumber"])(this.workChaExpGained, 3) + " cha exp.");
}
} else {
Object(_utils_DialogBox_js__WEBPACK_IMPORTED_MODULE_16__["dialogBoxCreate"])("Crime successful! <br><br>" +
"You gained:<br>"+
@ -1713,13 +1715,15 @@ PlayerObject.prototype.finishCrime = function(cancelled) {
this.workAgiExpGained /= 2;
this.workChaExpGained /= 2;
if (this.committingCrimeThruSingFn) {
if(this.singFnCrimeWorkerScript.disableLogs.ALL == null && this.singFnCrimeWorkerScript.disableLogs.commitCrime == null) {
this.singFnCrimeWorkerScript.scriptRef.log("Crime failed! Gained " +
Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_21__["formatNumber"])(this.workHackExpGained, 3) + " hack exp, " +
Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_21__["formatNumber"])(this.workStrExpGained, 3) + " str exp, " +
Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_21__["formatNumber"])(this.workDefExpGained, 3) + " def exp, " +
Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_21__["formatNumber"])(this.workDexExpGained, 3) + " dex exp, " +
Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_21__["formatNumber"])(this.workAgiExpGained, 3) + " agi exp, " +
Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_21__["formatNumber"])(this.workChaExpGained, 3) + " chaexp.");
Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_21__["formatNumber"])(this.workChaExpGained, 3) + " cha exp.");
}
} else {
Object(_utils_DialogBox_js__WEBPACK_IMPORTED_MODULE_16__["dialogBoxCreate"])("Crime failed! <br><br>" +
"You gained:<br>"+
@ -2953,7 +2957,7 @@ function generateRandomString(n) {
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONSTANTS", function() { return CONSTANTS; });
let CONSTANTS = {
Version: "0.36.0",
Version: "0.36.1",
//Max level for any skill, assuming no multipliers. Determined by max numerical value in javascript for experience
//and the skill level formula in Player.js. Note that all this means it that when experience hits MAX_INT, then
@ -4101,6 +4105,7 @@ let CONSTANTS = {
"** Datamancer skill effect increased from 4% per level to 5%<br>" +
"** Slightly decreased the base stamina cost of contracts/operations<br>" +
"** Slightly increased the effects of the Tracer, Digital Observer, Short Circuit, Cloak, and Blade's Intuition skills<br>" +
"** Overclock skill capped at level 95, rather than 99<br>" +
"** Training gives significantly more exp/s<br>" +
"* Crime, Infiltration, and Hacking are now slightly more profitable in BN-6<br>" +
"* Gyms are now more expensive, but give slightly more exp<br>" +
@ -4112,8 +4117,10 @@ let CONSTANTS = {
"* Added an option to disable hotkeys/keyboard shortcuts<br>" +
"* Refactored 'Active Scripts' UI page to optimize its performance<br>" +
"* Added a new .fconf Terminal setting: ENABLE_TIMESTAMP<br>" +
"* 'Netscript Execution Time', which can be found in the Options, now has a minimum value of 15ms rather than 25ms<br>" +
"* Bug Fix: Fixed a typo in the Fulcrum Technologies company name (Technolgies -> Technologies)<br>" +
"* Bug Fix: hacknetnodes keyword should no longer incur RAM cost if its in a comment<br>"
"* Bug Fix: hacknetnodes keyword should no longer incur RAM cost if its in a comment<br>" +
"* Bug Fix: disableLog() now works for the commitCrime() Netscript function (fixed by Github user hydroflame)"
}
@ -6351,7 +6358,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/StringHelperFunctions.js */ 2);
/* harmony import */ var _utils_LogBox_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/LogBox.js */ 51);
/* harmony import */ var _ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ActiveScriptsUI.js */ 44);
/* harmony import */ var _ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ActiveScriptsUI.js */ 43);
/* harmony import */ var _Augmentations_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Augmentations.js */ 19);
/* harmony import */ var _BitNode_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./BitNode.js */ 15);
/* harmony import */ var _Bladeburner_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Bladeburner.js */ 47);
@ -6373,7 +6380,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _NetscriptWorker_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./NetscriptWorker.js */ 21);
/* harmony import */ var _Player_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./Player.js */ 0);
/* harmony import */ var _Prestige_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./Prestige.js */ 57);
/* harmony import */ var _RedPill_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./RedPill.js */ 43);
/* harmony import */ var _RedPill_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./RedPill.js */ 44);
/* harmony import */ var _SaveObject_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./SaveObject.js */ 46);
/* harmony import */ var _Script_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./Script.js */ 26);
/* harmony import */ var _Server_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./Server.js */ 10);
@ -6860,30 +6867,18 @@ let Engine = {
displayCharacterOverviewInfo: function() {
if (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].hp == null) {_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].hp = _Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].max_hp;}
var overviewText = "Hp: " + _Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].hp + " / " + _Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].max_hp + "<br>" +
"Money: " + _utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_3___default()(_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].money.toNumber()).format('($0.000a)') + "<br>" +
"Hack: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].hacking_skill).toLocaleString() + "<br>" +
"Str: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].strength).toLocaleString() + "<br>" +
"Def: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].defense).toLocaleString() + "<br>" +
"Dex: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].dexterity).toLocaleString() + "<br>" +
"Agi: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].agility).toLocaleString() + "<br>" +
"Cha: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].charisma).toLocaleString();
if (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].intelligence >= 1) {
document.getElementById("character-overview-text").innerHTML =
("Hp: " + _Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].hp + " / " + _Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].max_hp + "<br>" +
"Money: " + _utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_3___default()(_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].money.toNumber()).format('($0.000a)') + "<br>" +
"Hack: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].hacking_skill).toLocaleString() + "<br>" +
"Str: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].strength).toLocaleString() + "<br>" +
"Def: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].defense).toLocaleString() + "<br>" +
"Dex: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].dexterity).toLocaleString() + "<br>" +
"Agi: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].agility).toLocaleString() + "<br>" +
"Cha: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].charisma).toLocaleString() + "<br>" +
"Int: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].intelligence).toLocaleString()
).replace( / /g, "&nbsp;" );
} else {
document.getElementById("character-overview-text").innerHTML =
("Hp: " + _Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].hp + " / " + _Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].max_hp + "<br>" +
"Money: " + _utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_3___default()(_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].money.toNumber()).format('($0.000a)') + "<br>" +
"Hack: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].hacking_skill).toLocaleString() + "<br>" +
"Str: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].strength).toLocaleString() + "<br>" +
"Def: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].defense).toLocaleString() + "<br>" +
"Dex: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].dexterity).toLocaleString() + "<br>" +
"Agi: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].agility).toLocaleString() + "<br>" +
"Cha: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].charisma).toLocaleString()
).replace( / /g, "&nbsp;" );
overviewText += "<br>Int: " + (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].intelligence).toLocaleString();
}
document.getElementById("character-overview-text").innerHTML = overviewText.replace( / /g, "&nbsp;");
},
/* Display character info */
@ -7264,7 +7259,7 @@ let Engine = {
updateDisplays: 3,
updateDisplaysMed: 9,
updateDisplaysLong: 15,
updateDisplaysSecond:5,
updateActiveScriptsDisplay: 5,
createProgramNotifications: 10, //Checks whether any programs can be created and notifies
checkFactionInvitations: 100, //Check whether you qualify for any faction invitations
passiveFactionGrowth: 600,
@ -7302,11 +7297,14 @@ let Engine = {
Engine.Counters.updateSkillLevelsCounter = 10;
}
if (Engine.Counters.updateDisplaysSecond <= 0) {
if (Engine.currentPage === Engine.Page.ActiveScripts) {
if (Engine.Counters.updateActiveScriptsDisplay <= 0) {
//Always update, but make the interval longer if the page isn't active
Object(_ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_6__["updateActiveScriptsItems"])();
if (Engine.currentPage === Engine.Page.ActiveScripts) {
Engine.Counters.updateActiveScriptsDisplay = 5;
} else {
Engine.Counters.updateActiveScriptsDisplay = 15;
}
Engine.Counters.updateDisplaysSecond = 5;
}
if (Engine.Counters.updateDisplays <= 0) {
@ -12523,7 +12521,9 @@ function getNextNeurofluxLevel() {
}
}
if (aug == null) {
console.log("ERROR, Could not find NeuroFlux Governor aug");
console.log("WARNING: Could not find NeuroFlux Governor aug. This is OK if " +
"it happens during the loading/initialization of the game, but probably " +
"indicates something seriously wrong at other times");
return 1;
}
}
@ -13439,7 +13439,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _NetscriptEvaluator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./NetscriptEvaluator.js */ 7);
/* harmony import */ var _NetscriptWorker_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./NetscriptWorker.js */ 21);
/* harmony import */ var _Player_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Player.js */ 0);
/* harmony import */ var _RedPill_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./RedPill.js */ 43);
/* harmony import */ var _RedPill_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./RedPill.js */ 44);
/* harmony import */ var _Script_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./Script.js */ 26);
/* harmony import */ var _Server_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./Server.js */ 10);
/* harmony import */ var _Settings_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./Settings.js */ 23);
@ -18457,7 +18457,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addWorkerScript", function() { return addWorkerScript; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateOnlineScriptTimes", function() { return updateOnlineScriptTimes; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prestigeWorkerScripts", function() { return prestigeWorkerScripts; });
/* harmony import */ var _ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ActiveScriptsUI.js */ 44);
/* harmony import */ var _ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ActiveScriptsUI.js */ 43);
/* harmony import */ var _Constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Constants.js */ 3);
/* harmony import */ var _engine_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./engine.js */ 5);
/* harmony import */ var _NetscriptEnvironment_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./NetscriptEnvironment.js */ 69);
@ -26921,7 +26921,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _CreateProgram_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CreateProgram.js */ 14);
/* harmony import */ var _Missions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Missions.js */ 33);
/* harmony import */ var _Player_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Player.js */ 0);
/* harmony import */ var _RedPill_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./RedPill.js */ 43);
/* harmony import */ var _RedPill_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./RedPill.js */ 44);
/* harmony import */ var _Server_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Server.js */ 10);
/* harmony import */ var _Settings_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Settings.js */ 23);
/* harmony import */ var _utils_DialogBox_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/DialogBox.js */ 6);
@ -27137,7 +27137,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasCorporationSF", function() { return hasCorporationSF; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasAISF", function() { return hasAISF; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasBladeburnerSF", function() { return hasBladeburnerSF; });
/* harmony import */ var _ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ActiveScriptsUI.js */ 44);
/* harmony import */ var _ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ActiveScriptsUI.js */ 43);
/* harmony import */ var _Augmentations_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Augmentations.js */ 19);
/* harmony import */ var _BitNode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BitNode.js */ 15);
/* harmony import */ var _Crimes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Crimes.js */ 20);
@ -27216,6 +27216,55 @@ var hasCorporationSF=false, //Source-File 3
hasBn11SF=false; //Source-File 11
var possibleLogs = {
ALL: true,
scan: true,
hack: true,
sleep: true,
disableLog: true,
enableLog: true,
grow: true,
weaken: true,
nuke: true,
brutessh: true,
ftpcrack: true,
relaysmtp: true,
httpworm: true,
sqlinject: true,
spawn: true,
kill: true,
killall: true,
scp: true,
getHackingLevel: true,
getServerMoneyAvailable: true,
getServerSecurityLevel: true,
getServerBaseSecurityLevel: true,
getServerMinSecurityLevel: true,
getServerRequiredHackingLevel: true,
getServerMaxMoney: true,
getServerGrowth: true,
getServerNumPortsRequired: true,
getServerRam: true,
buyStock: true,
sellStock: true,
purchaseServer: true,
deleteServer: true,
universityCourse: true,
gymWorkout: true,
travelToCity: true,
purchaseTor: true,
purchaseProgram: true,
stopAction: true,
upgradeHomeRam: true,
workForCompany: true,
applyToCompany: true,
joinFaction: true,
workForFaction: true,
createProgram: true,
commitCrime: true,
shortStock: true,
sellShort: true,
}
var singularitySFLvl=1, wallStreetSFLvl=1;
@ -27496,13 +27545,23 @@ function NetscriptFunctions(workerScript) {
},
disableLog : function(fn) {
if (workerScript.checkingRam) {return 0;}
if(possibleLogs[fn]===undefined) {
throw Object(_NetscriptEvaluator_js__WEBPACK_IMPORTED_MODULE_23__["makeRuntimeRejectMsg"])(workerScript, "Invalid argument to disableLog: "+fn);
}
workerScript.disableLogs[fn] = true;
if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.disableLog == null) {
workerScript.scriptRef.log("Disabled logging for " + fn);
}
},
enableLog : function(fn) {
if (workerScript.checkingRam) {return 0;}
if(possibleLogs[fn]===undefined) {
throw Object(_NetscriptEvaluator_js__WEBPACK_IMPORTED_MODULE_23__["makeRuntimeRejectMsg"])(workerScript, "Invalid argument to enableLog: "+fn);
}
delete workerScript.disableLogs[fn];
if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.enableLog == null) {
workerScript.scriptRef.log("Enabled logging for " + fn);
}
},
nuke : function(ip){
if (workerScript.checkingRam) {
@ -30473,41 +30532,42 @@ function NetscriptFunctions(workerScript) {
}
crime = crime.toLowerCase();
let enableCommitCrimeLog = workerScript.disableLogs.ALL == null && workerScript.disableLogs.commitCrime == null
if (crime.includes("shoplift")) {
workerScript.scriptRef.log("Attempting to shoplift...");
if(enableCommitCrimeLog) {workerScript.scriptRef.log("Attempting to shoplift...");}
return Object(_Crimes_js__WEBPACK_IMPORTED_MODULE_3__["commitShopliftCrime"])(_Constants_js__WEBPACK_IMPORTED_MODULE_5__["CONSTANTS"].CrimeSingFnDivider, {workerscript: workerScript});
} else if (crime.includes("rob") && crime.includes("store")) {
workerScript.scriptRef.log("Attempting to rob a store...");
if(enableCommitCrimeLog) {workerScript.scriptRef.log("Attempting to rob a store...");}
return Object(_Crimes_js__WEBPACK_IMPORTED_MODULE_3__["commitRobStoreCrime"])(_Constants_js__WEBPACK_IMPORTED_MODULE_5__["CONSTANTS"].CrimeSingFnDivider, {workerscript: workerScript});
} else if (crime.includes("mug")) {
workerScript.scriptRef.log("Attempting to mug someone...");
if(enableCommitCrimeLog) {workerScript.scriptRef.log("Attempting to mug someone...");}
return Object(_Crimes_js__WEBPACK_IMPORTED_MODULE_3__["commitMugCrime"])(_Constants_js__WEBPACK_IMPORTED_MODULE_5__["CONSTANTS"].CrimeSingFnDivider, {workerscript: workerScript});
} else if (crime.includes("larceny")) {
workerScript.scriptRef.log("Attempting to commit larceny...");
if(enableCommitCrimeLog) {workerScript.scriptRef.log("Attempting to commit larceny...");}
return Object(_Crimes_js__WEBPACK_IMPORTED_MODULE_3__["commitLarcenyCrime"])(_Constants_js__WEBPACK_IMPORTED_MODULE_5__["CONSTANTS"].CrimeSingFnDivider, {workerscript: workerScript});
} else if (crime.includes("drugs")) {
workerScript.scriptRef.log("Attempting to deal drugs...");
if(enableCommitCrimeLog) {workerScript.scriptRef.log("Attempting to deal drugs...");}
return Object(_Crimes_js__WEBPACK_IMPORTED_MODULE_3__["commitDealDrugsCrime"])(_Constants_js__WEBPACK_IMPORTED_MODULE_5__["CONSTANTS"].CrimeSingFnDivider, {workerscript: workerScript});
} else if (crime.includes("bond") && crime.includes("forge")) {
workerScript.scriptRef.log("Attempting to forge corporate bonds...");
if(enableCommitCrimeLog) {workerScript.scriptRef.log("Attempting to forge corporate bonds...");}
return Object(_Crimes_js__WEBPACK_IMPORTED_MODULE_3__["commitBondForgeryCrime"])(_Constants_js__WEBPACK_IMPORTED_MODULE_5__["CONSTANTS"].CrimeSingFnDivider, {workerscript: workerScript});
} else if (crime.includes("traffick") && crime.includes("arms")) {
workerScript.scriptRef.log("Attempting to traffick illegal arms...");
if(enableCommitCrimeLog) {workerScript.scriptRef.log("Attempting to traffick illegal arms...");}
return Object(_Crimes_js__WEBPACK_IMPORTED_MODULE_3__["commitTraffickArmsCrime"])(_Constants_js__WEBPACK_IMPORTED_MODULE_5__["CONSTANTS"].CrimeSingFnDivider, {workerscript: workerScript});
} else if (crime.includes("homicide")) {
workerScript.scriptRef.log("Attempting to commit homicide...");
if(enableCommitCrimeLog) {workerScript.scriptRef.log("Attempting to commit homicide...");}
return Object(_Crimes_js__WEBPACK_IMPORTED_MODULE_3__["commitHomicideCrime"])(_Constants_js__WEBPACK_IMPORTED_MODULE_5__["CONSTANTS"].CrimeSingFnDivider, {workerscript: workerScript});
} else if (crime.includes("grand") && crime.includes("auto")) {
workerScript.scriptRef.log("Attempting to commit grand theft auto...");
if(enableCommitCrimeLog) {workerScript.scriptRef.log("Attempting to commit grand theft auto...");}
return Object(_Crimes_js__WEBPACK_IMPORTED_MODULE_3__["commitGrandTheftAutoCrime"])(_Constants_js__WEBPACK_IMPORTED_MODULE_5__["CONSTANTS"].CrimeSingFnDivider, {workerscript: workerScript});
} else if (crime.includes("kidnap")) {
workerScript.scriptRef.log("Attempting to kidnap and ransom a high-profile target...");
if(enableCommitCrimeLog) {workerScript.scriptRef.log("Attempting to kidnap and ransom a high-profile target...");}
return Object(_Crimes_js__WEBPACK_IMPORTED_MODULE_3__["commitKidnapCrime"])(_Constants_js__WEBPACK_IMPORTED_MODULE_5__["CONSTANTS"].CrimeSingFnDivider, {workerscript: workerScript});
} else if (crime.includes("assassinate")) {
workerScript.scriptRef.log("Attempting to assassinate a high-profile target...");
if(enableCommitCrimeLog) {workerScript.scriptRef.log("Attempting to assassinate a high-profile target...");}
return Object(_Crimes_js__WEBPACK_IMPORTED_MODULE_3__["commitAssassinationCrime"])(_Constants_js__WEBPACK_IMPORTED_MODULE_5__["CONSTANTS"].CrimeSingFnDivider, {workerscript: workerScript})
} else if (crime.includes("heist")) {
workerScript.scriptRef.log("Attempting to pull off a heist...");
if(enableCommitCrimeLog) {workerScript.scriptRef.log("Attempting to pull off a heist...");}
return Object(_Crimes_js__WEBPACK_IMPORTED_MODULE_3__["commitHeistCrime"])(_Constants_js__WEBPACK_IMPORTED_MODULE_5__["CONSTANTS"].CrimeSingFnDivider, {workerscript: workerScript});
} else {
throw Object(_NetscriptEvaluator_js__WEBPACK_IMPORTED_MODULE_23__["makeRuntimeRejectMsg"])(workerScript, "Invalid crime passed into commitCrime(): " + crime);
@ -54849,6 +54909,312 @@ function applySourceFile(srcFile) {
/***/ }),
/* 43 */
/*!********************************!*\
!*** ./src/ActiveScriptsUI.js ***!
\********************************/
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addActiveScriptsItem", function() { return addActiveScriptsItem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deleteActiveScriptsItem", function() { return deleteActiveScriptsItem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateActiveScriptsItems", function() { return updateActiveScriptsItems; });
/* harmony import */ var _engine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./engine.js */ 5);
/* harmony import */ var _NetscriptWorker_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./NetscriptWorker.js */ 21);
/* harmony import */ var _Player_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Player.js */ 0);
/* harmony import */ var _Server_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Server.js */ 10);
/* harmony import */ var _utils_DialogBox_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/DialogBox.js */ 6);
/* harmony import */ var _utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/HelperFunctions.js */ 1);
/* harmony import */ var _utils_LogBox_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/LogBox.js */ 51);
/* harmony import */ var _utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/numeral.min.js */ 13);
/* harmony import */ var _utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/StringHelperFunctions.js */ 2);
/* {
* serverName: {
* header: Server Header Element
* panel: Server Panel List (ul) element
* scripts: {
* script id: Ref to Script information
* }
* }
* ...
*/
let ActiveScriptsUI = {};
let ActiveScriptsTasks = []; //Sequentially schedule the creation/deletion of UI elements
function createActiveScriptsServerPanel(server) {
ActiveScriptsTasks.push(function(server) {
let hostname = server.hostname;
var activeScriptsList = document.getElementById("active-scripts-list");
let res = Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["createAccordionElement"])({hdrText:hostname});
let li = res[0];
var hdr = res[1];
let panel = res[2];
if (ActiveScriptsUI[hostname] != null) {
console.log("WARNING: Tried to create already-existing Active Scripts Server panel. This is most likely fine. It probably means many scripts just got started up on a new server. Aborting");
return;
}
var panelScriptList = Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["createElement"])("ul");
panel.appendChild(panelScriptList);
activeScriptsList.appendChild(li);
ActiveScriptsUI[hostname] = {
header: hdr,
panel: panel,
panelList: panelScriptList,
scripts: {}, //Holds references to li elements for each active script
scriptHdrs: {}, //Holds references to header elements for each active script
scriptStats: {} //Holds references to the p elements containing text for each active script
};
return li;
}.bind(null, server));
}
//Deletes the info for a particular server (Dropdown header + Panel with all info)
//in the Active Scripts page if it exists
function deleteActiveScriptsServerPanel(server) {
ActiveScriptsTasks.push(function(server) {
let hostname = server.hostname;
if (ActiveScriptsUI[hostname] == null) {
console.log("WARNING: Tried to delete non-existent Active Scripts Server panel. Aborting");
return;
}
//Make sure it's empty
if (Object.keys(ActiveScriptsUI[hostname].scripts).length > 0) {
console.log("WARNING: Tried to delete Active Scripts Server panel that still has scripts. Aborting");
return;
}
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["removeElement"])(ActiveScriptsUI[hostname].panel);
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["removeElement"])(ActiveScriptsUI[hostname].header);
delete ActiveScriptsUI[hostname];
}.bind(null, server));
}
function addActiveScriptsItem(workerscript) {
var server = Object(_Server_js__WEBPACK_IMPORTED_MODULE_3__["getServer"])(workerscript.serverIp);
if (server == null) {
console.log("ERROR: Invalid server IP for workerscript in addActiveScriptsItem()");
return;
}
let hostname = server.hostname;
if (ActiveScriptsUI[hostname] == null) {
createActiveScriptsServerPanel(server);
}
ActiveScriptsTasks.push(function(workerscript, hostname) {
//Create the unique identifier (key) for this script
var itemNameArray = ["active", "scripts", hostname, workerscript.name];
for (var i = 0; i < workerscript.args.length; ++i) {
itemNameArray.push(String(workerscript.args[i]));
}
var itemName = itemNameArray.join("-");
let res = Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["createAccordionElement"])({hdrText:workerscript.name});
let li = res[0];
let hdr = res[1];
let panel = res[2];
hdr.classList.remove("accordion-header");
hdr.classList.add("active-scripts-script-header");
panel.classList.remove("accordion-panel");
panel.classList.add("active-scripts-script-panel");
//Handle the constant elements on the panel that don't change after creation
//Threads, args, kill/log button
panel.appendChild(Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["createElement"])("p", {
innerHTML: "Threads: " + workerscript.scriptRef.threads + "<br>" +
"Args: " + Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["printArray"])(workerscript.args)
}));
var panelText = Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["createElement"])("p", {
innerText:"Loading...", fontSize:"14px",
});
panel.appendChild(panelText);
panel.appendChild(Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["createElement"])("br"));
panel.appendChild(Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["createElement"])("span", {
innerText:"Log", class:"active-scripts-button", margin:"4px", padding:"4px",
clickListener:()=>{
Object(_utils_LogBox_js__WEBPACK_IMPORTED_MODULE_6__["logBoxCreate"])(workerscript.scriptRef);
return false;
}
}));
panel.appendChild(Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["createElement"])("span", {
innerText:"Kill Script", class:"active-scripts-button", margin:"4px", padding:"4px",
clickListener:()=>{
Object(_NetscriptWorker_js__WEBPACK_IMPORTED_MODULE_1__["killWorkerScript"])(workerscript.scriptRef, workerscript.scriptRef.scriptRef.server);
Object(_utils_DialogBox_js__WEBPACK_IMPORTED_MODULE_4__["dialogBoxCreate"])("Killing script, may take a few minutes to complete...");
return false;
}
}));
//Append element to list
ActiveScriptsUI[hostname]["panelList"].appendChild(li);
ActiveScriptsUI[hostname].scripts[itemName] = li;
ActiveScriptsUI[hostname].scriptHdrs[itemName] = hdr;
ActiveScriptsUI[hostname].scriptStats[itemName] = panelText;
}.bind(null, workerscript, hostname));
}
function deleteActiveScriptsItem(workerscript) {
ActiveScriptsTasks.push(function(workerscript) {
var server = Object(_Server_js__WEBPACK_IMPORTED_MODULE_3__["getServer"])(workerscript.serverIp);
if (server == null) {
throw new Error("ERROR: Invalid server IP for workerscript. This most likely occurred because " +
"you tried to delete a large number of scripts and also purchased servers at the " +
"same time. It's not a big deal, just save and refresh the game.");
return;
}
let hostname = server.hostname;
if (ActiveScriptsUI[hostname] == null) {
console.log("ERROR: Trying to delete Active Script UI Element with a hostname that cant be found in ActiveScriptsUI: " + hostname);
return;
}
var itemNameArray = ["active", "scripts", server.hostname, workerscript.name];
for (var i = 0; i < workerscript.args.length; ++i) {
itemNameArray.push(String(workerscript.args[i]));
}
var itemName = itemNameArray.join("-");
let li = ActiveScriptsUI[hostname].scripts[itemName];
if (li == null) {
console.log("ERROR: Cannot find Active Script UI element for workerscript: ");
console.log(workerscript);
return;
}
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["removeElement"])(li);
delete ActiveScriptsUI[hostname].scripts[itemName];
delete ActiveScriptsUI[hostname].scriptHdrs[itemName];
delete ActiveScriptsUI[hostname].scriptStats[itemName];
if (Object.keys(ActiveScriptsUI[hostname].scripts).length === 0) {
deleteActiveScriptsServerPanel(server);
}
}.bind(null, workerscript));
}
//Update the ActiveScriptsItems array
function updateActiveScriptsItems() {
//Run tasks that need to be done sequentially (adding items, creating/deleting server panels)
//We'll limit this to 50 at a time in case someone decides to start a bunch of scripts all at once...
let numTasks = Math.min(100, ActiveScriptsTasks.length);
for (let i = 0; i < numTasks; ++i) {
let task = ActiveScriptsTasks.shift();
try {
task();
} catch(e) {
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["exceptionAlert"])(e);
console.log(task);
}
}
if (_engine_js__WEBPACK_IMPORTED_MODULE_0__["Engine"].currentPage !== _engine_js__WEBPACK_IMPORTED_MODULE_0__["Engine"].Page.ActiveScripts) {return;}
var total = 0;
for (var i = 0; i < _NetscriptWorker_js__WEBPACK_IMPORTED_MODULE_1__["workerScripts"].length; ++i) {
try {
total += updateActiveScriptsItemContent(_NetscriptWorker_js__WEBPACK_IMPORTED_MODULE_1__["workerScripts"][i]);
} catch(e) {
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["exceptionAlert"])(e);
}
}
document.getElementById("active-scripts-total-prod").innerHTML =
"Total online production of Active Scripts: " + _utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_7___default()(total).format('$0.000a') + " / sec<br>" +
"Total online production since last Aug installation: " +
_utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_7___default()(_Player_js__WEBPACK_IMPORTED_MODULE_2__["Player"].scriptProdSinceLastAug).format('$0.000a') + " (" +
_utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_7___default()(_Player_js__WEBPACK_IMPORTED_MODULE_2__["Player"].scriptProdSinceLastAug / (_Player_js__WEBPACK_IMPORTED_MODULE_2__["Player"].playtimeSinceLastAug/1000)).format('$0.000a') + " / sec)";
return total;
}
//Updates the content of the given item in the Active Scripts list
function updateActiveScriptsItemContent(workerscript) {
var server = Object(_Server_js__WEBPACK_IMPORTED_MODULE_3__["getServer"])(workerscript.serverIp);
if (server == null) {
console.log("ERROR: Invalid server IP for workerscript.");
return;
}
let hostname = server.hostname;
if (ActiveScriptsUI[hostname] == null) {
return; //Hasn't been created yet. We'll skip it
}
var itemNameArray = ["active", "scripts", server.hostname, workerscript.name];
for (var i = 0; i < workerscript.args.length; ++i) {
itemNameArray.push(String(workerscript.args[i]));
}
var itemName = itemNameArray.join("-");
if (ActiveScriptsUI[hostname].scriptStats[itemName] == null) {
return; //Hasn't been fully added yet. We'll skip it
}
var item = ActiveScriptsUI[hostname].scriptStats[itemName];
//Update the text if necessary. This fn returns the online $/s production
return updateActiveScriptsText(workerscript, item, itemName);
}
function updateActiveScriptsText(workerscript, item, itemName) {
var server = Object(_Server_js__WEBPACK_IMPORTED_MODULE_3__["getServer"])(workerscript.serverIp);
if (server == null) {
console.log("ERROR: Invalid server IP for workerscript.");
return;
}
let hostname = server.hostname;
if (ActiveScriptsUI[hostname] == null || ActiveScriptsUI[hostname].scriptHdrs[itemName] == null) {
console.log("ERROR: Trying to update Active Script UI Element with a hostname that cant be found in ActiveScriptsUI: " + hostname);
return;
}
var onlineMps = workerscript.scriptRef.onlineMoneyMade / workerscript.scriptRef.onlineRunningTime;
//Only update if the item is visible
if (ActiveScriptsUI[hostname].header.classList.contains("active") === false) {return onlineMps;}
if (ActiveScriptsUI[hostname].scriptHdrs[itemName].classList.contains("active") === false) {return onlineMps;}
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["removeChildrenFromElement"])(item);
//Online
var onlineTotalMoneyMade = "Total online production: $" + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_8__["formatNumber"])(workerscript.scriptRef.onlineMoneyMade, 2);
var onlineTotalExpEarned = (Array(26).join(" ") + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_8__["formatNumber"])(workerscript.scriptRef.onlineExpGained, 2) + " hacking exp").replace( / /g, "&nbsp;");
var onlineMpsText = "Online production rate: $" + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_8__["formatNumber"])(onlineMps, 2) + "/second";
var onlineEps = workerscript.scriptRef.onlineExpGained / workerscript.scriptRef.onlineRunningTime;
var onlineEpsText = (Array(25).join(" ") + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_8__["formatNumber"])(onlineEps, 4) + " hacking exp/second").replace( / /g, "&nbsp;");
//Offline
var offlineTotalMoneyMade = "Total offline production: $" + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_8__["formatNumber"])(workerscript.scriptRef.offlineMoneyMade, 2);
var offlineTotalExpEarned = (Array(27).join(" ") + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_8__["formatNumber"])(workerscript.scriptRef.offlineExpGained, 2) + " hacking exp").replace( / /g, "&nbsp;");
var offlineMps = workerscript.scriptRef.offlineMoneyMade / workerscript.scriptRef.offlineRunningTime;
var offlineMpsText = "Offline production rate: $" + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_8__["formatNumber"])(offlineMps, 2) + "/second";
var offlineEps = workerscript.scriptRef.offlineExpGained / workerscript.scriptRef.offlineRunningTime;
var offlineEpsText = (Array(26).join(" ") + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_8__["formatNumber"])(offlineEps, 4) + " hacking exp/second").replace( / /g, "&nbsp;");
item.innerHTML = onlineTotalMoneyMade + "<br>" + onlineTotalExpEarned + "<br>" +
onlineMpsText + "<br>" + onlineEpsText + "<br>" + offlineTotalMoneyMade + "<br>" + offlineTotalExpEarned + "<br>" +
offlineMpsText + "<br>" + offlineEpsText + "<br>";
return onlineMps;
}
/***/ }),
/* 44 */
/*!************************!*\
!*** ./src/RedPill.js ***!
\************************/
@ -55196,307 +55562,6 @@ function createBitNodeYesNoEventListeners(newBitNode, destroyedBitNode, flume=fa
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ 38)))
/***/ }),
/* 44 */
/*!********************************!*\
!*** ./src/ActiveScriptsUI.js ***!
\********************************/
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addActiveScriptsItem", function() { return addActiveScriptsItem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deleteActiveScriptsItem", function() { return deleteActiveScriptsItem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateActiveScriptsItems", function() { return updateActiveScriptsItems; });
/* harmony import */ var _NetscriptWorker_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./NetscriptWorker.js */ 21);
/* harmony import */ var _Player_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Player.js */ 0);
/* harmony import */ var _Server_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Server.js */ 10);
/* harmony import */ var _utils_DialogBox_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/DialogBox.js */ 6);
/* harmony import */ var _utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/HelperFunctions.js */ 1);
/* harmony import */ var _utils_LogBox_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/LogBox.js */ 51);
/* harmony import */ var _utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/numeral.min.js */ 13);
/* harmony import */ var _utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/StringHelperFunctions.js */ 2);
/* {
* serverName: {
* header: Server Header Element
* panel: Server Panel List (ul) element
* scripts: {
* script id: Ref to Script information
* }
* }
* ...
*/
let ActiveScriptsUI = {};
let ActiveScriptsTasks = []; //Sequentially schedule the creation/deletion of UI elements
function createActiveScriptsServerPanel(server) {
ActiveScriptsTasks.push(function(server) {
let hostname = server.hostname;
var activeScriptsList = document.getElementById("active-scripts-list");
let res = Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["createAccordionElement"])({hdrText:hostname});
let li = res[0];
var hdr = res[1];
let panel = res[2];
if (ActiveScriptsUI[hostname] != null) {
console.log("WARNING: Tried to create already-existing Active Scripts Server panel. This is most likely fine. It probably means many scripts just got started up on a new server. Aborting");
return;
}
var panelScriptList = Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["createElement"])("ul");
panel.appendChild(panelScriptList);
activeScriptsList.appendChild(li);
ActiveScriptsUI[hostname] = {
header: hdr,
panel: panel,
panelList: panelScriptList,
scripts: {}, //Holds references to li elements for each active script
scriptHdrs: {}, //Holds references to header elements for each active script
scriptStats: {} //Holds references to the p elements containing text for each active script
};
return li;
}.bind(null, server));
}
//Deletes the info for a particular server (Dropdown header + Panel with all info)
//in the Active Scripts page if it exists
function deleteActiveScriptsServerPanel(server) {
ActiveScriptsTasks.push(function(server) {
let hostname = server.hostname;
if (ActiveScriptsUI[hostname] == null) {
console.log("WARNING: Tried to delete non-existent Active Scripts Server panel. Aborting");
return;
}
//Make sure it's empty
if (Object.keys(ActiveScriptsUI[hostname].scripts).length > 0) {
console.log("WARNING: Tried to delete Active Scripts Server panel that still has scripts. Aborting");
return;
}
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["removeElement"])(ActiveScriptsUI[hostname].panel);
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["removeElement"])(ActiveScriptsUI[hostname].header);
delete ActiveScriptsUI[hostname];
}.bind(null, server));
}
function addActiveScriptsItem(workerscript) {
var server = Object(_Server_js__WEBPACK_IMPORTED_MODULE_2__["getServer"])(workerscript.serverIp);
if (server == null) {
console.log("ERROR: Invalid server IP for workerscript in addActiveScriptsItem()");
return;
}
let hostname = server.hostname;
if (ActiveScriptsUI[hostname] == null) {
createActiveScriptsServerPanel(server);
}
ActiveScriptsTasks.push(function(workerscript, hostname) {
//Create the unique identifier (key) for this script
var itemNameArray = ["active", "scripts", hostname, workerscript.name];
for (var i = 0; i < workerscript.args.length; ++i) {
itemNameArray.push(String(workerscript.args[i]));
}
var itemName = itemNameArray.join("-");
let res = Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["createAccordionElement"])({hdrText:workerscript.name});
let li = res[0];
let hdr = res[1];
let panel = res[2];
hdr.classList.remove("accordion-header");
hdr.classList.add("active-scripts-script-header");
panel.classList.remove("accordion-panel");
panel.classList.add("active-scripts-script-panel");
//Handle the constant elements on the panel that don't change after creation
//Threads, args, kill/log button
panel.appendChild(Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["createElement"])("p", {
innerHTML: "Threads: " + workerscript.scriptRef.threads + "<br>" +
"Args: " + Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["printArray"])(workerscript.args)
}));
var panelText = Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["createElement"])("p", {
innerText:"Loading...", fontSize:"14px",
});
panel.appendChild(panelText);
panel.appendChild(Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["createElement"])("br"));
panel.appendChild(Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["createElement"])("span", {
innerText:"Log", class:"active-scripts-button", margin:"4px", padding:"4px",
clickListener:()=>{
Object(_utils_LogBox_js__WEBPACK_IMPORTED_MODULE_5__["logBoxCreate"])(workerscript.scriptRef);
return false;
}
}));
panel.appendChild(Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["createElement"])("span", {
innerText:"Kill Script", class:"active-scripts-button", margin:"4px", padding:"4px",
clickListener:()=>{
Object(_NetscriptWorker_js__WEBPACK_IMPORTED_MODULE_0__["killWorkerScript"])(workerscript.scriptRef, workerscript.scriptRef.scriptRef.server);
Object(_utils_DialogBox_js__WEBPACK_IMPORTED_MODULE_3__["dialogBoxCreate"])("Killing script, may take a few minutes to complete...");
return false;
}
}));
//Append element to list
ActiveScriptsUI[hostname]["panelList"].appendChild(li);
ActiveScriptsUI[hostname].scripts[itemName] = li;
ActiveScriptsUI[hostname].scriptHdrs[itemName] = hdr;
ActiveScriptsUI[hostname].scriptStats[itemName] = panelText;
}.bind(null, workerscript, hostname));
}
function deleteActiveScriptsItem(workerscript) {
ActiveScriptsTasks.push(function(workerscript) {
var server = Object(_Server_js__WEBPACK_IMPORTED_MODULE_2__["getServer"])(workerscript.serverIp);
if (server == null) {
console.log("ERROR: Invalid server IP for workerscript.");
return;
}
let hostname = server.hostname;
if (ActiveScriptsUI[hostname] == null) {
console.log("ERROR: Trying to delete Active Script UI Element with a hostname that cant be found in ActiveScriptsUI: " + hostname);
return;
}
var itemNameArray = ["active", "scripts", server.hostname, workerscript.name];
for (var i = 0; i < workerscript.args.length; ++i) {
itemNameArray.push(String(workerscript.args[i]));
}
var itemName = itemNameArray.join("-");
let li = ActiveScriptsUI[hostname].scripts[itemName];
if (li == null) {
console.log("ERROR: Cannot find Active Script UI element for workerscript: ");
console.log(workerscript);
return;
}
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["removeElement"])(li);
delete ActiveScriptsUI[hostname].scripts[itemName];
delete ActiveScriptsUI[hostname].scriptHdrs[itemName];
delete ActiveScriptsUI[hostname].scriptStats[itemName];
if (Object.keys(ActiveScriptsUI[hostname].scripts).length === 0) {
deleteActiveScriptsServerPanel(server);
}
}.bind(null, workerscript));
}
//Update the ActiveScriptsItems array
function updateActiveScriptsItems() {
//Run tasks that need to be done sequentially (adding items, creating/deleting server panels)
//We'll limit this to 50 at a time in case someone decides to start a bunch of scripts all at once...
let numTasks = Math.min(50, ActiveScriptsTasks.length);
for (let i = 0; i < numTasks; ++i) {
let task = ActiveScriptsTasks.shift();
try {
task();
} catch(e) {
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["exceptionAlert"])(e);
console.log(task);
}
}
var total = 0;
for (var i = 0; i < _NetscriptWorker_js__WEBPACK_IMPORTED_MODULE_0__["workerScripts"].length; ++i) {
try {
total += updateActiveScriptsItemContent(_NetscriptWorker_js__WEBPACK_IMPORTED_MODULE_0__["workerScripts"][i]);
} catch(e) {
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["exceptionAlert"])(e);
}
}
document.getElementById("active-scripts-total-prod").innerHTML =
"Total online production of Active Scripts: " + _utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_6___default()(total).format('$0.000a') + " / sec<br>" +
"Total online production since last Aug installation: " +
_utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_6___default()(_Player_js__WEBPACK_IMPORTED_MODULE_1__["Player"].scriptProdSinceLastAug).format('$0.000a') + " (" +
_utils_numeral_min_js__WEBPACK_IMPORTED_MODULE_6___default()(_Player_js__WEBPACK_IMPORTED_MODULE_1__["Player"].scriptProdSinceLastAug / (_Player_js__WEBPACK_IMPORTED_MODULE_1__["Player"].playtimeSinceLastAug/1000)).format('$0.000a') + " / sec)";
return total;
}
//Updates the content of the given item in the Active Scripts list
function updateActiveScriptsItemContent(workerscript) {
var server = Object(_Server_js__WEBPACK_IMPORTED_MODULE_2__["getServer"])(workerscript.serverIp);
if (server == null) {
console.log("ERROR: Invalid server IP for workerscript.");
return;
}
let hostname = server.hostname;
if (ActiveScriptsUI[hostname] == null) {
return; //Hasn't been created yet. We'll skip it
}
var itemNameArray = ["active", "scripts", server.hostname, workerscript.name];
for (var i = 0; i < workerscript.args.length; ++i) {
itemNameArray.push(String(workerscript.args[i]));
}
var itemName = itemNameArray.join("-");
if (ActiveScriptsUI[hostname].scriptStats[itemName] == null) {
return; //Hasn't been fully added yet. We'll skip it
}
var item = ActiveScriptsUI[hostname].scriptStats[itemName];
//Update the text if necessary. This fn returns the online $/s production
return updateActiveScriptsText(workerscript, item, itemName);
}
function updateActiveScriptsText(workerscript, item, itemName) {
var server = Object(_Server_js__WEBPACK_IMPORTED_MODULE_2__["getServer"])(workerscript.serverIp);
if (server == null) {
console.log("ERROR: Invalid server IP for workerscript.");
return;
}
let hostname = server.hostname;
if (ActiveScriptsUI[hostname] == null || ActiveScriptsUI[hostname].scriptHdrs[itemName] == null) {
console.log("ERROR: Trying to update Active Script UI Element with a hostname that cant be found in ActiveScriptsUI: " + hostname);
return;
}
var onlineMps = workerscript.scriptRef.onlineMoneyMade / workerscript.scriptRef.onlineRunningTime;
//Only update if the item is visible
if (ActiveScriptsUI[hostname].header.classList.contains("active") === false) {return onlineMps;}
if (ActiveScriptsUI[hostname].scriptHdrs[itemName].classList.contains("active") === false) {return onlineMps;}
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_4__["removeChildrenFromElement"])(item);
//Online
var onlineTotalMoneyMade = "Total online production: $" + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_7__["formatNumber"])(workerscript.scriptRef.onlineMoneyMade, 2);
var onlineTotalExpEarned = (Array(26).join(" ") + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_7__["formatNumber"])(workerscript.scriptRef.onlineExpGained, 2) + " hacking exp").replace( / /g, "&nbsp;");
var onlineMpsText = "Online production rate: $" + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_7__["formatNumber"])(onlineMps, 2) + "/second";
var onlineEps = workerscript.scriptRef.onlineExpGained / workerscript.scriptRef.onlineRunningTime;
var onlineEpsText = (Array(25).join(" ") + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_7__["formatNumber"])(onlineEps, 4) + " hacking exp/second").replace( / /g, "&nbsp;");
//Offline
var offlineTotalMoneyMade = "Total offline production: $" + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_7__["formatNumber"])(workerscript.scriptRef.offlineMoneyMade, 2);
var offlineTotalExpEarned = (Array(27).join(" ") + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_7__["formatNumber"])(workerscript.scriptRef.offlineExpGained, 2) + " hacking exp").replace( / /g, "&nbsp;");
var offlineMps = workerscript.scriptRef.offlineMoneyMade / workerscript.scriptRef.offlineRunningTime;
var offlineMpsText = "Offline production rate: $" + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_7__["formatNumber"])(offlineMps, 2) + "/second";
var offlineEps = workerscript.scriptRef.offlineExpGained / workerscript.scriptRef.offlineRunningTime;
var offlineEpsText = (Array(26).join(" ") + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_7__["formatNumber"])(offlineEps, 4) + " hacking exp/second").replace( / /g, "&nbsp;");
item.innerHTML = onlineTotalMoneyMade + "<br>" + onlineTotalExpEarned + "<br>" +
onlineMpsText + "<br>" + onlineEpsText + "<br>" + offlineTotalMoneyMade + "<br>" + offlineTotalExpEarned + "<br>" +
offlineMpsText + "<br>" + offlineEpsText + "<br>";
return onlineMps;
}
/***/ }),
/* 45 */
/*!******************************!*\
@ -56222,7 +56287,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _Faction_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Faction.js */ 11);
/* harmony import */ var _Location_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Location.js */ 4);
/* harmony import */ var _Player_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Player.js */ 0);
/* harmony import */ var _RedPill_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./RedPill.js */ 43);
/* harmony import */ var _RedPill_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./RedPill.js */ 44);
/* harmony import */ var _Terminal_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Terminal.js */ 18);
/* harmony import */ var _utils_DialogBox_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/DialogBox.js */ 6);
/* harmony import */ var _utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/HelperFunctions.js */ 1);
@ -59401,7 +59466,7 @@ function initBladeburner() {
name:SkillNames.Overclock,
desc:"Each level of this skill decreases the time it takes " +
"to attempt a contract or operation by 1% (Max Level: 99)",
baseCost:5, costInc:1, maxLvl:99,
baseCost:5, costInc:1, maxLvl:95,
actionTime:1
});
Skills[SkillNames.EvasiveSystem] = new Skill({
@ -61065,7 +61130,7 @@ exports.Utf8EncodeWorker = Utf8EncodeWorker;
__webpack_require__.r(__webpack_exports__);
/* WEBPACK VAR INJECTION */(function($) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prestigeAugmentation", function() { return prestigeAugmentation; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prestigeSourceFile", function() { return prestigeSourceFile; });
/* harmony import */ var _ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ActiveScriptsUI.js */ 44);
/* harmony import */ var _ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ActiveScriptsUI.js */ 43);
/* harmony import */ var _Augmentations_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Augmentations.js */ 19);
/* harmony import */ var _BitNode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BitNode.js */ 15);
/* harmony import */ var _CinematicText_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CinematicText.js */ 70);

@ -744,7 +744,7 @@
</span>
</label>
<input type ="range" max="250" min="25"
<input type ="range" max="250" min="15"
step="1" name="settingsNSExecTimeRangeVal" id="settingsNSExecTimeRangeVal" value="100">
</input>
<em id="settingsNSExecTimeRangeValLabel" style="font-style: normal;"></em>

@ -1,3 +1,4 @@
import {Engine} from "./engine.js";
import {workerScripts,
addWorkerScript,
killWorkerScript} from "./NetscriptWorker.js";
@ -147,7 +148,9 @@ function deleteActiveScriptsItem(workerscript) {
ActiveScriptsTasks.push(function(workerscript) {
var server = getServer(workerscript.serverIp);
if (server == null) {
console.log("ERROR: Invalid server IP for workerscript.");
throw new Error("ERROR: Invalid server IP for workerscript. This most likely occurred because " +
"you tried to delete a large number of scripts and also purchased servers at the " +
"same time. It's not a big deal, just save and refresh the game.");
return;
}
let hostname = server.hostname;
@ -182,7 +185,7 @@ function deleteActiveScriptsItem(workerscript) {
function updateActiveScriptsItems() {
//Run tasks that need to be done sequentially (adding items, creating/deleting server panels)
//We'll limit this to 50 at a time in case someone decides to start a bunch of scripts all at once...
let numTasks = Math.min(50, ActiveScriptsTasks.length);
let numTasks = Math.min(100, ActiveScriptsTasks.length);
for (let i = 0; i < numTasks; ++i) {
let task = ActiveScriptsTasks.shift();
try {
@ -193,6 +196,7 @@ function updateActiveScriptsItems() {
}
}
if (Engine.currentPage !== Engine.Page.ActiveScripts) {return;}
var total = 0;
for (var i = 0; i < workerScripts.length; ++i) {
try {

@ -3175,7 +3175,7 @@ function initBladeburner() {
name:SkillNames.Overclock,
desc:"Each level of this skill decreases the time it takes " +
"to attempt a contract or operation by 1% (Max Level: 99)",
baseCost:5, costInc:1, maxLvl:99,
baseCost:5, costInc:1, maxLvl:95,
actionTime:1
});
Skills[SkillNames.EvasiveSystem] = new Skill({

@ -1,5 +1,5 @@
let CONSTANTS = {
Version: "0.36.0",
Version: "0.36.1",
//Max level for any skill, assuming no multipliers. Determined by max numerical value in javascript for experience
//and the skill level formula in Player.js. Note that all this means it that when experience hits MAX_INT, then
@ -1147,6 +1147,7 @@ let CONSTANTS = {
"** Datamancer skill effect increased from 4% per level to 5%<br>" +
"** Slightly decreased the base stamina cost of contracts/operations<br>" +
"** Slightly increased the effects of the Tracer, Digital Observer, Short Circuit, Cloak, and Blade's Intuition skills<br>" +
"** Overclock skill capped at level 95, rather than 99<br>" +
"** Training gives significantly more exp/s<br>" +
"* Crime, Infiltration, and Hacking are now slightly more profitable in BN-6<br>" +
"* Gyms are now more expensive, but give slightly more exp<br>" +
@ -1158,8 +1159,10 @@ let CONSTANTS = {
"* Added an option to disable hotkeys/keyboard shortcuts<br>" +
"* Refactored 'Active Scripts' UI page to optimize its performance<br>" +
"* Added a new .fconf Terminal setting: ENABLE_TIMESTAMP<br>" +
"* 'Netscript Execution Time', which can be found in the Options, now has a minimum value of 15ms rather than 25ms<br>" +
"* Bug Fix: Fixed a typo in the Fulcrum Technologies company name (Technolgies -> Technologies)<br>" +
"* Bug Fix: hacknetnodes keyword should no longer incur RAM cost if its in a comment<br>"
"* Bug Fix: hacknetnodes keyword should no longer incur RAM cost if its in a comment<br>" +
"* Bug Fix: disableLog() now works for the commitCrime() Netscript function (fixed by Github user hydroflame)"
}

@ -1095,7 +1095,9 @@ function getNextNeurofluxLevel() {
}
}
if (aug == null) {
console.log("ERROR, Could not find NeuroFlux Governor aug");
console.log("WARNING: Could not find NeuroFlux Governor aug. This is OK if " +
"it happens during the loading/initialization of the game, but probably " +
"indicates something seriously wrong at other times");
return 1;
}
}

@ -498,30 +498,18 @@ let Engine = {
displayCharacterOverviewInfo: function() {
if (Player.hp == null) {Player.hp = Player.max_hp;}
var overviewText = "Hp: " + Player.hp + " / " + Player.max_hp + "<br>" +
"Money: " + numeral(Player.money.toNumber()).format('($0.000a)') + "<br>" +
"Hack: " + (Player.hacking_skill).toLocaleString() + "<br>" +
"Str: " + (Player.strength).toLocaleString() + "<br>" +
"Def: " + (Player.defense).toLocaleString() + "<br>" +
"Dex: " + (Player.dexterity).toLocaleString() + "<br>" +
"Agi: " + (Player.agility).toLocaleString() + "<br>" +
"Cha: " + (Player.charisma).toLocaleString();
if (Player.intelligence >= 1) {
document.getElementById("character-overview-text").innerHTML =
("Hp: " + Player.hp + " / " + Player.max_hp + "<br>" +
"Money: " + numeral(Player.money.toNumber()).format('($0.000a)') + "<br>" +
"Hack: " + (Player.hacking_skill).toLocaleString() + "<br>" +
"Str: " + (Player.strength).toLocaleString() + "<br>" +
"Def: " + (Player.defense).toLocaleString() + "<br>" +
"Dex: " + (Player.dexterity).toLocaleString() + "<br>" +
"Agi: " + (Player.agility).toLocaleString() + "<br>" +
"Cha: " + (Player.charisma).toLocaleString() + "<br>" +
"Int: " + (Player.intelligence).toLocaleString()
).replace( / /g, "&nbsp;" );
} else {
document.getElementById("character-overview-text").innerHTML =
("Hp: " + Player.hp + " / " + Player.max_hp + "<br>" +
"Money: " + numeral(Player.money.toNumber()).format('($0.000a)') + "<br>" +
"Hack: " + (Player.hacking_skill).toLocaleString() + "<br>" +
"Str: " + (Player.strength).toLocaleString() + "<br>" +
"Def: " + (Player.defense).toLocaleString() + "<br>" +
"Dex: " + (Player.dexterity).toLocaleString() + "<br>" +
"Agi: " + (Player.agility).toLocaleString() + "<br>" +
"Cha: " + (Player.charisma).toLocaleString()
).replace( / /g, "&nbsp;" );
overviewText += "<br>Int: " + (Player.intelligence).toLocaleString();
}
document.getElementById("character-overview-text").innerHTML = overviewText.replace( / /g, "&nbsp;");
},
/* Display character info */
@ -902,7 +890,7 @@ let Engine = {
updateDisplays: 3,
updateDisplaysMed: 9,
updateDisplaysLong: 15,
updateDisplaysSecond:5,
updateActiveScriptsDisplay: 5,
createProgramNotifications: 10, //Checks whether any programs can be created and notifies
checkFactionInvitations: 100, //Check whether you qualify for any faction invitations
passiveFactionGrowth: 600,
@ -940,11 +928,14 @@ let Engine = {
Engine.Counters.updateSkillLevelsCounter = 10;
}
if (Engine.Counters.updateDisplaysSecond <= 0) {
if (Engine.currentPage === Engine.Page.ActiveScripts) {
if (Engine.Counters.updateActiveScriptsDisplay <= 0) {
//Always update, but make the interval longer if the page isn't active
updateActiveScriptsItems();
if (Engine.currentPage === Engine.Page.ActiveScripts) {
Engine.Counters.updateActiveScriptsDisplay = 5;
} else {
Engine.Counters.updateActiveScriptsDisplay = 15;
}
Engine.Counters.updateDisplaysSecond = 5;
}
if (Engine.Counters.updateDisplays <= 0) {