From 7b950bd7d97d865d16b816f0a0c528249d1ff37f Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Wed, 3 Nov 2021 20:27:32 -0400 Subject: [PATCH] update rtd a little. --- doc/source/index.rst | 1 - doc/source/netscript/netscriptjs.rst | 9 +- doc/source/scripteditors.rst | 140 --------------------------- 3 files changed, 6 insertions(+), 144 deletions(-) delete mode 100644 doc/source/scripteditors.rst diff --git a/doc/source/index.rst b/doc/source/index.rst index 5ad5df996..ea980b50d 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -24,7 +24,6 @@ secrets that you've been searching for. Basic Gameplay Advanced Gameplay Keyboard Shortcuts - Script Editors Game Frozen or Stuck? Guides & Tips Tools & Resources diff --git a/doc/source/netscript/netscriptjs.rst b/doc/source/netscript/netscriptjs.rst index 2c4aafef7..b2fb56af5 100644 --- a/doc/source/netscript/netscriptjs.rst +++ b/doc/source/netscript/netscriptjs.rst @@ -2,8 +2,8 @@ NetscriptJS (Netscript 2.0) =========================== -Netscript 2.0, or Netscript JS, is the new and improved version of Netscript that -allows users to write (almost) full-fledged Javascript code in their scripts, while +Netscript 2.0, or Netscript JS, is the improved version of Netscript that +allows users to write full-fledged Javascript code in their scripts, while still being able to access the Netscript functions. NetscriptJS was developed primarily by `Github user jaguilar `_ @@ -53,6 +53,9 @@ Here is a summary of all rules you need to follow when writing Netscript JS code * sleep * prompt * wget + * scp + * write + * writePort * Any function that contains :code:`await` must be declared as :code:`async` @@ -60,7 +63,7 @@ Here is a summary of all rules you need to follow when writing Netscript JS code * Any functions that you want to be visible from other scripts must be marked with :code:`export`. -* **Do not write any infinite loops without using a** :code:`sleep` **or one of the timed Netscript functions like** :code:`hack`. Doing so will crash your game. +* **Do not write any infinite loops without using a** :code:`sleep` **or one of the timed Netscript functions like** :code:`hack`. Doing so will freeze your game. * Any global variable declared in a NetscriptJS script is shared between all instances of that script. For example, assume you write a script *foo.ns* and declared a global variable like so:: diff --git a/doc/source/scripteditors.rst b/doc/source/scripteditors.rst deleted file mode 100644 index 57ddabeaa..000000000 --- a/doc/source/scripteditors.rst +++ /dev/null @@ -1,140 +0,0 @@ -.. _scripteditors: - -Script Editors -============== -Third-party libraries are used to implement the game's Script Editor(s). There are -currently two options for the Script Editor: - -* `Ace `_ -* `CodeMirror `_ - -You can select which of the two editors you want to use on the Script Editor page -('Create Script' on the main menu). - -Ace was the game's original Script Editor, while CodeMirror was added later in -v0.43.0. The two editors share many of the same features, so there is not a significant -difference between the two. Currently, CodeMirror is slightly more modern, -more customizable, and has a few quality-of-life improvements compared to Ace. - -Universal Key Bindings ----------------------- -These keyboard shortcuts are available in both the Ace and CodeMirror editors, regardless -of what key binding option you are using: - -============= =========================================================================== -Shortcut Action -============= =========================================================================== -Ctrl + b Save script and return to :ref:`terminal` -Ctrl + space Show Autocomplete Hints -============= =========================================================================== - -.. _scripteditor_linter: - -Linter ------- -Both script editors contain a linter, which is a tool that analyzes your -code and flags anything it thinks might be an error. You can see -warnings and errors from the linter on the left-hand side of the script editor. There -will be an icon on whatever lines the linter thinks might be problematic. Hovering -over the icon will display information on what the issue is. - -Note that **just because the linter shows an error/warning, this does NOT automatically mean that** -**your script is broken and will fail to run.** This is especially true if you are using -:ref:`netscriptjs`. The linter used by the script editors isn't necessarily perfect or -up-to-date. Furthermore, the linter does not affect anything when you actually run scripts. - -Ace ---- -The following documents what the different settings/options do for the Ace editor, -as well as the different key binding settings. Note that the -information for the key bindings may not be completely comprehensive. You'll -have to dig into the editor source code if you want to learn more. - -Settings -~~~~~~~~ - -===================== =========================================================================================================== -Setting Effect -===================== =========================================================================================================== -Theme Switch between different color schemes -Key Binding Switch between different key binding options. This changes what keyboard shortcuts are available -Highlight Active Line When enabled, the line on which the cursor currently resides will be highlighted. -Show Invisibles When enabled, you will be able to view hidden whitespace characters such as spaces, tabs, and newlines. -Use Soft Tab When enabled, tabs will be replaced with spaces -Max Error Count Specifies the (approximate) number of lines that will be linted -===================== =========================================================================================================== - -Ace Key Bindings -~~~~~~~~~~~~~~~~ -For Ace, the "Ace" Key Binding setting uses the default configuration. A list of these -`can be found here `_. - -Vim Key Bindings -~~~~~~~~~~~~~~~~ -For Ace, the "Vim" Key Binding setting configures the editor to use -`Vim `_ key mappings. Note that while this tries -to emulate Vim features as faithfully as possible, it is not a complete Vim implementation. - -Since I'm not familiar with Vim, I'll leave -`Ace's Vim Mode implementation here `_, -which I believe shows most of the implemented features. - -Note that the following Vim Ex commands will properly save the script and/or quit the editor in game: - -======= ============================================== -Command Effect -======= ============================================== -:w Save the script and return to :ref:`terminal` -:q Return to :ref:`terminal` **WITHOUT** saving -:x Save the script and return to :ref:`terminal` -:wq Save the script and return to :ref:`terminal` -======= ============================================== - -Emacs Key Bindings -~~~~~~~~~~~~~~~~~~ -For Ace, the "Emacs" Key Binding setting configures the editor to use -`Emacs `_ key mappings. Note that while this tries -to emulate the Emacs key mappings as faithfully as possible, it won't necessarily be a -complete implementation. - -Since I'm not familiar with Emacs, I'll leave -`Ace's Emacs Mode implementation here `_, -which I believe shows most of the implemented features. - -CodeMirror ----------- -The following documents what the different settings/options do for the CodeMirror editor, -as well as the shortcuts for the different key binding settings. Note that the -information for the key bindings may not be completely comprehensive. You'll -have to dig into the editor source code if you want to learn everything. - -Settings -~~~~~~~~ -========================== =========================================================================================================== -Setting Effect -========================== =========================================================================================================== -Theme Switch between different color schemes -Key Binding Switch between different key binding options. This changes what keyboard shortcuts are available -Highlight Active Line When enabled, the line on which the cursor currently resides will be highlighted. -Show Invisibles When enabled, you will be able to view hidden whitespace characters such as spaces, tabs, and newlines. -Use Soft Tab When enabled, tabs will be replaced with spaces -Auto-Close Brackets/Quotes When enabled, any opening brackets or quotes that are typed will be closed -Enable Linting Enable/Disable the :ref:`scripteditor_linter` -Continue Comments When enabled, pressing 'Enter' inside a comment block will continue the comment on the next line -========================== =========================================================================================================== - -Default Key Bindings -~~~~~~~~~~~~~~~~~~~~ -.. todo:: Fill out - -Sublime Key Bindings -~~~~~~~~~~~~~~~~~~~~ -.. todo:: Fill out - -Vim Key Bindings -~~~~~~~~~~~~~~~~ -.. todo:: Fill out - -Emacs Key Bindings -~~~~~~~~~~~~~~~~~~ -.. todo:: Fill out