mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-18 13:43:49 +01:00
commit
8188140b53
@ -1,5 +1,5 @@
|
||||
CONSTANTS = {
|
||||
Version: "0.19.4",
|
||||
Version: "0.19.5",
|
||||
|
||||
//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
|
||||
|
@ -801,36 +801,48 @@ function evaluate(exp, workerScript) {
|
||||
return;
|
||||
}
|
||||
|
||||
//Check that a script with this filename does not already exist
|
||||
for (var i = 0; i < destServer.scripts.length; ++i) {
|
||||
if (scriptname == destServer.scripts[i].filename) {
|
||||
workerScript.scriptRef.log(destServer.hostname + " already contains a script named " + scriptname);
|
||||
resolve(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var currServ = getServer(workerScript.serverIp);
|
||||
if (currServ == null) {
|
||||
reject(makeRuntimeRejectMsg(workerScript, "Could not find server ip for this script. This is a bug please contact game developer"));
|
||||
return;
|
||||
}
|
||||
|
||||
var sourceScript = null;
|
||||
for (var i = 0; i < currServ.scripts.length; ++i) {
|
||||
if (scriptname == currServ.scripts[i].filename) {
|
||||
var newScript = new Script();
|
||||
newScript.filename = scriptname;
|
||||
newScript.code = currServ.scripts[i].code;
|
||||
newScript.ramUsage = currServ.scripts[i].ramUsage;
|
||||
newScript.server = destServer.ip;
|
||||
destServer.scripts.push(newScript);
|
||||
workerScript.scriptRef.log(scriptname + " copied over to " + destServer.hostname);
|
||||
sourceScript = currServ.scripts[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sourceScript == null) {
|
||||
workerScript.scriptRef.log(scriptname + " does not exist. scp() failed");
|
||||
resolve(false);
|
||||
return;
|
||||
}
|
||||
|
||||
//Overwrite script if it already exists
|
||||
for (var i = 0; i < destServer.scripts.length; ++i) {
|
||||
if (scriptname == destServer.scripts[i].filename) {
|
||||
workerScript.scriptRef.log("WARNING: " + scriptname + " already exists on " + destServer.hostname + " and it will be overwritten.");
|
||||
workerScript.scriptRef.log(scriptname + " overwritten on " + destServer.hostname);
|
||||
var oldScript = destServer.scripts[i];
|
||||
oldScript.code = sourceScript.code;
|
||||
oldScript.ramUsage = sourceScript.ramUsage;
|
||||
resolve(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
workerScript.scriptRef.log(scriptname + " does not exist. scp() failed");
|
||||
resolve(false);
|
||||
|
||||
|
||||
//Create new script if it does not already exist
|
||||
var newScript = new Script();
|
||||
newScript.filename = scriptname;
|
||||
newScript.code = sourceScript.code;
|
||||
newScript.ramUsage = sourceScript.ramUsage;
|
||||
newScript.server = destServer.ip;
|
||||
destServer.scripts.push(newScript);
|
||||
workerScript.scriptRef.log(scriptname + " copied over to " + destServer.hostname);
|
||||
resolve(true);
|
||||
return;
|
||||
}, function(e) {
|
||||
reject(e);
|
||||
});
|
||||
|
@ -33,6 +33,7 @@ function runScriptsLoop() {
|
||||
var ast = Parser(Tokenizer(InputStream(workerScripts[i].code)));
|
||||
//console.log(ast);
|
||||
} catch (e) {
|
||||
console.log("Error parsing script: " + workerScripts[i].name);
|
||||
dialogBoxCreate("Syntax ERROR in " + workerScripts[i].name + ":<br>" + e);
|
||||
workerScripts[i].env.stopFlag = true;
|
||||
continue;
|
||||
|
@ -573,9 +573,9 @@ initForeignServers = function() {
|
||||
var NetworkGroup3 = [OmegaSoftwareServer, PhantasyServer, SilverHelixServer, NeoNightclubServer];
|
||||
var NetworkGroup4 = [CrushFitnessGymServer, NetLinkTechnologiesServer, CompuTekServer, TheHubServer, JohnsonOrthopedicsServer, NiteSecServer];
|
||||
var NetworkGroup5 = [CatalystVenturesServer, SysCoreSecuritiesServer, SummitUniversityServer, ZBInstituteOfTechnologyServer, RothmanUniversityServer, TheBlackHandServer];
|
||||
var NetworkGroup6 = [LexoCorpServer, RhoConstructionServer, AlphaEnterprisesServer, AevumPoliceServer, MilleniumFitnessGymServer, CyberSecServer, NiteSecServer];
|
||||
var NetworkGroup6 = [LexoCorpServer, RhoConstructionServer, AlphaEnterprisesServer, AevumPoliceServer, MilleniumFitnessGymServer];
|
||||
var NetworkGroup7 = [GlobalPharmaceuticalsServer, AeroCorpServer, GalacticCyberSystemsServer, SnapFitnessGymServer];
|
||||
var NetworkGroup8 = [DeltaOneServer, UnitaLifeGroupServer, OmniaCybersystemsServer, BitRunnersServer];
|
||||
var NetworkGroup8 = [DeltaOneServer, UnitaLifeGroupServer, OmniaCybersystemsServer];
|
||||
var NetworkGroup9 = [ZeusMedicalServer, SolarisSpaceSystemsServer, UniversalEnergyServer, IcarusMicrosystemsServer, DefCommServer];
|
||||
var NetworkGroup10 = [NovaMedicalServer, ZBDefenseServer, TaiYangDigitalServer, InfoCommServer];
|
||||
var NetworkGroup11 = [AppliedEnergeticsServer, MicrodyneTechnologiesServer, TitanLabsServer, BitRunnersServer];
|
||||
|
@ -384,7 +384,6 @@ var Terminal = {
|
||||
|
||||
//Process any aliases
|
||||
command = substituteAliases(command);
|
||||
console.log("command after alises: " + command);
|
||||
|
||||
//Only split the first space
|
||||
var commandArray = command.split(" ");
|
||||
@ -828,28 +827,40 @@ var Terminal = {
|
||||
}
|
||||
var ip = server.ip;
|
||||
|
||||
//Check that a script with this filename does not already exist
|
||||
var currServ = Player.getCurrentServer();
|
||||
|
||||
//Get the current script
|
||||
var sourceScript = null;
|
||||
for (var i = 0; i < currServ.scripts.length; ++i) {
|
||||
if (scriptname == currServ.scripts[i].filename) {
|
||||
sourceScript = currServ.scripts[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sourceScript == null) {
|
||||
post("ERROR: scp() failed. No such script exists");
|
||||
return;
|
||||
}
|
||||
|
||||
//Overwrite script if it exists
|
||||
for (var i = 0; i < server.scripts.length; ++i) {
|
||||
if (scriptname == server.scripts[i].filename) {
|
||||
post(server.hostname + " already contains a script named " + scriptname);
|
||||
post("WARNING: " + scriptname + " already exists on " + server.hostname + " and will be overwritten");
|
||||
var oldScript = server.scripts[i];
|
||||
oldScript.code = sourceScript.code;
|
||||
oldScript.ramUsage = sourceScript.ramUsage;
|
||||
post(scriptname + " overwriten on " + server.hostname);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var currServ = Player.getCurrentServer();
|
||||
for (var i = 0; i < currServ.scripts.length; ++i) {
|
||||
if (scriptname == currServ.scripts[i].filename) {
|
||||
var newScript = new Script();
|
||||
newScript.filename = scriptname;
|
||||
newScript.code = currServ.scripts[i].code;
|
||||
newScript.ramUsage = currServ.scripts[i].ramUsage;
|
||||
newScript.server = ip;
|
||||
server.scripts.push(newScript);
|
||||
post(scriptname + " copied over to " + server.hostname);
|
||||
return;
|
||||
}
|
||||
}
|
||||
post("Script not found");
|
||||
var newScript = new Script();
|
||||
newScript.filename = scriptname;
|
||||
newScript.code = sourceScript.code;
|
||||
newScript.ramUsage = sourceScript.ramUsage;
|
||||
newScript.server = ip;
|
||||
server.scripts.push(newScript);
|
||||
post(scriptname + " copied over to " + server.hostname);
|
||||
break;
|
||||
case "sudov":
|
||||
if (commandArray.length != 1) {
|
||||
|
Loading…
Reference in New Issue
Block a user