2019-03-02 19:08:54 -08:00
|
|
|
getNumTriesRemaining() Netscript Function
|
|
|
|
=========================================
|
|
|
|
|
2021-03-12 02:51:56 -05:00
|
|
|
.. js:function:: getNumTriesRemaining(filename[, hostname=current hostname])
|
2019-03-02 19:08:54 -08:00
|
|
|
|
2021-03-12 02:51:56 -05:00
|
|
|
:RAM cost: 2 GB
|
|
|
|
:param string filename: Filename of the contract
|
|
|
|
:param string hostname: Hostname of the server containing the contract.
|
|
|
|
Optional. Defaults to current server if not provided
|
|
|
|
:returns: Number indicating how many attempts are remaining
|
2019-03-02 19:08:54 -08:00
|
|
|
|
|
|
|
Get the number of tries remaining on the contract before it
|
|
|
|
self-destructs.
|
|
|
|
|
2021-03-12 02:51:56 -05:00
|
|
|
Example:
|
2021-03-07 04:13:37 -05:00
|
|
|
|
2021-03-12 02:51:56 -05:00
|
|
|
.. code-block:: javascript
|
|
|
|
|
|
|
|
codingcontract.getNumTriesRemaining("contract-123.cct", "home"); // returns: 5
|