mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 06:48:42 +02:00
work to make documentation unified.
This commit is contained in:
@@ -3,8 +3,21 @@ prompt() Netscript Function
|
||||
|
||||
.. js:function:: prompt(txt)
|
||||
|
||||
:param string txt: Text to appear in the prompt dialog box
|
||||
:RAM cost: 0 GB
|
||||
:param string txt: Text to appear in the prompt dialog box.
|
||||
:returns: ``true`` if the player clicks "Yes".
|
||||
|
||||
Prompts the player with a dialog box with two options: "Yes" and "No". This function will return true if the player click "Yes" and
|
||||
false if the player clicks "No". The script's execution is halted until the player selects one of the options.
|
||||
Prompts the player with a dialog box with two options: "Yes" and "No". This
|
||||
function will return true if the player click "Yes" and false if the player
|
||||
clicks "No". The script's execution is halted until the player selects one
|
||||
of the options.
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
cost = getPurchasedServerCost(8192);
|
||||
answer = prompt("Buy a server for $"+cost);
|
||||
if(answer) {
|
||||
purchaseServer("my server", 8192);
|
||||
}
|
||||
Reference in New Issue
Block a user