UI Improvements. Added two new Netscript functions to purchase Hacknet Nodes

This commit is contained in:
Daniel Xie
2017-05-20 04:27:42 -05:00
parent c454e3729b
commit 4d0ee212be
7 changed files with 102 additions and 8 deletions
+4 -2
View File
@@ -239,6 +239,7 @@ Reviver.constructors.Script = Script;
//into worker scripts so that they will start running
loadAllRunningScripts = function() {
var count = 0;
var total = 0;
for (var property in AllServers) {
if (AllServers.hasOwnProperty(property)) {
var server = AllServers[property];
@@ -254,10 +255,11 @@ loadAllRunningScripts = function() {
addWorkerScript(script, server);
//Offline production
scriptCalculateOfflineProduction(script);
total += scriptCalculateOfflineProduction(script);
}
}
}
return total;
console.log("Loaded " + count.toString() + " running scripts");
}
@@ -305,7 +307,7 @@ scriptCalculateOfflineProduction = function(script) {
script.offlineMoneyMade += totalOfflineProduction;
script.offlineRunningTime += timePassed;
script.offlineExpGained += expGain;
return totalOfflineProduction;
//DEBUG
var serverName = AllServers[script.server].hostname;
console.log(script.filename + " from server " + serverName + " generated $" + totalOfflineProduction + " TOTAL while offline");