mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-19 15:54:09 +02:00
v0.35.1
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ secrets that you've been searching for.
|
||||
:caption: Contents:
|
||||
|
||||
Netscript <netscript>
|
||||
|
||||
Keyboard Shortcuts <shortcuts>
|
||||
|
||||
|
||||
Indices and tables
|
||||
|
||||
+62
@@ -142,6 +142,68 @@ Comments are not evaluated as code, and can be used to document and/or explain c
|
||||
* comment */
|
||||
print("This code will actually get executed");
|
||||
|
||||
Importing Functions
|
||||
-------------------
|
||||
|
||||
In Netscript you can import functions that are declared in other scripts.
|
||||
The script will incur the RAM usage of all imported functions.
|
||||
There are two ways of doing this::
|
||||
|
||||
import * as namespace from "script filename"; //Import all functions from script
|
||||
import {fn1, fn2, ...} from "script filename"; //Import specific functions from script
|
||||
|
||||
Suppose you have a library script called *testlibrary.script*::
|
||||
|
||||
function foo1(args) {
|
||||
//function definition...
|
||||
}
|
||||
|
||||
function foo2(args) {
|
||||
//function definition...
|
||||
}
|
||||
|
||||
function foo3(args) {
|
||||
//function definition...
|
||||
}
|
||||
|
||||
function foo4(args) {
|
||||
//function definition...
|
||||
}
|
||||
|
||||
Then, if you wanted to use these functions in another script, you can import them like so::
|
||||
|
||||
import * as testlib from "testlibrary.script";
|
||||
|
||||
values = [1,2,3];
|
||||
|
||||
//The imported functions must be specified using the namespace
|
||||
someVal1 = testlib.foo3(values);
|
||||
someVal2 = testlib.foo1(values);
|
||||
if (someVal1 > someVal2) {
|
||||
//...
|
||||
} else {
|
||||
//...
|
||||
}
|
||||
|
||||
If you only wanted to import certain functions, you can do so without needing
|
||||
to specify a namespace for the import::
|
||||
|
||||
import {foo1, foo3} from "testlibrary.script"; //Saves RAM since not all functions are imported!
|
||||
|
||||
values = [1,2,3];
|
||||
|
||||
//No namespace needed
|
||||
someVal1 = foo3(values);
|
||||
someVal2 = foo1(values);
|
||||
if (someVal1 > someVal2) {
|
||||
//...
|
||||
} else {
|
||||
//...
|
||||
}
|
||||
|
||||
Note that exporting functions is not required.
|
||||
|
||||
|
||||
Javascript Math Module
|
||||
----------------------
|
||||
|
||||
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
Keyboard Shortcuts
|
||||
==================
|
||||
This page documents the various keyboard shortcuts that can be used in the game.
|
||||
|
||||
Game Navigation
|
||||
---------------
|
||||
These are used to switch between the different menus/tabs in the game.
|
||||
These shortcuts are almost always available. Exceptions include:
|
||||
|
||||
* Working at a company or for a faction
|
||||
* Creating a program
|
||||
* Taking a university class
|
||||
* Training at a gym
|
||||
* Active Mission (aka Hacking Mission)
|
||||
|
||||
========== ===========================================================================
|
||||
Shortcut Action
|
||||
========== ===========================================================================
|
||||
Alt + t Switch to Terminal
|
||||
Alt + c Switch to 'Stats' page
|
||||
Alt + e Switch to Script Editor. Will open up the last-edited file or a new file
|
||||
Alt + s Switch to 'Active Scripts' page
|
||||
Alt + h Switch to 'Hacknet Nodes' page
|
||||
Alt + w Switch to 'City' page
|
||||
Alt + j Go to the company where you are employed ('Job' page on navigation menu)
|
||||
Alt + r Go to Travel Agency in current City ('Travel' page on navigation menu)
|
||||
Alt + p Switch to 'Create Program' page
|
||||
Alt + f Switch to 'Factions' page
|
||||
Alt + a Switch to 'Augmentations' page
|
||||
Alt + u Switch to 'Tutorial' page
|
||||
Alt + o Switch to 'Options' page
|
||||
========== ===========================================================================
|
||||
|
||||
Script Editor
|
||||
-------------
|
||||
These shortcuts are available only in the Script Editor
|
||||
|
||||
============= ===========================================================================
|
||||
Shortcut Action
|
||||
============= ===========================================================================
|
||||
Ctrl + b Save script and return to Terminal
|
||||
Ctrl + space Function autocompletion
|
||||
============= ===========================================================================
|
||||
|
||||
In the Script Editor you can configure your key binding mode to three preset options:
|
||||
|
||||
* `Ace <https://github.com/ajaxorg/ace/wiki/Default-Keyboard-Shortcuts>`_
|
||||
* Vim
|
||||
* Emacs
|
||||
|
||||
Terminal Shortcuts
|
||||
------------------
|
||||
These shortcuts are available only in the Terminal
|
||||
|
||||
============= ===========================================================================
|
||||
Shortcut Action
|
||||
============= ===========================================================================
|
||||
Up/Down arrow Cycle through previous commands
|
||||
Ctrl + c Cancel a hack/analyze action
|
||||
Ctrl + l Clear screen
|
||||
Tab Autocomplete command
|
||||
============= ===========================================================================
|
||||
|
||||
Terminal Bash Shortcuts
|
||||
-----------------------
|
||||
These shortcuts were implemented to better emulate a bash shell. They must be enabled
|
||||
in your Terminal's *.fconf* file. This can be done be entering the Terminal command::
|
||||
|
||||
nano .fconf
|
||||
|
||||
and then setting the *ENABLE_BASH_HOTKEYS* option to 1.
|
||||
|
||||
**Note that these Bash shortcuts override any other shortcuts defined in the game (unless otherwise noted),
|
||||
as well as your browser's shortcuts**
|
||||
|
||||
**Also note that more Bash-like shortcuts will be implemented in the future**
|
||||
|
||||
============= ===========================================================================
|
||||
Shortcut Action
|
||||
============= ===========================================================================
|
||||
Ctrl + c Clears current Terminal input (does NOT override default Ctrl + c command)
|
||||
Ctrl + p Same as Up Arrow
|
||||
Ctrl + n Same as Down Arrow
|
||||
Ctrl + a Move cursor to beginning of line (same as 'Home' key)
|
||||
Ctrl + e Move cursor to end of line (same as 'End' key)
|
||||
Ctrl + b Move cursor to previous character
|
||||
Alt + b Move cursor to previous word
|
||||
Ctrl + f Move cursor to next character
|
||||
Alt + f Move cursor to next word
|
||||
Ctrl + h/d Delete previous character ('Backspace')
|
||||
============= ===========================================================================
|
||||
|
||||
Misc Shortcuts
|
||||
--------------
|
||||
============= ===========================================================================
|
||||
Shortcut Action
|
||||
============= ===========================================================================
|
||||
Esc Close a script's log window
|
||||
============= ===========================================================================
|
||||
Reference in New Issue
Block a user