Fixed numerous reported bugs. Refactored some of the directory-related code. Added documentation for MasonDs changes to hack/grow/weaken

This commit is contained in:
danielyxie
2019-05-11 19:20:20 -07:00
parent 29e0ce5f96
commit b0918d7bd3
19 changed files with 172 additions and 88 deletions
+9 -4
View File
@@ -134,10 +134,15 @@ A Stop Order to buy will execute if the stock's price <= order's price
A Stop Order to sell will execute if the stock's price >= order's price.
.. note:: Limit and Stop orders do **not** take into account the fact that
transactions can influence a stock's price. If a stock's price
changes mid-transaction, a limit/stop order will continue to execute
even if its conditions are no longer met.
.. note:: Stop Orders do **not** take into account the fact that transactions can
influence a stock's price. Limit Orders, however, do take this into account.
For example, assume you have a Limit Order set to purchase a stock at
$5. Then, the stock's price drops to $5 and your Limit Order executes.
However, the transaction causes the stock's price to increase before
the order finishes executing all of the shares. Your Limit Order will
stop executing, and will continue only when the stock's price drops back to
$5 or below.
Automating the Stock Market
---------------------------
@@ -4,6 +4,11 @@ grow() Netscript Function
.. js:function:: grow(hostname/ip)
:param string hostname/ip: IP or hostname of the target server to grow
:param object options: Optional parameters for configuring function behavior. Properties:
* threads (*number*) - Number of threads to use for this function.
Must be less than or equal to the number of threads the script is running with.
:returns: The number by which the money on the server was multiplied for the growth
:RAM cost: 0.15 GB
@@ -19,3 +24,4 @@ grow() Netscript Function
Example::
grow("foodnstuff");
grow("foodnstuff", { threads: 5 }); // Only use 5 threads to grow
@@ -4,6 +4,11 @@ hack() Netscript Function
.. js:function:: hack(hostname/ip)
:param string hostname/ip: IP or hostname of the target server to hack
:param object options: Optional parameters for configuring function behavior. Properties:
* threads (*number*) - Number of threads to use for this function.
Must be less than or equal to the number of threads the script is running with.
:returns: The amount of money stolen if the hack is successful, and zero otherwise
:RAM cost: 0.1 GB
@@ -20,3 +25,4 @@ hack() Netscript Function
hack("foodnstuff");
hack("10.1.2.3");
hack("foodnstuff", { threads: 5 }); // Only use 5 threads to hack
@@ -1,9 +1,14 @@
weaken() Netscript Function
===========================
.. js:function:: weaken(hostname/ip)
.. js:function:: weaken(hostname/ip, options={})
:param string hostname/ip: IP or hostname of the target server to weaken
:param object options: Optional parameters for configuring function behavior. Properties:
* threads (*number*) - Number of threads to use for this function.
Must be less than or equal to the number of threads the script is running with.
:returns: The amount by which the target server's security level was decreased. This is equivalent to 0.05 multiplied
by the number of script threads
:RAM cost: 0.15 GB
@@ -18,3 +23,4 @@ weaken() Netscript Function
Example::
weaken("foodnstuff");
weaken("foodnstuff", { threads: 5 }); // Only use 5 threads to weaken
@@ -5,7 +5,7 @@ workForFaction() Netscript Function
:param string factionName: Name of faction to work for. CASE-SENSITIVE
:param string workType:
Type of work to perform for the faction
Type of work to perform for the faction:
* hacking/hacking contracts/hackingcontracts
* field/fieldwork/field work