mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 01:23:49 +01:00
Adding Basic Gameplay to documentation
This commit is contained in:
parent
6f26408de7
commit
b38fd4a54d
22
doc/source/basicgameplay.rst
Normal file
22
doc/source/basicgameplay.rst
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
Basic Gameplay
|
||||||
|
==============
|
||||||
|
This section documents Bitburner gameplay elements that are immediately
|
||||||
|
available and/or accessible to the player.
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 5
|
||||||
|
:caption: Elements:
|
||||||
|
|
||||||
|
Stats <basicgameplay/stats>
|
||||||
|
Terminal <basicgameplay/terminal>
|
||||||
|
Servers <basicgameplay/servers>
|
||||||
|
Hacking <basicgameplay/hacking>
|
||||||
|
Scripts <basicgameplay/scripts>
|
||||||
|
World <basicgameplay/world>
|
||||||
|
Factions <basicgameplay/factions>
|
||||||
|
Augmentations <basicgameplay/augmentations>
|
||||||
|
Companies <basicgameplay/companies>
|
||||||
|
Crimes <basicgameplay/crimes>
|
||||||
|
Infiltration <basicgameplay/infiltration>
|
||||||
|
Stock Market <basicgameplay/stockmarket>
|
||||||
|
Coding Contracts <basicgameplay/codingcontracts>
|
74
doc/source/basicgameplay/augmentations.rst
Normal file
74
doc/source/basicgameplay/augmentations.rst
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
.. _gameplay_augmentations:
|
||||||
|
|
||||||
|
Augmentations
|
||||||
|
=============
|
||||||
|
Advances in science and medicine have lead to powerful new technologies
|
||||||
|
that allow people to augment themselves beyond normal human capabilities.
|
||||||
|
There are many different types of Augmentations, ranging from cybernetic
|
||||||
|
to genetic to biological. Acquiring these Augmentations enhances the
|
||||||
|
user's physical and mental faculties.
|
||||||
|
|
||||||
|
Augmentations provide persistent upgrades in the form of multipliers.
|
||||||
|
These multipliers apply to a wide variety of things such as stats,
|
||||||
|
experience gain, and hacking, just to name a few. Your multipliers
|
||||||
|
can be viewed in the 'Character' page (keyboard shortcut Alt + c)
|
||||||
|
|
||||||
|
How to acquire Augmentations
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
Because of how powerful Augmentations are, the technology behind them
|
||||||
|
is kept private and secret by the corporations and organizations that
|
||||||
|
create them. Therefore, the only way for the player to obtain
|
||||||
|
Augmentations is through Factions. After joining a Faction and earning
|
||||||
|
enough reputation in it, you will be able to purchase its Augmentations.
|
||||||
|
Different Factions offer different Augmentations. Augmentations must be
|
||||||
|
purchased in order to be installed, and they are fairly expensive.
|
||||||
|
|
||||||
|
Installing Augmentations
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
You will not gain the benefits of your purchased Augmentations until you
|
||||||
|
actually install them. You can choose to install Augmentations through
|
||||||
|
the 'Augmentations' menu tab (Found under 'Character'. Alternatively,
|
||||||
|
use the keyboard shortcut Alt + a).
|
||||||
|
|
||||||
|
Unfortunately, installing Augmentations has side effects. You will lose
|
||||||
|
most of the progress you've made, including your skills, stats, and
|
||||||
|
money. You will have to start over, but you will have all of the
|
||||||
|
Augmentations you have installed to help you progress. This is the
|
||||||
|
game's "soft reset" or "prestige" mechanic.
|
||||||
|
|
||||||
|
To summarize, here is a list of everything you will LOSE when you install
|
||||||
|
an Augmentation:
|
||||||
|
|
||||||
|
* Stats/Skills
|
||||||
|
* Money
|
||||||
|
* Scripts on all servers EXCEPT your home computer
|
||||||
|
* Purchased servers
|
||||||
|
* Hacknet Nodes
|
||||||
|
* Company/faction reputation
|
||||||
|
* Jobs and Faction memberships
|
||||||
|
* Programs
|
||||||
|
* Stocks
|
||||||
|
* TOR router
|
||||||
|
|
||||||
|
Here is everything you will KEEP when you install an Augmentation:
|
||||||
|
|
||||||
|
* Every Augmentation you have installed
|
||||||
|
* Scripts on your home computer
|
||||||
|
* RAM Upgrades on your home computer
|
||||||
|
* World Stock Exchange account and TIX API Access
|
||||||
|
|
||||||
|
Purchasing Multiple Augmentations
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
You do not have to install an Augmentation right after you purchase it.
|
||||||
|
You can purchase as many Augmentations as you'd like before you choose to
|
||||||
|
install them. When you install your purchased Augmentations they will ALL
|
||||||
|
get installed.
|
||||||
|
|
||||||
|
There are a few drawbacks to this, however. First, obviously, you won't
|
||||||
|
gain the benefits of your purchased Augmentations until after you install
|
||||||
|
them. Second, purchasing multiple Augmentations before installing them
|
||||||
|
will cause the Augmentations to get progressively more expensive. When
|
||||||
|
you purchase an Augmentation, the price of purchasing another Augmentation
|
||||||
|
doubles. This multiplier stacks for each Augmentation you
|
||||||
|
purchase. Once you install your purchased Augmentations, their costs
|
||||||
|
are reset back to the original prices.
|
4
doc/source/basicgameplay/companies.rst
Normal file
4
doc/source/basicgameplay/companies.rst
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
.. _gameplay_companies:
|
||||||
|
|
||||||
|
Companies
|
||||||
|
=========
|
4
doc/source/basicgameplay/crimes.rst
Normal file
4
doc/source/basicgameplay/crimes.rst
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
.. _gameplay_crimes:
|
||||||
|
|
||||||
|
Crimes
|
||||||
|
======
|
163
doc/source/basicgameplay/factions.rst
Normal file
163
doc/source/basicgameplay/factions.rst
Normal file
@ -0,0 +1,163 @@
|
|||||||
|
.. _gameplay_factions:
|
||||||
|
|
||||||
|
Factions
|
||||||
|
========
|
||||||
|
Throughout the game you may receive invitations from factions. There are
|
||||||
|
many different factions, and each faction has different criteria for
|
||||||
|
determining its potential members. Joining a faction and furthering
|
||||||
|
its cause is crucial to progressing in the game and unlocking endgame
|
||||||
|
content.
|
||||||
|
|
||||||
|
It is possible to join multiple factions if you receive invitations from
|
||||||
|
them. However, note that joining a faction may prevent you from joining
|
||||||
|
other rival factions. (Don't worry, this usually isn't the case. Also,
|
||||||
|
it would only be temporary since resetting the game by installing
|
||||||
|
:ref:`gameplay_augmentations` will clear all your factions)
|
||||||
|
|
||||||
|
The 'Factions' link on the menu brings up a list of all factions that
|
||||||
|
you have joined. You can select a Faction on this list to go to that
|
||||||
|
Faction page. This page displays general information about the Faction
|
||||||
|
and also lets you perform work for the faction. Working for a Faction
|
||||||
|
is similar to working for a company except that you don't get paid a
|
||||||
|
salary. You will only earn reputation in your Faction and train your
|
||||||
|
stats. Also, cancelling work early when working for a Faction does
|
||||||
|
**not** result in reduced reputation earnings.
|
||||||
|
|
||||||
|
Earning reputation for a Faction unlocks powerful Augmentations.
|
||||||
|
Purchasing and installing these Augmentations will upgrade your
|
||||||
|
abilities. The Augmentations that are available to unlock vary
|
||||||
|
from faction to faction.
|
||||||
|
|
||||||
|
List of Factions and their Requirements
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
+---------------------+----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| Early Game | Faction Name | Requirements | Joining this Faction prevents |
|
||||||
|
| Factions | | | you from joining: |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | CyberSec | * Hack CSEC Manually | |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | Tian Di Hui | * $1m | |
|
||||||
|
| | | * Hacking Level 50 | |
|
||||||
|
| | | * Be in Chongqing, New Tokyo, or Ishima | |
|
||||||
|
+---------------------+----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | Netburners | * Hacking Level 80 | |
|
||||||
|
| | | * Total Hacknet Levels of 100 | |
|
||||||
|
| | | * Total Hacknet RAM of 8 | |
|
||||||
|
| | | * Total Hacknet Cores of 4 | |
|
||||||
|
+---------------------+----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| City Factions | Sector-12 | * Be in Sector-12 | * Chongqing |
|
||||||
|
| | | * $15m | * New Tokyo |
|
||||||
|
| | | | * Ishima |
|
||||||
|
| | | | * Volhaven |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | Chongqing | * Be in Chongqing | * Sector-12 |
|
||||||
|
| | | * $20m | * Aevum |
|
||||||
|
| | | | * Volhaven |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | New Tokyo | * Be in New Tokyo | * Sector-12 |
|
||||||
|
| | | * $20m | * Aevum |
|
||||||
|
| | | | * Volhaven |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | Ishima | * Be in Ishima | * Sector-12 |
|
||||||
|
| | | * $30m | * Aevum |
|
||||||
|
| | | | * Volhaven |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | Aevum | * Be in Aevum | * Chongqing |
|
||||||
|
| | | * $40m | * New Tokyo |
|
||||||
|
| | | | * Ishima |
|
||||||
|
| | | | * Volhaven |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | Volhaven | * Be in Volhaven | * Sector-12 |
|
||||||
|
| | | * $50m | * Aevum |
|
||||||
|
| | | | * Chongqing |
|
||||||
|
| | | | * New Tokyo |
|
||||||
|
| | | | * Ishima |
|
||||||
|
+---------------------+----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| Hacking | NiteSec | * Hack avmnite-02h manually | |
|
||||||
|
| Groups | | * Home Computer RAM of at least 32GB | |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | The Black Hand | * Hack I.I.I.I manually | |
|
||||||
|
| | | * Home Computer RAM of at least 64GB | |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | Bitrunners | * Hack run4theh111z manually | |
|
||||||
|
| | | * Home Computer RAM of at least 128GB | |
|
||||||
|
+---------------------+----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| Megacorporations | ECorp | * Have 200k reputation with | |
|
||||||
|
| | | the Corporation | |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | MegaCorp | * Have 200k reputation with | |
|
||||||
|
| | | the Corporation | |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | KuaiGong | * Have 200k reputation with | |
|
||||||
|
| | International | the Corporation | |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | Four Sigma | * Have 200k reputation with | |
|
||||||
|
| | | the Corporation | |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | NWO | * Have 200k reputation with | |
|
||||||
|
| | | the Corporation | |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | Blade | * Have 200k reputation with | |
|
||||||
|
| | Industries | the Corporation | |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | OmniTek | * Have 200k reputation with | |
|
||||||
|
| | Incorporated | the Corporation | |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | Bachman & | * Have 200k reputation with | |
|
||||||
|
| | Associates | the Corporation | |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | Clarke | * Have 200k reputation with | |
|
||||||
|
| | Incorporated | the Corporation | |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | Fulcrum Secret | * Have 200k reputation with | |
|
||||||
|
| | Technologies | the Corporation | |
|
||||||
|
| | | * Hack fulcrumassets manually | |
|
||||||
|
+---------------------+----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| Criminal | Slum Snakes | * All Combat Stats of 30 | |
|
||||||
|
| Organizations | | * -9 Karma | |
|
||||||
|
| | | * $1m | |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | Tetrads | * Be in Chongqing, New Tokyo, or Ishima | |
|
||||||
|
| | | * All Combat Stats of 75 | |
|
||||||
|
| | | * -18 Karma | |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | Silhouette | * CTO, CFO, or CEO of a company | |
|
||||||
|
| | | * $15m | |
|
||||||
|
| | | * -22 Karma | |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | Speakers for | * Hacking Level 100 | |
|
||||||
|
| | the Dead | * All Combat Stats of 300 | |
|
||||||
|
| | | * 30 People Killed | |
|
||||||
|
| | | * -45 Karma | |
|
||||||
|
| | | * Not working for CIA or NSA | |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | The Dark Army | * Hacking Level 300 | |
|
||||||
|
| | | * All Combat Stats of 300 | |
|
||||||
|
| | | * Be in Chongqing | |
|
||||||
|
| | | * 5 People Killed | |
|
||||||
|
| | | * -45 Karma | |
|
||||||
|
| | | * Not working for CIA or NSA | |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | The Syndicate | * Hacking Level 200 | |
|
||||||
|
| | | * All Combat Stats of 200 | |
|
||||||
|
| | | * Be in Aevum or Sector-12 | |
|
||||||
|
| | | * $10m | |
|
||||||
|
| | | * -90 Karma | |
|
||||||
|
| | | * Not working for CIA or NSA | |
|
||||||
|
+---------------------+----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| Endgame | The Covenant | * 30 Augmentations | |
|
||||||
|
| Factions | | * $75b | |
|
||||||
|
| | | * Hacking Level of 850 | |
|
||||||
|
| | | * All Combat Stats of 850 | |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | Daedalus | * 30 Augmentations | |
|
||||||
|
| | | * $100b | |
|
||||||
|
| | | * Hacking Level of 2500 OR All Combat | |
|
||||||
|
| | | Stats of 1500 | |
|
||||||
|
+ +----------------+-----------------------------------------+-------------------------------+
|
||||||
|
| | Illuminati | * 30 Augmentations | |
|
||||||
|
| | | * $150b | |
|
||||||
|
| | | * Hacking Level of 1500 | |
|
||||||
|
| | | * All Combat Stats of 1200 | |
|
||||||
|
+---------------------+----------------+-----------------------------------------+-------------------------------+
|
105
doc/source/basicgameplay/hacking.rst
Normal file
105
doc/source/basicgameplay/hacking.rst
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
.. _gameplay_hacking:
|
||||||
|
|
||||||
|
Hacking
|
||||||
|
=======
|
||||||
|
|
||||||
|
In the year 2077, currency has become digital and decentralized.
|
||||||
|
People and corporations store their money on servers. By hacking
|
||||||
|
these servers, you can steal their money and gain experience.
|
||||||
|
|
||||||
|
Gaining Root Access
|
||||||
|
^^^^^^^^^^^^^^^^^^^
|
||||||
|
The first step to hacking a server is to gain root access to that server.
|
||||||
|
This can be done using the NUKE virus (NUKE.exe). You start the
|
||||||
|
game with a copy of the NUKE virus on your home computer. The
|
||||||
|
NUKE virus attacks the target server's open ports using buffer
|
||||||
|
overflow exploits. When successful, you are granted root
|
||||||
|
administrative access to the machine.
|
||||||
|
|
||||||
|
In order for the NUKE virus to succeed, the target server
|
||||||
|
needs to have enough open ports. Some servers have no
|
||||||
|
security and will not need any ports opened. Some will have very high
|
||||||
|
security and will need many ports opened. In order to open ports on
|
||||||
|
another server, you will need to run programs that attack the server
|
||||||
|
to open specific ports. These programs can be coded once your hacking
|
||||||
|
skill gets high enough, or they can be purchased if you can find a seller.
|
||||||
|
|
||||||
|
**There are two ways to execute port-opening programs and the NUKE virus:**
|
||||||
|
|
||||||
|
1. Connect to the target server through the :ref:`terminal` and use the
|
||||||
|
:ref:`run_terminal_command` Terminal command::
|
||||||
|
|
||||||
|
$ run [programName]
|
||||||
|
2. Use a :ref:`Netscript Function <netscriptfunctions>`:
|
||||||
|
|
||||||
|
* :js:func:`nuke`
|
||||||
|
* :js:func:`brutessh`
|
||||||
|
* :js:func:`ftpcrack`
|
||||||
|
* :js:func:`relaysmtp`
|
||||||
|
* :js:func:`httpworm`
|
||||||
|
* :js:func:`sqlinject`
|
||||||
|
|
||||||
|
**There are two ways to determine how many ports need to be opened
|
||||||
|
on a server in order to successfully NUKE it:**
|
||||||
|
|
||||||
|
1. Connect to that server through the :ref:`terminal` and use the
|
||||||
|
:ref:`analyze_terminal_command` command
|
||||||
|
2. Use the :js:func:`getServerNumPortsRequired` Netscript function
|
||||||
|
|
||||||
|
Once you have enough ports opened on a server and have ran the NUKE virus
|
||||||
|
to gain root access, you will be able to hack it.
|
||||||
|
|
||||||
|
General Hacking Mechanics
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
When you execute the hack command, either manually through the terminal
|
||||||
|
or automatically through a script, you attempt to hack the server.
|
||||||
|
This action takes time. The more advanced a server's security is,
|
||||||
|
the more time it will take. Your hacking skill level also affects
|
||||||
|
the hacking time, with a higher hacking skill leading to shorter
|
||||||
|
hacking times. Also, running the hack command manually through terminal
|
||||||
|
is faster than hacking from a script.
|
||||||
|
|
||||||
|
Your attempt to hack a server will not always succeed. The chance you
|
||||||
|
have to successfully hack a server is also determined by the server's
|
||||||
|
security and your hacking skill level. Even if your hacking attempt
|
||||||
|
is unsuccessful, you will still gain experience points.
|
||||||
|
|
||||||
|
When you successfully hack a server. You steal a certain percentage
|
||||||
|
of that server's total money. This percentage is, once again, determined by the
|
||||||
|
server's security and your hacking skill level. The amount of money
|
||||||
|
on a server is not limitless. So, if you constantly hack a server
|
||||||
|
and deplete its money, then you will encounter diminishing returns
|
||||||
|
in your hacking (since you are only hacking a certain percentage).
|
||||||
|
You can increase the amount of money on a server using a script and
|
||||||
|
the :js:func:`grow` function in Netscript.
|
||||||
|
|
||||||
|
Server Security
|
||||||
|
^^^^^^^^^^^^^^^
|
||||||
|
Each server has a security level, typically between 1 and 100.
|
||||||
|
A higher number means the server has stronger security. It is
|
||||||
|
possible for a server to have a security of level 100 or higher, in
|
||||||
|
which case hacking a server will become impossible (0% chance for
|
||||||
|
hack to succeed).
|
||||||
|
|
||||||
|
As mentioned above, a server's security level is an important factor
|
||||||
|
to consider when hacking. You can check a server's security level
|
||||||
|
using the :ref:`analyze_terminal_command` Terminal command. You can
|
||||||
|
also check a server's security in
|
||||||
|
a script, using the :js:func:`getServerSecurityLevel` Netscript
|
||||||
|
Function. See the Netscript documentation for more details.
|
||||||
|
|
||||||
|
Whenever a server is hacked manually or through a script, its security
|
||||||
|
level increases by a small amount. Calling the :js:func:`grow` function in a
|
||||||
|
script will also increase security level of the target server. These
|
||||||
|
actions will make it harder for you to hack the server, and decrease
|
||||||
|
the amount of money you can steal. You can lower a server's security
|
||||||
|
level in a script using the :js:func:`weaken` function in Netscript. See
|
||||||
|
the Netscript documentation for more details
|
||||||
|
|
||||||
|
A server has a minimum security level that is equal to one third of its
|
||||||
|
starting security, rounded to the nearest integer. To be more precise::
|
||||||
|
|
||||||
|
server.minSecurityLevel = Math.max(1, Math.round(server.startingSecurityLevel / 3))
|
||||||
|
|
||||||
|
This means that a server's security level will not fall below this
|
||||||
|
value if you are trying to weaken() it.
|
42
doc/source/basicgameplay/infiltration.rst
Normal file
42
doc/source/basicgameplay/infiltration.rst
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
.. _gameplay_infiltration:
|
||||||
|
|
||||||
|
Infiltration
|
||||||
|
============
|
||||||
|
Infiltration is a gameplay mechanic that allows you to infiltrate a
|
||||||
|
company's facility to try and steal the company's classified secrets.
|
||||||
|
These secrets can be sold for money or for reputation with a faction.
|
||||||
|
|
||||||
|
Overview
|
||||||
|
^^^^^^^^
|
||||||
|
Many companies have facilities that you can attempt to infiltrate.
|
||||||
|
By infiltrating, you can steal classified company secrets and then sell
|
||||||
|
these for money or for faction reputation. To try and infiltrate a company,
|
||||||
|
visit a company through the 'World' menu. There will be an option that
|
||||||
|
says 'Infiltrate Company'.
|
||||||
|
|
||||||
|
When infiltrating a company, you must progress through clearance levels in
|
||||||
|
the facility. Every clearance level has some form of security that
|
||||||
|
you must get past. There are several forms of security, ranging from
|
||||||
|
high-tech security systems to armed guards. For each form of security,
|
||||||
|
there are a variety of options that you can choose to try and bypass
|
||||||
|
the security. Examples include hacking the security, engaging in combat,
|
||||||
|
assassination, or sneaking past the security. The chance to succeed for
|
||||||
|
each option is determined in part by your stats. So, for example,
|
||||||
|
trying to hack the security system relies on your hacking skill,
|
||||||
|
whereas trying to sneak past the security relies on your agility level.
|
||||||
|
|
||||||
|
The facility has a 'security level' that affects your chance of success
|
||||||
|
when trying to get past a clearance level. Every time you advance to the
|
||||||
|
next clearance level, the facility's security level will increase by a
|
||||||
|
fixed percentage. Furthermore the options you choose and whether you
|
||||||
|
succeed or fail will affect the security level as well. For example,
|
||||||
|
if you try to kill a security guard and fail, the security level will
|
||||||
|
increase by a lot. If you choose to sneak past security and succeed,
|
||||||
|
the security level will not increase at all.
|
||||||
|
|
||||||
|
Every 5 clearance levels, you will steal classified company secrets that
|
||||||
|
can be sold for money or faction reputation. However, in order to sell
|
||||||
|
these secrets you must successfully escape the facility using the
|
||||||
|
'Escape' option. Furthermore, companies have a max clearance level.
|
||||||
|
If you reach the max clearance level you will automatically escape the
|
||||||
|
facility with all of your stolen secrets.
|
181
doc/source/basicgameplay/scripts.rst
Normal file
181
doc/source/basicgameplay/scripts.rst
Normal file
@ -0,0 +1,181 @@
|
|||||||
|
.. _gameplay_scripts:
|
||||||
|
|
||||||
|
Scripts
|
||||||
|
=======
|
||||||
|
Scripts are programs that can be used to automate the hacking process
|
||||||
|
and almost every other part of the game. Scripts must be written
|
||||||
|
in the :ref:`netscript` language.
|
||||||
|
|
||||||
|
It is highly recommended that you have a basic background in programming
|
||||||
|
to start writing scripts. You by no means need to be an expert. All you
|
||||||
|
need is some familiarity with basic programming constructs like
|
||||||
|
for/while loops, conditionals (if/else), functions, variables, etc.
|
||||||
|
If you'd like to learn a little bit about programming, see
|
||||||
|
:ref:`netscriptlearntoprogram`.
|
||||||
|
|
||||||
|
Script Arguments
|
||||||
|
^^^^^^^^^^^^^^^^
|
||||||
|
When running a script, you can choose to pass arguments to that script.
|
||||||
|
The script's logic can access and act on these arguments. This allows
|
||||||
|
for flexibility in your scripts. For more details, see
|
||||||
|
:ref:`netscript_script_arguments`.
|
||||||
|
|
||||||
|
For information on how to run scripts with arguments, see
|
||||||
|
:ref:`gameplay_working_with_scripts_in_terminal` and
|
||||||
|
:ref:`gameplay_working_with_scripts_in_netscript` below.
|
||||||
|
|
||||||
|
Identifying a Script
|
||||||
|
^^^^^^^^^^^^^^^^^^^^
|
||||||
|
Many commands and functions act on an executing script
|
||||||
|
(i.e. a script that is running). Therefore, there must
|
||||||
|
be a way to specify which script you want those commands & functions
|
||||||
|
to act on.
|
||||||
|
|
||||||
|
**A script that is being executed is uniquely identified by both its
|
||||||
|
name and the arguments that it was run with.**
|
||||||
|
|
||||||
|
The arguments must be an **exact** match. This means that both
|
||||||
|
the order and type of the arguments matter.
|
||||||
|
|
||||||
|
Multithreading scripts
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
A script can be run with multiple threads. This is also called multithreading.
|
||||||
|
The effect of multithreading is that every call to the
|
||||||
|
:js:func:`hack`, :js:func:`grow`, and :js:func:`weaken` Netscript functions
|
||||||
|
will have their results multiplied by the number of threads.
|
||||||
|
For example, if a normal single-threaded script
|
||||||
|
is able to hack $10,000, then running the same script with 5 threads would
|
||||||
|
yield $50,000.
|
||||||
|
|
||||||
|
(This is the **only** affect of running a script with multiple threads.
|
||||||
|
Scripts will not actually become multithreaded in the real-world
|
||||||
|
sense.)
|
||||||
|
|
||||||
|
When multithreading a script, the total RAM cost can be calculated by
|
||||||
|
simply multiplying the base RAM cost of the script with the number of
|
||||||
|
threads, where the base cost refers to the amount of RAM required to
|
||||||
|
run the script single-threaded. In the terminal, you can run the
|
||||||
|
:ref:`mem_terminal_command` Terminal command to see how much RAM a script
|
||||||
|
requires with `n` threads::
|
||||||
|
|
||||||
|
$ mem [scriptname] -t n
|
||||||
|
|
||||||
|
.. _gameplay_working_with_scripts_in_terminal:
|
||||||
|
|
||||||
|
Working with Scripts in Terminal
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
Running a script requires RAM. The more complex a script is, the more
|
||||||
|
RAM it requires to run. Scripts can be run on any server you have root
|
||||||
|
access to.
|
||||||
|
|
||||||
|
Here are some :ref:`terminal` commands that are useful when working
|
||||||
|
with scripts:
|
||||||
|
|
||||||
|
**check [script] [args...]**
|
||||||
|
|
||||||
|
Prints the logs of the script specified by the name and arguments to
|
||||||
|
Terminal. Arguments should be separated by a space. Remember that scripts
|
||||||
|
are uniquely identified by their arguments as well as their name. For
|
||||||
|
example, if you ran a script `foo.script` with the argument `foodnstuff`
|
||||||
|
then in order to 'check' it you must also add the `foodnstuff` argument
|
||||||
|
to the check command::
|
||||||
|
|
||||||
|
$ check foo.script foodnstuff
|
||||||
|
|
||||||
|
**free**
|
||||||
|
|
||||||
|
Shows the current server's RAM usage and availability
|
||||||
|
|
||||||
|
**kill [script] [args...]**
|
||||||
|
|
||||||
|
Stops a script that is running with the specified script name and
|
||||||
|
arguments. Arguments should be separated by a space. Remember that
|
||||||
|
scripts are uniquely identified by their arguments as well as
|
||||||
|
their name. For example, if you ran a script `foo.script` with
|
||||||
|
the argument 1 and 2, then just typing "`kill foo.script`" will
|
||||||
|
not work. You have to use::
|
||||||
|
|
||||||
|
$ kill foo.script 1 2
|
||||||
|
|
||||||
|
**mem [script] [-t] [n]**
|
||||||
|
|
||||||
|
Check how much RAM a script requires to run with n threads
|
||||||
|
|
||||||
|
**nano [script]**
|
||||||
|
|
||||||
|
Create/Edit a script. The name of the script must end with a valid
|
||||||
|
extension: .script, .js, or .ns
|
||||||
|
|
||||||
|
**ps**
|
||||||
|
|
||||||
|
Displays all scripts that are actively running on the current server
|
||||||
|
|
||||||
|
**rm [script]**
|
||||||
|
|
||||||
|
Delete a script from the server. This is permanent
|
||||||
|
|
||||||
|
**run [script] [-t] [n] [args...]**
|
||||||
|
|
||||||
|
Run a script with n threads and the specified arguments. Each argument should
|
||||||
|
be separated by a space. Both the arguments and thread specification are
|
||||||
|
optional. If neither are specified, then the script will be run single-threaded
|
||||||
|
with no arguments.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
|
||||||
|
Run 'foo.script' single-threaded with no arguments::
|
||||||
|
|
||||||
|
$ run foo.script
|
||||||
|
|
||||||
|
Run 'foo.script' with 10 threads and no arguments::
|
||||||
|
|
||||||
|
$ run foo.script -t 10
|
||||||
|
|
||||||
|
Run 'foo.script' single-threaded with three arguments: [foodnstuff, sigma-cosmetics, 10]::
|
||||||
|
|
||||||
|
$ run foo.script foodnstuff sigma-cosmetics 10
|
||||||
|
|
||||||
|
Run 'foo.script' with 50 threads and a single argument: [foodnstuff]::
|
||||||
|
|
||||||
|
$ run foo.script -t 50 foodnstuff
|
||||||
|
|
||||||
|
|
||||||
|
**tail [script] [args...]**
|
||||||
|
|
||||||
|
Displays the logs of the script specified by the name and arguments. Note that scripts are uniquely identified by their arguments as well as their name. For example, if you ran a script 'foo.script' with the argument 'foodnstuff' then in order to 'tail' it you must also add the 'foodnstuff' argument to the tail command as so: tail foo.script foodnstuff
|
||||||
|
|
||||||
|
**top**
|
||||||
|
|
||||||
|
Displays all active scripts and their RAM usage
|
||||||
|
|
||||||
|
.. _gameplay_working_with_scripts_in_netscript:
|
||||||
|
|
||||||
|
Working with Scripts in Netscript
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
Notes about how Scripts Work Offline
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
The scripts that you write and execute are interpreted in Javascript.
|
||||||
|
For this reason, it is not possible for these scripts to run while
|
||||||
|
offline (when the game is closed). It is important to note that for
|
||||||
|
this reason, conditionals such as if/else statements and certain
|
||||||
|
commands such as purchaseHacknetNode() or nuke() will not work while
|
||||||
|
the game is offline.
|
||||||
|
|
||||||
|
However, Scripts WILL continue to generate money and hacking exp
|
||||||
|
for you while the game is offline. This offline production is based
|
||||||
|
off of the scripts' production while the game is online.
|
||||||
|
|
||||||
|
grow() and weaken() are two Netscript commands that will also be
|
||||||
|
applied when the game is offline, although at a slower rate compared
|
||||||
|
to if the game was open. This is done by having each script keep
|
||||||
|
track of the rate at which the grow() and weaken() commands are called
|
||||||
|
when the game is online. These calculated rates are used to determine
|
||||||
|
how many times these function calls would be made while the game is
|
||||||
|
offline.
|
||||||
|
|
||||||
|
Also, note that because of the way the Netscript interpreter is
|
||||||
|
implemented, whenever you reload or re-open the game all of the
|
||||||
|
scripts that you are running will start running from the BEGINNING
|
||||||
|
of the code. The game does not keep track of where exactly the
|
||||||
|
execution of a script is when it saves/loads.
|
69
doc/source/basicgameplay/servers.rst
Normal file
69
doc/source/basicgameplay/servers.rst
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
.. _gameplay_servers:
|
||||||
|
|
||||||
|
Servers
|
||||||
|
=======
|
||||||
|
In this game, a server refers to a computer that can be connected to,
|
||||||
|
accessed, and manipulated through the Terminal. All servers in the
|
||||||
|
game are connected to each other to form a large, global network.
|
||||||
|
To learn about how to navigate this network and connect to other
|
||||||
|
servers, see the :ref:`Terminal` page.
|
||||||
|
|
||||||
|
Server RAM
|
||||||
|
^^^^^^^^^^
|
||||||
|
Perhaps the most important property of a server to make note of is its RAM,
|
||||||
|
which refers to how much memory is available on that machine. RAM is
|
||||||
|
important because it is required to run Scripts. More RAM allows
|
||||||
|
the user to run more powerful and complicated scripts.
|
||||||
|
|
||||||
|
The `free`, `scan-analyze`, and `analyze` Terminal commands
|
||||||
|
can be used to check how much RAM a server has.
|
||||||
|
|
||||||
|
Identifying Servers
|
||||||
|
^^^^^^^^^^^^^^^^^^^
|
||||||
|
A server is identified by two properties: its IP address and its hostname.
|
||||||
|
An IP address is a 32-bit number represented in dot-decimal notation.
|
||||||
|
For example, "56.1.5.0" and "86.5.1.0" might be two IP addresses
|
||||||
|
you see in the game. A hostname is a label assigned to a server.
|
||||||
|
A hostname will usually give you a general idea of what the server
|
||||||
|
is. For example, the company Nova Medical might have a server with
|
||||||
|
the hostname "nova-med".
|
||||||
|
|
||||||
|
Hostnames and IP addresses are unique. This means that if one
|
||||||
|
server has the IP address "1.1.1.1" and the hostname
|
||||||
|
"some-server", then no other server in the game can have that
|
||||||
|
IP address or that hostname.
|
||||||
|
|
||||||
|
There are many :ref:`Netscript Functions <netscriptfunctions>`
|
||||||
|
and :ref:`terminal` commands in the game
|
||||||
|
that will require you to target a specific server. This is done using
|
||||||
|
either the IP address or the hostname of the server.
|
||||||
|
|
||||||
|
Player-owned Servers
|
||||||
|
^^^^^^^^^^^^^^^^^^^^
|
||||||
|
The player starts with a single server: his/her home computer.
|
||||||
|
This server will have the hostname "home." The player's home
|
||||||
|
computer is special for a variety of reasons:
|
||||||
|
|
||||||
|
1. The home computer's RAM can be upgraded. This can be done by visiting
|
||||||
|
certain locations in the World.
|
||||||
|
|
||||||
|
2. The home computer persists through Augmentation Installations. This means
|
||||||
|
that you will not lose any RAM upgrades or Scripts on your
|
||||||
|
home computer when you install Augmentations (you will
|
||||||
|
however, lose programs and messages on your home computer).
|
||||||
|
|
||||||
|
The player can also purchase additional servers. This can be
|
||||||
|
done by visiting certain locations in the World, or it can be
|
||||||
|
done automatically through a script using the :js:func:`purchaseServer`
|
||||||
|
Netscript Function. The advantage of purchased servers is that,
|
||||||
|
in terms of RAM, they are cheaper than upgrading your home
|
||||||
|
computer. The disadvantage is that your purchased servers
|
||||||
|
are lost when you install Augmentations.
|
||||||
|
|
||||||
|
Hackable Servers
|
||||||
|
^^^^^^^^^^^^^^^^
|
||||||
|
Most servers that are not owned by the player can be hacked for money
|
||||||
|
and exp. See the :ref:`gameplay_hacking` page for more details.
|
||||||
|
|
||||||
|
Different servers have different levels of security, but also offer
|
||||||
|
different rewards when being hacked.
|
124
doc/source/basicgameplay/stats.rst
Normal file
124
doc/source/basicgameplay/stats.rst
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
.. _gameplay_stats:
|
||||||
|
|
||||||
|
Stats
|
||||||
|
=====
|
||||||
|
The player has several stats that can be increased in order to progress
|
||||||
|
in the game.
|
||||||
|
|
||||||
|
Hacking
|
||||||
|
^^^^^^^
|
||||||
|
Represents the player's ability to code and hack.
|
||||||
|
|
||||||
|
Affects:
|
||||||
|
|
||||||
|
* Time it takes to hack a server
|
||||||
|
* Time it takes to execute the grow() and weaken() Netscript function
|
||||||
|
* Chance to successfully hack a server
|
||||||
|
* Percent money stolen when hacking a server
|
||||||
|
* Success rate of certain crimes
|
||||||
|
* Success rate of Hacking option during Infiltration
|
||||||
|
* Time it takes to create a program
|
||||||
|
* Faction reputation gain when carrying out Hacking Contracts or Field Work
|
||||||
|
|
||||||
|
Gain experience by:
|
||||||
|
|
||||||
|
* Manually hacking servers through Terminal
|
||||||
|
* Executing hack(), grow(), or weaken() through a script
|
||||||
|
* Committing certain crimes
|
||||||
|
* Infiltration
|
||||||
|
* Carrying out Hacking Contracts or doing Field work for Factions
|
||||||
|
* Working software/IT-related jobs at a company
|
||||||
|
* Studying at a university
|
||||||
|
|
||||||
|
Strength
|
||||||
|
^^^^^^^^
|
||||||
|
Represents the player's physical offensive power
|
||||||
|
|
||||||
|
Affects:
|
||||||
|
|
||||||
|
* Success rate of certain crimes
|
||||||
|
* Success rate of Combat options during Infiltration
|
||||||
|
* Faction reputation gain for Security and Field Work
|
||||||
|
* Company reputation gain for certain jobs
|
||||||
|
|
||||||
|
Gain experience by:
|
||||||
|
|
||||||
|
* Committing certain crimes
|
||||||
|
* Infiltration
|
||||||
|
* Working out at a gym
|
||||||
|
* Doing Security/Field Work for a faction
|
||||||
|
|
||||||
|
Defense
|
||||||
|
^^^^^^^
|
||||||
|
Represents the player's ability to withstand damage
|
||||||
|
|
||||||
|
Affects:
|
||||||
|
|
||||||
|
* Success rate of certain crimes
|
||||||
|
* The player's HP
|
||||||
|
* Success rate of Combat options during Infiltration
|
||||||
|
* How much damage the player takes during Infiltration
|
||||||
|
* Faction reputation gain for Security and Field Work
|
||||||
|
* Company reputation gain for certain jobs
|
||||||
|
|
||||||
|
Gain experience by:
|
||||||
|
|
||||||
|
* Committing certain crimes
|
||||||
|
* Infiltration
|
||||||
|
* Working out at a gym
|
||||||
|
* Doing Security/Field Work for a faction
|
||||||
|
|
||||||
|
Dexterity
|
||||||
|
^^^^^^^^^
|
||||||
|
Represents the player's skill and adeptness in performing certain tasks
|
||||||
|
|
||||||
|
Affects:
|
||||||
|
|
||||||
|
* Success rate of certain crimes
|
||||||
|
* Success rate of Combat, Lockpick, and Escape options during Infiltration
|
||||||
|
* Faction reputation gain for Security and Field Work
|
||||||
|
* Company reputation gain for certain jobs
|
||||||
|
|
||||||
|
Gain experience by:
|
||||||
|
|
||||||
|
* Committing certain crimes
|
||||||
|
* Infiltration
|
||||||
|
* Working out at a gym
|
||||||
|
* Doing Security/Field Work for a faction
|
||||||
|
|
||||||
|
Agility
|
||||||
|
^^^^^^^
|
||||||
|
Represents the player's speed and ability to move
|
||||||
|
|
||||||
|
Affects:
|
||||||
|
|
||||||
|
* Success rate of certain crimes
|
||||||
|
* Success rate of Combat, Sneak, and Escape options during Infiltration
|
||||||
|
* Faction reputation gain for Security and Field Work
|
||||||
|
* Company reputation gain for certain jobs
|
||||||
|
|
||||||
|
Gain experience by:
|
||||||
|
|
||||||
|
* Committing certain crimes
|
||||||
|
* Infiltration
|
||||||
|
* Working out at a gym
|
||||||
|
* Doing Security/Field Work for a faction
|
||||||
|
|
||||||
|
Charisma
|
||||||
|
^^^^^^^^
|
||||||
|
Represents the player's social abilities
|
||||||
|
|
||||||
|
Affects:
|
||||||
|
|
||||||
|
* Success rate of certain crimes
|
||||||
|
* Success rate of Bribe option during Infiltration
|
||||||
|
* Faction reputation gain for Field Work
|
||||||
|
* Company reputation gain for most jobs
|
||||||
|
|
||||||
|
Gain experience by:
|
||||||
|
|
||||||
|
* Committing certain crimes
|
||||||
|
* Infiltration
|
||||||
|
* Working out at a gym
|
||||||
|
* Working a relevant job at a company
|
||||||
|
* Doing Field work for a Faction
|
4
doc/source/basicgameplay/stockmarket.rst
Normal file
4
doc/source/basicgameplay/stockmarket.rst
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
.. _gameplay_stock_market:
|
||||||
|
|
||||||
|
Stock Market
|
||||||
|
============
|
@ -58,6 +58,8 @@ defined aliases in the reusable form 'alias NAME=VALUE' on the Terminal.
|
|||||||
|
|
||||||
The :ref:`unalias_terminal_command` Terminal command can be used to remove aliases.
|
The :ref:`unalias_terminal_command` Terminal command can be used to remove aliases.
|
||||||
|
|
||||||
|
.. _analyze_terminal_command:
|
||||||
|
|
||||||
analyze
|
analyze
|
||||||
^^^^^^^
|
^^^^^^^
|
||||||
|
|
||||||
@ -243,6 +245,8 @@ lscpu
|
|||||||
|
|
||||||
Prints the number of CPU cores the current server has.
|
Prints the number of CPU cores the current server has.
|
||||||
|
|
||||||
|
.. _mem_terminal_command:
|
||||||
|
|
||||||
mem
|
mem
|
||||||
^^^
|
^^^
|
||||||
|
|
12
doc/source/basicgameplay/world.rst
Normal file
12
doc/source/basicgameplay/world.rst
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
.. _gameplay_world:
|
||||||
|
|
||||||
|
World
|
||||||
|
=====
|
||||||
|
In Bitburner, the world consists of six different cities:
|
||||||
|
|
||||||
|
* Sector-12 (this is where you start out)
|
||||||
|
* Aevum
|
||||||
|
* Ishima
|
||||||
|
* New Tokyo
|
||||||
|
* Chongqing
|
||||||
|
* Volhaven
|
@ -20,8 +20,7 @@ secrets that you've been searching for.
|
|||||||
:caption: Contents:
|
:caption: Contents:
|
||||||
|
|
||||||
Netscript <netscript>
|
Netscript <netscript>
|
||||||
Terminal <terminal>
|
Basic Gameplay <basicgameplay>
|
||||||
Coding Contracts <codingcontracts>
|
|
||||||
Keyboard Shortcuts <shortcuts>
|
Keyboard Shortcuts <shortcuts>
|
||||||
Game Frozen or Stuck? <gamefrozen>
|
Game Frozen or Stuck? <gamefrozen>
|
||||||
Changelog <changelog>
|
Changelog <changelog>
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
Netscript Documentation
|
.. _netscript:
|
||||||
=======================
|
|
||||||
|
Netscript
|
||||||
|
=========
|
||||||
Netscript is the programming language used in the world of Bitburner.
|
Netscript is the programming language used in the world of Bitburner.
|
||||||
|
|
||||||
When you write scripts in Bitburner, they are written in the Netscript language.
|
When you write scripts in Bitburner, they are written in the Netscript language.
|
||||||
@ -15,16 +17,16 @@ to reach out to the developer!
|
|||||||
:maxdepth: 5
|
:maxdepth: 5
|
||||||
:caption: Sections:
|
:caption: Sections:
|
||||||
|
|
||||||
Learn to Program <netscriptlearntoprogram>
|
Learn to Program <netscript/netscriptlearntoprogram>
|
||||||
Netscript 1.0 <netscript1>
|
Netscript 1.0 <netscript/netscript1>
|
||||||
NetscriptJS (Netscript 2.0) <netscriptjs>
|
NetscriptJS (Netscript 2.0) <netscript/netscriptjs>
|
||||||
Script Arguments <netscriptscriptarguments>
|
Script Arguments <netscript/netscriptscriptarguments>
|
||||||
Basic Functions <netscriptfunctions>
|
Basic Functions <netscript/netscriptfunctions>
|
||||||
Advanced Functions <netscriptadvancedfunctions>
|
Advanced Functions <netscript/netscriptadvancedfunctions>
|
||||||
Hacknet Node API <netscripthacknetnodeapi>
|
Hacknet Node API <netscript/netscripthacknetnodeapi>
|
||||||
Trade Information eXchange (TIX) API <netscriptixapi>
|
Trade Information eXchange (TIX) API <netscript/netscriptixapi>
|
||||||
Singularity Functions <netscriptsingularityfunctions>
|
Singularity Functions <netscript/netscriptsingularityfunctions>
|
||||||
Bladeburner API <netscriptbladeburnerapi>
|
Bladeburner API <netscript/netscriptbladeburnerapi>
|
||||||
Gang API <netscriptgangapi>
|
Gang API <netscript/netscriptgangapi>
|
||||||
Coding Contract API <netscriptcodingcontractapi>
|
Coding Contract API <netscript/netscriptcodingcontractapi>
|
||||||
Miscellaneous <netscriptmisc>
|
Miscellaneous <netscript/netscriptmisc>
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
.. _netscriptfunctions:
|
||||||
|
|
||||||
Netscript Basic Functions
|
Netscript Basic Functions
|
||||||
=========================
|
=========================
|
||||||
|
|
26
doc/source/netscript/netscriptscriptarguments.rst
Normal file
26
doc/source/netscript/netscriptscriptarguments.rst
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
.. _netscript_script_arguments:
|
||||||
|
|
||||||
|
Netscript Script Arguments
|
||||||
|
==========================
|
||||||
|
|
||||||
|
Arguments passed into a script can be accessed in Netscript using a
|
||||||
|
special array called *args*. The arguments can be
|
||||||
|
accessed using a normal array using the [] operator
|
||||||
|
(args[0], args[1], etc...).
|
||||||
|
|
||||||
|
For example, let's say we want to make a generic script
|
||||||
|
'generic-run.script' and we plan to pass two arguments into that script.
|
||||||
|
The first argument will be the name of another script, and the second
|
||||||
|
argument will be a number. This generic script will run the
|
||||||
|
script specified in the first argument with the amount of threads
|
||||||
|
specified in the second element. The code would look like::
|
||||||
|
|
||||||
|
run(args[0], args[1]);
|
||||||
|
|
||||||
|
It is also possible to get the number of arguments that was passed
|
||||||
|
into a script using::
|
||||||
|
|
||||||
|
args.length
|
||||||
|
|
||||||
|
**WARNING: Do not try to modify the args array. This will break the game.
|
||||||
|
I will do my best to prevent players from doing this.**
|
@ -1,17 +0,0 @@
|
|||||||
Netscript Script Arguments
|
|
||||||
==========================
|
|
||||||
|
|
||||||
Arguments passed into a script can be accessed in Netscript using a special array called *args*. The arguments can be
|
|
||||||
accessed using a normal array using the [] operator (args[0], args[1], etc...).
|
|
||||||
|
|
||||||
For example, let's say we want to make a generic script 'generic-run.script' and we plan to pass two arguments into that script.
|
|
||||||
The first argument will be the name of another script, and the second argument will be a number. This generic script will run the
|
|
||||||
script specified in the first argument with the amount of threads specified in the second element. The code would look like::
|
|
||||||
|
|
||||||
run(args[0], args[1]);
|
|
||||||
|
|
||||||
It is also possible to get the number of arguments that was passed into a script using::
|
|
||||||
|
|
||||||
args.length
|
|
||||||
|
|
||||||
WARNING: Do not try to modify the args array. This will break the game. I will do my best to prevent players from doing this.
|
|
Loading…
Reference in New Issue
Block a user