2019-03-03 04:08:54 +01:00
|
|
|
getServerRam() Netscript Function
|
|
|
|
=================================
|
|
|
|
|
2021-03-12 08:51:56 +01:00
|
|
|
.. js:function:: getServerRam(hostname)
|
2019-03-03 04:08:54 +01:00
|
|
|
|
2021-07-02 23:27:59 +02:00
|
|
|
.. warning:: This function is deprecated. It still functions, but new
|
|
|
|
scripts should prefer :doc:`getServerMaxRam<getServerMaxRam>`
|
|
|
|
and :doc:`getServerUsedRam<getServerUsedRam>` instead.
|
2021-05-03 07:07:46 +02:00
|
|
|
|
2019-03-03 04:08:54 +01:00
|
|
|
:RAM cost: 0.1 GB
|
2021-03-12 08:51:56 +01:00
|
|
|
:param string hostname: Hostname of target server.
|
2021-07-02 23:27:59 +02:00
|
|
|
:returns: An array of 2 numbers; the first number is the total RAM, and the
|
|
|
|
second is the used RAM.
|
2019-03-03 04:08:54 +01:00
|
|
|
|
|
|
|
Returns an array with two elements that gives information about a server's memory (RAM). The first
|
|
|
|
element in the array is the amount of RAM that the server has total (in GB). The second element in
|
|
|
|
the array is the amount of RAM that is currently being used on the server (in GB).
|
|
|
|
|
2021-03-12 08:51:56 +01:00
|
|
|
Example:
|
2019-03-03 04:08:54 +01:00
|
|
|
|
2021-03-12 08:51:56 +01:00
|
|
|
.. code-block:: javascript
|
|
|
|
|
|
|
|
res = getServerRam("helios"); // returns: [5, 10]
|
2019-03-03 04:08:54 +01:00
|
|
|
totalRam = res[0];
|
|
|
|
ramUsed = res[1];
|