

Add the token manually to the workspace settings.json to the key of thToken.vscode/settings.json), so you can either: The token will ultimately end up in the workspace configuration (See your workspaces. You can copy the token from the Bitburner application 'API Server' context menu: This extension requires that token to in order to function.

When the game is started for the first time, it generates an 'Auth Token' that can be used by third party programs/applications/scripts to push files to the game. The auth token that the game generates, needed for you to be able to push files in to your game client. If true, this will show a notification/toast whenever the File Watcher is enabled and/or the extension configuration scriptRoot has changed. Errors will always show.īitburner.showFileWatcherEnabledNotification If true, this will show a notification/toast when a file has been successfully pushed to the game. The directory that the File Watcher (if enabled) uses as the 'root' directory to watch.Ī configuration option that is only read from the Workspace or Folder configurations, a way to enable the File Watcher by default. Use at your own risk! Remember to backup your save and scripts! Extension Configuration Configuration This is an early WIP with a few hours gone in to both the extension and the game functionality, a lot is subject to change. Note: The extension currently works with the 'dev' branch of the game. extension allows for you to have all of your scripts on your host machine and push them to the running game client! This.threads = params.threads ? params.threads : 1 Throw new Error("No Filename (fn) passed into ScriptJob ctor") Therefore, the signature of the main() function must be: export async function main(ns) from "tprintColored.ns" //Importing from other NetscriptJS scripts works! ( hack(), exec, etc.) as well as the arguments you pass to the script. This environment includes all of the pre-defined Netscript functions Sequentially, NetscriptJS uses a main() function as an entry point.įurthermore, the "Netscript environment" must be passed into a NetscriptJS script through
#Bitburner faster training getelementbyid code#
Furthermore, instead of using the global scope and executing your code The caveat when using NetscriptJS to write scripts is that your code must beĪsynchronous. Is that NetscriptJS scripts use the ".ns" or ".js" extension rather than ".script". Working with NetscriptJS scripts is the same as Netscript 1.0 scripts. These browsers will thus only be capable of using Netscript 1.0.


Browser compatibilityĪs of the time of writing this, a few browsers do not support dynamic import functionality and therefore cannot run NetscriptJS scripts. There is plenty of documentation on Javascript available on the web. This documentation will not go over any of the additional features of NetscriptJS, since On top of having almost all of the features and capabilities of JavaScript, NetscriptJS is also NetscriptJS was developed primarily by Github user jaguilar Still being able to access the Netscript functions. Netscript 2.0, or Netscript JS, is the new and improved version of Netscript thatĪllows users to write (almost) full-fledged Javascript code in their scripts, while
