From 223bc3c2c6b8133d9408533dfa722a60d0303788 Mon Sep 17 00:00:00 2001 From: Daniel Xie Date: Mon, 15 May 2017 22:27:47 -0500 Subject: [PATCH] Properly focuses on Script editor when its opened --- README.md | 3 --- src/Constants.js | 6 ++---- src/HacknetNode.js | 2 +- src/InteractiveTutorial.js | 6 ++---- src/Terminal.js | 12 ++++++++++-- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 559295e76..d8e920c29 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,6 @@ Private beta feedback Now, only other suggestion before sleep would be to be able to buy multiple Hacknet upgrades in one click -1) - multiple commands to do the same thing? (why?) <--- there are a few of these in the initial help... clear/cls, scan/netstat, connect/telnet... Maybe just pick one to unclutter it? 2) - "Wrong Command! Try Again!" seemed a bit out of place for a terminal. Trying to repro this, it seems you may have already fixed it? -3) - If you can help it, please don't require the code to be exactly pasted from the tutorial to finish the tutorial. I copied the code and then "corrected" the brackets and spacing... and it wouldn't let me continue. :D 5) - As a programmer... you cannot take the TAB key from us in the script editor. :neutral_face: Not sure how the game itself is coded, but if you've got to EAT a ghost-tab just to give me one in-editor... let me tab out my code in-script, or I'll go mad. 6) - Maybe show total $ somewhere onscreen at all (or most) times. $/sec would also be good to know, depending on if you want the player to know that. Bottom of the menu on the left is an empty enough place to keep these. -7) - default the focus to in-editor when you nano up a new script, so you can start typing immediately upon commanding one to be created. \ No newline at end of file diff --git a/src/Constants.js b/src/Constants.js index 5e3074d26..6cdfc803d 100644 --- a/src/Constants.js +++ b/src/Constants.js @@ -1,5 +1,5 @@ CONSTANTS = { - Version: "0.9", + Version: "0.10", //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 @@ -141,14 +141,12 @@ CONSTANTS = { "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
" + - "netstat Displays all available network connections
" + "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 See 'netstat' command
" + + "scan Displays all available network connections
" + "sudov Shows whether or not you have root access on this computer
" + "tail [script] Display script logs (logs contain details about active scripts)
" + - "telnet [ip/hostname] See 'connect' command
" + "top Display all running scripts and their RAM usage
", /* Tutorial related things */ diff --git a/src/HacknetNode.js b/src/HacknetNode.js index 01264b705..096a1855b 100644 --- a/src/HacknetNode.js +++ b/src/HacknetNode.js @@ -18,7 +18,7 @@ HacknetNode.prototype.updateMoneyGainRate = function() { //Each CPU core doubles the speed. Every 1GB of ram adds 15% increase this.moneyGainRatePerSecond = (this.level * gainPerLevel) * - Math.pow(1.05, this.ram-1) * + Math.pow(1.07, this.ram-1) * ((this.numCores + 1) / 2) * Player.hacknet_node_money_mult; if (isNaN(this.moneyGainRatePerSecond)) { this.moneyGainRatePerSecond = 0; diff --git a/src/InteractiveTutorial.js b/src/InteractiveTutorial.js index f72cb2dec..460990f63 100644 --- a/src/InteractiveTutorial.js +++ b/src/InteractiveTutorial.js @@ -151,8 +151,7 @@ function iTutorialEvaluateStep() { "on the computer. Right now, it shows that you have a program called 'NUKE.exe' on your computer. " + "We'll get to what this does later.

Through your home computer's terminal, you can connect " + "to other machines throughout the world. Let's do that now by first entering " + - "the 'scan' command (Alternatively, you can also enter the 'netstat' command " + - "which does the same thing). "); + "the 'scan' command. "); //next step triggered by terminal command break; case iTutorialSteps.TerminalConnect: @@ -160,8 +159,7 @@ function iTutorialEvaluateStep() { "it displays a list of all servers that can be connected to from your " + "current machine. A server is identified by either its IP or its hostname.

" + "To connect to a machine, use the 'connect [ip/hostname]' command. You can type in " + - "the ip or the hostname, but dont use both. (Alternatively, " + - "the 'telnet [ip/hostname]' command does the same thing).

" + + "the ip or the hostname, but dont use both.

" + "Let's try this now by connecting to the 'foodnstuff' server (connect foodnstuff)"); //next step triggered by terminal command break; diff --git a/src/Terminal.js b/src/Terminal.js index 656d40fb6..c9f34eb35 100644 --- a/src/Terminal.js +++ b/src/Terminal.js @@ -27,6 +27,15 @@ var postNetburnerText = function() { post("Bitburner v" + CONSTANTS.Version); } +/* +$(document).keyup(function(event) { + //Enter + if (event.keyCode == 13) { + + } +}); +*/ + //Defines key commands in terminal $(document).keydown(function(event) { //Terminal @@ -36,6 +45,7 @@ $(document).keydown(function(event) { //Enter if (event.keyCode == 13) { + event.preventDefault(); var command = $('input[class=terminal-input]').val(); if (command.length > 0) { post("> " + command); @@ -501,7 +511,6 @@ var Terminal = { postNetburnerText(); break; case "connect": - case "telnet": //Disconnect from current server in terminal and connect to new one if (commandArray.length != 2) { post("Incorrect usage of connect/telnet command. Usage: connect/telnet [ip/hostname]"); @@ -644,7 +653,6 @@ var Terminal = { } Engine.loadScriptEditorContent(scriptname, ""); break; - case "netstat": case "scan": Terminal.executeScanCommand(commandArray); break;