Adding more directory-related unit tests. Several more bug fixes and QoL improvements

This commit is contained in:
danielyxie
2019-05-14 01:35:37 -07:00
parent 1775ea86ff
commit fef7aaba8f
24 changed files with 423 additions and 85 deletions

View File

@@ -1,10 +1,10 @@
grow() Netscript Function
=========================
.. js:function:: grow(hostname/ip)
.. js:function:: grow(hostname/ip[, opts={}])
:param string hostname/ip: IP or hostname of the target server to grow
:param object options: Optional parameters for configuring function behavior. Properties:
:param object opts: 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.

View File

@@ -1,10 +1,10 @@
hack() Netscript Function
=========================
.. js:function:: hack(hostname/ip)
.. js:function:: hack(hostname/ip[, opts={}])
:param string hostname/ip: IP or hostname of the target server to hack
:param object options: Optional parameters for configuring function behavior. Properties:
:param object opts: 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.

View File

@@ -1,10 +1,10 @@
weaken() Netscript Function
===========================
.. js:function:: weaken(hostname/ip, options={})
.. js:function:: weaken(hostname/ip[, opts={}])
:param string hostname/ip: IP or hostname of the target server to weaken
:param object options: Optional parameters for configuring function behavior. Properties:
:param object opts: 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.

View File

@@ -1,13 +1,20 @@
attempt() Netscript Function
============================
.. js:function:: attempt(answer, fn[, hostname/ip=current ip])
.. js:function:: attempt(answer, fn[, hostname/ip=current ip, opts={}])
:param answer: Solution for the contract
:param string fn: Filename of the contract
:param string hostname/ip: Hostname or IP of the server containing the contract.
Optional. Defaults to current server if not provided
:param object opts: Optional parameters for configuring function behavior. Properties:
* returnReward (*boolean*) If truthy, then the function will return a string
that states the contract's reward when it is successfully solved.
Attempts to solve the Coding Contract with the provided solution.
:returns: Boolean indicating whether the solution was correct
:returns: Boolean indicating whether the solution was correct. If the :code:`returnReward`
option is configured, then the function will instead return a string. If the
contract is successfully solved, the string will contain a description of the
contract's reward. Otherwise, it will be an empty string.