diff --git a/src/Augmentations.js b/src/Augmentations.js index d14729103..8737d8f57 100644 --- a/src/Augmentations.js +++ b/src/Augmentations.js @@ -789,7 +789,7 @@ initAugmentations = function() { HacknetNodeKernelDNI.setInfo("Installs a Direct-Neural Interface jack into the arm that is capable of connecting to a " + "Hacknet Node. This lets the user access and manipulate the Node's kernel using the mind's " + "electrochemical signals.

" + - "This augmentation increases the amount of money produced by Hacknet Nodes by 30%."); + "This augmentation increases the amount of money produced by Hacknet Nodes by 25%."); HacknetNodeKernelDNI.addToFactions(["Netburners"]); if (augmentationExists(AugmentationNames.HacknetNodeKernelDNI)) { HacknetNodeKernelDNI.owned = Augmentations[AugmentationNames.HacknetNodeKernelDNI].owned; @@ -802,7 +802,7 @@ initAugmentations = function() { HacknetNodeCoreDNI.setInfo("Installs a Direct-Neural Interface jack into the arm that is capable of connecting " + "to a Hacknet Node. This lets the user access and manipulate the Node's processing logic using " + "the mind's electrochemical signals.

" + - "This augmentation increases the amount of money produced by Hacknet Nodes by 50%."); + "This augmentation increases the amount of money produced by Hacknet Nodes by 45%."); HacknetNodeCoreDNI.addToFactions(["Netburners"]); if (augmentationExists(AugmentationNames.HacknetNodeCoreDNI)) { HacknetNodeCoreDNI.owned = Augmentations[AugmentationNames.HacknetNodeCoreDNI].owned; @@ -1528,10 +1528,10 @@ applyAugmentation = function(aug, reapply=false) { Player.hacknet_node_purchase_cost_mult *= 0.9; break; case AugmentationNames.HacknetNodeKernelDNI: - Player.hacknet_node_money_mult *= 1.30; + Player.hacknet_node_money_mult *= 1.25; break; case AugmentationNames.HacknetNodeCoreDNI: - Player.hacknet_node_money_mult *= 1.50; + Player.hacknet_node_money_mult *= 1.45; break; //Misc augmentations diff --git a/src/Constants.js b/src/Constants.js index 600b1d2fd..c9eb92ae5 100644 --- a/src/Constants.js +++ b/src/Constants.js @@ -147,15 +147,16 @@ CONSTANTS = { "home Connect to home computer
" + "hostname Displays the hostname of the machine
" + "ifconfig Displays the IP address of the machine
" + - "kill [script name] Stops a script that is running on the current machine
" + + "kill [script] Stops a script that is running on the current machine
" + "ls Displays all programs and scripts on the machine
" + - "mem [script name] Displays the amount of RAM the script requires to run
" + - "nano [script name] Text editor - Open up and edit a script
" + + "mem [script] Displays the amount of RAM the script requires to run
" + + "nano [script] Text editor - Open up and edit a script
" + "ps Display all scripts that are currently running
" + "rm Delete a script/program from the machine. (WARNING: Permanent)
" + "run [script/program] Execute a program or a script
" + "scan Displays all available network connections
" + "scan-analyze [depth] Displays hacking-related information for all servers up to depth nodes away
" + + "scp [script] [server] Copies a script to a destination server (specified by ip or hostname)
" + "sudov Shows whether or not you have root access on this computer
" + "tail [script] Display script logs (logs contain details about active scripts)
" + "top Display all running scripts and their RAM usage
", diff --git a/src/Location.js b/src/Location.js index 6e163f5a8..8f302f23e 100644 --- a/src/Location.js +++ b/src/Location.js @@ -861,7 +861,7 @@ displayLocationContent = function() { case Locations.AevumSlums: case Locations.ChongqingSlums: case Locations.Sector12Slums: - case Locations.NewTokyokSlums: + case Locations.NewTokyoSlums: case Locations.IshimaSlums: case Locations.VolhavenSlums: var shopliftChance = determineCrimeChanceShoplift(); diff --git a/src/NetscriptEvaluator.js b/src/NetscriptEvaluator.js index 26a345423..50a6a48a1 100644 --- a/src/NetscriptEvaluator.js +++ b/src/NetscriptEvaluator.js @@ -707,6 +707,58 @@ function evaluate(exp, workerScript) { }, function(e) { reject(e); }); + } else if (exp.func.value == "scp") { + if (exp.args.length != 1) { + reject(makeRuntimeRejectMsg(workerScript, "scp() call has incorrect number of arguments. Takes 2 arguments")); + return; + } + var scriptNamePromise = evaluate(exp.args[0], workerScript); + scriptNamePromise.then(function(scriptname) { + var ipPromise = evaluate(exp.args[1], workerScript); + ipPromise.then(function(ip) { + var destServer = getServer(ip); + if (destServer == null) { + reject(makeRuntimeRejectMsg(workerScript, "Invalid hostname/ip passed into scp() command: " + ip)); + 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(destServ.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; + } + 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); + workerScript.scriptRef.log(scriptname + " copied over to " + server.hostname); + resolve(true); + return; + } + } + workerScript.scriptRef.log(scriptname + " does not exist. scp() failed"); + resolve(false); + + }, function(e) { + reject(e); + }); + }, function(e) { + reject(e); + }); + } else if (exp.func.value == "getHostname") { if (exp.args.length != 0) { reject(makeRuntimeRejectMsg(workerScript, "getHostname() call has incorrect number of arguments. Takes 0 arguments")); diff --git a/src/Terminal.js b/src/Terminal.js index ca2a2ee10..144baa912 100644 --- a/src/Terminal.js +++ b/src/Terminal.js @@ -789,8 +789,7 @@ var Terminal = { var currServ = Player.getCurrentServer(); for (var i = 0; i < currServ.scripts.length; ++i) { - if (scriptname == currServ.scripts[i].filename){ - + if (scriptname == currServ.scripts[i].filename) { var newScript = new Script(); newScript.filename = scriptname; newScript.code = currServ.scripts[i].code; diff --git a/src/engine.js b/src/engine.js index ce4647542..56535293d 100644 --- a/src/engine.js +++ b/src/engine.js @@ -1092,6 +1092,7 @@ var Engine = { document.getElementById("debug-delete-scripts-link").addEventListener("click", function() { console.log("Deleting running scripts on home computer"); Player.getHomeComputer().runningScripts = []; + dialogBoxCreate("Forcefully deleted scripts. Please refresh page"); return false; }); },