mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-02 05:47:14 +02:00
Merge branch 'master' into patch-1
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
|
||||
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
|
||||
!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
|
||||
!_TAG_PROGRAM_NAME Exuberant Ctags //
|
||||
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
|
||||
!_TAG_PROGRAM_VERSION 5.8 //
|
||||
author .\conf.py /^author = 'Bitburner'$/;" v
|
||||
copyright .\conf-guzzle.py /^copyright = u'2017, Daniel Xie'$/;" v
|
||||
copyright .\conf.py /^copyright = '2017, Bitburner'$/;" v
|
||||
exclude_patterns .\conf-guzzle.py /^exclude_patterns = ['_build']$/;" v
|
||||
exclude_patterns .\conf.py /^exclude_patterns = []$/;" v
|
||||
extensions .\conf-guzzle.py /^extensions = []$/;" v
|
||||
extensions .\conf.py /^extensions = ['sphinx.ext.autodoc',$/;" v
|
||||
guzzle_sphinx_theme .\conf-guzzle.py /^import guzzle_sphinx_theme$/;" i
|
||||
html_show_sourcelink .\conf-guzzle.py /^html_show_sourcelink = False$/;" v
|
||||
html_static_path .\conf.py /^html_static_path = ['ystatic']$/;" v
|
||||
html_theme .\conf-guzzle.py /^html_theme = 'guzzle_sphinx_theme'$/;" v
|
||||
html_theme .\conf.py /^html_theme = 'agogo'$/;" v
|
||||
html_theme_options .\conf-guzzle.py /^html_theme_options = {$/;" v
|
||||
html_theme_path .\conf-guzzle.py /^html_theme_path = guzzle_sphinx_theme.html_theme_path()$/;" v
|
||||
htmlhelp_basename .\conf.py /^htmlhelp_basename = 'Bitburnerdoc'$/;" v
|
||||
intersphinx_mapping .\conf.py /^intersphinx_mapping = {'https:\/\/docs.python.org\/': None}$/;" v
|
||||
language .\conf.py /^language = 'English'$/;" v
|
||||
latex_documents .\conf.py /^latex_documents = [$/;" v
|
||||
latex_elements .\conf.py /^latex_elements = {$/;" v
|
||||
man_pages .\conf.py /^man_pages = [$/;" v
|
||||
master_doc .\conf-guzzle.py /^master_doc = 'index'$/;" v
|
||||
master_doc .\conf.py /^master_doc = 'index'$/;" v
|
||||
os .\conf-guzzle.py /^import sys, os, subprocess$/;" i
|
||||
project .\conf-guzzle.py /^project = u'Bitburner'$/;" v
|
||||
project .\conf.py /^project = 'Bitburner'$/;" v
|
||||
pygments_style .\conf.py /^pygments_style = 'sphinx'$/;" v
|
||||
release .\conf.py /^release = '1.0'$/;" v
|
||||
source_suffix .\conf-guzzle.py /^source_suffix = '.rst'$/;" v
|
||||
source_suffix .\conf.py /^source_suffix = '.rst'$/;" v
|
||||
subprocess .\conf-guzzle.py /^import sys, os, subprocess$/;" i
|
||||
sys .\conf-guzzle.py /^import sys, os, subprocess$/;" i
|
||||
templates_path .\conf-guzzle.py /^templates_path = ['_templates']$/;" v
|
||||
templates_path .\conf.py /^templates_path = ['ytemplates']$/;" v
|
||||
texinfo_documents .\conf.py /^texinfo_documents = [$/;" v
|
||||
todo_include_todos .\conf.py /^todo_include_todos = True$/;" v
|
||||
version .\conf-guzzle.py /^version = '1.0.0'$/;" v
|
||||
version .\conf.py /^version = '1.0'$/;" v
|
||||
@@ -23,3 +23,4 @@ to reach out to the developer!
|
||||
Hacknet Node API <netscripthacknetnodeapi>
|
||||
Trade Information eXchange (TIX) API <netscriptixapi>
|
||||
Singularity Functions <netscriptsingularityfunctions>
|
||||
Miscellaneous <netscriptmisc>
|
||||
|
||||
@@ -12,7 +12,7 @@ hack
|
||||
.. js:function:: hack(hostname/ip)
|
||||
|
||||
:param string hostname/ip: IP or hostname of the target server to hack
|
||||
:returns: True if the hack is successful, false otherwise
|
||||
:returns: The amount of money stolen if the hack is successful, and zero otherwise
|
||||
|
||||
Function that is used to try and hack servers to steal money and gain hacking experience. The runtime for this command depends
|
||||
on your hacking level and the target server's security level. In order to hack a server you must first gain root access
|
||||
@@ -72,10 +72,9 @@ weaken
|
||||
sleep
|
||||
^^^^^
|
||||
|
||||
.. js:function:: sleep(n[, log=true])
|
||||
.. js:function:: sleep(n)
|
||||
|
||||
:param number n: Number of milliseconds to sleep
|
||||
:param boolean log: Optional boolean specifying whether or not to log the action
|
||||
|
||||
Suspends the script for n milliseconds.
|
||||
|
||||
@@ -97,6 +96,39 @@ tprint
|
||||
|
||||
Prints a value or a variable to the Terminal
|
||||
|
||||
clearLog
|
||||
^^^^^^^^
|
||||
|
||||
.. js:function:: clearLog()
|
||||
|
||||
Clears the script's logs
|
||||
|
||||
disableLog
|
||||
^^^^^^^^^^
|
||||
|
||||
.. js:function:: disableLog(fn)
|
||||
|
||||
:param string fn: Name of function for which to disable logging
|
||||
|
||||
Disables logging for the given function. Logging can be disabled for
|
||||
all functions by passing 'ALL' as the argument.
|
||||
|
||||
Note that this does not completely remove all logging functionality.
|
||||
This only stops a function from logging
|
||||
when the function is successful. If the function fails, it will still log the reason for failure.
|
||||
|
||||
Notable functions that cannot have their logs disabled: run, exec, exit
|
||||
|
||||
enableLog
|
||||
^^^^^^^^^
|
||||
|
||||
.. js:function:: enableLog(fn)
|
||||
|
||||
:param string fn: Name of function for which to enable logging
|
||||
|
||||
Re-enables logging for the given function. If 'ALL' is passed into this function
|
||||
as an argument, then it will revert the effects of disableLog('ALL')
|
||||
|
||||
scan
|
||||
^^^^
|
||||
|
||||
@@ -304,7 +336,8 @@ killall
|
||||
|
||||
:param string hostname/ip: IP or hostname of the server on which to kill all scripts
|
||||
|
||||
Kills all running scripts on the specified server. This function will always return true.
|
||||
Kills all running scripts on the specified server. This function returns true if any scripts were killed, and
|
||||
false otherwise. In other words, it will return true if there are any scripts running on the target server.
|
||||
|
||||
|
||||
exit
|
||||
@@ -346,9 +379,10 @@ scp
|
||||
ls
|
||||
^^
|
||||
|
||||
.. js:function:: ls(hostname/ip)
|
||||
.. js:function:: ls(hostname/ip, [grep])
|
||||
|
||||
:param string hostname/ip: Hostname or IP of the target server
|
||||
:param string grep: a substring to search for in the filename
|
||||
|
||||
Returns an array with the filenames of all files on the specified server (as strings). The returned array
|
||||
is sorted in alphabetic order
|
||||
@@ -639,15 +673,6 @@ getPurchasedServers
|
||||
|
||||
Returns an array with either the hostnames or IPs of all of the servers you have purchased.
|
||||
|
||||
round
|
||||
^^^^^
|
||||
|
||||
.. js:function:: round(n)
|
||||
|
||||
:param number n: Number to round
|
||||
|
||||
Returns the argument *n* rounded to the nearest integer. If the argument passed in is not a number, then the function will return 0.
|
||||
|
||||
write
|
||||
^^^^^
|
||||
|
||||
@@ -684,6 +709,18 @@ read
|
||||
If the argument *port/fn* is a string, then it specifies the name of a text file (.txt) and this function will return the data in the specified text file. If
|
||||
the text file does not exist, an empty string will be returned.
|
||||
|
||||
peek
|
||||
^^^^
|
||||
|
||||
.. js:function:: peek(port)
|
||||
|
||||
:param number port: Port to peek. Must be an integer between 1 and 10
|
||||
|
||||
This function is used to peek at the data from a port. It returns the first element in the specified port
|
||||
without removing that element. If the port is empty, the string "NULL PORT DATA" will be returned.
|
||||
|
||||
Read about how `Netscript Ports work here <http://bitburner.wikia.com/wiki/Netscript_Ports>`_.
|
||||
|
||||
clear
|
||||
^^^^^
|
||||
|
||||
@@ -697,6 +734,16 @@ clear
|
||||
|
||||
If the *port/fn* argument is a string, then it specifies the name of a text file (.txt) and will delete all data from that text file.
|
||||
|
||||
rm
|
||||
^^
|
||||
|
||||
.. js:function:: rm(fn)
|
||||
|
||||
:param string fn: Filename of file to remove. Must include the extension
|
||||
:returns: True if it successfully deletes the file, and false otherwise
|
||||
|
||||
Removes the specified file from the current server. This function works for every file type except message (.msg) files.
|
||||
|
||||
scriptRunning
|
||||
^^^^^^^^^^^^^
|
||||
|
||||
|
||||
@@ -2,9 +2,6 @@ Netscript Loops and Conditionals
|
||||
================================
|
||||
|
||||
|
||||
Loops and Conditionals
|
||||
----------------------
|
||||
|
||||
Netscript loops and conditionals are the same as Javascript. However, the one caveat is that when declaring variables such as the
|
||||
iterator for traversing a loop, you should not use the 'var' or 'let' keyword. For reference, you can see the Javascript
|
||||
documentation for loops/conditionals here:
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
Netscript Miscellaneous
|
||||
=======================
|
||||
|
||||
|
||||
Comments
|
||||
--------
|
||||
Netscript supports comments using the same syntax as `Javascript comments <https://www.w3schools.com/js/js_comments.asp>`_.
|
||||
Comments are not evaluated as code, and can be used to document and/or explain code::
|
||||
|
||||
//This is a comment and will not get executed even though its in the code
|
||||
/* Multi
|
||||
* line
|
||||
* comment */
|
||||
print("This code will actually get executed");
|
||||
|
||||
Javascript Math Module
|
||||
----------------------
|
||||
|
||||
The `Javascript Math Module <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math>`_ is
|
||||
supported in Netscript and is used in the same way::
|
||||
|
||||
numThreads = Math.floor(getServerRam("foodnstuff")[1] / 3.4);
|
||||
|
||||
Javascript Date Module
|
||||
----------------------
|
||||
|
||||
The `Javascript Date Module <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date>`_ is supported in Netscript.
|
||||
However, since the 'new' operator does not work in Netscript, only the Date module's static functions can be used:
|
||||
|
||||
* now()
|
||||
* UTC()
|
||||
* Parse()
|
||||
* Maybe some others I don't know about
|
||||
|
||||
Example::
|
||||
|
||||
time = Date.now();
|
||||
Reference in New Issue
Block a user