"this one</a>. Note that while the Netscript language is similar to Javascript, it is not the exact same, so the "+
"syntax will vary a little bit. </strong> <br><br>"+
"Running a script requires RAM. The more complex a script is, the more RAM "+
"it requires to run. Scripts can be run on any server you have root access to. <br><br>"+
"Here are some Terminal commands that are useful when working with scripts: <br><br>"+
"<i>check [script] [args...]</i><br>Prints the logs of the script specified by the name and arguments to Terminal. Arguments should be separated "+
"by a space. Note that scripts are uniquely "+
"identified by their arguments as well as their name. For example, if you ran a script 'foo.script' with the argument 'foodnstuff' then in order to 'check' it you must "+
"also add the 'foodnstuff' argument to the check command as so: <br>check foo.script foodnstuff<br><br>"+
"<i>free</i><br>Shows the current server's RAM usage and availability <br><br>"+
"<i>kill [script] [args...]</i><br>Stops a script that is running with the specified script name and arguments. "+
"<i>nano [script]</i><br>Create/Edit a script. The name of the script must end with the '.script' extension <br><br>"+
"<i>ps</i><br>Displays all scripts that are actively running on the current server<br><br>"+
"<i>rm [script]</i><br>Delete a script<br><br>"+
"<i>run [script] [-t] [n] [args...]</i><br>Run a script with n threads and the specified arguments. Each argument should be separated by a space. "+
"Both the arguments and thread specification are optional. If neither are specified, then the script will be run single-threaded with no arguments.<br>"+
"Examples:<br>run foo.script<br>The command above will run 'foo.script' single-threaded with no arguments."+
"<br>run foo.script -t 10<br>The command above will run 'foo.script' with 10 threads and no arguments."+
"<br>run foo.script foodnstuff sigma-cosmetics 10<br>The command above will run 'foo.script' single-threaded with three arguments: [foodnstuff, sigma-cosmetics, 10]"+
"<br>run foo.script -t 50 foodnstuff<br>The command above will run 'foo.script' with 50 threads and a single argument: [foodnstuff]<br><br>"+
"<i>tail [script] [args...]</i><br>Displays the logs of the script specified by the name and arguments. Note that scripts are uniquely "+
"identified by their arguments as well as their name. For example, if you ran a script 'foo.script' with the argument 'foodnstuff' then in order to 'tail' it you must "+
"also add the 'foodnstuff' argument to the tail command as so: <br>tail foo.script foodnstuff<br><br>"+
"<i>top</i><br>Displays all active scripts and their RAM usage <br><br>"+
"<u><h1> Multithreading scripts </h1></u><br>"+
"Scripts can be multithreaded. A multithreaded script runs the script's code once in each thread. The result is that "+
"every call to the hack(), grow(), and weaken() Netscript functions will have its effect multiplied by the number of scripts. "+
"For example, if a normal single-threaded script is able to hack $10,000, then running the same script with 5 threads would "+
"Netscript arrays have the same properties and functions as javascript arrays. For information see javascripts <a href=\"https://www.w3schools.com/js/js_arrays.asp\" target='_blank'>array</a> documentation.<br><br>"+
"For example, let's say we want to make a generic script 'generic-run.script' and we plan to pass two arguments into that script. The first argument will be the name of "+
"another script, and the second argument will be a number. This generic script will run the script specified in the first argument "+
"with the amount of threads specified in the second element. The code would look like:<br><br>"+
"run(args[0], args[1]);<br><br>"+
"It is also possible to get the number of arguments that was passed into a script using:<br><br>"+
"args.length<br><br>"+
"Note that none of the other functions that typically work with arrays, such as remove(), insert(), clear(), etc., will work on the "+
"<i>hack(hostname/ip)</i><br>Core function that is used to try and hack servers to steal money and gain hacking experience. The argument passed in must be a string with "+
"either the IP or hostname of the server you want to hack. The runtime for this command depends on your hacking level and the target server's security level. "+
"must be a string with either the IP or hostname of the target server. The runtime for this command depends on your hacking level and the target server's security level. "+
"Returns the number by which the money on the server was multiplied for the growth. "+
"Works offline at a slower rate. <br> Example: grow('foodnstuff');<br><br>"+
"<i>weaken(hostname/ip)</i><br>Use your hacking skills to attack a server's security, lowering the server's security level. The argument passed "+
"in must be a string with either the IP or hostname of the target server. The runtime for this command depends on your "+
"hacking level and the target server's security level. This function lowers the security level of the target server by "+
"0.05.<br><br> Like hack() and grow(), weaken() can be called on "+
"any server, regardless of where the script is running. This command requires root access to the target server, but "+
"there is no required hacking level to run the command. Returns "+
"0.1. Works offline at a slower rate<br> Example: weaken('foodnstuff');<br><br>"+
"<i>print(x)</i> <br>Prints a value or a variable to the scripts logs (which can be viewed with the 'tail [script]' terminal command ). <br><br>"+
"<i>clearLog()</i><br>Clears the script's logs. <br><br>"+
"<i>scan(hostname/ip)</i><br>Returns an array containing the hostnames of all servers that are one node away from the specified server. "+
"The argument must be a string containing the IP or hostname of the target server. The hostnames in the returned array are strings.<br><br>"+
"<i>nuke(hostname/ip)</i><br>Run NUKE.exe on the target server. NUKE.exe must exist on your home computer. Does NOT work while offline <br> Example: nuke('foodnstuff'); <br><br>"+
"<i>brutessh(hostname/ip)</i><br>Run BruteSSH.exe on the target server. BruteSSH.exe must exist on your home computer. Does NOT work while offline <br> Example: brutessh('foodnstuff');<br><br>"+
"<i>ftpcrack(hostname/ip)</i><br>Run FTPCrack.exe on the target server. FTPCrack.exe must exist on your home computer. Does NOT work while offline <br> Example: ftpcrack('foodnstuff');<br><br>"+
"<i>relaysmtp(hostname/ip)</i><br>Run relaySMTP.exe on the target server. relaySMTP.exe must exist on your home computer. Does NOT work while offline <br> Example: relaysmtp('foodnstuff');<br><br>"+
"<i>httpworm(hostname/ip)</i><br>Run HTTPWorm.exe on the target server. HTTPWorm.exe must exist on your home computer. Does NOT work while offline <br> Example: httpworm('foodnstuff');<br><br>"+
"<i>sqlinject(hostname/ip)</i><br>Run SQLInject.exe on the target server. SQLInject.exe must exist on your home computer. Does NOT work while offline <br> Example: sqlinject('foodnstuff');<br><br>"+
"<i>run(script, [numThreads], [args...])</i> <br> Run a script as a separate process. The first argument that is passed in is the name of the script as a string. This function can only "+
"be used to run scripts located on the current server (the server running the script that calls this function). The second argument "+
"is optional, and it specifies how many threads to run the script with. This argument must be a number greater than 0. If it is omitted, then the script will be run single-threaded. Any additional arguments will specify "+
"arguments to pass into the new script that is being run. If arguments are specified for the new script, then the second argument numThreads argument must be filled in with a value.<br><br>"+
"of RAM to run this command. Does NOT work while offline <br><br>"+
"The simplest way to use the run command is to call it with just the script name. The following example will run 'foo.script' single-threaded with no arguments:<br><br>"+
"run('foo.script');<br><br>"+
"The following example will run 'foo.script' but with 5 threads instead of single-threaded:<br><br>"+
"run('foo.script', 5);<br><br>"+
"The following example will run 'foo.script' single-threaded, and will pass the string 'foodnstuff' into the script as an argument:<br><br>"+
"run('foo.script', 1, 'foodnstuff');<br><br>"+
"<i>exec(script, hostname/ip, [numThreads], [args...])</i><br>Run a script as a separate process on another server. The first argument is the name of the script as a string. The "+
"second argument is a string with the hostname or IP of the 'target server' on which to run the script. The specified script must exist on the target server. "+
"The third argument is optional, and it specifies how many threads to run the script with. If it is omitted, then the script will be run single-threaded. "+
"This argument must be a number that is greater than 0. Any additional arguments will specify arguments to pass into the new script that is being run. If "+
"arguments are specified for the new script, then the third argument numThreads must be filled in with a value.<br><br>Returns "+
"true if the script is successfully started, and false otherwise. Does NOT work while offline<br><br> "+
"The simplest way to use the exec command is to call it with just the script name and the target server. The following example will try to run 'generic-hack.script' "+
"The following example will try to run the script 'foo.script' on the 'foodnstuff' server with 5 threads. It will also pass the number 1 and the string 'test' in as arguments "+
"same as 'foo.script' run with the argument 2, even though they have the same code. <br><br>"+
"The first argument must be a string with the name of the script. The name is case-sensitive. "+
"The second argument must be a string with the hostname or IP of the target server. Any additional arguments to the function will specify the arguments passed "+
"into the script that should be killed. <br><br>The function will try to kill the specified script on the target server. "+
"If the script is found on the specified server and is running, then it will be killed and this function "+
"will return true. Otherwise, this function will return false. <br><br>"+
"Examples:<br>"+
"If you are trying to kill a script named 'foo.script' on the 'foodnstuff' server that was ran with no arguments, use this:<br><br>"+
"kill('foo.script', 'foodnstuff');<br><br>"+
"If you are trying to kill a script named 'foo.script' on the current server that was ran with no arguments, use this:<br><br>"+
"kill('foo.script', getHostname());<br><br>"+
"If you are trying to kill a script named 'foo.script' on the current server that was ran with the arguments 1 and 'foodnstuff', use this:<br><br>"+
"<i>getServerMoneyAvailable(hostname/ip)</i><br> Returns the amount of money available on a server. The argument passed in must be a string with either the "+
"hostname or IP of the target server. Does NOT work while offline <br> Example: getServerMoneyAvailable('foodnstuff');<br><br>"+
"<i>getServerMaxMoney(hostname/ip)</i><br>Returns the maximum amount of money that can be available on a server. The argument passed in must be a string with "+
"the hostname or IP of the target server. Does NOT work while offline<br>Example: getServerMaxMoney('foodnstuff');<br><br>"+
"<i>getServerSecurityLevel(hostname/ip)</i><br>Returns the security level of a server. The argument passed in must be a string with either the "+
"hostname or IP of the target server. A server's security is denoted by a number between 1 and 100. Does NOT work while offline.<br><br>"+
"<i>getServerBaseSecurityLevel(hostname/ip)</i><br> Returns the base security level of a server. This is the security level that the server starts out with. "+
"This is different than getServerSecurityLevel() because getServerSecurityLevel() returns the current security level of a server, which can constantly change "+
"due to hack(), grow(), and weaken() calls on that server. The base security level will stay the same until you reset by installing an Augmentation. <br><br>"+
"The argument passed in must be a string with either the hostname or IP of the target server. A server's base security is denoted by a number between 1 and 100. "+
"<i>getServerRequiredHackingLevel(hostname/ip)</i><br> Returns the required hacking level of a server. The argument passed in must be a string with either the "+
"hostname or IP or the target server. Does NOT work while offline <br><br>"+
"<i>getServerNumPortsRequired(hostname/ip)</i><br>Returns the number of open ports required to successfully run NUKE.exe on a server. The argument "+
"passed in must be a string with either the hostname or IP of the target server. Does NOT work while offline<br><br>"+
"<i>fileExists(filename, [hostname/ip])</i><br> Returns a boolean (true or false) indicating whether the specified file exists on a server. "+
"program is not. For example, fileExists('brutessh.exe') will work fine, even though the actual program is named BruteSSH.exe. <br><br> "+
"The second argument is a string with the hostname or IP of the server on which to search for the program. This second argument is optional. "+
"If it is omitted, then the function will search through the current server (the server running the script that calls this function) for the file. <br> "+
"The first example above will return true if the script named 'foo.script' exists on the 'foodnstuff' server, and false otherwise. The second example above will "+
"return true if the current server (the server on which this function runs) contains the FTPCrack.exe program, and false otherwise. <br><br>"+
"<i>isRunning(filename, hostname/ip, [args...])</i><br> Returns a boolean (true or false) indicating whether the specified script is running on a server. "+
"Remember that a script is uniquely identified by both its name and its arguments. <br><br>"+
"The first example above will return true if there is a script named 'foo.script' with no arguments running on the 'foodnstuff' server, and false otherwise. The second "+
"example above will return true if there is a script named 'foo.script' with no arguments running on the current server, and false otherwise. "+
"The third example above will return true if there is a script named 'foo.script' with the arguments 1, 5, and 'test' running on the 'joesguns' server, and "+
"false otherwise.<br><br>"+
"<i>purchaseHacknetNode()</i><br> Purchases a new Hacknet Node. Returns a number with the index of the Hacknet Node. This index is equivalent to the number "+
"at the end of the Hacknet Node's name (e.g The Hacknet Node named 'hacknet-node-4' will have an index of 4). If the player cannot afford to purchase "+
"a new Hacknet Node then the function will return false. Does NOT work offline<br><br>"+
"<i>purchaseServer(hostname, ram)</i><br> Purchases a server with the specified hostname and amount of RAM. The first argument can be any data type, "+
"but it will be converted to a string using Javascript's String function. Anything that resolves to an empty string will cause the function to fail. "+
"The second argument specified the amount of RAM (in GB) for the server. This argument must resolve to a numeric and it must be a power of 2 "+
"(2, 4, 8, etc...). <br><br>"+
"Purchasing a server using this Netscript function is twice as expensive as manually purchasing a server from a location in the World.<br><br>"+
"This function returns the hostname of the newly purchased server as a string. If the function fails to purchase a server, then it will return "+
"an empty string. The function will fail if the arguments passed in are invalid or if the player does not have enough money to purchase the specified server.<br><br>"+
"<i>round(n)</i><br>Rounds the number n to the nearest integer. If the argument passed in is not a number, then the function will return 0.<br><br>"+
"<i>write(port, data)</i><br>Writes data to a port. The first argument must be a number between 1 and 10 that specifies the port. The second "+
"argument defines the data to write to the port. If the second argument is not specified then it will write an empty string to the port.<br><br>"+
"<i>read(port)</i><br>Reads data from a port. The first argument must be a number between 1 and 10 that specifies the port. A port is a serialized queue. "+
"This function will remove the first element from the queue and return it. If the queue is empty, then the string 'NULL PORT DATA' will be returned. <br><br>"+
"<u><h1>Hacknet Nodes API</h1></u><br>"+
"Netscript provides the following API for accessing and upgrading your Hacknet Nodes through scripts. This API does NOT work offline.<br><br>"+
"<i>hacknetnodes</i><br> A special variable. This is an array that maps to the Player's Hacknet Nodes. The Hacknet Nodes are accessed through "+
"indexes. These indexes correspond to the number at the end of the name of the Hacknet Node. For example, the first Hacknet Node you purchase "+
"will have the same 'hacknet-node-0' and can be accessed with hacknetnodes[0]. The fourth Hacknet Node you purchase will have the name "+
"'hacknet-node-3' and can be accessed with hacknetnodes[3]. <br><br>"+
"<i>hacknetnodes.length</i><br> Returns the number of Hacknet Nodes that the player owns<br><br>"+
"<i>hacknetnodes[i].upgradeLevel(n)</i><br> Tries to upgrade the level of the corresponding Hacknet Node n times. The argument n must be a "+
"positive integer. Returns true if the Hacknet Node's level is successfully upgraded n times or up to the max level (200), and false otherwise.<br><br>"+
"<i>hacknetnodes[i].upgradeRam()</i><br> Tries to upgrade the amount of RAM on the corresponding Hacknet Node. Returns true if the "+
"RAM is successfully upgraded, and false otherwise. <br><br>"+
"<i>hacknetnodes[i].upgradeCore()</i><br> Attempts to purchase an additional core for the corresponding Hacknet Node. Returns true if the "+
"additional core is successfully purchase, and false otherwise. <br><br>"+
"<i>buyStock(sym, shares)</i><br>Attempts to purchase shares of a stock. The first argument must be a string with the stock's symbol. The second argument "+
"must be the number of shares to purchase.<br><br>"+
"If the player does not have enough money to purchase specified number of shares, then no shares will be purchased (it will not purchase the most you can afford). "+
"Remember that every transaction on the stock exchange costs a certain commission fee.<br><br>"+
"The function will return true if it successfully purchases the specified number of shares of stock, and false otherwise.<br><br>"+
"<i>sellStock(sym, shares)</i><br>Attempts to sell shares of a stock. The first argument must be a string with the stock's symbol. The second argument "+
"must be the number of shares to sell.<br><br>"+
"If the specified number of shares in the function exceeds the amount that the player actually owns, then this function will sell all owned shares. "+
"Remember that every transaction on the stock exchange costs a certain commission fee.<br><br>"+
"The net profit made from selling stocks with this function is reflected in the script's statistics. This net profit is calculated as: <br><br>"+
"shares * (sell price - average price of purchased shares)<br><br>"+
"This function will return true if the shares of stock are successfully sold and false otherwise.<br><br>"+
"This while loop above is an infinite loop (continuously runs until the script is manually stopped) that repeatedly runs the 'hack('foodnstuff')' command. "+
"Added getLevelUpgradeCost(n), getRamUpgradeCost(), getCoreUpgradeCost() functions for Netscript Hacknet Node API<br>"+
"v0.26.0<br>"+
"-Game now has a real ending, although it's not very interesting/satisfying right now. It sets up the framework for the secondary prestige system "+
"in the future<br>"+
"-Forgot to mention that since last update, comments now work in Netscript. Use // for single line comments or /* and */ for multiline comments "+
"just like in Javascript<br>"+
"-Added ports to Netscript. These ports are essentially serialized queues. You can use the write() Netscript function to write a value "+
"to a queue, and then you can use the read() Netscript function to read the value from the queue. Once you read a value from the queue it will be "+
"removed. There are only 10 queues (1-10), and each has a maximum capacity of 50 entries. If you try to write to a queue that is full, the "+
"the first value is removed. See wiki/Netscript documentation for more details<br>"+
"-You can now use the 'help' Terminal command for specific commands<br>"+
"-You can now use './' to run a script/program (./NUKE.exe). However, tab completion currently doesn't work for it (I'm working on it)<br>"+
"-Decreased the base growth rate of servers by ~25%<br>"+
"-Both the effect of weaken() and its time to execute were halved. In other words, calling weaken() on a server only lowers its security by 0.05 (was 0.1 before) "+
"but the time to execute the function is half of what it was before. Therefore, the effective rate of weaken() should be about the same<br>"+
"-Increased all Infiltration rewards by ~10%, and increased infiltration rep gains by an additional 20% (~32% total for rep gains)<br>"+
"-The rate at which the security level of a facility increases during Infiltration was decreased significantly (~33%)<br>"+
"-Getting treated at the Hospital is now 33% more expensive<br>"+
"-Slightly increased the amount of time it takes to hack a server<br>"+
"-Slightly decreased the base cost for RAM on home computer, but increased the cost multiplier. This means "+
"that upgrading RAM on the home computer should be slightly cheaper at the start, but slightly more expensive "+
"later on<br>"+
"-Increased the required hacking level for many late game servers<br>"+
"-The sleep() Netscript function now takes an optional 'log' argument that specifies whether or "+
"not the 'Sleeping for N milliseconds' will be logged for the script<br>"+
"-Added clearLog() Netscript function<br>"+
"-Deleted a few stocks. Didn't see a reason for having so many, and it just affects performance. Won't take "+
"effect until you reset by installing Augmentations<br>"+
"-There was a typo with Zeus Medical's server hostname. It is now 'zeus-med' rather than 'zeud-med'<br>"+
"-Added keyboard shortcuts to quickly navigate between different menus. See wiki link <a href='http://bitburner.wikia.com/wiki/Shortcuts' target='_blank'>here</a><br>"+