From 14e6b604b4fa7ae0d67ae2b85a52cbb7b14855e4 Mon Sep 17 00:00:00 2001 From: Daniel Xie Date: Mon, 22 May 2017 22:50:06 -0500 Subject: [PATCH] Bug fix --- src/NetscriptEvaluator.js | 4 ++-- src/Terminal.js | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/NetscriptEvaluator.js b/src/NetscriptEvaluator.js index e7c7ee55e..00d25493b 100644 --- a/src/NetscriptEvaluator.js +++ b/src/NetscriptEvaluator.js @@ -248,7 +248,7 @@ function evaluate(exp, workerScript) { } if (server.requiredHackingSkill > Player.hacking_skill) { - workerScript.scriptRef.log("Cannot hack this server (" + server.hostaname + ") because user does not have root access"); + workerScript.scriptRef.log("Cannot hack this server (" + server.hostname + ") because user's hacking skill is not high enough"); reject("|" + workerScript.serverIp + "|" + workerScript.name + "|Script crashed because player's hacking skill is not high enough to hack " + server.hostname); return; } @@ -701,7 +701,7 @@ function evaluate(exp, workerScript) { workerScript.scriptRef.log("Cannot getServerMoneyAvailable(). Invalid IP or hostname passed in: " + ip); return; } - workerScript.scriptRef.log("getServerMoneyAvailable() returned " + server.moneyAvailable); + workerScript.scriptRef.log("getServerMoneyAvailable() returned " + formatNumber(server.moneyAvailable, 2)); resolve(server.moneyAvailable); }, CONSTANTS.CodeInstructionRunTime); }, function(e) { diff --git a/src/Terminal.js b/src/Terminal.js index ad8626330..d2dc1ba93 100644 --- a/src/Terminal.js +++ b/src/Terminal.js @@ -360,7 +360,11 @@ var Terminal = { } Terminal.commandHistoryIndex = Terminal.commandHistory.length; + //Only split the first space var commandArray = command.split(" "); + if (commandArray.length > 1) { + commandArray = [commandArray.shift(), commandArray.join(" ")]; + } if (commandArray.length == 0) {return;} @@ -484,6 +488,16 @@ var Terminal = { /* Command parser */ switch (commandArray[0]) { + case "alias": + if (commandArray.length == 1) { + printAliases(); + } else if (commandArray.length == 2) { + + } else { + post("Incorrect usage of alias command. Usage: alias [aliasname='value'"); return; + } + + break; case "analyze": if (commandArray.length != 1) { post("Incorrect usage of analyze command. Usage: analyze"); return;