mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2025-03-14 14:22:32 +01:00
Implemented df and cls/clear commands
This commit is contained in:
@ -53,9 +53,9 @@
|
||||
})
|
||||
</script>
|
||||
|
||||
<script src="src/Terminal.js"></script>
|
||||
<script src="src/Server.js"></script>
|
||||
<script src="src/Player.js"></script>
|
||||
<script src="src/Terminal.js"></script>
|
||||
<script src="src/engine.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -51,7 +51,7 @@ var Player = {
|
||||
|
||||
|
||||
init: function() {
|
||||
homeComputer.init("19.42.93.219", "home", "Home PC", true, true, true, true, 1);
|
||||
currentServer = Player.homeComputer;
|
||||
Player.homeComputer.init("19.42.93.219", "home", "Home PC", true, true, true, true, 1);
|
||||
Player.currentServer = Player.homeComputer;
|
||||
}
|
||||
};
|
@ -4,6 +4,10 @@ var post = function(input) {
|
||||
window.scrollTo(0, document.body.scrollHeight);
|
||||
}
|
||||
|
||||
var postNetburnerText = function() {
|
||||
post("Netburner v1.0");
|
||||
}
|
||||
|
||||
//command is checked on enter key press
|
||||
$(document).keyup(function(event) {
|
||||
if (event.keyCode == 13) {
|
||||
@ -32,13 +36,17 @@ var Terminal = {
|
||||
break;
|
||||
case "clear":
|
||||
case "cls":
|
||||
//TODO
|
||||
console.log("cls/clear command called");
|
||||
$("#terminal tr:not(:last)").remove();
|
||||
postNetburnerText();
|
||||
break;
|
||||
case "connect":
|
||||
//TODO Disconnect from current server in terminal and connect to new one..maybe rename this to telnet?
|
||||
break;
|
||||
case "df":
|
||||
//TODO
|
||||
console.log("df command called");
|
||||
var dfStr = Player.currentServer.ramUsed.toString() + " / " Player.currentServer.maxRam.toString() + "GB";
|
||||
post(dfStr);
|
||||
break;
|
||||
case "hack":
|
||||
//TODO Hack the current PC (usually for money)
|
||||
|
@ -87,7 +87,7 @@ var Engine = {
|
||||
loadTerminalContent: function() {
|
||||
Engine.hideAllContent();
|
||||
Engine.Display.terminalContent.style.visibility = "visible";
|
||||
post("Netburner v1.0");
|
||||
postNetburnerText();
|
||||
},
|
||||
|
||||
loadCharacterContent: function() {
|
||||
@ -141,6 +141,9 @@ var Engine = {
|
||||
|
||||
/* Initialization */
|
||||
init: function() {
|
||||
//Initialize Player objects
|
||||
Player.init();
|
||||
|
||||
//Load, save, and delete buttons
|
||||
//Engine.Clickables.saveButton = document.getElementById("save");
|
||||
//Engine.Clickables.saveButton.addEventListener("click", function() {
|
||||
@ -182,7 +185,7 @@ var Engine = {
|
||||
Engine.displayCharacterInfo();
|
||||
|
||||
//Message at the top of terminal
|
||||
post("Netburner v1.0");
|
||||
postNetburnerText();
|
||||
|
||||
//Run main loop
|
||||
Engine.idleTimer();
|
||||
|
Reference in New Issue
Block a user