Early Hacknet Auto Management Script.
Early Hacknet Auto Management Script
NOTE: This script will buy new nodes or upgrade your current nodes depending on which you can afford.
Create a script:
nano WhateverTheNameIs.js
Copy past the code:
/** @param {NS} ns **/ export async function main(ns) { while (true) { for (var i = 0; i < await ns.hacknet.numNodes(); i++) { if (await ns.getPlayer().money > await ns.hacknet.getLevelUpgradeCost(i, 1)) { await ns.hacknet.upgradeLevel(i, 1); } if (await ns.getPlayer().money > await ns.hacknet.getRamUpgradeCost(i, 1)) { await ns.hacknet.upgradeRam(i, 1); } if (await ns.getPlayer().money > await ns.hacknet.getCoreUpgradeCost(i, 1)) { await ns.hacknet.upgradeCore(i, 1); } } if (await ns.getPlayer().money > await ns.hacknet.getPurchaseNodeCost()) { await ns.hacknet.purchaseNode(); } await ns.sleep(1000); } }
Run the script:
run WhateverTheNameIs.js
NOTE: Better run it on your “home” machine.
screenshot of the code:
More Guides:
- Bitburner: Automation for Hacknet Nodes
- Bitburner: Time Calculation Script (How to Get the Time)
- Bitburner: Combat Gang Management Script (Fully Automatic)
- Bitburner: How to Add Custom Stats to the HUD (Heads up Display)
- Bitburner: Early Game Guide (Spoiler Free)