This script will buy new nodes or upgrade your current nodes depending on which you can afford.
Create a Script
- nano WhateverTheNameIs.js
Script 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
Better run it on your “home” machine.
That's everything we are sharing today for this Bitburner guide. This guide was originally created and written by Bloodly Hell Cat~. In case we fail to update this guide, you can find the latest update by following this link.