2019-03-03 04:08:54 +01:00
|
|
|
attempt() Netscript Function
|
|
|
|
============================
|
|
|
|
|
2019-05-14 10:35:37 +02:00
|
|
|
.. js:function:: attempt(answer, fn[, hostname/ip=current ip, opts={}])
|
2019-03-03 04:08:54 +01:00
|
|
|
|
|
|
|
: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
|
2019-05-14 10:35:37 +02:00
|
|
|
: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.
|
2019-03-03 04:08:54 +01:00
|
|
|
|
|
|
|
Attempts to solve the Coding Contract with the provided solution.
|
|
|
|
|
2019-05-14 10:35:37 +02:00
|
|
|
: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.
|
2021-03-07 10:13:37 +01:00
|
|
|
|
|
|
|
:RAM cost: 10 GB
|