2017-08-30 19:44:29 +02:00
let CONSTANTS = {
2017-09-19 20:38:03 +02:00
Version : "0.29.0" ,
2017-07-25 04:51:03 +02:00
2017-05-07 12:04:54 +02:00
//Max level for any skill, assuming no multipliers. Determined by max numerical value in javascript for experience
//and the skill level formula in Player.js. Note that all this means it that when experience hits MAX_INT, then
2017-07-25 04:51:03 +02:00
//the player will have this level assuming no multipliers. Multipliers can cause skills to go above this.
2017-03-31 23:47:06 +02:00
MaxSkillLevel : 975 ,
2017-07-25 04:51:03 +02:00
2017-02-09 23:40:55 +01:00
//How much reputation is needed to join a megacorporation's faction
CorpFactionRepRequirement : 250000 ,
2017-07-25 04:51:03 +02:00
2017-04-27 22:02:58 +02:00
/* Base costs */
2017-07-22 00:54:55 +02:00
BaseCostFor1GBOfRamHome : 30000 ,
2017-08-01 21:03:45 +02:00
BaseCostFor1GBOfRamServer : 50000 , //1 GB of RAM
2017-05-15 18:54:23 +02:00
BaseCostFor1GBOfRamHacknetNode : 30000 ,
2017-07-25 04:51:03 +02:00
2017-04-27 22:02:58 +02:00
BaseCostForHacknetNode : 1000 ,
2017-05-24 07:05:31 +02:00
BaseCostForHacknetNodeCore : 500000 ,
2017-07-25 04:51:03 +02:00
2017-04-27 22:02:58 +02:00
/* Hacknet Node constants */
2017-07-30 21:11:30 +02:00
HacknetNodeMoneyGainPerLevel : 1.6 ,
2017-07-13 18:54:29 +02:00
HacknetNodePurchaseNextMult : 1.85 , //Multiplier when purchasing an additional hacknet node
2017-08-01 21:03:45 +02:00
HacknetNodeUpgradeLevelMult : 1.04 , //Multiplier for cost when upgrading level
HacknetNodeUpgradeRamMult : 1.28 , //Multiplier for cost when upgrading RAM
HacknetNodeUpgradeCoreMult : 1.48 , //Multiplier for cost when buying another core
2017-07-25 04:51:03 +02:00
2017-05-16 05:06:25 +02:00
HacknetNodeMaxLevel : 200 ,
2017-05-16 00:22:17 +02:00
HacknetNodeMaxRam : 64 ,
HacknetNodeMaxCores : 16 ,
2017-07-25 04:51:03 +02:00
2017-06-20 18:11:33 +02:00
/* Faction and Company favor */
2017-08-13 07:01:33 +02:00
FactionReputationToFavorBase : 500 ,
2017-08-03 06:21:15 +02:00
FactionReputationToFavorMult : 1.02 ,
2017-08-13 07:01:33 +02:00
CompanyReputationToFavorBase : 500 ,
2017-08-03 06:21:15 +02:00
CompanyReputationToFavorMult : 1.02 ,
2017-07-25 04:51:03 +02:00
2017-05-07 12:04:54 +02:00
/* Augmentation */
//NeuroFlux Governor cost multiplier as you level up
2017-07-13 18:54:29 +02:00
NeuroFluxGovernorLevelMult : 1.14 ,
2017-07-25 04:51:03 +02:00
2017-06-05 17:31:46 +02:00
//RAM Costs for different commands
ScriptWhileRamCost : 0.2 ,
ScriptForRamCost : 0.2 ,
2017-05-15 16:15:59 +02:00
ScriptIfRamCost : 0.1 ,
2017-06-06 03:34:00 +02:00
ScriptHackRamCost : 0.1 ,
2017-06-05 16:31:47 +02:00
ScriptGrowRamCost : 0.15 ,
ScriptWeakenRamCost : 0.15 ,
2017-06-28 06:11:27 +02:00
ScriptScanRamCost : 0.2 ,
2017-05-15 16:15:59 +02:00
ScriptNukeRamCost : 0.05 ,
ScriptBrutesshRamCost : 0.05 ,
ScriptFtpcrackRamCost : 0.05 ,
ScriptRelaysmtpRamCost : 0.05 ,
ScriptHttpwormRamCost : 0.05 ,
ScriptSqlinjectRamCost : 0.05 ,
2017-05-21 05:45:36 +02:00
ScriptRunRamCost : 0.8 ,
2017-05-31 19:37:32 +02:00
ScriptExecRamCost : 1.1 ,
2017-05-30 04:02:41 +02:00
ScriptScpRamCost : 0.5 ,
2017-08-13 07:01:33 +02:00
ScriptKillRamCost : 0.5 , //Kill and killall
2017-05-30 01:12:57 +02:00
ScriptHasRootAccessRamCost : 0.05 ,
2017-09-19 20:38:03 +02:00
ScriptGetHostnameRamCost : 0.05 , //getHostname() and getIp()
ScriptGetHackingLevelRamCost : 0.05 , //getHackingLevel() and getIntelligence()
ScriptGetMultipliersRamCost : 4.0 , //getHackingMultipliers() and getBitNodeMultipliers()
2017-07-27 04:56:14 +02:00
ScriptGetServerCost : 0.1 ,
2017-06-05 19:50:32 +02:00
ScriptFileExistsRamCost : 0.1 ,
ScriptIsRunningRamCost : 0.1 ,
2017-05-15 17:38:17 +02:00
ScriptOperatorRamCost : 0.01 ,
2017-05-25 14:18:34 +02:00
ScriptPurchaseHacknetRamCost : 1.5 ,
ScriptHacknetNodesRamCost : 1.0 , //Base cost for accessing hacknet nodes array
2017-07-25 04:51:03 +02:00
ScriptHNUpgLevelRamCost : 0.4 ,
2017-05-25 14:18:34 +02:00
ScriptHNUpgRamRamCost : 0.6 ,
ScriptHNUpgCoreRamCost : 0.8 ,
2017-07-13 18:54:29 +02:00
ScriptGetStockRamCost : 2.0 ,
ScriptBuySellStockRamCost : 2.5 ,
ScriptPurchaseServerRamCost : 2.0 ,
ScriptRoundRamCost : 0.05 ,
2017-07-22 00:54:55 +02:00
ScriptReadWriteRamCost : 1.0 ,
2017-08-13 07:01:33 +02:00
ScriptArbScriptRamCost : 1.0 , //Functions that apply to all scripts regardless of args
2017-08-30 19:44:29 +02:00
ScriptGetScriptRamCost : 0.1 ,
ScriptGetHackTimeRamCost : 0.05 ,
ScriptSingularityFn1RamCost : 1 ,
ScriptSingularityFn2RamCost : 2 ,
ScriptSingularityFn3RamCost : 3 ,
2017-07-25 04:51:03 +02:00
2017-06-28 06:11:27 +02:00
MultithreadingRAMCost : 1 ,
2017-07-25 04:51:03 +02:00
2017-05-31 18:45:30 +02:00
//Server constants
2017-08-01 21:03:45 +02:00
ServerBaseGrowthRate : 1.03 , //Unadjusted Growth rate
2017-09-15 16:06:59 +02:00
ServerMaxGrowthRate : 1.0035 , //Maximum possible growth rate (max rate accounting for server security)
2017-06-06 23:22:57 +02:00
ServerFortifyAmount : 0.002 , //Amount by which server's security increases when its hacked/grown
2017-09-15 16:06:59 +02:00
ServerWeakenAmount : 0.05 , //Amount by which server's security decreases when weakened
2017-07-25 04:51:03 +02:00
2017-07-27 04:56:14 +02:00
PurchasedServerLimit : 25 ,
2017-06-01 01:39:03 +02:00
//Augmentation Constants
2017-06-07 04:33:50 +02:00
AugmentationCostMultiplier : 5 , //Used for balancing costs without having to readjust every Augmentation cost
2017-07-03 21:42:11 +02:00
AugmentationRepMultiplier : 2.5 , //Used for balancing rep cost without having to readjust every value
MultipleAugMultiplier : 1.9 ,
2017-07-25 04:51:03 +02:00
2017-04-13 22:21:03 +02:00
//How much a TOR router costs
2017-05-30 04:29:57 +02:00
TorRouterCost : 200000 ,
2017-07-25 04:51:03 +02:00
2017-06-28 22:53:12 +02:00
//Infiltration constants
InfiltrationBribeBaseAmount : 100000 , //Amount per clearance level
2017-07-03 21:42:11 +02:00
InfiltrationMoneyValue : 2000 , //Convert "secret" value to money
2017-07-25 04:51:03 +02:00
2017-07-03 21:42:11 +02:00
//Stock market constants
2017-07-13 18:54:29 +02:00
WSEAccountCost : 200000000 ,
TIXAPICost : 5000000000 ,
2017-07-03 21:42:11 +02:00
StockMarketCommission : 100000 ,
2017-07-25 04:51:03 +02:00
2017-07-03 21:42:11 +02:00
//Hospital/Health
2017-07-22 00:54:55 +02:00
HospitalCostPerHp : 100000 ,
2017-07-25 04:51:03 +02:00
2017-09-15 16:06:59 +02:00
//Intelligence-related constants
IntelligenceCrimeWeight : 0.05 , //Weight for how much int affects crime success rates
IntelligenceInfiltrationWeight : 0.1 , //Weight for how much int affects infiltration success rates
2017-09-19 20:38:03 +02:00
IntelligenceCrimeBaseExpGain : 0.0002 ,
2017-09-15 16:06:59 +02:00
IntelligenceProgramBaseExpGain : 1000 , //Program required hack level divided by this to determine int exp gain
IntelligenceTerminalHackBaseExpGain : 200 , //Hacking exp divided by this to determine int exp gain
2017-09-19 20:38:03 +02:00
IntelligenceSingFnBaseExpGain : 0.0005 ,
2017-09-26 04:44:33 +02:00
IntelligenceClassBaseExpGain : 0.0000001 ,
2017-09-19 20:38:03 +02:00
//Hacking Missions
HackingMissionRepToDiffConversion : 5000 , //Faction rep is divided by this to get mission difficulty
2017-09-27 17:13:42 +02:00
HackingMissionRepToRewardConversion : 12 , //Faction rep divided byt his to get mission rep reward
2017-09-26 04:44:33 +02:00
HackingMissionSpamTimeIncrease : 20000 , //How much time limit increase is gained when conquering a Spam Node (ms)
HackingMissionTransferAttackIncrease : 1.05 , //Multiplier by which the attack for all Core Nodes is increased when conquering a Transfer Node
HackingMissionHowToPlay : "Hacking missions are a minigame that, if won, will reward you with faction reputation.<br><br>" +
"In this game you control a set of Nodes and use them to try and defeat an enemy. Your Nodes " +
2017-09-27 17:13:42 +02:00
"are colored blue, while the enemy's are red. There are also other nodes on the map colored gray " +
2017-09-26 04:44:33 +02:00
"that initially belong to neither you nor the enemy. The goal of the game is " +
"to capture all of the enemy's database nodes, which are the parallelogram-shaped ones, within the time limit. " +
"If you cannot capture all of the enemy's database nodes in the time limit, you will lose.<br><br>" +
"Each Node has three stats: Attack, Defense, and HP. There are five different actions that " +
"a Node can take:<br><br> " +
2017-09-27 17:13:42 +02:00
"Attack - Targets an enemy Node and lowers its HP. The effectiveness is determined by the owner's Attack, the Player's " +
2017-09-26 04:44:33 +02:00
"hacking level, and the enemy's defense.<br>" +
2017-09-27 17:13:42 +02:00
"Scan - Targets an enemy Node and lowers its Defense. The effectiveness is determined by the owner's Attack, the Player's hacking level, and the " +
2017-09-26 04:44:33 +02:00
"enemy's defense.<br>" +
2017-09-27 17:13:42 +02:00
"Weaken - Targets an enemy Node and lowers its Attack. The effectiveness is determined by the owner's Attack, the Player's hacking level, and the enemy's " +
2017-09-26 04:44:33 +02:00
"defense.<br>" +
2017-09-27 17:13:42 +02:00
"Fortify - Raises the Node's Defense. The effectiveness is determined by your hacking level.<br>" +
"Overflow - Raises the Node's Attack but lowers its Defense. The effectiveness is determined by your hacking level.<br><br>" +
"Note that when determining the effectiveness of the above actions, the TOTAL Attack or Defense of the team is used, not just the " +
"Attack/Defense of the individual Node that is performing the action.<br><br." +
"To capture a Node, you must lower its HP down to 0.<br><br>" +
2017-09-26 04:44:33 +02:00
"There are six different types of Nodes:<br><br>" +
2017-09-27 17:13:42 +02:00
"CPU Core - These are your main Nodes that are used to perform actions. Capable of performing every action<br>" +
2017-09-26 04:44:33 +02:00
"Firewall - Nodes with high defense. These Nodes cannot perform any actions<br>" +
"Database - A special type of Node. The player's objective is to conquer all of the enemy's Database Nodes within " +
"the time limit. These Nodes cannot perform any actions<br>" +
"Spam - Conquering one of these Nodes will slow the enemy's trace, giving the player additional time to complete " +
"the mission. These Nodes cannot perform any actions<br>" +
"Transfer - Conquering one of these nodes will increase the Attack of all of your CPU Cores by a small fixed percentage. " +
"These Nodes are capable of performing every action except the 'Attack' action<br>" +
"Shield - Nodes with high defense. These Nodes cannot perform any actions<br><br>" +
2017-09-27 17:13:42 +02:00
"To assign an action to a Node, you must first select one of your Nodes. This can be done by simply clicking on it. Only " +
"one Node can be selected at a time, and it will be denoted with a white highlight. After selecting the Node, " +
"select its action using the Action Buttons near the top of the screen. Every action also has a corresponding keyboard " +
"shortcut that can be used as well.<br><br>" +
2017-09-26 04:44:33 +02:00
"For certain actions such as attacking, scanning, and weakening, the Node performing the action must have a target. To target " +
"another node, simply click-and-drag from the 'source' Node to a target. A Node can only have one target, and you can only target " +
"Nodes that are adjacent to one of your Nodes (immediately above, below, or to the side. NOT diagonal). Furthermore, only CPU Cores and Transfer Nodes " +
2017-09-27 17:13:42 +02:00
"can target, since they are the only ones that can perform actions. To remove a target, you can simply click on the line that represents " +
"the connection between one of your Nodes and its target. Alternatively, you can select the 'source' Node and click the 'Drop Connection' button, " +
"or press 'd'," ,
2017-09-26 04:44:33 +02:00
2017-09-15 16:06:59 +02:00
2017-08-13 07:01:33 +02:00
//Gang constants
GangRespectToReputationRatio : 2 , //Respect is divided by this to get rep gain
MaximumGangMembers : 20 ,
GangRecruitCostMultiplier : 2 ,
GangTerritoryUpdateTimer : 150 ,
2017-04-18 06:32:17 +02:00
MillisecondsPer20Hours : 72000000 ,
GameCyclesPer20Hours : 72000000 / 200 ,
2017-07-25 04:51:03 +02:00
2017-04-19 07:02:40 +02:00
MillisecondsPer10Hours : 36000000 ,
GameCyclesPer10Hours : 36000000 / 200 ,
2017-07-25 04:51:03 +02:00
2017-04-18 06:32:17 +02:00
MillisecondsPer8Hours : 28800000 ,
GameCyclesPer8Hours : 28800000 / 200 ,
2017-07-25 04:51:03 +02:00
2017-04-19 23:39:25 +02:00
MillisecondsPer4Hours : 14400000 ,
GameCyclesPer4Hours : 14400000 / 200 ,
2017-07-25 04:51:03 +02:00
2017-05-04 07:27:22 +02:00
MillisecondsPer2Hours : 7200000 ,
GameCyclesPer2Hours : 7200000 / 200 ,
2017-07-25 04:51:03 +02:00
2017-04-18 06:32:17 +02:00
MillisecondsPerHour : 3600000 ,
GameCyclesPerHour : 3600000 / 200 ,
2017-07-25 04:51:03 +02:00
2017-04-24 03:43:41 +02:00
MillisecondsPerHalfHour : 1800000 ,
GameCyclesPerHalfHour : 1800000 / 200 ,
2017-07-25 04:51:03 +02:00
2017-05-04 07:27:22 +02:00
MillisecondsPerQuarterHour : 900000 ,
GameCyclesPerQuarterHour : 900000 / 200 ,
2017-07-25 04:51:03 +02:00
2017-05-24 17:32:45 +02:00
MillisecondsPerFiveMinutes : 300000 ,
GameCyclesPerFiveMinutes : 300000 / 200 ,
2017-07-25 04:51:03 +02:00
2017-04-20 10:29:07 +02:00
FactionWorkHacking : "Faction Hacking Work" ,
FactionWorkField : "Faction Field Work" ,
FactionWorkSecurity : "Faction Security Work" ,
2017-07-25 04:51:03 +02:00
2017-04-24 21:10:35 +02:00
WorkTypeCompany : "Working for Company" ,
2017-05-10 19:42:46 +02:00
WorkTypeCompanyPartTime : "Working for Company part-time" ,
2017-04-24 21:10:35 +02:00
WorkTypeFaction : "Working for Faction" ,
WorkTypeCreateProgram : "Working on Create a Program" ,
WorkTypeStudyClass : "Studying or Taking a class at university" ,
2017-05-03 19:52:54 +02:00
WorkTypeCrime : "Committing a crime" ,
2017-07-25 04:51:03 +02:00
2017-04-24 21:10:35 +02:00
ClassStudyComputerScience : "studying Computer Science" ,
ClassDataStructures : "taking a Data Structures course" ,
ClassNetworks : "taking a Networks course" ,
ClassAlgorithms : "taking an Algorithms course" ,
2017-04-25 21:14:01 +02:00
ClassManagement : "taking a Management course" ,
ClassLeadership : "taking a Leadership course" ,
2017-05-10 19:42:46 +02:00
ClassGymStrength : "training your strength at a gym" ,
ClassGymDefense : "training your defense at a gym" ,
ClassGymDexterity : "training your dexterity at a gym" ,
ClassGymAgility : "training your agility at a gym" ,
2017-07-25 04:51:03 +02:00
2017-08-01 21:03:45 +02:00
ClassDataStructuresBaseCost : 40 ,
ClassNetworksBaseCost : 80 ,
ClassAlgorithmsBaseCost : 320 ,
ClassManagementBaseCost : 160 ,
ClassLeadershipBaseCost : 320 ,
2017-07-05 18:49:01 +02:00
ClassGymBaseCost : 120 ,
2017-07-25 04:51:03 +02:00
2017-05-03 19:52:54 +02:00
CrimeShoplift : "shoplift" ,
2017-08-01 21:03:45 +02:00
CrimeRobStore : "rob a store" ,
2017-05-03 19:52:54 +02:00
CrimeMug : "mug someone" ,
2017-08-01 21:03:45 +02:00
CrimeLarceny : "commit larceny" ,
2017-05-03 19:52:54 +02:00
CrimeDrugs : "deal drugs" ,
CrimeTraffickArms : "traffick illegal arms" ,
CrimeHomicide : "commit homicide" ,
2017-05-08 18:00:34 +02:00
CrimeGrandTheftAuto : "commit grand theft auto" ,
2017-05-03 19:52:54 +02:00
CrimeKidnap : "kidnap someone for ransom" ,
2017-05-08 18:00:34 +02:00
CrimeAssassination : "assassinate a high-profile target" ,
CrimeHeist : "pull off the ultimate heist" ,
2017-07-25 04:51:03 +02:00
2017-03-31 23:47:06 +02:00
/* Tutorial related things */
2017-07-25 04:51:03 +02:00
TutorialNetworkingText : "Servers are a central part of the game. You start with a single personal server (your home computer) " +
"and you can purchase additional servers as you progress through the game. Connecting to other servers " +
"and hacking them can be a major source of income and experience. Servers can also be used to run " +
"scripts which can automatically hack servers for you. <br><br>" +
2017-06-28 06:11:27 +02:00
"In order to navigate between machines, use the 'scan' or 'scan-analyze' Terminal command to see all servers " +
2017-07-25 04:51:03 +02:00
"that are reachable from your current server. Then, you can use the 'connect [hostname/ip]' " +
"command to connect to one of the available machines. <br><br>" +
2017-04-05 23:09:37 +02:00
"The 'hostname' and 'ifconfig' commands can be used to display the hostname/IP of the " +
"server you are currently connected to." ,
2017-07-25 04:51:03 +02:00
TutorialHackingText : "In the year 2077, currency has become digital and decentralized. People and corporations " +
"store their money on servers. By hacking these servers, you can steal their money and gain " +
"experience. <br><br>" +
"<h1>Gaining root access</h1> <br>" +
"The key to hacking a server is to gain root access to that server. This can be done using " +
"the NUKE virus (NUKE.exe). You start the game with a copy of the NUKE virus on your home " +
"computer. The NUKE virus attacks the target server's open ports using buffer overflow " +
"exploits. When successful, you are granted root administrative access to the machine. <br><br>" +
"Typically, in order for the NUKE virus to succeed, the target server needs to have at least " +
2017-04-05 23:09:37 +02:00
"one of its ports opened. Some servers have no security and will not need any ports opened. Some " +
2017-07-25 04:51:03 +02:00
"will have very high security and will need many ports opened. In order to open ports on another " +
2017-04-05 23:09:37 +02:00
"server, you will need to run programs that attack the server to open specific ports. These programs " +
2017-07-25 04:51:03 +02:00
"can be coded once your hacking skill gets high enough, or they can be purchased if you can find " +
2017-04-13 19:33:34 +02:00
"a seller. <br><br>" +
2017-07-25 04:51:03 +02:00
"In order to determine how many ports need to be opened to successfully NUKE a server, connect to " +
"that server and run the 'analyze' command. This will also show you which ports have already been " +
2017-05-31 19:37:32 +02:00
"opened. <br><br>" +
2017-07-25 04:51:03 +02:00
"Once you have enough ports opened and have ran the NUKE virus to gain root access, the server " +
"can then be hacked by simply calling the 'hack' command through terminal, or by using a script.<br><br>" +
"<h1>Hacking mechanics</h1><br>" +
"When you execute the hack command, either manually through the terminal or automatically through " +
"a script, you attempt to hack the server. This action takes time. The more advanced a server's " +
"security is, the more time it will take. Your hacking skill level also affects the hacking time, " +
"with a higher hacking skill leading to shorter hacking times. Also, running the hack command " +
"manually through terminal is faster than hacking from a script. <br><br>" +
"Your attempt to hack a server will not always succeed. The chance you have to successfully hack a " +
"server is also determined by the server's security and your hacking skill level. Even if your " +
"hacking attempt is unsuccessful, you will still gain experience points. <br><br>" +
"When you successfully hack a server. You steal a certain percentage of that server's total money. This " +
"percentage is determined by the server's security and your hacking skill level. The amount of money " +
2017-04-12 04:05:21 +02:00
"on a server is not limitless. So, if you constantly hack a server and deplete its money, then you will " +
2017-06-06 23:22:57 +02:00
"encounter diminishing returns in your hacking (since you are only hacking a certain percentage). You can " +
"increase the amount of money on a server using a script and the grow() function in Netscript.<br><br>" +
2017-07-25 04:51:03 +02:00
"<h1>Server Security</h1><br>" +
2017-09-19 20:38:03 +02:00
"Each server has a security level, typically between 1 and 100. A higher number means the server has stronger security. " +
"It is possible for a server to have a security level of 100 or higher, in which case hacking that server " +
"will become impossible (0% chance to hack).<br><br>" +
"As mentioned above, a server's security level is an important factor " +
2017-05-31 19:37:32 +02:00
"to consider when hacking. You can check a server's security level using the 'analyze' command, although this " +
2017-07-25 04:51:03 +02:00
"only gives an estimate (with 5% uncertainty). You can also check a server's security in a script, using the " +
"<i>getServerSecurityLevel(server)</i> function in Netscript. See the Netscript documentation for more details. " +
"This function will give you an exact value for a server's security. <br><br>" +
"Whenever a server is hacked manually or through a script, its security level increases by a small amount. Calling " +
"the grow() command in a script will also increase security level of the target server. These actions will " +
"make it harder for you to hack the server, and decrease the amount of money you can steal. You can lower a " +
"server's security level in a script using the <i>weaken(server)</i> function in Netscript. See the Netscript " +
2017-08-18 19:20:51 +02:00
"documentation for more details.<br><br>" +
"A server has a minimum security level that is equal to one third of its starting security, rounded to the " +
"nearest integer. To be more precise:<br><br>" +
"server.minSecurityLevel = Math.max(1, Math.round(server.startingSecurityLevel / 3))<br><br>" +
"This means that a server's security will not fall below this value if you are trying to weaken it." ,
2017-07-25 04:51:03 +02:00
TutorialScriptsText : "Scripts can be used to automate the hacking process. Scripts must be written in the Netscript language. " +
"Documentation about the Netscript language can be found in the 'Netscript Programming Language' " +
2017-06-02 18:49:14 +02:00
"section of this 'Tutorial' page. <br><br> " +
2017-07-25 04:51:03 +02:00
"<strong>It is highly recommended that you have a basic background in programming to start writing scripts. " +
"You by no means need to be an expert. All you need is some familiarity with basic programming " +
"constructs like for/while loops, if statements, " +
"functions, variables, etc. The Netscript programming language most resembles the Javascript language. " +
2017-06-02 19:04:43 +02:00
"Therefore, a good beginner's programming tutorial to read might be <a href='https://www.w3schools.com/js/default.asp' target='_blank'>" +
2017-07-25 04:51:03 +02:00
"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. " +
2017-06-17 04:53:57 +02:00
"Arguments should be separated by a space. Note that " +
2017-07-25 04:51:03 +02:00
"scripts are uniquely identified by their arguments as well as their name. For example, if you ran a script 'foo.script' with the " +
"argument 1 and 2, then just typing 'kill foo.script' will not work. You have to use 'kill foo.script 1 2'. <br><br>" +
2017-06-17 04:53:57 +02:00
"<i>mem [script] [-t] [n]</i><br>Check how much RAM a script requires to run with n threads<br><br>" +
2017-07-25 04:51:03 +02:00
"<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." +
2017-06-17 04:53:57 +02:00
"<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]" +
2017-07-25 04:51:03 +02:00
"<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 " +
2017-08-18 19:20:51 +02:00
"every call to the hack(), grow(), and weaken() Netscript functions will have its effect multiplied by the number of threads. " +
2017-07-25 04:51:03 +02:00
"For example, if a normal single-threaded script is able to hack $10,000, then running the same script with 5 threads would " +
2017-06-11 08:52:52 +02:00
"yield $50,000. <br><br> " +
2017-07-25 04:51:03 +02:00
"When multithreading a script, the total RAM cost can be calculated by simply multiplying the base RAM cost of the script " +
"with the number of threads, where the base cost refers to the amount of RAM required to run the script single-threaded. " +
"In the terminal, you can run the " +
"'mem [scriptname] -t n' command to see how much RAM a script requires with n threads. <br><br>" +
"Every method for running a script has an option for making it multihreaded. To run a script with " +
"n threads from a Terminal: <br>" +
"run [scriptname] -t n<br><br>" +
"Using Netscript commands: <br>" +
2017-06-28 06:11:27 +02:00
"run('scriptname.script', n);<br> " +
2017-07-25 04:51:03 +02:00
"exec('scriptname.script, 'targetServer', n);<br><br>" +
"<u><h1> Notes about how scripts work offline </h1> </u><br>" +
"<strong> The scripts that you write and execute are interpreted in Javascript. For this " +
2017-05-21 23:04:57 +02:00
"reason, it is not possible for these scripts to run while offline (when the game is closed). " +
2017-07-25 04:51:03 +02:00
"It is important to note that for this reason, conditionals such as if/else statements and certain " +
"commands such as purchaseHacknetNode() or nuke() will not work while the game is offline.<br><br>" +
2017-05-21 23:04:57 +02:00
"However, Scripts WILL continue to generate money and hacking exp for you while the game is offline. This " +
2017-07-25 04:51:03 +02:00
"offline production is based off of the scripts' production while the game is online. <br><br>" +
"grow() and weaken() are two Netscript commands that will also be applied when the game is offline, although at a slower rate " +
"compared to if the game was open. This is done by having each script keep track of the " +
"rate at which the grow() and weaken() commands are called when the game is online. These calculated rates are used to determine how many times " +
"these function calls would be made while the game is offline. <br><br> " +
"Also, note that because of the way the Netscript interpreter is implemented, " +
2017-05-15 17:13:21 +02:00
"whenever you reload or re-open the game all of the scripts that you are running will " +
"start running from the BEGINNING of the code. The game does not keep track of where exactly " +
"the execution of a script is when it saves/loads. </strong><br><br>" ,
2017-07-25 04:51:03 +02:00
TutorialNetscriptText : "Netscript is a programming language implemented for this game. The language has " +
"your basic programming constructs and several built-in commands that are used to hack. <br><br>" +
"<u><h1>Official Wiki and Documentation</h1></u><br>" +
"<a href='https://bitburner.wikia.com/wiki/Netscript' target='_blank'>Check out Bitburner's wiki for the official Netscript documentation</a>" +
". The wiki documentation will contain more details and " +
2017-07-13 18:54:29 +02:00
"code examples than this documentation page. Also, it can be opened up in another tab/window for convenience!<br><br>" +
2017-07-25 04:51:03 +02:00
"<u><h1> Variables and data types </h1></u><br>" +
"The following data types are supported by Netscript: <br>" +
"numeric - Integers and floats (eg. 6, 10.4999)<br>" +
"string - Encapsulated by single or double quotes (eg. 'this is a string')<br>" +
"boolean - true or false<br><br>" +
2017-08-30 19:44:29 +02:00
"Strings are fully functional <a href='https://www.w3schools.com/jsref/jsref_obj_string.asp' target='_blank'>Javascript strings</a>, " +
"which means that all of the member functions of Javascript strings such as toLowerCase() and includes() are also " +
"available in Netscript!<br><br>" +
2017-07-25 04:51:03 +02:00
"To create a variable, use the assign (=) operator. The language is not strongly typed. Examples: <br>" +
"i = 5;<br>" +
"s = 'this game is awesome!';<br><br>" +
2017-05-07 00:19:18 +02:00
"In the first example above, we are creating the variable i and assigning it a value of 5. In the second, " +
2017-07-25 04:51:03 +02:00
"we are creating the variable s and assigning it the value of a string. Note that all expressions must be " +
2017-05-07 00:19:18 +02:00
"ended with a semicolon. <br><br>" +
2017-07-25 04:51:03 +02:00
"<u><h1> Operators</h1> </u><br>" +
"The following operators are supported by Netscript: <br>" +
" +<br>" +
" -<br>" +
" *<br>" +
" /<br>" +
" %<br>" +
" &&<br>" +
" ||<br>" +
" <<br>" +
" ><br>" +
" <=<br>" +
" >=<br>" +
" ==<br>" +
2017-08-03 06:21:15 +02:00
" !=<br>" +
" ++ (Note: This ONLY pre-increments. Post-increment does not work)<br>" +
" -- (Note: This ONLY pre-decrements. Post-decrement does not work)<br>" +
" - (Negation operator)<br>" +
" !<br><br>" +
2017-07-25 04:51:03 +02:00
"<u><h1> Arrays </h1></u><br>" +
2017-07-13 18:54:29 +02:00
"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>" +
2017-07-25 04:51:03 +02:00
"<u><h1> Script Arguments </h1></u><br>" +
"Arguments passed into a script can be accessed using a special array called 'args'. The arguments can be accessed like a normal array using the [] " +
"operator. (args[0], args[1], args[2]...) <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 " +
2017-06-17 04:53:57 +02:00
"args array.<br><br>" +
2017-09-27 17:13:42 +02:00
"<u><h1>Javascript Modules</h1></u><br>" +
"Netscript supports the following Javascript Modules:<br><br>" +
"Math<br>Date (static functions only)<br><br>" +
2017-07-25 04:51:03 +02:00
"<u><h1> Functions </h1></u><br>" +
2017-05-07 00:19:18 +02:00
"You can NOT define you own functions in Netscript (yet), but there are several built in functions that " +
2017-07-25 04:51:03 +02:00
"you may use: <br><br> " +
2017-05-15 04:36:58 +02:00
"<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 " +
2017-07-25 04:51:03 +02:00
"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. " +
2017-06-03 22:51:18 +02:00
" A script can hack a server from anywhere. It does not need to be running on the same server to hack that server. " +
2017-07-25 04:51:03 +02:00
"For example, you can create a script that hacks the 'foodnstuff' server and run that script on any server in the game. A successful hack() on " +
"a server will raise that server's security level by 0.002. Returns true if the hack is successful and " +
"false otherwise. <br>" +
"Examples: hack('foodnstuff'); or hack('148.192.0.12');<br><br>" +
2017-07-22 00:54:55 +02:00
"<i>sleep(n, log=true)</i><br>Suspends the script for n milliseconds. The second argument is an optional boolean that indicates " +
2017-07-25 04:51:03 +02:00
"whether or not the function should log the sleep action. If this argument is true, then calling this function will write " +
"'Sleeping for N milliseconds' to the script's logs. If it's false, then this function will not log anything. " +
"If this argument is not specified then it will be true by default. <br>Example: sleep(5000);<br><br>" +
"<i>grow(hostname/ip)</i><br>Use your hacking skills to increase the amount of money available on a server. The argument passed in " +
2017-06-03 22:51:18 +02:00
"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. " +
2017-07-25 04:51:03 +02:00
"When grow() completes, the money available on a target server will be increased by a certain, fixed percentage. This percentage " +
"is determined by the server's growth rate and varies between servers. Generally, higher-level servers have higher growth rates. <br><br> " +
"Like hack(), grow() can be called on any server, regardless of where the script is running. " +
"The grow() command requires root access to the target server, but there is no required hacking level to run the command. " +
2017-06-28 06:11:27 +02:00
"It also raises the security level of the target server by 0.004. " +
2017-07-25 04:51:03 +02:00
"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>" +
2017-09-01 16:12:40 +02:00
"<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>" +
2017-09-05 03:39:00 +02:00
"<i>tprint(x)</i><br>Prints a value or a variable to the Terminal<br><br>" +
2017-07-25 04:51:03 +02:00
"<i>clearLog()</i><br>Clears the script's logs. <br><br>" +
2017-09-19 20:38:03 +02:00
"<i>scan(hostname/ip, [hostnames=true])</i><br>Returns an array containing the hostnames or IPs 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 second argument is a boolean that specifies whether " +
"the hostnames or IPs of the scanned servers should be output. If it is true then hostnames will be returned, and if false then IP addresses will. " +
"This second argument is optional and, if ommitted, the function will output " +
"the hostnames of the scanned servers. The hostnames/IPs in the returned array are strings.<br><br>" +
2017-09-26 04:44:33 +02:00
"<i>nuke(hostname/ip)</i><br>Run NUKE.exe on the target server. NUKE.exe must exist on your home computer.<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.<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.<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.<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.<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.<br> Example: sqlinject('foodnstuff');<br><br>" +
2017-07-25 04:51:03 +02:00
"<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>" +
2017-06-11 08:52:52 +02:00
"Returns true if the script is successfully started, and false otherwise. Requires a significant amount " +
2017-09-26 04:44:33 +02:00
"of RAM to run this command.<br><br>" +
2017-07-25 04:51:03 +02:00
"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 " +
2017-09-26 04:44:33 +02:00
"true if the script is successfully started, and false otherwise.<br><br> " +
2017-07-25 04:51:03 +02:00
"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' " +
"on the 'foodnstuff' server:<br><br>" +
"exec('generic-hack.script', 'foodnstuff');<br><br>" +
"The following example will try to run the script 'generic-hack.script' on the 'joesguns' server with 10 threads:<br><br>" +
"exec('generic-hack.script', 'joesguns', 10);<br><br>" +
2017-06-17 04:53:57 +02:00
"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 " +
2017-07-25 04:51:03 +02:00
"to the script.<br><br>" +
"exec('foo.script', 'foodnstuff', 5, 1, 'test');<br><br>" +
"<i>kill(script, hostname/ip, [args...])</i><br> Kills the script on the target server specified by the script's name and arguments. Remember that " +
2017-06-17 04:53:57 +02:00
"scripts are uniquely identified by both their name and arguments. For example, if 'foo.script' is run with the argument 1, then this is not the " +
2017-07-25 04:51:03 +02:00
"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>" +
"kill('foo.script', getHostname(), 1, 'foodnstuff');<br><br>" +
"<i>killall(hostname/ip)</i><br> Kills all running scripts on the specified server. This function takes a single argument which " +
"must be a string containing the hostname or IP of the target server. This function will always return true. <br><br>" +
2017-09-19 20:38:03 +02:00
"<i>scp(script, [source], destination)</i><br>Copies a script or literature (.lit) file to another server. The first argument is a string with " +
2017-09-07 07:45:14 +02:00
"the filename of the script or literature file " +
2017-09-19 20:38:03 +02:00
"to be copied. The next two arguments are strings containing the hostname/IPs of the source and target server. " +
"The source refers to the server from which the script/literature file will be copied, while the destination " +
"refers to the server to which it will be copied. The source server argument is optional, and if ommitted the source " +
"will be the current server (the server on which the script is running). Returns true if the script/literature file is " +
"successfully copied over and false otherwise. <br><br>" +
"Example: scp('hack-template.script', 'foodnstuff'); //Copies hack-template.script from the current server to foodnstuff<br>" +
"Example: scp('foo.lit', 'helios', 'home'); //Copies foo.lit from the helios server to the home computer<br><br>" +
2017-09-07 07:45:14 +02:00
"<i>ls(hostname/ip)</i><br>Returns an array containing the names of all files on the specified server. The argument must be a " +
"string with the hostname or IP of the target server.<br><br>" +
2017-07-25 04:51:03 +02:00
"<i>hasRootAccess(hostname/ip)</i><br> Returns a boolean (true or false) indicating whether or not the Player has root access to a server. " +
2017-09-26 04:44:33 +02:00
"The argument passed in must be a string with either the hostname or IP of the target server.<br> " +
2017-07-25 04:51:03 +02:00
"Example:<br>if (hasRootAccess('foodnstuff') == false) {<br> nuke('foodnstuff');<br>}<br><br>" +
2017-09-19 20:38:03 +02:00
"<i>getIp()</i><br>Returns a string with the IP Address of the server that the script is running on <br><br>" +
2017-07-25 04:51:03 +02:00
"<i>getHostname()</i><br>Returns a string with the hostname of the server that the script is running on<br><br>" +
2017-09-26 04:44:33 +02:00
"<i>getHackingLevel()</i><br>Returns the Player's current hacking level.<br><br> " +
2017-09-19 20:38:03 +02:00
"<i>getIntelligence()</i><br>Returns the Player's current intelligence level. Requires Source-File 5 to run<br><br>" +
"<i>getHackingMultipliers()</i><br>Returns an object containing the Player's hacking related multipliers. " +
"These multipliers are returned in integer forms, not percentages (e.g. 1.5 instead of 150%). " +
"The object has the following structure:<br><br>" +
"{<br>" +
"chance: Player's hacking chance multiplier<br>" +
"speed: Player's hacking speed multiplier<br>" +
"money: Player's hacking money stolen multiplier<br>" +
"growth: Player's hacking growth multiplier<br>" +
"}<br><br>Example:<br><br>" +
"mults = getHackingMultipliers();<br>" +
"print(mults.chance);<br>" +
"print(mults.growth);<br><br>" +
"<i>getBitNodeMultipliers()</i><br>Returns an object containing the current BitNode multipliers. " +
"This function requires Source-File 5 in order to run. The multipliers are returned in integer forms, not percentages " +
"(e.g. 1.5 instead of 150%). The multipliers represent the difference between the current BitNode and the " +
"original BitNode (BitNode-1). For example, if the 'CrimeMoney' multiplier has a value of 0.1 then that means " +
"that committing crimes in the current BitNode will only give 10% of the money you would have received in " +
"BitNode-1. The object has the following structure (subject to change in the future):<br><br>" +
"{<br>" +
"ServerMaxMoney: 1,<br>" +
"ServerStartingMoney: 1,<br>" +
"ServerGrowthRate: 1,<br>" +
"ServerWeakenRate: 1,<br>" +
"ServerStartingSecurity: 1,<br>" +
"ManualHackMoney: 1,<br>" +
"ScriptHackMoney: 1,<br>" +
"CompanyWorkMoney: 1,<br>" +
"CrimeMoney: 1,<br>" +
"HacknetNodeMoney: 1,<br>" +
"CompanyWorkExpGain: 1,<br>" +
"ClassGymExpGain: 1,<br>" +
"FactionWorkExpGain: 1,<br>" +
"HackExpGain: 1,<br>" +
"CrimeExpGain: 1,<br>" +
"FactionWorkRepGain: 1,<br>" +
"FactionPassiveRepGain: 1,<br>" +
"AugmentationRepCost: 1,<br>" +
"AugmentationMoneyCost: 1,<br>" +
"}<br><br>Example:<br><br>" +
"mults = getBitNodeMultipliers();<br>" +
"print(mults.ServerMaxMoney);<br>" +
"print(mults.HackExpGain);<br><br>" +
2017-05-15 17:13:21 +02:00
"<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 " +
2017-09-26 04:44:33 +02:00
"hostname or IP of the target server.<br> Example: getServerMoneyAvailable('foodnstuff');<br><br>" +
2017-07-25 04:51:03 +02:00
"<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 " +
2017-09-26 04:44:33 +02:00
"the hostname or IP of the target server.<br>Example: getServerMaxMoney('foodnstuff');<br><br>" +
2017-08-18 19:20:51 +02:00
"<i>getServerGrowth(hostname/ip)</i><br>Returns the server's intrinsic 'growth parameter'. This growth parameter is a number " +
"between 1 and 100 that represents how quickly the server's money grows. This parameter affects the percentage by which this server's " +
"money is increased when using the grow() function. A higher growth parameter will result in a higher percentage from grow().<br><br>" +
"The argument passed in must be a string with the hostname or IP of the target server.<br><br>" +
2017-07-25 04:51:03 +02:00
"<i>getServerSecurityLevel(hostname/ip)</i><br>Returns the security level of a server. The argument passed in must be a string with either the " +
2017-09-26 04:44:33 +02:00
"hostname or IP of the target server. A server's security is denoted by a number, typically between 1 and 100.<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. " +
2017-07-25 04:51:03 +02:00
"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>" +
2017-09-26 04:44:33 +02:00
"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, typically between 1 and 100. " +
"<br><br>" +
"<i>getServerMinSecurityLevel(hostname/ip)</i>Returns the minimum security level of a server. The argument passed in must be a string with " +
"either the hostname or IP of the target server.<br><br>" +
2017-08-18 19:20:51 +02:00
"<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 " +
2017-09-26 04:44:33 +02:00
"hostname or IP or the target server.<br><br>" +
2017-07-25 04:51:03 +02:00
"<i>getServerNumPortsRequired(hostname/ip)</i><br>Returns the number of open ports required to successfully run NUKE.exe on a server. The argument " +
2017-09-26 04:44:33 +02:00
"passed in must be a string with either the hostname or IP of the target server.<br><br>" +
2017-08-18 19:20:51 +02:00
"<i>getServerRam(hostname/ip)</i><br>Returns an array with two elements that gives information about the target server's RAM. The first " +
"element in the array is the amount of RAM that the server has (in GB). The second element in the array is the amount of RAM that " +
"is currently being used on the server.<br><br>" +
2017-09-15 16:06:59 +02:00
"<i>serverExists(hostname/ip)</i><br>Returns a boolean denoting whether or not the specified server exists. The argument " +
"must be a string with the hostname or IP of the target server.<br><br>" +
2017-07-25 04:51:03 +02:00
"<i>fileExists(filename, [hostname/ip])</i><br> Returns a boolean (true or false) indicating whether the specified file exists on a server. " +
2017-09-21 23:27:31 +02:00
"The first argument must be a string with the name of the file. A file can either be a script, program, or literature file. A script name is case-sensitive, but a " +
"program/literature file is not. For example, fileExists('brutessh.exe') will work fine, even though the actual program is named BruteSSH.exe. <br><br> " +
2017-07-25 04:51:03 +02:00
"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> " +
"Example: fileExists('foo.script', 'foodnstuff');<br>" +
"Example: fileExists('ftpcrack.exe');<br><br>" +
2017-06-05 17:31:46 +02:00
"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 " +
2017-07-25 04:51:03 +02:00
"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>" +
2017-06-05 19:50:32 +02:00
"The first argument must be a string with the name of the script. The script name is case sensitive. The second argument is a string with the " +
2017-06-17 04:53:57 +02:00
"hostname or IP of the target server. Any additional arguments passed to the function will specify the arguments passed into the target script. " +
2017-07-25 04:51:03 +02:00
"The function will check whether the script is running on that target server.<br>" +
"Example: isRunning('foo.script', 'foodnstuff');<br>" +
"Example: isRunning('foo.script', getHostname());<br>" +
"Example: isRunning('foo.script', 'joesguns', 1, 5, 'test');<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>" +
2017-08-18 19:20:51 +02:00
"<i>getNextHacknetNodeCost()</i><br>Returns the cost of purchasing a new Hacknet Node<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 " +
2017-05-25 16:50:58 +02:00
"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 " +
2017-07-25 04:51:03 +02:00
"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>" +
"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>" +
2017-09-19 20:38:03 +02:00
"<i>deleteServer(hostname)</i><br>Deletes one of the servers you've purchased with the specified hostname. The function will fail if " +
"there are any scripts running on the specified server. Returns true if successful and false otherwise<br><br>" +
2017-07-25 04:51:03 +02:00
"<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>" +
2017-08-18 19:20:51 +02:00
"<i>scriptRunning(scriptname, hostname/ip)</i><br>Returns a boolean indicating whether any instance of the specified script is running " +
"on a server, regardless of its arguments. This is different than the isRunning() function because it does not " +
"try to identify a specific instance of a running script by its arguments.<br><br>" +
"The first argument must be a string with the name of the script. The script name is case sensitive. The second argument is " +
"a string with the hostname or IP of the target server. Both arguments are required.<br><br>" +
"<i>scriptKill(scriptname, hostname/ip)</i><br>Kills all scripts with the specified filename that are running on the server specified by the " +
"hostname/ip, regardless of arguments. Returns true if one or more scripts were successfully killed, and false if there were none. <br><br>" +
"The first argument must be a string with the name of the script. The script name is case sensitive. The second argument is " +
"a string with the hostname or IP of the target server. Both arguments are required.<br><br>" +
"<i>getScriptRam(scriptname, hostname/ip)</i><br>Returns the amount of RAM required to run the specified script on the " +
"target server. The first argument must be a string with the name of the script. The script name is case sensitive. " +
"The second argument is a string with the hostname or IP of the server where that script is. Both arguments are required.<br><br>" +
2017-08-20 03:36:19 +02:00
"<i>getHackTime(hostname/ip)</i><br>Returns the amount of time in seconds it takes to execute the hack() Netscript function " +
"on the server specified by the hostname/ip. The argument must be a string with the hostname/ip of the target server.<br><br>" +
"<i>getGrowTime(hostname/ip)</i><br>Returns the amount of time in seconds it takes to execute the grow() Netscript function " +
"on the server specified by the hostname/ip. The argument must be a string with the hostname/ip of the target server.<br><br>" +
"<i>getWeakenTime(hostname/ip)</i><br>Returns the amount of time in seconds it takes to execute the weaken() Netscript function " +
"on the server specified by the hostname/ip. The argument must be a string with the hostname/ip of the target server.<br><br>" +
2017-09-12 01:14:51 +02:00
"<i>getScriptIncome([scriptname], [hostname/ip], [args...])</i><br>" +
"Returns the amount of income the specified script generates while online (when the game is open, does not apply for " +
2017-09-27 17:13:42 +02:00
"offline income). This function can also be called with no arguments. If called with no arguments, then this function " +
"will return an array of two values. The first value is the total income ($/sec) of all of your active scripts (currently running). " +
"The second value is the total income ($/sec) from scripts since you last installed Augmentations (or destroyed a BitNode).<br><br>" +
2017-09-12 01:14:51 +02:00
"Remember that a script is uniquely identified by both its name and its arguments. So for example if you ran a script " +
"with the arguments 'foodnstuff' and '5' then in order to use this function to get that script's income you must " +
"specify those arguments in this function call.<br><br>" +
"The first argument, if specified, must be a string with the name of the script (including the .script extension). " +
"The second argument must be a string with the hostname/IP of the target server. If the first argument is specified " +
"then the second argument must be specified as well. Any additional arguments passed to the function will specify " +
"the arguments passed into the target script.<br><br>" +
2017-09-15 16:06:59 +02:00
"<i>getScriptExpGain([scriptname], [hostname/ip], [args...])</i><br>" +
"Returns the amount of hacking experience the specified script generates while online (when the game is open, does not apply for " +
"offline experience gains). This function can also return the total experience gain rate of all of your active scripts by running the function " +
"with no arguments.<br><br>" +
"Remember that a script is uniquely identified by both its name and its arguments. So for example if you ran a script " +
"with the arguments 'foodnstuff' and '5' then in order to use this function to get that script's income you must " +
"specify those arguments in this function call.<br><br>" +
"The first argument, if specified, must be a string with the name of the script (including the .script extension). " +
"The second argument must be a string with the hostname/IP of the target server. If the first argument is specified " +
"then the second argument must be specified as well. Any additional arguments passed to the function will specify " +
"the arguments passed into the target script.<br><br>" +
2017-09-27 17:13:42 +02:00
"<i>getTimeSinceLastAug()</i><br>" +
"Returns the amount of time in milliseconds that have passed since you last installed Augmentations (or destroyed a BitNode).<br><br>" +
2017-07-25 04:51:03 +02:00
"<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>" +
2017-09-12 01:14:51 +02:00
"<i>hacknetnodes.length</i><br>Returns the number of Hacknet Nodes that the player owns<br><br>" +
"<i>hacknetnodes[i].level</i><br>Returns the level of the corresponding Hacknet Node<br><br>" +
"<i>hacknetnodes[i].ram</i><br>Returns the amount of RAM on the corresponding Hacknet Node<br><br>" +
"<i>hacknetnodes[i].cores</i><br>Returns the number of cores on the corresponding Hacknet Node<br><br>" +
"<i>hacknetnodes[i].totalMoneyGenerated</i><br>Returns the total amount of money that the corresponding Hacknet Node has earned<br><br>" +
"<i>hacknetnodes[i].onlineTimeSeconds</i><br>Returns the total amount of time that the corresponding Hacknet Node has existed<br><br>" +
"<i>hacknetnodes[i].moneyGainRatePerSecond</i><br>Returns the income ($ / sec) that the corresponding Hacknet Node earns<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 " +
2017-07-25 04:51:03 +02:00
"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>" +
2017-09-12 01:14:51 +02:00
"<i>hacknetnodes[i].upgradeRam()</i><br>Tries to upgrade the amount of RAM on the corresponding Hacknet Node. Returns true if the " +
2017-07-25 04:51:03 +02:00
"RAM is successfully upgraded, and false otherwise. <br><br>" +
2017-09-12 01:14:51 +02:00
"<i>hacknetnodes[i].upgradeCore()</i><br>Attempts to purchase an additional core for the corresponding Hacknet Node. Returns true if the " +
2017-07-25 04:51:03 +02:00
"additional core is successfully purchase, and false otherwise. <br><br>" +
2017-05-25 16:50:58 +02:00
"Example: The following is an example of one way a script can be used to automate the purchasing and upgrading of Hacknet Nodes. " +
"This script purchases new Hacknet Nodes until the player has four. Then, it iteratively upgrades each of those four Hacknet Nodes " +
2017-07-25 04:51:03 +02:00
"to a level of at least 75, RAM to at least 8GB, and number of cores to at least 2.<br><br>" +
"while(hacknetnodes.length < 4) {<br>" +
" purchaseHacknetNode();<br>" +
"}<br>" +
"for (i = 0; i < 4; i = i++) {<br>" +
" while (hacknetnodes[i].level <= 75) {<br>" +
" hacknetnodes[i].upgradeLevel(5);<br>" +
" sleep(10000);<br>" +
" }<br>" +
"}<br>" +
"for (i = 0; i < 4; i = i++) {<br>" +
" while (hacknetnodes[i].ram < 8) {<br>" +
" hacknetnodes[i].upgradeRam();<br>" +
" sleep(10000);<br>" +
" }<br>" +
"}<br>" +
"for (i = 0; i < 4; i = i++) {<br>" +
" while (hacknetnodes[i].cores < 2) {<br>" +
" hacknetnodes[i].upgradeCore();<br>" +
" sleep(10000);<br>" +
" }<br>" +
"}<br><br>" +
"<u><h1>Trade Information eXchange (TIX) API</h1></u><br>" +
"<i>getStockPrice(sym)</i><br>Returns the price of a stock. The argument passed in must be the stock's symbol (NOT THE COMPANY NAME!). The symbol " +
"is a sequence of two to four capital letters. The symbol argument must be a string. <br><br>" +
"Example: getStockPrice('FSIG');<br><br>" +
2017-07-13 18:54:29 +02:00
"<i>getStockPosition(sym)</i><br>Returns an array of two elements that represents the player's position in a stock. The first element " +
2017-07-25 04:51:03 +02:00
"in the array is the number of shares the player owns of the specified stock. The second element in the array is the average price of the player's " +
"shares. Both elements are numbers. The argument passed in must be the stock's symbol, which is a sequence of two to four capital letters.<br><br>" +
"Example: <br><br>pos = getStockPosition('ECP');<br>shares = pos[0];<br>avgPx = pos[1];<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>" +
2017-05-15 03:43:10 +02:00
"<u><h1>While loops </h1></u><br>" +
2017-05-07 00:19:18 +02:00
"A while loop is a control flow statement that repeatedly executes code as long as a condition is met. <br><br> " +
2017-07-25 04:51:03 +02:00
"<i>while (<i>[cond]</i>) {<br> <i>[code]</i><br>}</i><br><br>" +
"As long as <i>[cond]</i> remains true, the code block <i>[code]</i> will continuously execute. Example: <br><br>" +
"<i>i = 0; <br> while (i < 10) { <br> hack('foodnstuff');<br> i = i + 1;<br> } </i><br><br>" +
"This code above repeats the 'hack('foodnstuff')' command 10 times before it stops and exits. <br><br>" +
"<i>while(true) { <br> hack('foodnstuff'); <br> }</i><br><br> " +
2017-05-15 03:43:10 +02:00
"This while loop above is an infinite loop (continuously runs until the script is manually stopped) that repeatedly runs the 'hack('foodnstuff')' command. " +
2017-07-25 04:51:03 +02:00
"Note that a semicolon is needed at closing bracket of the while loop, UNLESS it is at the end of the code<br><br> " +
"<u><h1>For loops</h1></u><br>" +
2017-05-15 19:49:49 +02:00
"A for loop is another control flow statement that allows code to be repeated by iterations. The structure is: <br><br> " +
2017-07-25 04:51:03 +02:00
"<i>for (<i>[init]</i>; <i>[cond]</i>; <i>[post]</i>) {<br> <i>code</i> <br> } </i><br><br>" +
2017-05-07 00:19:18 +02:00
"The <i>[init]</i> expression evaluates before the for loop begins. The for loop will continue to execute " +
2017-07-25 04:51:03 +02:00
"as long as <i>[cond]</i> is met. The <i>[post]</i> expression will evaluate at the end of every iteration " +
2017-05-15 19:49:49 +02:00
"of the for loop. The following example shows code that will run the 'hack('foodnstuff');' command 10 times " +
2017-07-25 04:51:03 +02:00
" using a for loop: <br><br>" +
"<i>for (i = 0; i < 10; i = i++) { <br> hack('foodnstuff');<br>} </i><br><br>" +
"<u><h1> If statements </h1></u><br>" +
"If/Else if/Else statements are conditional statements used to perform different actions based on different conditions: <br><br>" +
"<i>if (condition1) {<br> code1<br>} else if (condition2) {<br> code2<br>} else {<br>" +
" code3<br>}</i><br><br>" +
2017-05-15 17:13:21 +02:00
"In the code above, first <i>condition1</i> will be checked. If this condition is true, then <i>code1</i> will execute and the " +
2017-07-25 04:51:03 +02:00
"rest of the if/else if/else statement will be skipped. If <i>condition1</i> is NOT true, then the code will then go on to check " +
2017-07-13 18:54:29 +02:00
"<i>condition2</i>. If <i>condition2</i> is true, then <i>code2</i> will be executed, and the rest of the if/else if/else statement " +
2017-07-25 04:51:03 +02:00
"will be skipped. If none of the conditions are true, then the code within the else block (<i>code3</i>) will be executed. " +
"Note that a conditional statement can have any number of 'else if' statements. <br><br>" +
"Example: <br><br>" +
"if(getServerMoneyAvailable('foodnstuff') > 200000) {<br> hack('foodnstuff');<br>" +
"} else {<br> grow('foodnstuff');<br>}<br><br>" +
"The code above will use the getServerMoneyAvailable() function to check how much money there is on the 'foodnstuff' server. " +
"If there is more than $200,000, then it will try to hack that server. If there is $200,000 or less on the server, " +
2017-05-15 17:13:21 +02:00
"then the code will call grow('foodnstuff') instead and add more money to the server.<br><br>" ,
2017-08-31 07:04:23 +02:00
TutorialSingularityFunctionsText : "<u><h1>Singularity Functions</h1></u><br>" +
"The Singularity Functions are a special set of Netscript functions that are unlocked in BitNode-4. " +
"These functions allow you to control many additional aspects of the game through scripts, such as " +
"working for factions/companies, purchasing/installing Augmentations, and creating programs.<br><br>" +
"If you are in BitNode-4, then you will automatically have access to all of these functions. " +
"You can use the Singularity Functions in other BitNodes if and only if you have the Source-File " +
"for BitNode-4 (aka Source-File 4). Each level of Source-File 4 will open up additional Singularity " +
"Functions that you can use in other BitNodes. If your Source-File 4 is upgraded all the way to level 3, " +
"then you will be able to access all of the Singularity Functions.<br><br>" +
"Note that Singularity Functions require a lot of RAM outside of BitNode-4 (their RAM costs are multiplied by " +
"10 if you are not in BitNode-4).<br><br>" +
"<i>universityCourse(universityName, courseName)</i><br>" +
"If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to use this function.<br><br>" +
"This function will automatically set you to start taking a course at a university. If you are already " +
"in the middle of some 'working' action (such as working at a company, for a faction, or on a program), " +
"then running this function will automatically cancel that action and give you your earnings.<br><br>" +
"The first argument must be a string with the name of the university. The names are NOT case-sensitive. " +
"Note that you must be in the correct city for whatever university you specify. The three universities are:<br><br>" +
"Summit University<br>Rothman University<br>ZB Institute of Technology<br><br>" +
"The second argument must be a string with the name of the course you are taking. These names are NOT case-sensitive. " +
"The available courses are:<br><br>" +
"Study Computer Science<br>Data Structures<br>Networks<br>Algorithms<br>Management<br>Leadership<br><br>" +
"The cost and experience gains for all of these universities and classes are the same as if you were to manually " +
"visit and take these classes.<br><br>" +
"This function will return true if you successfully start taking the course, and false otherwise.<br><br>" +
"<i>gymWorkout(gymName, stat)</i><br>" +
"If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to use this function.<br><br>" +
"This function will automatically set you to start working out at a gym to train a particular stat. If you are " +
"already in the middle of some 'working' action (such as working at a company, for a faction, or on a program), then " +
"running this function will automatically cancel that action and give you your earnings.<br><br>" +
"The first argument must be a string with the name of the gym. The names are NOT case-sensitive. Note that you must " +
"be in the correct city for whatever gym you specify. The available gyms are:<br><br>" +
"Crush Fitness Gym<br>Snap Fitness Gym<br>Iron Gym<br>Powerhouse Gym<br>Millenium Fitness Gym<br><br>" +
"The second argument must be a string with the stat you want to work out. These are NOT case-sensitive. " +
"The valid stats are:<br><br>strength OR str<br>defense OR def<br>dexterity OR dex<br>agility OR agi<br><br>" +
"The cost and experience gains for all of these gyms are the same as if you were to manually visit these gyms and train " +
"This function will return true if you successfully start working out at the gym, and false otherwise.<br><br>" +
"<i>travelToCity(cityname)</i><br>" +
"If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to use this function.<br><br>" +
"This function allows the player to travel to any city. The cost for using this function is the same as the cost for traveling through the Travel Agency.<br><br>" +
"The argument passed into this must be a string with the name of the city to travel to. Note that this argument IS CASE SENSITIVE. The valid cities are:<br><br>" +
"Aevum<br>Chongqing<br>Sector-12<br>New Tokyo<br>Ishima<br>Volhaven<br><br>" +
"This function will return true if you successfully travel to the specified city and false otherwise.<br><br>" +
"<i>purchaseTor()</i><br>" +
"If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to use this function.<br><br>" +
"This function allows you to automatically purchase a TOR router. The cost for purchasing a TOR router using this " +
"function is the same as if you were to manually purchase one.<br><br>" +
"This function will return true if it successfully purchase a TOR router and false otherwise.<br><br>" +
"<i>purchaseProgram(programName)</i><br>" +
"If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to use this function.<br><br>" +
"This function allows you to automatically purchase programs. You MUST have a TOR router in order to use this function.<br><br>" +
"The argument passed in must be a string with the name of the program (including the '.exe' extension). This argument is " +
"NOT case-sensitive.<br><br>Example: " +
"purchaseProgram('brutessh.exe');<br><br>" +
"The cost of purchasing programs using this function is the same as if you were purchasing them through the Dark Web (using " +
"the buy Terminal command).<br><br>" +
"This function will return true if the specified program is purchased, and false otherwise.<br><br>" +
"<i>upgradeHomeRam()</i><br>" +
"If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function.<br><br>" +
"This function will upgrade amount of RAM on the player's home computer. The cost is the same as if you were to do it manually.<br><br>" +
"This function will return true if the player's home computer RAM is successfully upgraded, and false otherwise.<br><br>" +
"<i>getUpgradeHomeRamCost()</i><br>" +
"If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function.<br><br>" +
"Returns the cost of upgrading the player's home computer RAM.<br><br>" +
"<i>workForCompany()</i><br>" +
"If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function.<br><br>" +
"This function will automatically set you to start working at the company at which you are employed. If you are already " +
"in the middle of some 'working' action (such as working for a faction, training at a gym, or creating a program), then " +
"running this function will automatically cancel that action and give you your earnings.<br><br>" +
"This function will return true if the player starts working, and false otherwise.<br><br>" +
"<i>applyToCompany(companyName, field)</i><br>" +
"If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function.<br><br>" +
"This function will automatically try to apply to the specified company for a position in the specified field. This " +
"function can also be used to apply for promotions by specifying the company and field you are already employed at.<br><br>" +
"The first argument must be a string with the name of the company. This argument IS CASE-SENSITIVE. The second argument must " +
"be a string representing the 'field' to which you want to apply. This second argument is NOT case-sensitive. Valid values for " +
"the second argument are:<br><br>" +
"software<br>software consultant<br>it<br>security engineer<br>network engineer<br>business<br>business consultant<br>" +
"security<br>agent<br>employee<br>part-time employee<br>waiter<br>part-time waiter<br><br>" +
"This function will return true if you successfully get a job/promotion, and false otherwise. Note " +
"that if you are trying to use this function to apply for a promotion and you don't get one, it will return false.<br><br>" +
"<i>getCompanyRep(companyName)</i><br>" +
"If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function.<br><br>" +
"This function will return the amount of reputation you have at the specified company. If the company passed in as " +
"an argument is invalid, -1 will be returned.<br><br>" +
"The argument passed in must be a string with the name of the company. This argument IS CASE-SENSITIVE.<br><br>" +
"<i>checkFactionInvitations()</i><br>" +
"If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function.<br><br>" +
"Returns an array with the name of all Factions you currently have oustanding invitations from.<br><br>" +
"<i>joinFaction(name)</i><br>" +
"If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function.<br><br>" +
"This function will automatically accept an invitation from a faction and join it.<br><br>" +
"The argument must be a string with the name of the faction. This name IS CASE-SENSITIVE.<br><br>" +
"<i>workForFaction(factionName, workType)</i><br>" +
"If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function.<br><br>" +
"This function will automatically set you to start working for the specified Faction. Obviously, you " +
"must be a member of the Faction or else this function will fail. If you are already in the middle of " +
"some 'working' action (such as working for a company, training at a gym, or creating a program), then running " +
"this function will automatically cancel that action and give you your earnings.<br><br>" +
"The first argument must be a string with the name of the faction. This argument IS CASE-SENSITIVE. The second argument " +
"must be a string with the type of work you want to perform for the faction. The valid values for this argument are:<br><br>" +
"<br>hacking/hacking contracts/hackingcontracts<br>field/fieldwork/field work<br>security/securitywork/security work<br><br>" +
"This function will return true if you successfully start working for the specified faction, and false otherwise.<br><br>" +
"<i>getFactionRep(factionName)</i><br>" +
"If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function.<br><br>" +
"This function returns the amount of reputation you have for the specified Faction. The argument must be a " +
"string with the name of the Faction. The argument IS CASE-SENSITIVE.<br><br>" +
"<i>createProgram(programName)</i><br>" +
"If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function.<br><br>" +
"This function will automatically set you to start working on creating the specified program. If you are already in " +
"the middle of some 'working' action (such as working for a company, training at a gym, or taking a course), then " +
"running this function will automatically cancel that action and give you your earnings.<br><br>" +
"The argument passed in must be a string designating the name of the program. This argument is NOT case-sensitive.<br><br>" +
"Example:<br><br>createProgram('relaysmtp.exe');<br><br>" +
"Note that creating a program using this function has the same hacking level requirements as it normally would. These level requirements are:<br><br>" +
"BruteSSH.exe: 50<br>FTPCrack.exe: 100<br>relaySMTP.exe: 250<br>HTTPWorm.exe: 500<br>SQLInject.exe: 750<br>" +
"DeepscanV1.exe: 75<br>DeepscanV2.exe: 400<br>ServerProfiler.exe: 75<br>AutoLink.exe: 25<br><br>" +
"This function returns true if you successfully start working on the specified program, and false otherwise.<br><br>" +
"<i>getAugmentationCost(augName)</i><br>" +
"If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function.<br><br>" +
"This function returns an array with two elements that gives the cost for the specified Augmentation" +
". The first element in the returned array is the reputation requirement of the Augmentation, and the second element " +
"is the money cost.<br><br>" +
"The argument passed in must be a string with the name of the Augmentation. This argument IS CASE-SENSITIVE. " +
"If an invalid Augmentation name is passed in, this function will return the array [-1, -1].<br><br>" +
"<i>purchaseAugmentation(factionName, augName)</i><br>" +
"If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function.<br><br>" +
"This function will try to purchase the specified Augmentation through the given Faction.<br><br>" +
"The two arguments must be strings specifying the name of the Faction and Augmentation, respectively. These arguments are both CASE-SENSITIVE.<br><br>" +
"This function will return true if the Augmentation is successfully purchased, and false otherwise.<br><br>" +
"<i>installAugmentations()</i><br>" +
"If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function.<br><br>" +
"This function will automatically install your Augmentations, resetting the game as usual.<br><br>" +
"It will return true if successful, and false otherwise." ,
2017-07-25 04:51:03 +02:00
2017-05-07 00:19:18 +02:00
TutorialTravelingText : "There are six major cities in the world that you are able to travel to: <br><br> " +
2017-07-25 04:51:03 +02:00
" Aevum<br>" +
" Chongqing<br>" +
" Sector-12<br>" +
" New Tokyo<br>" +
" Ishima<br>" +
" Volhaven<br><br>" +
"To travel between cities, visit your current city's travel agency through the 'World' page. " +
"From the travel agency you can travel to any other city. Doing so costs money. <br><br>" +
2017-05-08 19:40:53 +02:00
"Each city has its own set of companies and unique locations. Also, certain content is only available to you " +
"if you are in certain cities, so get exploring!" ,
2017-07-25 04:51:03 +02:00
TutorialCompaniesText : "Hacking is not the only way to gain money and experience! Located around the world are many " +
"different companies which you can work for. By working for a company you can earn money, " +
2017-07-03 21:42:11 +02:00
"train your various labor skills, and unlock powerful passive perks. <br><br> " +
2017-07-25 04:51:03 +02:00
"To apply for a job, visit the company you want to work for through the 'World' menu. The company " +
"page will have options that let you apply to positions in the company. There might be several different " +
"positions you can apply for, ranging from software engineer to business analyst to security officer. <br><br> " +
"When you apply for a job, you will get the offer if your stats are high enough. Your first position at " +
"a company will be an entry-level position such as 'intern'. Once you get the job, an button will appear on " +
"the company page that allows you to work for the company. Click this button to start working. <br><br>" +
"Working occurs in 8 hour shifts. Once you start working, you will begin earning money, experience, " +
"and reputation. The rate at which you money and experience depends on the company and your position. " +
2017-07-03 21:42:11 +02:00
"The amount of reputation you gain for your company is based on your job performance, which is affected by " +
"your stats. Different positions value different stats. When you are working, you are unable to perform any " +
2017-07-25 04:51:03 +02:00
"other actions such as using your terminal or visiting other locations (However, note that any scripts you have " +
"running on servers will continue to run as you work!). It is possible to cancel your work shift before the " +
"8 hours is up. However, if you have a full-time job, then cancelling a shift early will result in you gaining " +
2017-07-03 21:42:11 +02:00
"only half of the reputation " +
2017-07-25 04:51:03 +02:00
"that you had earned up to that point. There are also part-time/consultant jobs available where you will not " +
2017-07-03 21:42:11 +02:00
" be penalized if you cancel a work shift early. However, these positions pay less than full-time positions.<br><br>" +
2017-07-25 04:51:03 +02:00
"As you continue to work at a company, you will gain more and more reputation at that company. When your stats " +
"and reputation are high enough, you can get a promotion. You can apply for a promotion on the company page, just like " +
2017-07-03 21:42:11 +02:00
"you applied for the job originally. Higher positions at a company provide better salaries and stat gains.<br><br>" +
2017-07-25 04:51:03 +02:00
"<h1>Infiltrating Companies</h1><br>" +
"Many companies have facilities that you can attempt to infiltrate. By infiltrating, you can steal classified company secrets " +
2017-07-03 21:42:11 +02:00
"and then sell these for money or for faction reputation. To try and infiltrate a company, visit a company through the " +
2017-07-25 04:51:03 +02:00
"'World' menu. There will be an option that says 'Infiltrate Company'. <br><br>" +
"When infiltrating a company, you must progress through clearance levels in the facility. Every clearance level " +
"has some form of security that you must get past. There are several forms of security, ranging from high-tech security systems to " +
"armed guards. For each form of security, there are a variety of options that you can choose to try and bypass the security. Examples " +
"include hacking the security, engaging in combat, assassination, or sneaking past the security. The chance to succeed for each option " +
"is determined in part by your stats. So, for example, trying to hack the security system relies on your hacking skill, whereas trying to " +
"sneak past the security relies on your agility level.<br><br>" +
"The facility has a 'security level' that affects your chance of success when trying to get past a clearance level. " +
"Every time you advance to the next clearance level, the facility's security level will increase by a fixed amount. Furthermore " +
2017-07-03 21:42:11 +02:00
"the options you choose and whether you succeed or fail will affect the security level as well. For example, " +
"if you try to kill a security guard and fail, the security level will increase by a lot. If you choose to sneak past " +
2017-07-25 04:51:03 +02:00
"security and succeed, the security level will not increase at all. <br><br>" +
"Every 5 clearance levels, you will steal classified company secrets that can be sold for money or faction reputation. However, " +
2017-07-03 21:42:11 +02:00
"in order to sell these secrets you must successfully escape the facility using the 'Escape' option. Furthermore, companies have " +
2017-07-25 04:51:03 +02:00
"a max clearance level. If you reach the max clearance level you will automatically escape the facility with all of your " +
2017-07-03 21:42:11 +02:00
"stolen secrets.<br><br>" ,
2017-04-11 15:45:56 +02:00
TutorialFactionsText : "Throughout the game you may receive invitations from factions. There are many different factions, and each faction " +
2017-07-25 04:51:03 +02:00
"has different criteria for determining its potential members. Joining a faction and furthering its cause is crucial " +
"to progressing in the game and unlocking endgame content. <br><br> " +
2017-04-11 15:45:56 +02:00
"It is possible to join multiple factions if you receive invitations from them. However, note that joining a faction " +
2017-07-25 04:51:03 +02:00
"may prevent you from joining other rival factions. <br><br> " +
"The 'Factions' link on the menu brings up a list of all factions that you have joined. " +
"You can select a Faction on this list to go to that Faction page. This page displays general " +
"information about the Faction and also lets you perform work for the faction. " +
"Working for a Faction is similar to working for a company except that you don't get paid a salary. " +
"You will only earn reputation in your Faction and train your stats. Also, cancelling work early " +
"when working for a Faction does NOT result in reduced experience/reputation earnings. <br><br>" +
2017-05-08 19:40:53 +02:00
"Earning reputation for a Faction unlocks powerful Augmentations. Purchasing and installing these Augmentations will " +
"upgrade your abilities. The Augmentations that are available to unlock vary from faction to faction." ,
2017-07-25 04:51:03 +02:00
TutorialAugmentationsText : "Advances in science and medicine have lead to powerful new technologies that allow people to augment themselves " +
"beyond normal human capabilities. There are many different types of Augmentations, ranging from cybernetic to " +
"genetic to biological. Acquiring these Augmentations enhances the user's physical and mental faculties. <br><br>" +
"Because of how powerful these Augmentations are, the technology behind them is kept private and secret by the " +
"corporations and organizations that create them. Therefore, the only way for the player to obtain Augmentations is " +
"through Factions. After joining a Faction and earning enough reputation in it, you will be able to purchase " +
"its Augmentations. Different Factions offer different Augmentations. Augmentations must be purchased in order to be installed, " +
2017-05-08 19:40:53 +02:00
"and they are fairly expensive. <br><br>" +
2017-07-25 04:51:03 +02:00
"When you purchase an Augmentation, the price of purchasing another Augmentation increases by 90%. This multiplier stacks for " +
"each Augmentation you purchase. You will not gain the benefits of your purchased Augmentations until you install them. You can " +
"choose to install Augmentations through the 'Augmentations' menu tab. Once you install your purchased Augmentations, " +
"their costs are reset back to the original price.<br><br>" +
"Unfortunately, installing Augmentations has side effects. You will lose most of the progress you've made, including your " +
2017-05-08 19:40:53 +02:00
"skills, stats, and money. You will have to start over, but you will have all of the Augmentations you have installed to " +
2017-07-25 04:51:03 +02:00
"help you progress. <br><br> " +
"To summarize, here is a list of everything you will LOSE when you install an Augmentation: <br><br>" +
"Stats/Skills<br>" +
"Money<br>" +
"Scripts on all servers EXCEPT your home computer<br>" +
"Purchased servers<br>" +
"Hacknet Nodes<br>" +
"Company/faction reputation<br>" +
"Jobs and Faction memberships<br>" +
2017-05-08 19:40:53 +02:00
"Programs<br>" +
2017-07-25 04:51:03 +02:00
"Stocks<br>" +
"TOR router<br><br>" +
"Here is everything you will KEEP when you install an Augmentation: <br><br>" +
2017-05-08 19:40:53 +02:00
"Every Augmentation you have installed<br>" +
2017-07-25 04:51:03 +02:00
"Scripts on your home computer<br>" +
"RAM Upgrades on your home computer<br>" +
2017-07-04 21:34:17 +02:00
"World Stock Exchange account and TIX API Access<br>" ,
2017-07-25 04:51:03 +02:00
LatestUpdate :
2017-09-21 23:27:31 +02:00
"v0.29.1<br>" +
2017-09-27 17:13:42 +02:00
"-New gameplay feature that is currently in BETA: Hacking Missions. Hacking Missions is an active gameplay mechanic (its a minigame) " +
"that is meant to be used to earn faction reputation. However, since this is currently in beta, hacking missions will NOT grant reputation " +
"for the time being, since the feature likely has many bugs, balance problems, and other issues. If you have any feedback " +
"regarding the new feature, feel free to let me know<br>" +
"-CHANGED THE RETURN VALUE OF getScriptIncome() WHEN RAN WITH NO ARGUMENTS. It will now return an array of " +
"two values rather than a single value. This may break your scripts, so make sure to update them!<br>" +
2017-09-21 23:27:31 +02:00
"-Added continue statement for for/while loops<br>" +
2017-09-27 17:13:42 +02:00
"-Added getServerMinSecurityLevel(), getPurchasedServers(), and getTimeSinceLastAug() Netscript functions<br>" +
"-Netscript scp() function can now take an array as the first argument, and will try to copy " +
"every file specified in the array (it will just call scp() normally for every element in the array). " +
"If an array is passed in, then the scp() function returns true if at least one element from the array is successfully copied<br>" +
2017-09-26 04:44:33 +02:00
"-Added Javascript's Date module to Netscript. Since 'new' is not supported in Netscript yet, only the Date module's " +
"static methods will work (now(), UTC(), parse(), etc.).<br>" +
"-Failing a crime now gives half the experience it did before<br>" +
2017-09-27 17:13:42 +02:00
"-The forced repeated 'Find The-Cave' message after installing The Red Pill Augmentation now only happens " +
"if you've never destroyed a BitNode before, and will only popup every 15 minutes. If you have already destroyed a BitNode, " +
"the message will not pop up if you have messages suppressed (if you don't have messages suppressed it WILL still repeatedly popup)<br>" +
"-fileExists() function now works on literature files<br><br>" ,
2017-06-12 17:32:50 +02:00
}
2017-08-30 19:44:29 +02:00
export { CONSTANTS } ;