diff --git a/doc/source/netscript/netscriptfunctions.rst b/doc/source/netscript/netscriptfunctions.rst index b2b17466b..2e40a63c0 100644 --- a/doc/source/netscript/netscriptfunctions.rst +++ b/doc/source/netscript/netscriptfunctions.rst @@ -16,9 +16,16 @@ This includes information such as function signatures, what they do, and their r sleep() print() tprint() + tFormat() + nFormat() disableLog() enableLog() isLogEnabled() + clearLog() + tail() + closeTail() + moveTail() + resizeTail() scan() nuke() brutessh() @@ -31,10 +38,14 @@ This includes information such as function signatures, what they do, and their r spawn() kill() killall() + scriptKill() + scriptRunning() scp() ls() ps() + mv() hasRootAccess() + getHostname() getHackingLevel() getHackingMultipliers() getHacknetMultipliers() @@ -49,14 +60,14 @@ This includes information such as function signatures, what they do, and their r serverExists() fileExists() isRunning() - getPurchasedServerCost() purchaseServer() deleteServer() upgradePurchasedServer() getPurchasedServers() getPurchasedServerLimit() getPurchasedServerMaxRam() + getPurchasedServerCost() getPurchasedServerUpgradeCost() - scriptRunning() - scriptKill() - getScriptRam() \ No newline at end of file + getScriptRam() + share() + getSharePower() \ No newline at end of file diff --git a/doc/source/netscript/netscriptscriptarguments.rst b/doc/source/netscript/netscriptscriptarguments.rst index b1e34e1e0..81c72c125 100644 --- a/doc/source/netscript/netscriptscriptarguments.rst +++ b/doc/source/netscript/netscriptscriptarguments.rst @@ -17,7 +17,9 @@ specified in the second argument. The code would look like: .. code:: javascript - run(args[0], args[1]); + var fileName = args[0]; + var threads = args[1]; + run(fileName, threads); And it could be ran from the terminal like: @@ -28,8 +30,29 @@ In .js / ns2, the above script would look like: .. code:: javascript export async function main(ns) { - ns.run(ns.args[0], ns.args[1]); + let fileName = ns.args[0]; + let threads = ns.args[1]; + ns.run(fileName, threads); } It is also possible to get the number of arguments that were passed into a script using ``args.length``. + +If we want to make a script like ``foo.js`` that gets 2 arguments: a string to print +and a number of time to print that string, the code could look like: + +.. code:: javascript + + export async function main(ns) { + for (let i=0; i { Certain gangs )} - {Player.canAccessGrafting() && - !props.aug.isSpecial && - props.aug.name !== AugmentationNames.TheRedPill && ( -
  • - Grafting -
  • - )} + {Player.canAccessGrafting() && !props.aug.isSpecial && props.aug.name !== AugmentationNames.TheRedPill && ( +
  • + Grafting +
  • + )} diff --git a/src/Corporation/OfficeSpace.ts b/src/Corporation/OfficeSpace.ts index 792493092..74c61cbe2 100644 --- a/src/Corporation/OfficeSpace.ts +++ b/src/Corporation/OfficeSpace.ts @@ -229,7 +229,8 @@ export class OfficeSpace { } const diff = target - this.employeeNextJobs[job]; - if (diff === 0) return true; // We are already at the desired number + if (diff === 0) return true; + // We are already at the desired number else if (diff <= this.employeeNextJobs[EmployeePositions.Unassigned]) { // This covers both a negative diff (reducing the amount of employees in position) and a positive (increasing and using up unassigned employees) this.employeeNextJobs[EmployeePositions.Unassigned] -= diff;