2019-03-03 04:08:54 +01:00
|
|
|
getData() Netscript Function
|
|
|
|
============================
|
|
|
|
|
2021-03-12 08:51:56 +01:00
|
|
|
.. js:function:: getData(filename[, hostname=current hostname])
|
2019-03-03 04:08:54 +01:00
|
|
|
|
2021-05-08 03:24:16 +02:00
|
|
|
:RAM cost: 5 GB
|
2021-03-12 08:51:56 +01:00
|
|
|
: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: The specified contract's data. Different data type depending on
|
|
|
|
contract type.
|
2019-03-03 04:08:54 +01:00
|
|
|
|
|
|
|
Get the data associated with the specific Coding Contract. Note that this is
|
|
|
|
not the same as the contract's description. This is just the data that
|
|
|
|
the contract wants you to act on in order to solve
|
|
|
|
|
2021-03-12 08:51:56 +01:00
|
|
|
Example:
|
|
|
|
|
|
|
|
.. code-block:: javascript
|
|
|
|
|
|
|
|
data = codingcontract.getData("contract-123.cct", "home");
|
|
|
|
answer = solve(data);
|
|
|
|
codingcontract.attempt(answer, "contract-123.cct", "home");
|